@cjlapao/ui-kit 0.2.0 → 0.2.4
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/CapsuleBlueprint-DwDZ7nii.d.cts +1211 -0
- package/dist/CapsuleBlueprint-DwDZ7nii.d.ts +1211 -0
- package/dist/index.cjs +60978 -21656
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +27972 -10125
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11231 -1671
- package/dist/index.d.ts +11231 -1671
- package/dist/index.js +60795 -21726
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +9698 -13881
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -6
- package/dist/markdown.d.ts +2 -6
- package/dist/markdown.js +9681 -13957
- package/dist/markdown.js.map +1 -1
- package/package.json +24 -5
- package/dist/CapsuleBlueprint-w82xP6zg.d.cts +0 -222
- package/dist/CapsuleBlueprint-w82xP6zg.d.ts +0 -222
- package/dist/markdown.css +0 -48
- package/dist/markdown.css.map +0 -1
|
@@ -0,0 +1,1211 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* common/theme/glass.ts — Framework-agnostic glass utility module.
|
|
5
|
+
*
|
|
6
|
+
* Extracts all glass logic from Panel into reusable functions and types
|
|
7
|
+
* so that any control (Button, IconButton, DropdownButton, etc.) can
|
|
8
|
+
* compose glass styling without duplicating the Panel implementation.
|
|
9
|
+
*
|
|
10
|
+
* This file is pure TypeScript — no React, Vue, or DOM imports.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Backdrop vibrancy level for glass surfaces.
|
|
15
|
+
* - `"low"` → 1.0× saturation
|
|
16
|
+
* - `"medium"` → 1.2× saturation (default)
|
|
17
|
+
* - `"high"` → 1.4× saturation
|
|
18
|
+
* - `number` → arbitrary multiplier (0 – 2 recommended)
|
|
19
|
+
*/
|
|
20
|
+
type GlassVibrancy = "low" | "medium" | "high" | number;
|
|
21
|
+
/**
|
|
22
|
+
* Glass fill transparency level.
|
|
23
|
+
* - `"frosted"` → 65 % light / 25 % dark (default)
|
|
24
|
+
* - `"light"` → 85 % light / 35 % dark
|
|
25
|
+
* - `"clear"` → 30 % light / 10 % dark (sheer — pair with a light backdrop)
|
|
26
|
+
* - `number` → 0–1 fraction; light = round(frac × 100), dark = min(round(frac × 30), 30)
|
|
27
|
+
*
|
|
28
|
+
* Only the three presets (and their +10 hover steps) are safelisted. A numeric
|
|
29
|
+
* value emits an arbitrary opacity that Tailwind's scanner cannot see, so the
|
|
30
|
+
* fill silently disappears unless that exact step happens to be generated —
|
|
31
|
+
* see `scripts/generate-safelist.mjs`.
|
|
32
|
+
*/
|
|
33
|
+
type GlassOpacity = "frosted" | "light" | "clear" | number;
|
|
34
|
+
/**
|
|
35
|
+
* Specular highlight mode for glass surfaces.
|
|
36
|
+
* - `"none"` → no specular overlay
|
|
37
|
+
* - `"classic"` → sheen falling from the top edge
|
|
38
|
+
* - `"halo"` → broad bloom plus two off-centre corner glints
|
|
39
|
+
*/
|
|
40
|
+
type SpecularMode = "none" | "classic" | "halo";
|
|
41
|
+
|
|
42
|
+
declare const BUTTON_VARIANTS: readonly ["solid", "soft", "outline", "ghost", "link", "clear", "icon", "glass"];
|
|
43
|
+
type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
|
|
44
|
+
/** Label weight. Derived from the runtime list for the same reason. */
|
|
45
|
+
declare const BUTTON_WEIGHTS: readonly ["normal", "medium", "semibold", "bold"];
|
|
46
|
+
type ButtonWeight = (typeof BUTTON_WEIGHTS)[number];
|
|
47
|
+
/**
|
|
48
|
+
* The 21 Tailwind palette colours the kit supports.
|
|
49
|
+
*
|
|
50
|
+
* `TrueColor` is derived from this array rather than declared alongside it, so
|
|
51
|
+
* the runtime list and the type can never drift — adding a colour here adds it
|
|
52
|
+
* to the type, the generated theme, and every consumer that enumerates colours.
|
|
53
|
+
*/
|
|
54
|
+
declare const TRUE_COLORS: readonly ["red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "rose", "slate", "gray", "zinc", "neutral", "stone"];
|
|
55
|
+
/**
|
|
56
|
+
* TrueColor is the only valid color type in the ui-kit theme system.
|
|
57
|
+
* All components, tokens, and utilities must use TrueColor exclusively.
|
|
58
|
+
*/
|
|
59
|
+
type TrueColor = (typeof TRUE_COLORS)[number];
|
|
60
|
+
/**
|
|
61
|
+
* The fill class for a dot/swatch of each TrueColor: the 500 step in light
|
|
62
|
+
* mode, the 400 step in dark. Literal per colour — never interpolated — so
|
|
63
|
+
* Tailwind's scanner always sees them; the helper is what components share.
|
|
64
|
+
*/
|
|
65
|
+
declare const TRUE_COLOR_DOT_CLASSES: Record<TrueColor, string>;
|
|
66
|
+
/** Dot/swatch fill for a TrueColor. */
|
|
67
|
+
declare function getTrueColorDotClass(tone: TrueColor): string;
|
|
68
|
+
/**
|
|
69
|
+
* The ink class for a TrueColor: the 500 step in light mode, the 400 step
|
|
70
|
+
* in dark — what SVG strokes (`stroke-current`) and legends use where a
|
|
71
|
+
* fill class would not apply. Literal per colour, as above.
|
|
72
|
+
*/
|
|
73
|
+
declare const TRUE_COLOR_TEXT_CLASSES: Record<TrueColor, string>;
|
|
74
|
+
/** Ink (stroke/text) class for a TrueColor. */
|
|
75
|
+
declare function getTrueColorTextClass(tone: TrueColor): string;
|
|
76
|
+
/**
|
|
77
|
+
* Shared size type used across all frameworks and components.
|
|
78
|
+
* Replaces both the old ThemeSize (dead code) and ModalSize.
|
|
79
|
+
*/
|
|
80
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "2xl" | "3xl" | "full";
|
|
81
|
+
/**
|
|
82
|
+
* The size scale every interactive control shares. Derived from the runtime
|
|
83
|
+
* list so the two cannot drift, and so demos/docs can enumerate it.
|
|
84
|
+
*/
|
|
85
|
+
declare const CONTROL_SIZES: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
86
|
+
type ControlSize = (typeof CONTROL_SIZES)[number];
|
|
87
|
+
/**
|
|
88
|
+
* The two layouts a linear control can take.
|
|
89
|
+
*
|
|
90
|
+
* This union was declared independently in `Slider`, `Rating`, `AppDivider`,
|
|
91
|
+
* `Stepper` and `Tabs` (five names for one scale), so a rename or addition in
|
|
92
|
+
* the theme would never reach any of them. It lives here once; each control
|
|
93
|
+
* keeps its own alias (`SliderOrientation`, …) so call sites and the barrels
|
|
94
|
+
* are unaffected.
|
|
95
|
+
*/
|
|
96
|
+
declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
97
|
+
type Orientation = (typeof ORIENTATIONS)[number];
|
|
98
|
+
/**
|
|
99
|
+
* The geometry of an interactive control at each shared size.
|
|
100
|
+
*
|
|
101
|
+
* Every control in the trigger family needs the same answer to "how big is the
|
|
102
|
+
* icon, the box, the spinner at this size". That table was copy-pasted into
|
|
103
|
+
* `Button` (text padding, icon-only padding, icon and spinner sizes) and
|
|
104
|
+
* `IconButton` (square box, icon, `<Spinner>` size) — two copies of one scale,
|
|
105
|
+
* drifting independently. It lives here once; the components import it.
|
|
106
|
+
*/
|
|
107
|
+
type ControlSizeTokens = {
|
|
108
|
+
/** Font size and padding of a labelled control. */
|
|
109
|
+
text: string;
|
|
110
|
+
/** Padding of a square (icon-only) control. */
|
|
111
|
+
iconOnly: string;
|
|
112
|
+
/** Fixed box of a square control (`IconButton`). */
|
|
113
|
+
box: string;
|
|
114
|
+
/** Space between an icon and its label. */
|
|
115
|
+
gap: string;
|
|
116
|
+
/** Icon dimensions at this control size — identical across controls. */
|
|
117
|
+
icon: string;
|
|
118
|
+
/** Dimensions of the inline spinner inside a labelled control. */
|
|
119
|
+
spinner: string;
|
|
120
|
+
/** Size to pass to `<Spinner>` inside a square control. */
|
|
121
|
+
spinnerSize: ControlSize;
|
|
122
|
+
};
|
|
123
|
+
declare const getControlSizeTokens: (size: ControlSize) => ControlSizeTokens;
|
|
124
|
+
/**
|
|
125
|
+
* The corner radius every trigger-family control shares, so a `Button` next to
|
|
126
|
+
* an `Input` is the same box (both `rounded-lg`). Panel-family containers use
|
|
127
|
+
* `DEFAULT_SURFACE_CORNER` instead — a different scale, deliberately.
|
|
128
|
+
*/
|
|
129
|
+
declare const DEFAULT_TRIGGER_CORNER = "rounded-lg";
|
|
130
|
+
/**
|
|
131
|
+
* Strength of a decorative glow behind a control (currently `SearchBar`'s
|
|
132
|
+
* gradient variant).
|
|
133
|
+
*/
|
|
134
|
+
declare const GLOW_INTENSITIES: readonly ["subtle", "soft", "medium", "strong"];
|
|
135
|
+
type GlowIntensity = (typeof GLOW_INTENSITIES)[number];
|
|
136
|
+
/**
|
|
137
|
+
* The kit's standing glow intensity: the tone reads as a hint at rest and
|
|
138
|
+
* the field itself brightens it on focus — the glow should never be the
|
|
139
|
+
* loudest thing in a form. Gradient fields destructure this as their prop
|
|
140
|
+
* default, and `getGlowTokens` falls back to it.
|
|
141
|
+
*/
|
|
142
|
+
declare const DEFAULT_GLOW_INTENSITY: GlowIntensity;
|
|
143
|
+
/**
|
|
144
|
+
* Surface treatments shared by every text-entry control — `Input`, `Textarea`,
|
|
145
|
+
* `SearchBar`. Defined once here so the three are the same box when they sit
|
|
146
|
+
* next to each other in a form.
|
|
147
|
+
*/
|
|
148
|
+
declare const INPUT_VARIANTS: readonly ["flat", "elevated", "ghost", "underline", "glass", "gradient"];
|
|
149
|
+
type InputVariant = (typeof INPUT_VARIANTS)[number];
|
|
150
|
+
type InputVariantTokens = {
|
|
151
|
+
/** Border, fill, radius, shadow, backdrop. */
|
|
152
|
+
surface: string;
|
|
153
|
+
/** Text and placeholder colours. */
|
|
154
|
+
text: string;
|
|
155
|
+
/** Resting colour for a leading icon or other adornment. */
|
|
156
|
+
icon: string;
|
|
157
|
+
/** True when the surface is see-through and sits over unknown content. */
|
|
158
|
+
translucent: boolean;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* The variant's surface with its border colour removed, keeping the width and
|
|
162
|
+
* sides.
|
|
163
|
+
*
|
|
164
|
+
* A validation state paints its own border colour, and `border-rose-500`
|
|
165
|
+
* beside the variant's `border-neutral-300` is a same-specificity collision
|
|
166
|
+
* whose winner is emission order — measured in the built stylesheet,
|
|
167
|
+
* `.border-emerald-500` lands *before* `.border-neutral-300` and
|
|
168
|
+
* `.border-rose-500` after it, so an errored field turned rose and a
|
|
169
|
+
* successful one stayed grey. Strip the colour so only one class can apply.
|
|
170
|
+
*/
|
|
171
|
+
declare const stripBorderColor: (surface: string) => string;
|
|
172
|
+
/** True when a caller-supplied class string sets a text colour of its own. */
|
|
173
|
+
declare const hasTextColor: (className?: string) => boolean;
|
|
174
|
+
/**
|
|
175
|
+
* A class string with its text colour removed.
|
|
176
|
+
*
|
|
177
|
+
* Same trap as `stripBorderColor`: a component's own `text-neutral-500` and a
|
|
178
|
+
* caller's `text-emerald-600` are the same specificity, so the winner is
|
|
179
|
+
* emission order in the built stylesheet — which means a documented override
|
|
180
|
+
* works for some colours and silently does nothing for others.
|
|
181
|
+
*/
|
|
182
|
+
declare const stripTextColor: (className: string) => string;
|
|
183
|
+
/**
|
|
184
|
+
* The field surface tokens. `corner="auto"` (the default) leaves the radius
|
|
185
|
+
* baked into the surface in place — `rounded-lg`, the theme's control corner
|
|
186
|
+
* (`DEFAULT_CONTROL_CORNER`), one step looser than the container default so
|
|
187
|
+
* a field sits proud of the card it lives in. Any other corner token
|
|
188
|
+
* replaces it. (`underline` paints no box, so a corner there has nowhere
|
|
189
|
+
* to land — honestly no-op.)
|
|
190
|
+
*/
|
|
191
|
+
declare const getInputVariantTokens: (variant: InputVariant, tone?: TrueColor, corner?: SurfaceCorner) => InputVariantTokens;
|
|
192
|
+
type FieldToneTokens = {
|
|
193
|
+
/** Border colour while anything inside the field has focus. */
|
|
194
|
+
focusBorder: string;
|
|
195
|
+
/** Glow ring while anything inside the field has focus. */
|
|
196
|
+
focusRing: string;
|
|
197
|
+
/** Leading/trailing icon colour while the field has focus. */
|
|
198
|
+
icon: string;
|
|
199
|
+
/** Focus ring for an inline trailing button. */
|
|
200
|
+
buttonFocusRing: string;
|
|
201
|
+
};
|
|
202
|
+
declare const getFieldToneTokens: (color: TrueColor) => FieldToneTokens;
|
|
203
|
+
type FieldSizeTokens = {
|
|
204
|
+
px: string;
|
|
205
|
+
py: string;
|
|
206
|
+
/** `underline` has no box to inset from, and needs room above the rule. */
|
|
207
|
+
underlinePy: string;
|
|
208
|
+
text: string;
|
|
209
|
+
icon: ControlSize;
|
|
210
|
+
/** Inline trailing button. */
|
|
211
|
+
button: string;
|
|
212
|
+
};
|
|
213
|
+
/** Padding and type scale, so any two fields line up when stacked. */
|
|
214
|
+
declare const FIELD_SIZE_STYLES: Record<ControlSize, FieldSizeTokens>;
|
|
215
|
+
declare const getFieldSizeTokens: (size: ControlSize) => FieldSizeTokens;
|
|
216
|
+
/**
|
|
217
|
+
* Border only at rest; the ring is part of the focus state, exactly as it is
|
|
218
|
+
* for the tone tokens. A status used to add a bare `ring-2 ring-inset` at rest
|
|
219
|
+
* with no ring *colour* — an unset ring colour resolves to `currentColor`, so
|
|
220
|
+
* every errored or successful field carried a near-black 2px halo inside its
|
|
221
|
+
* coloured border.
|
|
222
|
+
*
|
|
223
|
+
* These also carry no copy colour. Forcing `text-neutral-900 dark:text-neutral-100`
|
|
224
|
+
* alongside the border costs an errored `underline` or `glass` field the
|
|
225
|
+
* high-contrast pair it needs to stay legible over a backdrop.
|
|
226
|
+
*/
|
|
227
|
+
declare const FIELD_STATUS_CLASSES: Record<"error" | "success", string>;
|
|
228
|
+
/**
|
|
229
|
+
* Surface treatments for containers — `Panel` and anything built on it
|
|
230
|
+
* (`FormSection`). Kept here so the type and the text that sits on those
|
|
231
|
+
* surfaces are defined once, not per component.
|
|
232
|
+
*/
|
|
233
|
+
declare const SURFACE_VARIANTS: readonly ["elevated", "outlined", "subtle", "tonal", "default", "glass", "simple", "liquid-glass"];
|
|
234
|
+
type SurfaceVariant = (typeof SURFACE_VARIANTS)[number];
|
|
235
|
+
/**
|
|
236
|
+
* The button a card surface implies — what a card CTA wears when it is not
|
|
237
|
+
* given a variant of its own. An outlined card offers an outlined button.
|
|
238
|
+
*/
|
|
239
|
+
declare const SURFACE_TO_BUTTON_VARIANT: Record<SurfaceVariant, ButtonVariant>;
|
|
240
|
+
/**
|
|
241
|
+
* The surface family plus `plain` — "draw a card, or draw nothing at all".
|
|
242
|
+
*
|
|
243
|
+
* A control that may already sit inside a card the app owns needs a way to say
|
|
244
|
+
* "no surface of my own"; nine components had each spelled that out for
|
|
245
|
+
* themselves (`PanelVariant | "plain"` seven times, `[...SURFACE_VARIANTS,
|
|
246
|
+
* "plain"]` twice) and only one of them exported a runtime list, so demos could
|
|
247
|
+
* not enumerate the others. Same list, nine names: the day `SURFACE_VARIANTS`
|
|
248
|
+
* gains a member, eight of them keep working only by luck.
|
|
249
|
+
*/
|
|
250
|
+
declare const PLAIN_SURFACE_VARIANTS: readonly ["elevated", "outlined", "subtle", "tonal", "default", "glass", "simple", "liquid-glass", "plain"];
|
|
251
|
+
type PlainSurfaceVariant = (typeof PLAIN_SURFACE_VARIANTS)[number];
|
|
252
|
+
type SurfaceTextTokens = {
|
|
253
|
+
/** Section and card headings. */
|
|
254
|
+
heading: string;
|
|
255
|
+
/** Body copy. */
|
|
256
|
+
body: string;
|
|
257
|
+
/** Secondary copy — descriptions under a label. */
|
|
258
|
+
description: string;
|
|
259
|
+
/** Tertiary copy — hints, counters, "optional" markers. */
|
|
260
|
+
muted: string;
|
|
261
|
+
/** Hairline between regions of the surface. */
|
|
262
|
+
divider: string;
|
|
263
|
+
translucent: boolean;
|
|
264
|
+
};
|
|
265
|
+
declare const getSurfaceTextTokens: (variant: SurfaceVariant) => SurfaceTextTokens;
|
|
266
|
+
/**
|
|
267
|
+
* A full-bleed interactive region on a container surface — a disclosure header,
|
|
268
|
+
* a clickable card row.
|
|
269
|
+
*
|
|
270
|
+
* Two rules learned the hard way, both encoded here so callers cannot get them
|
|
271
|
+
* wrong: a ring colour is inert without a ring *width*, and an outer ring is
|
|
272
|
+
* clipped by any ancestor with `overflow: hidden` (which every `Panel` has), so
|
|
273
|
+
* the ring is inset.
|
|
274
|
+
*/
|
|
275
|
+
type SurfaceTriggerTokens = {
|
|
276
|
+
/** Background wash on hover. Low-alpha, so it works on glass too. */
|
|
277
|
+
hover: string;
|
|
278
|
+
/** Complete focus indicator: outline reset, width, inset, colour. */
|
|
279
|
+
focusRing: string;
|
|
280
|
+
};
|
|
281
|
+
declare const getSurfaceTriggerTokens: (color: TrueColor) => SurfaceTriggerTokens;
|
|
282
|
+
/**
|
|
283
|
+
* The `CollapsibleHelpText` trigger — the shared surface-trigger tokens plus
|
|
284
|
+
* the accent glyph, icon chip and title line.
|
|
285
|
+
*
|
|
286
|
+
* The accent sits ON a same-hue `bg-{c}-50` chip, so it steps to the 700
|
|
287
|
+
* light shade rather than the usual 600: hue stacked on its own 50 shade is
|
|
288
|
+
* where 600 dropped under the 3:1 non-text bar (yellow landed ≈2.5:1).
|
|
289
|
+
*/
|
|
290
|
+
type CollapsibleHelpToneTokens = SurfaceTriggerTokens & {
|
|
291
|
+
/** Chevron and icon glyph. */
|
|
292
|
+
accent: string;
|
|
293
|
+
/** Icon chip fill. */
|
|
294
|
+
iconBg: string;
|
|
295
|
+
/** Title line. */
|
|
296
|
+
title: string;
|
|
297
|
+
};
|
|
298
|
+
declare const getCollapsibleHelpToneTokens: (color: TrueColor) => CollapsibleHelpToneTokens;
|
|
299
|
+
declare const getAppDividerToneTokens: (color: TrueColor) => string;
|
|
300
|
+
/**
|
|
301
|
+
* Corner radius scale for container surfaces.
|
|
302
|
+
*
|
|
303
|
+
* The token names are historical and do NOT map 1:1 onto Tailwind's radius
|
|
304
|
+
* utilities — `rounded-sm` here is Tailwind's `rounded-lg`. They are kept as
|
|
305
|
+
* they are because the whole kit already calls them by these names and the
|
|
306
|
+
* scale itself is monotonic and correct; renaming would silently reshape every
|
|
307
|
+
* existing card. `getSurfaceCornerRem` exposes the real radius so a demo can
|
|
308
|
+
* label them honestly.
|
|
309
|
+
*
|
|
310
|
+
* Capsule radii (`rounded-full` / `pill`) are not part of the container scale:
|
|
311
|
+
* a capsule is a shape, and the `Pill` component owns it. Containers that need
|
|
312
|
+
* one take a `rounded-full` class directly.
|
|
313
|
+
*/
|
|
314
|
+
declare const SURFACE_CORNERS: readonly ["auto", "none", "rounded", "rounded-sm", "rounded-md", "rounded-lg", "rounded-xl"];
|
|
315
|
+
type SurfaceCorner = (typeof SURFACE_CORNERS)[number];
|
|
316
|
+
/** The radius a container uses when the caller does not pick one. */
|
|
317
|
+
declare const DEFAULT_SURFACE_CORNER: Exclude<SurfaceCorner, "auto">;
|
|
318
|
+
/**
|
|
319
|
+
* The radius a control uses when the caller does not pick one — the
|
|
320
|
+
* input/button/segment scale, one step looser than the container default
|
|
321
|
+
* (`rounded-md` → `rounded-lg`) on purpose, so a control sits visibly proud
|
|
322
|
+
* of the card it lives in. Components whose docs say "the control corner
|
|
323
|
+
* from the theme" take this.
|
|
324
|
+
*/
|
|
325
|
+
declare const DEFAULT_CONTROL_CORNER: Exclude<SurfaceCorner, "auto">;
|
|
326
|
+
/**
|
|
327
|
+
* The container surface a field implies — used by composite controls (the
|
|
328
|
+
* `DatePicker` calendar's `panelVariant="auto"`) so their furniture reads as
|
|
329
|
+
* part of the field instead of a foreign surface dropped beside it. Field
|
|
330
|
+
* surfaces have no exact container twin, so this picks the nearest fit:
|
|
331
|
+
* `flat` is a bordered box → `outlined`; `elevated` and the lifted `gradient`
|
|
332
|
+
* → `elevated`; `ghost`/`underline` carry no box, so `subtle`; `glass` →
|
|
333
|
+
* `glass`. (Deliberately not `tonal`/`simple` — the hover-filled tints read
|
|
334
|
+
* as chrome, not as a floating calendar.)
|
|
335
|
+
*/
|
|
336
|
+
declare const SURFACE_VARIANT_FOR_FIELD: Record<InputVariant, SurfaceVariant>;
|
|
337
|
+
/**
|
|
338
|
+
* The surface variants that *are* glass — the ones where chrome has to sit
|
|
339
|
+
* *in* glass rather than on it. Every composite (calendar panels, array
|
|
340
|
+
* cards, the variable picker) used to keep its own copy of this two-item
|
|
341
|
+
* list, which is exactly how one of them ends up rendering a solid button
|
|
342
|
+
* on a blurred card.
|
|
343
|
+
*/
|
|
344
|
+
declare const isGlassSurface: (variant: PlainSurfaceVariant) => boolean;
|
|
345
|
+
/** The panel tone that follows a field: the field keeps its accent as the
|
|
346
|
+
* selected-day tint either way, so the fill takes the neutral default. */
|
|
347
|
+
declare const PANEL_TONE_FOR_FIELD: "neutral";
|
|
348
|
+
/**
|
|
349
|
+
* The field surface a container implies — the reverse pairing: composite
|
|
350
|
+
* controls whose rows of inputs sit *inside* a card (the `KeyValueArrayField`)
|
|
351
|
+
* take their inputs' variant from the card so nothing reads as slabs punched
|
|
352
|
+
* through it (`"auto"`). It is SplitView's search mapping, generalised: boxed
|
|
353
|
+
* surfaces carry bordered `flat` fields, tinted ones the boxless `ghost`,
|
|
354
|
+
* glass needs glass, and a plain (cardless) host gives the default field.
|
|
355
|
+
*/
|
|
356
|
+
declare const INPUT_VARIANT_FOR_SURFACE: Record<PlainSurfaceVariant, InputVariant>;
|
|
357
|
+
/**
|
|
358
|
+
* The tone a surface takes when the caller does not pick one. Every surface
|
|
359
|
+
* component — `Panel` and its wrappers — resolves to this same constant, so a
|
|
360
|
+
* default cannot be restated wrongly in one of them.
|
|
361
|
+
*/
|
|
362
|
+
declare const DEFAULT_SURFACE_TONE: TrueColor;
|
|
363
|
+
/**
|
|
364
|
+
* The `EmptyState` size for a pane that has its own header — a `Panel`
|
|
365
|
+
* sibling like `PagedPanel` or `TagPanel`. `EmptyState`'s own scale is tuned
|
|
366
|
+
* for full-page views (its `md` is a text-lg title with an h-12 disc), so
|
|
367
|
+
* inside a pane the empty/error state must never outgrow the pane's header:
|
|
368
|
+
* pick it at least two steps under the pane's control size.
|
|
369
|
+
*/
|
|
370
|
+
/**
|
|
371
|
+
* The expand/retract cascade shared by the kit's unfolding collections —
|
|
372
|
+
* `ColorSwatches`, `TagPanel`: a left-to-right step per item opening, a
|
|
373
|
+
* swifter reverse ripple closing, and a hold long enough for the fade to
|
|
374
|
+
* finish before the condensed geometry commits.
|
|
375
|
+
*/
|
|
376
|
+
declare const CASCADE_EXPAND: {
|
|
377
|
+
/** Per-item cascade step, expanding. */
|
|
378
|
+
readonly stepMs: 20;
|
|
379
|
+
/** Per-item step, retracting — swift, right to left. */
|
|
380
|
+
readonly retractStepMs: 8;
|
|
381
|
+
/** How long the expanded layout is held while items step away. */
|
|
382
|
+
readonly holdMs: 300;
|
|
383
|
+
/** How long the clip takes to grow. */
|
|
384
|
+
readonly growMs: 400;
|
|
385
|
+
};
|
|
386
|
+
declare const PANE_EMPTY_STATE_SIZE: Record<ControlSize, ControlSize>;
|
|
387
|
+
declare const getSurfaceCornerClass: (corner: SurfaceCorner) => string;
|
|
388
|
+
declare const getSurfaceCornerRem: (corner: SurfaceCorner) => string;
|
|
389
|
+
/**
|
|
390
|
+
* Container padding, on the same scale every control uses plus a `none` step,
|
|
391
|
+
* so a Panel's padding and the Button inside it are described in one language.
|
|
392
|
+
*/
|
|
393
|
+
declare const SURFACE_PADDINGS: readonly ["none", "xs", "sm", "md", "lg", "xl"];
|
|
394
|
+
type SurfacePadding = "none" | ControlSize;
|
|
395
|
+
/**
|
|
396
|
+
* The header seam. `SideMenu` draws it below its logo block, and `PageHeader`
|
|
397
|
+
* continues it into the main column; both paint these same classes on their
|
|
398
|
+
* facing edges, so the horizontal line the user sees crossing the shell is
|
|
399
|
+
* spelled exactly once. A component that rounded, padded or recoloured past
|
|
400
|
+
* these would visibly break the seam where the two meet.
|
|
401
|
+
*/
|
|
402
|
+
declare const SIDE_MENU_HEADER_HEIGHT = "h-15";
|
|
403
|
+
declare const SIDE_MENU_HEADER_SEAM = "border-neutral-200 dark:border-neutral-700";
|
|
404
|
+
declare const SIDE_MENU_HEADER_FILL = "bg-white dark:bg-neutral-900";
|
|
405
|
+
/**
|
|
406
|
+
* The webkit scrollbar paint every native scroller in the kit shares — a thin
|
|
407
|
+
* rounded thumb on a transparent track. These live here as complete literals
|
|
408
|
+
* (Tailwind extracts them from this file) so no component re-derives the
|
|
409
|
+
* recipe and quietly drifts a shade.
|
|
410
|
+
*
|
|
411
|
+
* Two tiers, one shade apart:
|
|
412
|
+
* - `THIN_SCROLLBAR` for card and panel bodies, where the surface itself
|
|
413
|
+
* frames the gutter.
|
|
414
|
+
* - `THIN_SCROLLBAR_FIELD` steps the thumb one shade darker for white
|
|
415
|
+
* popovers, inputs and bare scroll regions, where the panel-tier thumb
|
|
416
|
+
* disappears against the field.
|
|
417
|
+
*
|
|
418
|
+
* Scrollers that also scroll horizontally add their own
|
|
419
|
+
* `[&::-webkit-scrollbar]:h-*` alongside the constant. `ScrollArea`
|
|
420
|
+
* deliberately opts out — it hides the native scrollbar and paints its own
|
|
421
|
+
* overlay thumb.
|
|
422
|
+
*/
|
|
423
|
+
declare const THIN_SCROLLBAR = "[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-neutral-200 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-700 hover:[&::-webkit-scrollbar-thumb]:bg-neutral-300 dark:hover:[&::-webkit-scrollbar-thumb]:bg-neutral-600 [&::-webkit-scrollbar-track]:bg-transparent";
|
|
424
|
+
declare const THIN_SCROLLBAR_FIELD = "[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-neutral-300 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-600 hover:[&::-webkit-scrollbar-thumb]:bg-neutral-400 dark:hover:[&::-webkit-scrollbar-thumb]:bg-neutral-500 [&::-webkit-scrollbar-track]:bg-transparent";
|
|
425
|
+
/** The padding a container uses when the caller does not pick one. */
|
|
426
|
+
declare const DEFAULT_SURFACE_PADDING: SurfacePadding;
|
|
427
|
+
declare const getSurfacePaddingClass: (padding: SurfacePadding) => string;
|
|
428
|
+
/** Every padding token but `none`, for the callers that require a real inset. */
|
|
429
|
+
declare const getSurfacePaddingClasses: () => Record<SurfacePadding, string>;
|
|
430
|
+
/**
|
|
431
|
+
* The tones that read as "no tint". Consumers that tint chrome per tone
|
|
432
|
+
* (Table's header band, for instance) route these through the neutral
|
|
433
|
+
* treatment instead of painting a grey-blue header.
|
|
434
|
+
*/
|
|
435
|
+
declare const NEUTRAL_TONES: TrueColor[];
|
|
436
|
+
/**
|
|
437
|
+
* Cell density for data grids. Deliberately orthogonal to the surface
|
|
438
|
+
* variant: the variant decides how the container is drawn, the density how
|
|
439
|
+
* tight the cells inside it sit. A compact table on glass must read the same
|
|
440
|
+
* as a compact table on an outlined card.
|
|
441
|
+
*/
|
|
442
|
+
declare const TABLE_DENSITIES: readonly ["default", "compact", "minimal"];
|
|
443
|
+
type TableDensity = (typeof TABLE_DENSITIES)[number];
|
|
444
|
+
type TableDensityTokens = {
|
|
445
|
+
/** Padding + text size for body and header cells. */
|
|
446
|
+
cell: string;
|
|
447
|
+
/** Leading cell of a row (overrides `cell`'s left padding). */
|
|
448
|
+
sideLeft: string;
|
|
449
|
+
/** Trailing cell of a row (overrides `cell`'s right padding). */
|
|
450
|
+
sideRight: string;
|
|
451
|
+
/** Vertical padding inside the cell's inner flex wrapper. */
|
|
452
|
+
contentVertical: string;
|
|
453
|
+
};
|
|
454
|
+
declare const getTableDensityTokens: (density: TableDensity) => TableDensityTokens;
|
|
455
|
+
/**
|
|
456
|
+
* Geometry and opacity of the `gradient` variant's glow.
|
|
457
|
+
*
|
|
458
|
+
* `pad` is reserved on the control's own wrapper and `inset` positions the glow
|
|
459
|
+
* inside it, so the halo is drawn **within the control's layout box**. Painting
|
|
460
|
+
* it outside — the obvious way — means any ancestor with `overflow: auto`
|
|
461
|
+
* clips it, and `Panel`'s body is `overflow-auto` by default. Same rule as the
|
|
462
|
+
* inset focus ring.
|
|
463
|
+
*/
|
|
464
|
+
type GlowTokens = {
|
|
465
|
+
/**
|
|
466
|
+
* Padding on the wrapper — sized so the shadow's full reach (offset +
|
|
467
|
+
* spread + blur/2) lands inside the box, where no clipping ancestor can
|
|
468
|
+
* slice the glow.
|
|
469
|
+
*/
|
|
470
|
+
pad: string;
|
|
471
|
+
/** Positions the emitter exactly over the field, inside the pad. */
|
|
472
|
+
inset: string;
|
|
473
|
+
/** Shadow blur radius in px. */
|
|
474
|
+
blur: number;
|
|
475
|
+
/** Shadow spread in px. */
|
|
476
|
+
spread: number;
|
|
477
|
+
/** How far apart the two colour lobes sit, in px — the gradient axis. */
|
|
478
|
+
offset: number;
|
|
479
|
+
idleOpacity: number;
|
|
480
|
+
focusOpacity: number;
|
|
481
|
+
};
|
|
482
|
+
declare const getGlowTokens: (intensity: GlowIntensity) => GlowTokens;
|
|
483
|
+
/**
|
|
484
|
+
* Glow gradient stops: the tone's 600 and 400 shades, read from Tailwind's own
|
|
485
|
+
* custom properties rather than a hard-coded hex table.
|
|
486
|
+
*/
|
|
487
|
+
declare const resolveGlowGradient: (tone: TrueColor, from?: string, to?: string) => [string, string];
|
|
488
|
+
/**
|
|
489
|
+
* Surface treatments for the `SideMenu` container.
|
|
490
|
+
*
|
|
491
|
+
* `sidebar` is the kit's standing look (a translucent blur pushed into the
|
|
492
|
+
* layout), `inset` is a flat panel with a hairline on the content edge,
|
|
493
|
+
* `floating` is a detached rounded card, `floating-glass` is that card in the
|
|
494
|
+
* kit's liquid-glass language, and `glass` is the liquid-glass language flush
|
|
495
|
+
* in the layout — both glass treatments are tinted with the menu's tone. The
|
|
496
|
+
* rows inside a menu take the matching treatment automatically.
|
|
497
|
+
*/
|
|
498
|
+
declare const SIDEBAR_VARIANTS: readonly ["sidebar", "inset", "floating", "floating-glass", "glass"];
|
|
499
|
+
type SidebarVariant = (typeof SIDEBAR_VARIANTS)[number];
|
|
500
|
+
/**
|
|
501
|
+
* How a `SideMenu` collapses on desktop.
|
|
502
|
+
*
|
|
503
|
+
* `icon` shrinks it to an icon rail, `offcanvas` removes the panel from the
|
|
504
|
+
* layout entirely (a small handle at the edge opens it again), and `none`
|
|
505
|
+
* makes the panel non-collapsible.
|
|
506
|
+
*/
|
|
507
|
+
declare const SIDEBAR_COLLAPSIBLE_MODES: readonly ["icon", "offcanvas", "none"];
|
|
508
|
+
type SidebarCollapsible = (typeof SIDEBAR_COLLAPSIBLE_MODES)[number];
|
|
509
|
+
/** Which edge of the layout the `SideMenu` sits on. */
|
|
510
|
+
declare const SIDEBAR_SIDES: readonly ["left", "right"];
|
|
511
|
+
type SidebarSide = (typeof SIDEBAR_SIDES)[number];
|
|
512
|
+
/**
|
|
513
|
+
* The media query at which a responsive `SideMenu` becomes an offcanvas
|
|
514
|
+
* overlay (below it) instead of using its desktop collapsible mode (above it).
|
|
515
|
+
*/
|
|
516
|
+
declare const SIDEBAR_MOBILE_QUERY = "(max-width: 1023px)";
|
|
517
|
+
interface SideMenuItemTokens {
|
|
518
|
+
/** Fill of the active row. */
|
|
519
|
+
bg: string;
|
|
520
|
+
/** Copy of the active row. */
|
|
521
|
+
text: string;
|
|
522
|
+
/** Wash under the cursor on an idle row. */
|
|
523
|
+
hoverBg: string;
|
|
524
|
+
/** Copy of an idle row under the cursor. */
|
|
525
|
+
hoverText: string;
|
|
526
|
+
/** Icon of the active row. */
|
|
527
|
+
iconActive: string;
|
|
528
|
+
/** Icon of an idle row under the cursor. */
|
|
529
|
+
iconHover: string;
|
|
530
|
+
}
|
|
531
|
+
declare const getSideMenuItemTokens: (color: TrueColor) => SideMenuItemTokens;
|
|
532
|
+
/**
|
|
533
|
+
* Resting copy for an idle `SideMenu` row, per surface context.
|
|
534
|
+
*
|
|
535
|
+
* A see-through surface composites over unknown content, so the light end of
|
|
536
|
+
* the neutral scale disappears on it — the same two-step rule as
|
|
537
|
+
* `getSurfaceTextTokens`.
|
|
538
|
+
*/
|
|
539
|
+
declare const SIDEBAR_IDLE_COPY: {
|
|
540
|
+
readonly solid: {
|
|
541
|
+
readonly text: "text-neutral-600 dark:text-neutral-400";
|
|
542
|
+
readonly icon: "text-neutral-400 dark:text-neutral-500";
|
|
543
|
+
};
|
|
544
|
+
readonly glass: {
|
|
545
|
+
readonly text: "text-neutral-800 dark:text-neutral-100";
|
|
546
|
+
readonly icon: "text-neutral-600 dark:text-neutral-300";
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
type SidebarIdleCopyKind = keyof typeof SIDEBAR_IDLE_COPY;
|
|
550
|
+
interface SidebarSurfaceTokens {
|
|
551
|
+
/** Fill and blur of the layer painted behind the content. */
|
|
552
|
+
fill: string;
|
|
553
|
+
/**
|
|
554
|
+
* Opaque counterpart of `fill`, for states where the panel grows over other
|
|
555
|
+
* content (the hover-rail expansion) and must not show it through. A
|
|
556
|
+
* translucent `fill` there reads as a second, see-through layer.
|
|
557
|
+
*/
|
|
558
|
+
solidFill: string;
|
|
559
|
+
/** Edge treatment. Empty when the panel is flush and borderless. */
|
|
560
|
+
border: string;
|
|
561
|
+
/** Which edges carry the border: the content-facing one only, or all. */
|
|
562
|
+
borderSides: "start" | "all";
|
|
563
|
+
/** Shadow cast toward the content (left-side panel). */
|
|
564
|
+
shadow: string;
|
|
565
|
+
/** Shadow cast toward the content (right-side panel). */
|
|
566
|
+
shadowRight: string;
|
|
567
|
+
/** Corner radius. Empty when flush. */
|
|
568
|
+
radius: string;
|
|
569
|
+
/** Offset from the layout edges ("" = flush, a margin when detached). */
|
|
570
|
+
offset: string;
|
|
571
|
+
/** Whether the row copy needs the see-through contrast step. */
|
|
572
|
+
idleCopy: SidebarIdleCopyKind;
|
|
573
|
+
/** Hairline between regions of the panel (dividers, section seams). */
|
|
574
|
+
divider: string;
|
|
575
|
+
/** Tertiary copy — section titles, the empty-search note, idle glyphs. */
|
|
576
|
+
muted: string;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* The container treatment for a `SideMenu` variant. The glass treatments are
|
|
580
|
+
* resolved from the shared glass module at the call site, so their fill is
|
|
581
|
+
* tinted with the menu's tone and cannot drift from `Panel`'s glass.
|
|
582
|
+
* `floating-glass` is the glass treatment with the floating card's geometry
|
|
583
|
+
* (offset, radius) layered on top.
|
|
584
|
+
*/
|
|
585
|
+
declare const getSidebarSurfaceTokens: (variant: SidebarVariant, color: TrueColor) => SidebarSurfaceTokens;
|
|
586
|
+
/**
|
|
587
|
+
* The tone of a `Breadcrumb` — what the links turn into under the cursor,
|
|
588
|
+
* what the current crumb is painted with, and the ring a crumb focuses with.
|
|
589
|
+
*
|
|
590
|
+
* The copy pair follows the kit's contrast rule for text on the page
|
|
591
|
+
* background (the one `Button`'s `link` treatment follows): `-700` light —
|
|
592
|
+
* measured min 4.93:1 across the 21 tones — and `-300` dark. The old inline
|
|
593
|
+
* `-600`/`-400` hover pair was the mid-luminance band that whole rule exists
|
|
594
|
+
* to leave: `{c}-600` on white measured 2.94:1 on yellow.
|
|
595
|
+
*/
|
|
596
|
+
type BreadcrumbToneTokens = {
|
|
597
|
+
/** Copy of a crumb under the cursor. */
|
|
598
|
+
hover: string;
|
|
599
|
+
/** Copy of the crumb that *is* the current page. */
|
|
600
|
+
current: string;
|
|
601
|
+
/** Focus ring of a crumb link, including its `focus-visible:` prefix. */
|
|
602
|
+
focusRing: string;
|
|
603
|
+
};
|
|
604
|
+
declare const getBreadcrumbToneTokens: (color: TrueColor) => BreadcrumbToneTokens;
|
|
605
|
+
/**
|
|
606
|
+
* Geometry of a `Breadcrumb` at each shared control size.
|
|
607
|
+
*
|
|
608
|
+
* Anchored to the control scale — the text step is `getControlSizeTokens`'
|
|
609
|
+
* at every size — but the chip insets and icons are the compact versions of
|
|
610
|
+
* those steps, because a crumb is hierarchy copy that happens to be a link,
|
|
611
|
+
* not a control: the trigger-family paddings would space the trail wider
|
|
612
|
+
* than the sentence it sits in. Same precedent as the Toast size table.
|
|
613
|
+
*/
|
|
614
|
+
type BreadcrumbSizeTokens = {
|
|
615
|
+
/** Crumb text size — the control scale's step. */
|
|
616
|
+
text: string;
|
|
617
|
+
/** Hit-area inset of the crumb chip. */
|
|
618
|
+
chip: string;
|
|
619
|
+
/** Space between a crumb's icon and its label. */
|
|
620
|
+
gap: string;
|
|
621
|
+
/** Icon dimensions. */
|
|
622
|
+
icon: string;
|
|
623
|
+
/** Separator glyph dimensions. */
|
|
624
|
+
separator: string;
|
|
625
|
+
};
|
|
626
|
+
declare const getBreadcrumbSizeTokens: (size: ControlSize) => BreadcrumbSizeTokens;
|
|
627
|
+
type ButtonTheme = Record<ButtonVariant, Record<TrueColor, string>>;
|
|
628
|
+
type ButtonHoverTheme = Record<ButtonVariant, Record<TrueColor, string>>;
|
|
629
|
+
type ButtonActiveTheme = Record<ButtonVariant, Record<TrueColor, string>>;
|
|
630
|
+
type ButtonActiveHoverTheme = Record<ButtonVariant, Record<TrueColor, string>>;
|
|
631
|
+
type ToggleTheme = Record<TrueColor, string>;
|
|
632
|
+
type CheckboxTheme = Record<TrueColor, string>;
|
|
633
|
+
type SpinnerTheme = Record<TrueColor, [string, string, string, string]>;
|
|
634
|
+
type LoaderTheme = Record<TrueColor, {
|
|
635
|
+
track: string;
|
|
636
|
+
bar: string;
|
|
637
|
+
}>;
|
|
638
|
+
type MultiToggleTheme = Record<TrueColor, {
|
|
639
|
+
active: string;
|
|
640
|
+
activeText: string;
|
|
641
|
+
indicator: string;
|
|
642
|
+
hover: string;
|
|
643
|
+
}>;
|
|
644
|
+
type MultiToggleVariantTokens = {
|
|
645
|
+
softIndicator: string;
|
|
646
|
+
activeText: string;
|
|
647
|
+
hover: string;
|
|
648
|
+
};
|
|
649
|
+
type MultiToggleVariantTheme = Record<TrueColor, MultiToggleVariantTokens>;
|
|
650
|
+
type TabsColorTokens = {
|
|
651
|
+
hoverText: string;
|
|
652
|
+
activeText: string;
|
|
653
|
+
onAccentText: string;
|
|
654
|
+
focusRing: string;
|
|
655
|
+
accentBg: string;
|
|
656
|
+
subtleBg: string;
|
|
657
|
+
subtleHoverBg: string;
|
|
658
|
+
segmentedContainer: string;
|
|
659
|
+
badgeSubtle: string;
|
|
660
|
+
badgeStrong: string;
|
|
661
|
+
badgeOnAccent: string;
|
|
662
|
+
underlineActive: string;
|
|
663
|
+
};
|
|
664
|
+
type TabsTheme = Record<TrueColor, TabsColorTokens>;
|
|
665
|
+
type PanelToneConfig = {
|
|
666
|
+
border: string;
|
|
667
|
+
/**
|
|
668
|
+
* Hairline for the `outlined` variant. Deliberately lighter than `border`
|
|
669
|
+
* and paired with a low-alpha dark value, so the outline reads as a hairline
|
|
670
|
+
* in both modes instead of a hard rule in light mode.
|
|
671
|
+
*/
|
|
672
|
+
outlineBorder: string;
|
|
673
|
+
heading: string;
|
|
674
|
+
muted: string;
|
|
675
|
+
badge: string;
|
|
676
|
+
subtleBg: string;
|
|
677
|
+
tonalBg: string;
|
|
678
|
+
glassBg: string;
|
|
679
|
+
glassBorder: string;
|
|
680
|
+
liquidBg: string;
|
|
681
|
+
liquidBorder: string;
|
|
682
|
+
liquidShadow: string;
|
|
683
|
+
liquidHeading: string;
|
|
684
|
+
overlayGradient: string;
|
|
685
|
+
decorationShape: string;
|
|
686
|
+
decorationGradient: string;
|
|
687
|
+
};
|
|
688
|
+
type PanelTheme = Record<TrueColor, PanelToneConfig>;
|
|
689
|
+
type StepperToneConfig = {
|
|
690
|
+
activeBg: string;
|
|
691
|
+
activeText: string;
|
|
692
|
+
completedBg: string;
|
|
693
|
+
completedText: string;
|
|
694
|
+
pendingBorder: string;
|
|
695
|
+
pendingText: string;
|
|
696
|
+
underlineBase: string;
|
|
697
|
+
};
|
|
698
|
+
type StepperTheme = Record<TrueColor, StepperToneConfig>;
|
|
699
|
+
type BadgeTheme = Record<TrueColor, string>;
|
|
700
|
+
type PillTheme = Record<TrueColor, Record<"solid" | "soft" | "outline", {
|
|
701
|
+
base: string;
|
|
702
|
+
border?: string;
|
|
703
|
+
hover?: string;
|
|
704
|
+
}>>;
|
|
705
|
+
type AlertTheme = Record<TrueColor, {
|
|
706
|
+
subtle: string;
|
|
707
|
+
solid: string;
|
|
708
|
+
outline: string;
|
|
709
|
+
icon: string;
|
|
710
|
+
text: string;
|
|
711
|
+
border: string;
|
|
712
|
+
dismiss: string;
|
|
713
|
+
}>;
|
|
714
|
+
type StatTileTheme = Record<TrueColor, {
|
|
715
|
+
decorationBg: string;
|
|
716
|
+
iconColor: string;
|
|
717
|
+
divider: string;
|
|
718
|
+
}>;
|
|
719
|
+
type ButtonSelectorColorTokens = {
|
|
720
|
+
selectedBorder: string;
|
|
721
|
+
selectedBg: string;
|
|
722
|
+
selectedIcon: string;
|
|
723
|
+
selectedLabel: string;
|
|
724
|
+
selectedIndicatorBg: string;
|
|
725
|
+
selectedIndicatorBorder: string;
|
|
726
|
+
selectedIndicatorDot: string;
|
|
727
|
+
};
|
|
728
|
+
type ButtonSelectorTheme = Record<TrueColor, ButtonSelectorColorTokens>;
|
|
729
|
+
interface ThemeDefinition {
|
|
730
|
+
button: ButtonTheme;
|
|
731
|
+
buttonHover: ButtonHoverTheme;
|
|
732
|
+
buttonActive: ButtonActiveTheme;
|
|
733
|
+
buttonActiveHover: ButtonActiveHoverTheme;
|
|
734
|
+
toggle: ToggleTheme;
|
|
735
|
+
checkbox: CheckboxTheme;
|
|
736
|
+
spinner: SpinnerTheme;
|
|
737
|
+
loader: LoaderTheme;
|
|
738
|
+
multiToggle: MultiToggleTheme;
|
|
739
|
+
multiToggleVariant: MultiToggleVariantTheme;
|
|
740
|
+
tabs: TabsTheme;
|
|
741
|
+
panel: PanelTheme;
|
|
742
|
+
stepper: StepperTheme;
|
|
743
|
+
badge: BadgeTheme;
|
|
744
|
+
pill: PillTheme;
|
|
745
|
+
alert: AlertTheme;
|
|
746
|
+
statTile: StatTileTheme;
|
|
747
|
+
buttonSelector: ButtonSelectorTheme;
|
|
748
|
+
}
|
|
749
|
+
type DeepPartial<T> = {
|
|
750
|
+
[K in keyof T]?: T[K] extends Record<string, unknown> ? DeepPartial<T[K]> : T[K];
|
|
751
|
+
};
|
|
752
|
+
declare const configureTheme: (overrides: DeepPartial<ThemeDefinition>) => void;
|
|
753
|
+
declare const resetTheme: () => void;
|
|
754
|
+
declare const getButtonColorClasses: (variant: ButtonVariant, color: TrueColor) => string;
|
|
755
|
+
declare const getButtonHoverClasses: (variant: ButtonVariant, color: TrueColor) => string;
|
|
756
|
+
declare const getButtonActiveClasses: (variant: ButtonVariant, color: TrueColor) => string;
|
|
757
|
+
declare const getButtonActiveHoverClasses: (variant: ButtonVariant, color: TrueColor) => string;
|
|
758
|
+
declare const getButtonBaseClasses: (variant: ButtonVariant, color: TrueColor) => string;
|
|
759
|
+
/**
|
|
760
|
+
* The `ButtonVariant`s that read as a slider.
|
|
761
|
+
*
|
|
762
|
+
* `link` and `clear` are text treatments — a slider has no text to treat —
|
|
763
|
+
* and `icon` is a square affordance, so all three are excluded rather than
|
|
764
|
+
* aliased onto something else. What remains covers the full range a track
|
|
765
|
+
* can express: a saturated fill, a tinted one, a bordered wash, a quiet
|
|
766
|
+
* translucent one and a frosted one.
|
|
767
|
+
*/
|
|
768
|
+
declare const SLIDER_VARIANTS: readonly ["solid", "soft", "outline", "ghost", "glass"];
|
|
769
|
+
type SliderVariant = (typeof SLIDER_VARIANTS)[number];
|
|
770
|
+
interface SliderVariantTokens {
|
|
771
|
+
/** Paint for the active track segment, from the start (or min handle) to the value. */
|
|
772
|
+
fill: string;
|
|
773
|
+
/** Border of the handle. */
|
|
774
|
+
handle: string;
|
|
775
|
+
/** The handle's focus-ring colour, including its `focus-visible:` prefix. */
|
|
776
|
+
ring: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Slider treatments — the same visual language `Button` uses, mapped onto a
|
|
780
|
+
* slider's two paintable surfaces (the track segment and the handle) so a
|
|
781
|
+
* slider dropped next to a button row reads as part of the same UI.
|
|
782
|
+
*/
|
|
783
|
+
declare const getSliderVariantTokens: (color: TrueColor, variant: SliderVariant) => SliderVariantTokens;
|
|
784
|
+
/**
|
|
785
|
+
* The `ButtonVariant`s that read as a toggle.
|
|
786
|
+
*
|
|
787
|
+
* Same rationale as `SLIDER_VARIANTS`: `link` and `clear` are text treatments
|
|
788
|
+
* a track has nothing to treat, and `icon` is a square affordance. What
|
|
789
|
+
* remains covers the full range a track can express — a saturated fill, a
|
|
790
|
+
* tinted one, a bordered wash, a quiet translucent one and a frosted one.
|
|
791
|
+
*/
|
|
792
|
+
declare const TOGGLE_VARIANTS: readonly ["solid", "soft", "outline", "ghost", "glass"];
|
|
793
|
+
type ToggleVariant = (typeof TOGGLE_VARIANTS)[number];
|
|
794
|
+
interface ToggleVariantTokens {
|
|
795
|
+
/** Paint for the track when the switch is on (carries `peer-checked:`). */
|
|
796
|
+
track: string;
|
|
797
|
+
/** The thumb's focus-ring colour, driven off the input's `focus-visible`. */
|
|
798
|
+
ring: string;
|
|
799
|
+
/** True when the on-state fill is see-through and sits over unknown content. */
|
|
800
|
+
translucent: boolean;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* Toggle treatments — the same visual language `Button` and `Slider` use,
|
|
804
|
+
* mapped onto the toggle's one paintable surface (the on-state track fill) so
|
|
805
|
+
* a toggle dropped next to a button or slider reads as part of the same UI.
|
|
806
|
+
*
|
|
807
|
+
* The off-state track is deliberately identical across variants — the neutral
|
|
808
|
+
* base — so the on-state fill is what expresses the treatment, exactly as a
|
|
809
|
+
* slider's neutral track does.
|
|
810
|
+
*
|
|
811
|
+
* The `glass` token only carries the frosted fill; the backdrop blur,
|
|
812
|
+
* vibrancy and specular overlay stay with the component, because they depend
|
|
813
|
+
* on the `glassOpacity` / `vibrancy` / `specularMode` props. The same numeric
|
|
814
|
+
* opacity caveat as `getGlassFillClass` applies: only the three presets are
|
|
815
|
+
* safelisted.
|
|
816
|
+
*/
|
|
817
|
+
declare const getToggleVariantTokens: (color: TrueColor, variant: ToggleVariant, glassOpacity?: GlassOpacity) => ToggleVariantTokens;
|
|
818
|
+
declare const getToggleColorClasses: (color: TrueColor) => string;
|
|
819
|
+
/**
|
|
820
|
+
* @deprecated Returns `accent-{color}-600`, which only paints a *native*
|
|
821
|
+
* checkbox — and a native checkbox ignores border, radius and background, so
|
|
822
|
+
* every other class the control carried was dead. Use
|
|
823
|
+
* `getCheckboxControlTokens`, which styles a real box.
|
|
824
|
+
*/
|
|
825
|
+
declare const getCheckboxColorClasses: (color: TrueColor) => string;
|
|
826
|
+
interface CheckboxControlTokens {
|
|
827
|
+
/** Fill and border of the box once checked or indeterminate. */
|
|
828
|
+
checked: string;
|
|
829
|
+
/** Focus ring, driven off the sibling input's focus. */
|
|
830
|
+
ring: string;
|
|
831
|
+
/** Colour of the tick/dash glyph, which sits on the checked fill. */
|
|
832
|
+
glyph: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Fills step to `-700` light / `-400` dark rather than the `-600` / `-500` the
|
|
836
|
+
* native `accent-color` used, for the same reason `Alert`'s solid variant does:
|
|
837
|
+
* a white glyph on `{color}-600` measures 2.94:1 on yellow and 3.06 on lime,
|
|
838
|
+
* under even the 3:1 that WCAG asks of a *graphical* object, and on a `-500`
|
|
839
|
+
* fill it is worse. At `-700` under white and `-400` under `{color}-950` the
|
|
840
|
+
* worst case across all 21 tones is 4.93:1.
|
|
841
|
+
*/
|
|
842
|
+
interface CheckboxVariantTokens {
|
|
843
|
+
/** Fill, shadow and backdrop of the resting box. */
|
|
844
|
+
fill: string;
|
|
845
|
+
/** Resting border colour. Replaced wholesale by the error state. */
|
|
846
|
+
border: string;
|
|
847
|
+
/** Border colour under the cursor. */
|
|
848
|
+
hover: string;
|
|
849
|
+
/** True when the box is see-through and sits over unknown content. */
|
|
850
|
+
translucent: boolean;
|
|
851
|
+
}
|
|
852
|
+
declare const getCheckboxVariantTokens: (variant: InputVariant) => CheckboxVariantTokens;
|
|
853
|
+
/**
|
|
854
|
+
* The checked/indeterminate fill for the checkbox `glass` variant — Toggle's
|
|
855
|
+
* glass rule in miniature: the full-chroma 500 step at a translucent alpha
|
|
856
|
+
* (600 in dark), never the `100` pastel, so the box reads as *tinted glass*
|
|
857
|
+
* on any surface. The border is deliberately left out: unlike the opaque
|
|
858
|
+
* variants, glass keeps its frost edge in the on-state and lets the fill
|
|
859
|
+
* alone carry the tone.
|
|
860
|
+
*/
|
|
861
|
+
declare const getCheckboxGlassCheckedTokens: (color: TrueColor) => string;
|
|
862
|
+
declare const getCheckboxControlTokens: (color: TrueColor) => CheckboxControlTokens;
|
|
863
|
+
declare const getSpinnerColorTokens: (color: TrueColor) => [string, string, string, string];
|
|
864
|
+
/**
|
|
865
|
+
* The geometry of a `StatusSpinner` at each shared control size.
|
|
866
|
+
*
|
|
867
|
+
* The wrapper is the same circle `Spinner` draws at that size, so the two can
|
|
868
|
+
* sit side by side and line up; the dot and the ring width scale with it.
|
|
869
|
+
*/
|
|
870
|
+
interface StatusSpinnerSizeTokens {
|
|
871
|
+
/** Outer circle. Matches `Spinner`'s diameter at the same size. */
|
|
872
|
+
wrapper: string;
|
|
873
|
+
/** Centre dot. */
|
|
874
|
+
dot: string;
|
|
875
|
+
/** Ring border width. */
|
|
876
|
+
border: string;
|
|
877
|
+
}
|
|
878
|
+
declare const getStatusSpinnerSizeTokens: (size: ControlSize) => StatusSpinnerSizeTokens;
|
|
879
|
+
/**
|
|
880
|
+
* The paint of a `StatusSpinner` in one tone.
|
|
881
|
+
*
|
|
882
|
+
* Generated from `TRUE_COLORS` — there is no hand-written per-colour map to
|
|
883
|
+
* drift. `dot` is the one class-shaped token (both steps are already in the
|
|
884
|
+
* generated safelist); the arc and track are CSS colours rather than classes,
|
|
885
|
+
* because the four border sides carry four different values and a `dark:`
|
|
886
|
+
* variant cannot reach an inline style. They read the tone's own Tailwind
|
|
887
|
+
* variable — emitted for all 21 tones — and `color-mix` derives the track and
|
|
888
|
+
* the glow from it, so a tone can never render as another colour.
|
|
889
|
+
*/
|
|
890
|
+
interface StatusSpinnerToneTokens {
|
|
891
|
+
/** Centre dot fill. */
|
|
892
|
+
dot: string;
|
|
893
|
+
/** The rotating arc, as a CSS colour. */
|
|
894
|
+
arc: string;
|
|
895
|
+
/** The idle ring (30% of the tone), as a CSS colour. */
|
|
896
|
+
track: string;
|
|
897
|
+
/** The halo around the dot, as a CSS colour. */
|
|
898
|
+
glow: string;
|
|
899
|
+
}
|
|
900
|
+
declare const getStatusSpinnerToneTokens: (tone: TrueColor) => StatusSpinnerToneTokens;
|
|
901
|
+
/**
|
|
902
|
+
* The paint of a `ProgressSpinner` in one tone.
|
|
903
|
+
*
|
|
904
|
+
* The same generated-from-`TRUE_COLORS` approach as `StatusSpinner`: the arc
|
|
905
|
+
* reads the tone's own Tailwind variable and `color-mix` derives the idle
|
|
906
|
+
* track from it, so a tone can never render as another colour. The inline
|
|
907
|
+
* SVG cannot use `dark:` variants, which is why these are CSS colours rather
|
|
908
|
+
* than classes.
|
|
909
|
+
*/
|
|
910
|
+
interface ProgressSpinnerToneTokens {
|
|
911
|
+
/** The moving arc (or the determinate range), as a CSS colour. */
|
|
912
|
+
arc: string;
|
|
913
|
+
/** The idle ring (30% of the tone), as a CSS colour. */
|
|
914
|
+
track: string;
|
|
915
|
+
}
|
|
916
|
+
declare const getProgressSpinnerToneTokens: (tone: TrueColor) => ProgressSpinnerToneTokens;
|
|
917
|
+
declare const getLoaderProgressColors: (color: TrueColor) => {
|
|
918
|
+
track: string;
|
|
919
|
+
bar: string;
|
|
920
|
+
};
|
|
921
|
+
declare const getMultiToggleColorTokens: (color: TrueColor) => {
|
|
922
|
+
active: string;
|
|
923
|
+
activeText: string;
|
|
924
|
+
indicator: string;
|
|
925
|
+
hover: string;
|
|
926
|
+
};
|
|
927
|
+
declare const getMultiToggleVariantTokens: (color: TrueColor) => MultiToggleVariantTokens;
|
|
928
|
+
declare const getTabsColorTokens: (color: TrueColor) => TabsColorTokens;
|
|
929
|
+
/**
|
|
930
|
+
* Base treatment per surface variant — the shadow, ring, blur and fill that do
|
|
931
|
+
* not depend on tone.
|
|
932
|
+
*
|
|
933
|
+
* Lifted out of `Panel` so any control that draws a *surface* can mirror it
|
|
934
|
+
* exactly rather than copying the switch. `MultiToggle`'s track is the first
|
|
935
|
+
* other consumer: a segmented control is a container holding segments, so it
|
|
936
|
+
* belongs to the same family and has to read identically beside a `Panel`.
|
|
937
|
+
*/
|
|
938
|
+
declare const SURFACE_VARIANT_BASE: Record<SurfaceVariant, string>;
|
|
939
|
+
/**
|
|
940
|
+
* Rim for the translucent variants. Deliberately tone-independent: a saturated
|
|
941
|
+
* `{tone}-500` edge fights the backdrop it is meant to sit over, so glass gets
|
|
942
|
+
* a light rim that reads as a bevel instead of an outline.
|
|
943
|
+
*/
|
|
944
|
+
declare const SURFACE_GLASS_RIM = "border-white/50 dark:border-white/10";
|
|
945
|
+
/** Variants whose surface is see-through. */
|
|
946
|
+
declare const TRANSLUCENT_SURFACE_VARIANTS: readonly SurfaceVariant[];
|
|
947
|
+
interface SurfaceVariantOverrides {
|
|
948
|
+
/** Replaces the variant's own fill, keeping its shadow and ring. */
|
|
949
|
+
bgClass?: string;
|
|
950
|
+
/** Replaces the variant's own rim colour. */
|
|
951
|
+
borderClass?: string;
|
|
952
|
+
/** Extra classes folded in for `liquid-glass` (vibrancy, glass fill). */
|
|
953
|
+
liquidExtras?: string;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* The full class set for a surface variant at a tone — the same combination
|
|
957
|
+
* `Panel` renders, so a control using this sits flush beside one.
|
|
958
|
+
*/
|
|
959
|
+
declare const getSurfaceVariantClasses: (variant: SurfaceVariant, tone: TrueColor, overrides?: SurfaceVariantOverrides) => string;
|
|
960
|
+
declare const getPanelToneStyles: (tone: TrueColor) => PanelToneConfig;
|
|
961
|
+
declare const getStepperTonePalette: (tone: TrueColor) => StepperToneConfig;
|
|
962
|
+
declare const getBadgeColorClasses: (color: TrueColor) => string;
|
|
963
|
+
declare const getPillColorClasses: (color: TrueColor, variant: "solid" | "soft" | "outline") => {
|
|
964
|
+
base: string;
|
|
965
|
+
border?: string;
|
|
966
|
+
hover?: string;
|
|
967
|
+
};
|
|
968
|
+
/**
|
|
969
|
+
* @deprecated Use `getAlertVariantTokens(color, variant)`. This bag hands the
|
|
970
|
+
* same icon/text/dismiss classes to every variant, which is unreadable on
|
|
971
|
+
* `solid`. Kept so existing call sites keep compiling.
|
|
972
|
+
*/
|
|
973
|
+
declare const getAlertColorClasses: (color: TrueColor) => AlertTheme[TrueColor];
|
|
974
|
+
/**
|
|
975
|
+
* Alert treatments. `glass` and `liquid-glass` are the same pair `Panel` and
|
|
976
|
+
* `Pill` offer, so a callout dropped on a glass card no longer has to be the
|
|
977
|
+
* one opaque slab in the layout.
|
|
978
|
+
*/
|
|
979
|
+
declare const ALERT_VARIANTS: readonly ["subtle", "solid", "outline", "glass", "liquid-glass"];
|
|
980
|
+
type AlertVariant = (typeof ALERT_VARIANTS)[number];
|
|
981
|
+
/**
|
|
982
|
+
* Where the leading icon sits against the callout's content.
|
|
983
|
+
*
|
|
984
|
+
* `top` is the default and the only one that was previously possible: the icon
|
|
985
|
+
* centres on the *title's* line box, which is what you want for a one- or
|
|
986
|
+
* two-line callout. `center` centres it against the whole block — right when
|
|
987
|
+
* the body runs long enough that a top-aligned glyph looks stranded — and
|
|
988
|
+
* `bottom` pins it to the last line.
|
|
989
|
+
*/
|
|
990
|
+
declare const ALERT_ICON_ALIGNMENTS: readonly ["top", "center", "bottom"];
|
|
991
|
+
type AlertIconAlign = (typeof ALERT_ICON_ALIGNMENTS)[number];
|
|
992
|
+
/**
|
|
993
|
+
* What the callout *means*, as opposed to what colour it is.
|
|
994
|
+
*
|
|
995
|
+
* Both kits' demos have been passing `tone="info"` / `"success"` / `"warning"`
|
|
996
|
+
* / `"danger"` since tone became a `TrueColor` — none of them are one, so every
|
|
997
|
+
* such alert fell through to the blue fallback and four "different" tones
|
|
998
|
+
* rendered identically. The semantics were real and worth keeping; they just
|
|
999
|
+
* belong in their own prop, which resolves to a tone *and* the right icon *and*
|
|
1000
|
+
* the right live-region politeness.
|
|
1001
|
+
*/
|
|
1002
|
+
declare const ALERT_INTENTS: readonly ["info", "success", "warning", "danger", "neutral"];
|
|
1003
|
+
type AlertIntent = (typeof ALERT_INTENTS)[number];
|
|
1004
|
+
interface AlertIntentConfig {
|
|
1005
|
+
tone: TrueColor;
|
|
1006
|
+
/** Registry icon name used when the caller does not supply one. */
|
|
1007
|
+
icon: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* How assistive technology should announce it. `role="alert"` is an
|
|
1010
|
+
* *assertive* live region: it interrupts whatever the user is reading, which
|
|
1011
|
+
* is right for a failure and wrong for a page that merely renders an
|
|
1012
|
+
* informational banner on load.
|
|
1013
|
+
*/
|
|
1014
|
+
live: "assertive" | "polite";
|
|
1015
|
+
}
|
|
1016
|
+
declare const ALERT_INTENT_CONFIG: Record<AlertIntent, AlertIntentConfig>;
|
|
1017
|
+
/**
|
|
1018
|
+
* Where a toast viewport sits on the screen — PrimeVue's seven anchor
|
|
1019
|
+
* positions, kept as a runtime list so demos and docs enumerate the same
|
|
1020
|
+
* seven. `center` is the only one without a corner.
|
|
1021
|
+
*/
|
|
1022
|
+
declare const TOAST_POSITIONS: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right", "center"];
|
|
1023
|
+
type ToastPosition = (typeof TOAST_POSITIONS)[number];
|
|
1024
|
+
/**
|
|
1025
|
+
* How the stack reads: `stacked` (the PrimeVue 4.5.5 default — a deck of
|
|
1026
|
+
* collapsed cards that fans out on hover) or `expanded` (always fanned out,
|
|
1027
|
+
* the classic list).
|
|
1028
|
+
*/
|
|
1029
|
+
declare const TOAST_MODES: readonly ["stacked", "expanded"];
|
|
1030
|
+
type ToastMode = (typeof TOAST_MODES)[number];
|
|
1031
|
+
declare const DEFAULT_TOAST_POSITION: ToastPosition;
|
|
1032
|
+
declare const DEFAULT_TOAST_MODE: ToastMode;
|
|
1033
|
+
/** Distance the stack offsets each card (stacked peek and expanded seam). */
|
|
1034
|
+
declare const DEFAULT_TOAST_GAP_PX = 12;
|
|
1035
|
+
/** How many newest toasts stay visible; older ones wait their turn. */
|
|
1036
|
+
declare const DEFAULT_TOAST_LIMIT = 3;
|
|
1037
|
+
/**
|
|
1038
|
+
* Kit default — PrimeVue has no default auto-dismiss, and a toast that never
|
|
1039
|
+
* dies is a trap. `life: 0` or `sticky: true` for a persistent message.
|
|
1040
|
+
*/
|
|
1041
|
+
declare const DEFAULT_TOAST_LIFE_MS = 5000;
|
|
1042
|
+
/** Above Modal's 1600: a toast raised while a modal is open sits above it. */
|
|
1043
|
+
declare const DEFAULT_TOAST_Z_INDEX = 2000;
|
|
1044
|
+
/** PrimeVue's viewport width (18.75rem = 300px). */
|
|
1045
|
+
declare const TOAST_DEFAULT_WIDTH = "18.75rem";
|
|
1046
|
+
/**
|
|
1047
|
+
* The geometry of a toast card at each shared control size.
|
|
1048
|
+
*
|
|
1049
|
+
* Same reasoning as Alert's size table, promoted to the theme because the
|
|
1050
|
+
* card lives in a different folder than the callout it shares its language
|
|
1051
|
+
* with, and a second size table for the same scale would drift (brief §2).
|
|
1052
|
+
* The close button and the action buttons sit on the trigger family's scale,
|
|
1053
|
+
* so a toast and the Button beside it are described in the same language.
|
|
1054
|
+
*/
|
|
1055
|
+
interface ToastSizeTokens {
|
|
1056
|
+
/** The card's own padding. */
|
|
1057
|
+
container: string;
|
|
1058
|
+
/** Space between the leading glyph and the copy. */
|
|
1059
|
+
gap: string;
|
|
1060
|
+
/** Title type. */
|
|
1061
|
+
title: string;
|
|
1062
|
+
/** Detail type. */
|
|
1063
|
+
detail: string;
|
|
1064
|
+
/** The intent glyph, on the shared control scale. */
|
|
1065
|
+
icon: ControlSize;
|
|
1066
|
+
/**
|
|
1067
|
+
* Height of the glyph's box: exactly the title's line box, so the glyph
|
|
1068
|
+
* centres on the title's cap height at any size (Alert's calibration).
|
|
1069
|
+
*/
|
|
1070
|
+
iconBox: string;
|
|
1071
|
+
/** The close button's square box. */
|
|
1072
|
+
close: string;
|
|
1073
|
+
/** The close glyph's size. */
|
|
1074
|
+
closeIcon: ControlSize;
|
|
1075
|
+
/** The progress bar's height, on the shared scale. */
|
|
1076
|
+
progress: ControlSize;
|
|
1077
|
+
/** The action buttons' size (trigger family). */
|
|
1078
|
+
action: ControlSize;
|
|
1079
|
+
/** Space above the actions row. */
|
|
1080
|
+
actions: string;
|
|
1081
|
+
}
|
|
1082
|
+
declare const getToastSizeTokens: (size: ControlSize) => ToastSizeTokens;
|
|
1083
|
+
/**
|
|
1084
|
+
* Whether a field is reporting a problem.
|
|
1085
|
+
*
|
|
1086
|
+
* One list, because it was six: `INPUT_`, `SELECT_`, `CHECKBOX_` and
|
|
1087
|
+
* `INPUT_GROUP_VALIDATION_STATUSES` each declared it, and `Textarea` and
|
|
1088
|
+
* `FormField` had bare unions exporting no runtime list at all — so their
|
|
1089
|
+
* demos could not enumerate the states they support. Same three strings, six
|
|
1090
|
+
* names: the day one changes, the other five will not.
|
|
1091
|
+
*/
|
|
1092
|
+
declare const VALIDATION_STATUSES: readonly ["none", "error", "success"];
|
|
1093
|
+
type ValidationStatus = (typeof VALIDATION_STATUSES)[number];
|
|
1094
|
+
/**
|
|
1095
|
+
* What went wrong with a request, as opposed to what colour to paint it.
|
|
1096
|
+
*
|
|
1097
|
+
* The same reasoning as `ALERT_INTENTS`: a failing call already knows whether
|
|
1098
|
+
* it was refused, throttled, or simply could not be reached, and every caller
|
|
1099
|
+
* translating that into a tone *and* a glyph *and* two strings is how one
|
|
1100
|
+
* screen ends up saying "Connection Error" for a 403. The kind resolves all
|
|
1101
|
+
* four; anything the caller states explicitly still wins.
|
|
1102
|
+
*/
|
|
1103
|
+
declare const API_ERROR_KINDS: readonly ["unknown", "offline", "server", "forbidden", "notFound", "rateLimited"];
|
|
1104
|
+
type ApiErrorKind = (typeof API_ERROR_KINDS)[number];
|
|
1105
|
+
interface ApiErrorKindConfig {
|
|
1106
|
+
tone: TrueColor;
|
|
1107
|
+
/** Registry icon name used when the caller does not supply one. */
|
|
1108
|
+
icon: string;
|
|
1109
|
+
title: string;
|
|
1110
|
+
subtitle: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Whether retrying it stands a chance. A 403 does not get a "Try again"
|
|
1113
|
+
* button by default — offering one for a failure the user cannot clear is
|
|
1114
|
+
* how a dead end starts looking like a bug.
|
|
1115
|
+
*/
|
|
1116
|
+
retryable: boolean;
|
|
1117
|
+
}
|
|
1118
|
+
declare const API_ERROR_KIND_CONFIG: Record<ApiErrorKind, ApiErrorKindConfig>;
|
|
1119
|
+
interface AlertVariantTokens {
|
|
1120
|
+
/** Fill plus the callout's base copy colour. */
|
|
1121
|
+
surface: string;
|
|
1122
|
+
/** Border colour. The `border` utility itself is on the base class. */
|
|
1123
|
+
border: string;
|
|
1124
|
+
/** Leading icon. */
|
|
1125
|
+
icon: string;
|
|
1126
|
+
/** Secondary copy under the title. */
|
|
1127
|
+
text: string;
|
|
1128
|
+
/** Dismiss button: rest, hover and focus ring. */
|
|
1129
|
+
dismiss: string;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Replaces the old flat `getAlertColorClasses` bag, which handed the *same*
|
|
1133
|
+
* `icon`, `text` and `dismiss` classes to every variant. On `solid` — a
|
|
1134
|
+
* `{color}-600` fill — that painted the description `{color}-700` and the icon
|
|
1135
|
+
* `{color}-500`, i.e. a dark tone on a saturated tone of itself. It was
|
|
1136
|
+
* unreadable at every tone and no test could see it.
|
|
1137
|
+
*/
|
|
1138
|
+
declare const getAlertVariantTokens: (color: TrueColor, variant: AlertVariant) => AlertVariantTokens;
|
|
1139
|
+
declare const getStatTileColorClasses: (color: TrueColor) => StatTileTheme[TrueColor];
|
|
1140
|
+
|
|
1141
|
+
type IconName = "Accordion" | "Add" | "Apple" | "ArrowChevronLeft" | "ArrowChevronRight" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "Artifactory" | "Attached" | "Attachment" | "Aws" | "Azure" | "Back" | "Blueprint" | "Bug" | "Cache" | "Calendar" | "CatalogManifest" | "CatalogVersion" | "CentOS" | "ChartLine" | "Chat" | "Check" | "CheckCircle" | "ChevronLeft" | "ChevronRight" | "Claim" | "Claims" | "Clean" | "CleanBrush" | "Clone" | "Close" | "Close1" | "CloudOff" | "Cog" | "Complete" | "Container" | "Copy" | "CopyClipboard" | "Dashboard" | "Database" | "Debian" | "Details" | "Docker" | "DockerCopy" | "Dots" | "DotsVertical" | "Download" | "Drag" | "Edit" | "Equal" | "Error" | "Export" | "EyeClosed" | "EyeOpen" | "Fedora" | "File" | "Folder" | "Globe" | "Group" | "HealthCheck" | "Help" | "Host" | "Idea" | "Image" | "Info" | "Jobs" | "KaliLinux" | "Key" | "KeyManagement" | "LXC" | "LXCOld" | "Library" | "Live" | "Log" | "Login" | "Logout" | "Minio" | "Moon" | "Notification" | "Official" | "Offline" | "OpenApp" | "Orchestrator" | "Parameter" | "Pause" | "Pin" | "Podman" | "PodmanDesktop" | "Praise" | "Pull" | "Push" | "RedHat" | "Refresh" | "RemoteHost" | "ReportFeedback" | "Reset" | "Restart" | "ReverseProxy" | "ReverseProxyCORS" | "ReverseProxyFrom" | "ReverseProxyHTTP" | "ReverseProxyHeadersRequest" | "ReverseProxyHeadersResponse" | "ReverseProxyRoutes" | "ReverseProxyTCP" | "ReverseProxyTLS" | "ReverseProxyTo" | "Revert" | "Revoke" | "Rocket" | "Role" | "Roles" | "Run" | "Save" | "Scale" | "Script" | "Search" | "Send" | "Settings" | "Shop" | "Snapshot" | "Star" | "Stop" | "Sun" | "Suspend" | "Taint" | "ThemeAuto" | "ThemeDark" | "ThemeLight" | "Trash" | "UX" | "Ubuntu" | "Unlock" | "User" | "Users" | "Verified" | "ViewGrid" | "ViewRows" | "VirtualMachine" | "Warning" | "Windows" | (string & {});
|
|
1142
|
+
declare const iconRegistry: Record<IconName, React__default.ForwardRefExoticComponent<React__default.SVGProps<SVGSVGElement>>>;
|
|
1143
|
+
|
|
1144
|
+
type HelpButtonPlacement = "top" | "bottom" | "left" | "right" | "auto";
|
|
1145
|
+
interface HelpButtonProps {
|
|
1146
|
+
/**
|
|
1147
|
+
* Help content to display in the panel.
|
|
1148
|
+
* Pass a `string` to render as Markdown (tables and URLs supported).
|
|
1149
|
+
* Pass a `ReactNode` to render arbitrary JSX directly.
|
|
1150
|
+
*/
|
|
1151
|
+
content: string | React__default.ReactNode;
|
|
1152
|
+
/** Optional title shown in the panel header. Defaults to "Help". */
|
|
1153
|
+
title?: React__default.ReactNode;
|
|
1154
|
+
/**
|
|
1155
|
+
* Preferred placement of the floating panel relative to the trigger button.
|
|
1156
|
+
* "auto" (default) picks the side with the most available space.
|
|
1157
|
+
*/
|
|
1158
|
+
placement?: HelpButtonPlacement;
|
|
1159
|
+
/** Accent color for the trigger button and the panel header band. @default "sky" */
|
|
1160
|
+
color?: TrueColor;
|
|
1161
|
+
/**
|
|
1162
|
+
* Surface treatment of the floating panel — the shared container family the
|
|
1163
|
+
* `Panel` reference owns, so a help panel and a card beside it read the same.
|
|
1164
|
+
* @default "elevated"
|
|
1165
|
+
*/
|
|
1166
|
+
variant?: SurfaceVariant;
|
|
1167
|
+
/** Corner radius of the panel, on the shared container scale. @default "rounded-md" */
|
|
1168
|
+
corner?: SurfaceCorner;
|
|
1169
|
+
/** Size of the trigger icon button, on the shared control scale. @default "xs" */
|
|
1170
|
+
size?: ControlSize;
|
|
1171
|
+
/** Icon for the trigger button. Defaults to "Help". */
|
|
1172
|
+
icon?: IconName;
|
|
1173
|
+
/** Maximum width of the floating panel in px. Defaults to 360. */
|
|
1174
|
+
maxWidth?: number;
|
|
1175
|
+
/**
|
|
1176
|
+
* When true the panel body is a pulsing skeleton shaped like the help copy,
|
|
1177
|
+
* so a slow help fetch does not flash empty text. @default false
|
|
1178
|
+
*/
|
|
1179
|
+
loading?: boolean;
|
|
1180
|
+
/** Extra class applied to the root wrapper. */
|
|
1181
|
+
className?: string;
|
|
1182
|
+
}
|
|
1183
|
+
declare const HelpButton: React__default.FC<HelpButtonProps>;
|
|
1184
|
+
|
|
1185
|
+
declare enum CapsuleBlueprintValueType {
|
|
1186
|
+
String = "string",
|
|
1187
|
+
Int = "int",
|
|
1188
|
+
Boolean = "boolean",
|
|
1189
|
+
Select = "select",
|
|
1190
|
+
List = "list",
|
|
1191
|
+
Map = "map"
|
|
1192
|
+
}
|
|
1193
|
+
interface CapsuleBlueprintParameter {
|
|
1194
|
+
name: string;
|
|
1195
|
+
key: string;
|
|
1196
|
+
description?: string;
|
|
1197
|
+
type?: string;
|
|
1198
|
+
value_type?: CapsuleBlueprintValueType;
|
|
1199
|
+
default?: any;
|
|
1200
|
+
required?: boolean;
|
|
1201
|
+
is_required?: boolean;
|
|
1202
|
+
is_secret?: boolean;
|
|
1203
|
+
options?: any;
|
|
1204
|
+
hint?: string;
|
|
1205
|
+
help?: string;
|
|
1206
|
+
service_name?: string;
|
|
1207
|
+
depends_on?: string[];
|
|
1208
|
+
[key: string]: any;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
export { DEFAULT_GLOW_INTENSITY as $, type AlertIntent as A, type ButtonVariant as B, type ControlSize as C, API_ERROR_KIND_CONFIG as D, type AlertIntentConfig as E, type AlertVariantTokens as F, type GlassOpacity as G, type HelpButtonProps as H, type IconName as I, type ApiErrorKindConfig as J, BUTTON_VARIANTS as K, BUTTON_WEIGHTS as L, type BreadcrumbSizeTokens as M, type BreadcrumbToneTokens as N, type Orientation as O, type PlainSurfaceVariant as P, CASCADE_EXPAND as Q, CONTROL_SIZES as R, type SurfaceCorner as S, type TrueColor as T, CapsuleBlueprintValueType as U, type ValidationStatus as V, type CheckboxControlTokens as W, type CheckboxVariantTokens as X, type CollapsibleHelpToneTokens as Y, type ControlSizeTokens as Z, DEFAULT_CONTROL_CORNER as _, type AlertVariant as a, type ToastSizeTokens as a$, DEFAULT_SURFACE_CORNER as a0, DEFAULT_SURFACE_PADDING as a1, DEFAULT_SURFACE_TONE as a2, DEFAULT_TOAST_GAP_PX as a3, DEFAULT_TOAST_LIFE_MS as a4, DEFAULT_TOAST_LIMIT as a5, DEFAULT_TOAST_MODE as a6, DEFAULT_TOAST_POSITION as a7, DEFAULT_TOAST_Z_INDEX as a8, DEFAULT_TRIGGER_CORNER as a9, SURFACE_VARIANTS as aA, SURFACE_CORNERS as aB, SURFACE_GLASS_RIM as aC, SURFACE_PADDINGS as aD, SURFACE_TO_BUTTON_VARIANT as aE, SURFACE_VARIANT_BASE as aF, SURFACE_VARIANT_FOR_FIELD as aG, type SideMenuItemTokens as aH, type SidebarIdleCopyKind as aI, type SidebarSurfaceTokens as aJ, type SliderVariantTokens as aK, type StatusSpinnerSizeTokens as aL, type StatusSpinnerToneTokens as aM, type SurfaceTriggerTokens as aN, type SurfaceVariantOverrides as aO, TABLE_DENSITIES as aP, THIN_SCROLLBAR as aQ, THIN_SCROLLBAR_FIELD as aR, TOAST_DEFAULT_WIDTH as aS, TOAST_MODES as aT, TOAST_POSITIONS as aU, TOGGLE_VARIANTS as aV, TRANSLUCENT_SURFACE_VARIANTS as aW, TRUE_COLORS as aX, TRUE_COLOR_DOT_CLASSES as aY, TRUE_COLOR_TEXT_CLASSES as aZ, type TableDensityTokens as a_, FIELD_SIZE_STYLES as aa, FIELD_STATUS_CLASSES as ab, type FieldSizeTokens as ac, type FieldToneTokens as ad, GLOW_INTENSITIES as ae, type GlowTokens as af, HelpButton as ag, type HelpButtonPlacement as ah, INPUT_VARIANTS as ai, INPUT_VARIANT_FOR_SURFACE as aj, type InputVariantTokens as ak, NEUTRAL_TONES as al, ORIENTATIONS as am, PANEL_TONE_FOR_FIELD as an, PANE_EMPTY_STATE_SIZE as ao, PLAIN_SURFACE_VARIANTS as ap, type ProgressSpinnerToneTokens as aq, SIDEBAR_COLLAPSIBLE_MODES as ar, SIDEBAR_IDLE_COPY as as, SIDEBAR_MOBILE_QUERY as at, SIDEBAR_SIDES as au, SIDEBAR_VARIANTS as av, SIDE_MENU_HEADER_FILL as aw, SIDE_MENU_HEADER_HEIGHT as ax, SIDE_MENU_HEADER_SEAM as ay, SLIDER_VARIANTS as az, type AlertIconAlign as b, type ToggleVariantTokens as b0, VALIDATION_STATUSES as b1, configureTheme as b2, getAlertColorClasses as b3, getAlertVariantTokens as b4, getAppDividerToneTokens as b5, getBadgeColorClasses as b6, getBreadcrumbSizeTokens as b7, getBreadcrumbToneTokens as b8, getButtonActiveClasses as b9, getStatusSpinnerToneTokens as bA, getStepperTonePalette as bB, getSurfaceCornerClass as bC, getSurfaceCornerRem as bD, getSurfacePaddingClass as bE, getSurfacePaddingClasses as bF, getSurfaceTextTokens as bG, getSurfaceTriggerTokens as bH, getSurfaceVariantClasses as bI, getTableDensityTokens as bJ, getTabsColorTokens as bK, getToastSizeTokens as bL, getToggleColorClasses as bM, getToggleVariantTokens as bN, getTrueColorDotClass as bO, getTrueColorTextClass as bP, hasTextColor as bQ, iconRegistry as bR, isGlassSurface as bS, resetTheme as bT, resolveGlowGradient as bU, stripBorderColor as bV, stripTextColor as bW, getButtonActiveHoverClasses as ba, getButtonBaseClasses as bb, getButtonColorClasses as bc, getButtonHoverClasses as bd, getCheckboxColorClasses as be, getCheckboxControlTokens as bf, getCheckboxGlassCheckedTokens as bg, getCheckboxVariantTokens as bh, getCollapsibleHelpToneTokens as bi, getControlSizeTokens as bj, getFieldSizeTokens as bk, getFieldToneTokens as bl, getGlowTokens as bm, getInputVariantTokens as bn, getLoaderProgressColors as bo, getMultiToggleColorTokens as bp, getMultiToggleVariantTokens as bq, getPanelToneStyles as br, getPillColorClasses as bs, getProgressSpinnerToneTokens as bt, getSideMenuItemTokens as bu, getSidebarSurfaceTokens as bv, getSliderVariantTokens as bw, getSpinnerColorTokens as bx, getStatTileColorClasses as by, getStatusSpinnerSizeTokens as bz, type GlassVibrancy as c, type SpecularMode as d, type ButtonWeight as e, type SurfacePadding as f, type SurfaceVariant as g, type GlowIntensity as h, type InputVariant as i, type SliderVariant as j, type ToggleVariant as k, type ToastPosition as l, type ToastMode as m, type Size as n, type SidebarVariant as o, type SidebarSide as p, type SidebarCollapsible as q, type SurfaceTextTokens as r, type TableDensity as s, type ApiErrorKind as t, type CapsuleBlueprintParameter as u, ALERT_ICON_ALIGNMENTS as v, ALERT_INTENTS as w, ALERT_INTENT_CONFIG as x, ALERT_VARIANTS as y, API_ERROR_KINDS as z };
|