@shweet/qt 0.0.19 → 0.0.20
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/README.md +94 -0
- package/dist/$/index-bpdqaq7y.js +16 -0
- package/dist/$/index-wz2nqnj9.js +4 -0
- package/dist/$/index.d.ts +1799 -0
- package/dist/$/index.js +2 -0
- package/dist/$strap/index.d.ts +558 -0
- package/dist/$strap/index.js +2 -0
- package/dist/$tally/index.d.ts +19285 -0
- package/dist/$tally/index.js +2 -0
- package/dist/index.d.ts +5 -1808
- package/dist/index.js +3 -15
- package/package.json +53 -9
- package/readme.md +0 -9
package/dist/$/index.js
ADDED
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import { Medyas, MedyasOptions, CSSinR, CSSValue, media, Shweet } from 'shweet';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom media features used by Strap-authored declarations.
|
|
5
|
+
*
|
|
6
|
+
* Shweet media features are resolved by the instance that saves, not by
|
|
7
|
+
* imported instances, so consumers must spread this record (or pass the same
|
|
8
|
+
* keys themselves) on their saving `Shweet` instance.
|
|
9
|
+
*
|
|
10
|
+
* Keys deliberately contain no hyphens: Shweet splits media bucket names on
|
|
11
|
+
* `-` when it renders their conditions.
|
|
12
|
+
*/
|
|
13
|
+
declare const MEDIA_FEATURE: Readonly<{
|
|
14
|
+
standalone: "(display-mode: standalone)";
|
|
15
|
+
reducedMotion: "(prefers-reduced-motion: no-preference)";
|
|
16
|
+
forcedColors: "(forced-colors: active)";
|
|
17
|
+
}>;
|
|
18
|
+
type StrapMediaFeature = typeof MEDIA_FEATURE;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Base class for Strap preset helpers.
|
|
22
|
+
*
|
|
23
|
+
* Subclasses stay normal `Medyas` values: media accessors create instances
|
|
24
|
+
* that share declaration buckets, so `preset.MD.variant` writes only into the
|
|
25
|
+
* `md` bucket. Presets are never cached; every `Strap.BUTTON`-style access
|
|
26
|
+
* returns a fresh instance.
|
|
27
|
+
*/
|
|
28
|
+
declare abstract class Preset<T extends Medyas<T>, D extends object> extends Medyas<T, D> {
|
|
29
|
+
protected constructor(defaults: D, options?: MedyasOptions<D>);
|
|
30
|
+
/** Write the declarations for the preset's current variant state. */
|
|
31
|
+
protected apply(css: CSSinR): this;
|
|
32
|
+
/** Replace part of the variant state without mutating a sibling preset. */
|
|
33
|
+
protected configure(patch: Partial<D>): this;
|
|
34
|
+
/** Whether any declarations have been written on this instance or a parent. */
|
|
35
|
+
protected get hasValue(): boolean;
|
|
36
|
+
/** Whether writes are currently scoped to a media bucket. */
|
|
37
|
+
protected get isScoped(): boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Base class for presets whose variants are complete single-element
|
|
41
|
+
* declaration snapshots.
|
|
42
|
+
*
|
|
43
|
+
* Every variant is looked up in a table that mirrors a registered `.st-*`
|
|
44
|
+
* class hook. Later variant calls merge into the existing declaration buckets,
|
|
45
|
+
* which makes additive hooks (e.g. `TABLE.striped`) compose while a fresh
|
|
46
|
+
* getter access always starts from an empty bucket set.
|
|
47
|
+
*/
|
|
48
|
+
declare abstract class KindPreset<T extends Medyas<T>, K extends string> extends Preset<T, {
|
|
49
|
+
kind: K;
|
|
50
|
+
}> {
|
|
51
|
+
private readonly variants;
|
|
52
|
+
protected constructor(kind: K, variants: Readonly<Record<K, CSSinR>>, options?: MedyasOptions<{
|
|
53
|
+
kind: K;
|
|
54
|
+
}>);
|
|
55
|
+
/** Write the declarations for `kind` into the current media scope. */
|
|
56
|
+
protected select(kind: K): this;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type AlertKind = "info" | "success" | "danger";
|
|
60
|
+
interface AlertData {
|
|
61
|
+
kind: AlertKind;
|
|
62
|
+
}
|
|
63
|
+
/** Chainable preset for the registered alert hooks. */
|
|
64
|
+
declare class AlertPreset extends KindPreset<AlertPreset, AlertKind> {
|
|
65
|
+
constructor(options?: MedyasOptions<AlertData>);
|
|
66
|
+
get info(): this;
|
|
67
|
+
get success(): this;
|
|
68
|
+
get danger(): this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type BadgeKind = "default" | "accent" | "danger";
|
|
72
|
+
interface BadgeData {
|
|
73
|
+
kind: BadgeKind;
|
|
74
|
+
}
|
|
75
|
+
/** Chainable preset for the registered badge hooks. */
|
|
76
|
+
declare class BadgePreset extends KindPreset<BadgePreset, BadgeKind> {
|
|
77
|
+
constructor(options?: MedyasOptions<BadgeData>);
|
|
78
|
+
get default(): this;
|
|
79
|
+
get accent(): this;
|
|
80
|
+
get danger(): this;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type ButtonTone = "primary" | "secondary" | "danger" | "ghost" | "outline";
|
|
84
|
+
type ButtonSize = "small" | "medium" | "large";
|
|
85
|
+
interface ButtonData {
|
|
86
|
+
tone: ButtonTone;
|
|
87
|
+
size: ButtonSize;
|
|
88
|
+
/** Link-shaped presentation from `.st-btn-link`. */
|
|
89
|
+
link?: boolean;
|
|
90
|
+
/** Square icon-only presentation from `.st-btn.st-btn-icon`. */
|
|
91
|
+
icon?: boolean;
|
|
92
|
+
/** Full-width presentation from `.st-btn-block`. */
|
|
93
|
+
block?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Chainable button preset.
|
|
97
|
+
*
|
|
98
|
+
* Tone and size are independent dimensions: later calls in the same dimension
|
|
99
|
+
* win, and either order composes. `Strap.BUTTON.primary.small.MD` keeps the
|
|
100
|
+
* base declarations in the default bucket and scopes only later writes to the
|
|
101
|
+
* chosen media bucket, matching `Medyas` semantics.
|
|
102
|
+
*/
|
|
103
|
+
declare class ButtonPreset extends Preset<ButtonPreset, ButtonData> {
|
|
104
|
+
constructor(options?: MedyasOptions<ButtonData>);
|
|
105
|
+
get primary(): this;
|
|
106
|
+
get secondary(): this;
|
|
107
|
+
get danger(): this;
|
|
108
|
+
get ghost(): this;
|
|
109
|
+
/** Outline tone backed by the registered `.st-btn-outline` hook. */
|
|
110
|
+
get outline(): this;
|
|
111
|
+
get small(): this;
|
|
112
|
+
get medium(): this;
|
|
113
|
+
get large(): this;
|
|
114
|
+
/** Link-shaped button from the registered `.st-btn-link` hook. */
|
|
115
|
+
get link(): this;
|
|
116
|
+
/**
|
|
117
|
+
* Icon-only square button matching `.st-btn.st-btn-icon`.
|
|
118
|
+
*
|
|
119
|
+
* The inline icon slot itself is `Strap.ICON.button` (`.st-btn-icon`).
|
|
120
|
+
*/
|
|
121
|
+
get icon(): this;
|
|
122
|
+
/** Full-width button from the registered `.st-btn-block` hook. */
|
|
123
|
+
get block(): this;
|
|
124
|
+
private tone;
|
|
125
|
+
private size;
|
|
126
|
+
private shape;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
type CardKind = "default" | "header" | "body" | "footer" | "media";
|
|
130
|
+
interface CardData {
|
|
131
|
+
kind: CardKind;
|
|
132
|
+
}
|
|
133
|
+
/** Chainable card preset for the card shell and its parts. */
|
|
134
|
+
declare class CardPreset extends Preset<CardPreset, CardData> {
|
|
135
|
+
constructor(options?: MedyasOptions<CardData>);
|
|
136
|
+
get default(): this;
|
|
137
|
+
get header(): this;
|
|
138
|
+
get body(): this;
|
|
139
|
+
get footer(): this;
|
|
140
|
+
get media(): this;
|
|
141
|
+
private kind;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type ChoiceKind = "group" | "choice" | "checkbox" | "radio" | "switch" | "switchInput" | "label" | "help" | "error";
|
|
145
|
+
interface ChoiceData {
|
|
146
|
+
kind: ChoiceKind;
|
|
147
|
+
}
|
|
148
|
+
/** Chainable preset for native checkbox, radio, and switch presentations. */
|
|
149
|
+
declare class ChoicePreset extends KindPreset<ChoicePreset, ChoiceKind> {
|
|
150
|
+
constructor(options?: MedyasOptions<ChoiceData>);
|
|
151
|
+
get group(): this;
|
|
152
|
+
get choice(): this;
|
|
153
|
+
get checkbox(): this;
|
|
154
|
+
get radio(): this;
|
|
155
|
+
get switch(): this;
|
|
156
|
+
get switchInput(): this;
|
|
157
|
+
get label(): this;
|
|
158
|
+
get help(): this;
|
|
159
|
+
get error(): this;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type DisclosureKind = "accordion" | "item" | "summary" | "panel";
|
|
163
|
+
interface DisclosureData {
|
|
164
|
+
kind: DisclosureKind;
|
|
165
|
+
}
|
|
166
|
+
/** Chainable preset for the native accordion surface and its parts. */
|
|
167
|
+
declare class DisclosurePreset extends KindPreset<DisclosurePreset, DisclosureKind> {
|
|
168
|
+
constructor(options?: MedyasOptions<DisclosureData>);
|
|
169
|
+
get accordion(): this;
|
|
170
|
+
get item(): this;
|
|
171
|
+
get summary(): this;
|
|
172
|
+
get panel(): this;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
type FieldKind = "field" | "label" | "input" | "select" | "textarea" | "help" | "error";
|
|
176
|
+
interface FieldData {
|
|
177
|
+
kind: FieldKind;
|
|
178
|
+
}
|
|
179
|
+
/** Chainable form/field preset built from the semantic control tokens. */
|
|
180
|
+
declare class FieldPreset extends Preset<FieldPreset, FieldData> {
|
|
181
|
+
constructor(options?: MedyasOptions<FieldData>);
|
|
182
|
+
get field(): this;
|
|
183
|
+
get label(): this;
|
|
184
|
+
get input(): this;
|
|
185
|
+
get select(): this;
|
|
186
|
+
get textarea(): this;
|
|
187
|
+
get help(): this;
|
|
188
|
+
get error(): this;
|
|
189
|
+
private kind;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
type IconKind = "button" | "empty";
|
|
193
|
+
interface IconData {
|
|
194
|
+
kind: IconKind;
|
|
195
|
+
}
|
|
196
|
+
/** Chainable preset for the registered icon slots. */
|
|
197
|
+
declare class IconPreset extends KindPreset<IconPreset, IconKind> {
|
|
198
|
+
constructor(options?: MedyasOptions<IconData>);
|
|
199
|
+
get button(): this;
|
|
200
|
+
get empty(): this;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
type LayoutKind = "container" | "stack" | "cluster" | "grid" | "divider";
|
|
204
|
+
interface LayoutData {
|
|
205
|
+
kind: LayoutKind;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Chainable layout preset. Layout declarations use logical properties so the
|
|
209
|
+
* same classes mirror under RTL writing modes.
|
|
210
|
+
*/
|
|
211
|
+
declare class LayoutPreset extends Preset<LayoutPreset, LayoutData> {
|
|
212
|
+
constructor(options?: MedyasOptions<LayoutData>);
|
|
213
|
+
get container(): this;
|
|
214
|
+
get stack(): this;
|
|
215
|
+
get cluster(): this;
|
|
216
|
+
get grid(): this;
|
|
217
|
+
/** The registered `.st-divider` flow separator. */
|
|
218
|
+
get divider(): this;
|
|
219
|
+
private kind;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
type MenuKind = "dropdown" | "item" | "divider" | "header" | "danger";
|
|
223
|
+
interface MenuData {
|
|
224
|
+
kind: MenuKind;
|
|
225
|
+
}
|
|
226
|
+
/** Chainable preset for dropdown menu surfaces and their parts. */
|
|
227
|
+
declare class MenuPreset extends KindPreset<MenuPreset, MenuKind> {
|
|
228
|
+
constructor(options?: MedyasOptions<MenuData>);
|
|
229
|
+
get dropdown(): this;
|
|
230
|
+
get item(): this;
|
|
231
|
+
get divider(): this;
|
|
232
|
+
get header(): this;
|
|
233
|
+
get danger(): this;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
type NavKind = "breadcrumb" | "breadcrumbItem" | "breadcrumbLink" | "pagination" | "page" | "pageEllipsis" | "tabs" | "tab" | "tabPanel" | "bar" | "brand" | "item";
|
|
237
|
+
interface NavData {
|
|
238
|
+
kind: NavKind;
|
|
239
|
+
}
|
|
240
|
+
/** Chainable preset for breadcrumbs, pagination, tabs, and navigation bars. */
|
|
241
|
+
declare class NavPreset extends KindPreset<NavPreset, NavKind> {
|
|
242
|
+
constructor(options?: MedyasOptions<NavData>);
|
|
243
|
+
get breadcrumb(): this;
|
|
244
|
+
get breadcrumbItem(): this;
|
|
245
|
+
get breadcrumbLink(): this;
|
|
246
|
+
get pagination(): this;
|
|
247
|
+
get page(): this;
|
|
248
|
+
get pageEllipsis(): this;
|
|
249
|
+
get tabs(): this;
|
|
250
|
+
get tab(): this;
|
|
251
|
+
get tabPanel(): this;
|
|
252
|
+
get bar(): this;
|
|
253
|
+
get brand(): this;
|
|
254
|
+
get item(): this;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
type TableKind = "default" | "caption" | "head" | "headCell" | "cell" | "foot" | "footCell" | "compact" | "striped" | "hover" | "rowSelected" | "bordered" | "sticky" | "sort" | "empty" | "responsive";
|
|
258
|
+
interface TableData {
|
|
259
|
+
kind: TableKind;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Chainable table preset for the registered table hooks.
|
|
263
|
+
*
|
|
264
|
+
* `responsive` describes the overflow **wrapper** element (`.st-table-wrapper`)
|
|
265
|
+
* because a `<table>` cannot scroll itself. The remaining variants describe the
|
|
266
|
+
* table or one of its parts; striped/compact/sticky cell paint still comes from
|
|
267
|
+
* the registered descendant rules.
|
|
268
|
+
*/
|
|
269
|
+
declare class TablePreset extends KindPreset<TablePreset, TableKind> {
|
|
270
|
+
constructor(options?: MedyasOptions<TableData>);
|
|
271
|
+
get default(): this;
|
|
272
|
+
get caption(): this;
|
|
273
|
+
get head(): this;
|
|
274
|
+
get headCell(): this;
|
|
275
|
+
get cell(): this;
|
|
276
|
+
get foot(): this;
|
|
277
|
+
get footCell(): this;
|
|
278
|
+
get compact(): this;
|
|
279
|
+
get striped(): this;
|
|
280
|
+
get hover(): this;
|
|
281
|
+
get rowSelected(): this;
|
|
282
|
+
get bordered(): this;
|
|
283
|
+
get sticky(): this;
|
|
284
|
+
get sort(): this;
|
|
285
|
+
get empty(): this;
|
|
286
|
+
get responsive(): this;
|
|
287
|
+
/** Canonical alias for `.st-table-wrapper`, the same overflow contract. */
|
|
288
|
+
get wrapper(): this;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
type TypeKind = "title" | "body" | "lede" | "muted" | "link" | "code";
|
|
292
|
+
interface TypeData {
|
|
293
|
+
kind: TypeKind;
|
|
294
|
+
}
|
|
295
|
+
/** Chainable preset for the registered typography hooks. */
|
|
296
|
+
declare class TypePreset extends KindPreset<TypePreset, TypeKind> {
|
|
297
|
+
constructor(options?: MedyasOptions<TypeData>);
|
|
298
|
+
get title(): this;
|
|
299
|
+
get body(): this;
|
|
300
|
+
get lede(): this;
|
|
301
|
+
get muted(): this;
|
|
302
|
+
get link(): this;
|
|
303
|
+
get code(): this;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** A theme token value: a plain CSS value or a Shweet media value. */
|
|
307
|
+
type StrapTokenValue = CSSValue | media;
|
|
308
|
+
/** Semantic Strap tokens keyed by their camelCase `st*` names. */
|
|
309
|
+
type StrapTokens = Record<string, StrapTokenValue>;
|
|
310
|
+
/**
|
|
311
|
+
* Public shape shared by every Strap preset helper.
|
|
312
|
+
*
|
|
313
|
+
* Presets extend Shweet's `Medyas`, so `_value` and the media accessors
|
|
314
|
+
* (`MD`, `DARK`, `MOBILE`, …) keep exactly the behavior of other Shweet
|
|
315
|
+
* helpers while typing the preset-specific chain.
|
|
316
|
+
*/
|
|
317
|
+
interface StrapPreset<T> {
|
|
318
|
+
readonly _value: CSSinR;
|
|
319
|
+
readonly XS: T;
|
|
320
|
+
readonly SM: T;
|
|
321
|
+
readonly SMD: T;
|
|
322
|
+
readonly MD: T;
|
|
323
|
+
readonly LG: T;
|
|
324
|
+
readonly XL: T;
|
|
325
|
+
readonly XXL: T;
|
|
326
|
+
readonly NO_HOVER: T;
|
|
327
|
+
readonly MOBILE: T;
|
|
328
|
+
readonly PRINT: T;
|
|
329
|
+
readonly SCREEN: T;
|
|
330
|
+
readonly DARK: T;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Resolve a semantic Strap token as a CSS `var()` reference.
|
|
335
|
+
*
|
|
336
|
+
* Component declarations consume tokens with fallbacks so a missing token or a
|
|
337
|
+
* partial custom theme keeps working. For example,
|
|
338
|
+
* `token("st-color-accent")` → `var(--st-color-accent)`.
|
|
339
|
+
*/
|
|
340
|
+
declare const token: (name: string, fallback?: string) => string;
|
|
341
|
+
/**
|
|
342
|
+
* Modern is the default aesthetic and the fallback for every unspecified
|
|
343
|
+
* theme token. Every color has a paired dark partner; structural tokens stay
|
|
344
|
+
* plain values.
|
|
345
|
+
*/
|
|
346
|
+
declare const MODERN_TOKENS: {
|
|
347
|
+
stColorInk: media;
|
|
348
|
+
stColorInkMuted: media;
|
|
349
|
+
stColorSurface: media;
|
|
350
|
+
stColorSurfaceMuted: media;
|
|
351
|
+
stColorSurfaceRaised: media;
|
|
352
|
+
stColorBorder: media;
|
|
353
|
+
stColorBorderStrong: media;
|
|
354
|
+
stColorAccent: media;
|
|
355
|
+
stColorAccentStrong: media;
|
|
356
|
+
stColorOnAccent: media;
|
|
357
|
+
stColorDanger: media;
|
|
358
|
+
stColorDangerStrong: media;
|
|
359
|
+
stColorOnDanger: media;
|
|
360
|
+
stColorSuccess: media;
|
|
361
|
+
stColorOnSuccess: media;
|
|
362
|
+
stColorWarning: media;
|
|
363
|
+
stColorOnWarning: media;
|
|
364
|
+
stFocusRing: media;
|
|
365
|
+
stShadowSm: media;
|
|
366
|
+
stFontSans: string;
|
|
367
|
+
stFontMono: string;
|
|
368
|
+
stFontSize: string;
|
|
369
|
+
stFontSizeSm: string;
|
|
370
|
+
stFontSizeLg: string;
|
|
371
|
+
stFontSizeTitle: string;
|
|
372
|
+
stLineHeight: string;
|
|
373
|
+
stSpaceXs: string;
|
|
374
|
+
stSpaceSm: string;
|
|
375
|
+
stSpaceMd: string;
|
|
376
|
+
stSpaceLg: string;
|
|
377
|
+
stSpaceXl: string;
|
|
378
|
+
stRadiusSm: string;
|
|
379
|
+
stRadiusMd: string;
|
|
380
|
+
stRadiusLg: string;
|
|
381
|
+
stRadiusFull: string;
|
|
382
|
+
stBorderWidth: string;
|
|
383
|
+
stControlHeight: string;
|
|
384
|
+
stContainerMax: string;
|
|
385
|
+
stGridMin: string;
|
|
386
|
+
stCheckSize: string;
|
|
387
|
+
stMotionFast: string;
|
|
388
|
+
stBtnTransform: string;
|
|
389
|
+
stBtnTracking: string;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Retro overrides are token-driven only.
|
|
394
|
+
*
|
|
395
|
+
* Because every preset consumes the same semantic tokens, switching to
|
|
396
|
+
* `data-strap-theme="retro"` restyles built-in classes and consumer classes
|
|
397
|
+
* authored from `Strap.BUTTON`-style presets without changing markup or the
|
|
398
|
+
* generated map.
|
|
399
|
+
*/
|
|
400
|
+
declare const RETRO_TOKENS: {
|
|
401
|
+
stColorInk: media;
|
|
402
|
+
stColorInkMuted: media;
|
|
403
|
+
stColorSurface: media;
|
|
404
|
+
stColorSurfaceMuted: media;
|
|
405
|
+
stColorSurfaceRaised: media;
|
|
406
|
+
stColorBorder: media;
|
|
407
|
+
stColorBorderStrong: media;
|
|
408
|
+
stColorAccent: media;
|
|
409
|
+
stColorAccentStrong: media;
|
|
410
|
+
stColorOnAccent: media;
|
|
411
|
+
stColorDanger: media;
|
|
412
|
+
stColorDangerStrong: media;
|
|
413
|
+
stColorOnDanger: media;
|
|
414
|
+
stColorSuccess: media;
|
|
415
|
+
stColorOnSuccess: media;
|
|
416
|
+
stColorWarning: media;
|
|
417
|
+
stColorOnWarning: media;
|
|
418
|
+
stFocusRing: media;
|
|
419
|
+
stShadowSm: media;
|
|
420
|
+
stFontSans: string;
|
|
421
|
+
stFontMono: string;
|
|
422
|
+
stRadiusSm: string;
|
|
423
|
+
stRadiusMd: string;
|
|
424
|
+
stRadiusLg: string;
|
|
425
|
+
stBorderWidth: string;
|
|
426
|
+
stBtnTransform: string;
|
|
427
|
+
stBtnTracking: string;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Static Strap namespace, exported as `S`.
|
|
432
|
+
*
|
|
433
|
+
* `S` mirrors the authoring style of `$`: uppercase static getters return
|
|
434
|
+
* fresh preset helpers, static methods return unsaved Shweet instances, and
|
|
435
|
+
* importing the module performs no compilation or file writes. `Strap` remains
|
|
436
|
+
* a backwards-compatible alias for the same class.
|
|
437
|
+
*
|
|
438
|
+
* ```ts
|
|
439
|
+
* import { $, S } from "@shweet/qt";
|
|
440
|
+
* import { Shweet } from "shweet";
|
|
441
|
+
*
|
|
442
|
+
* const app = new Shweet({
|
|
443
|
+
* __filename,
|
|
444
|
+
* prefix: "",
|
|
445
|
+
* shweets: [S.SHWEET, S.theme("brand", { stColorAccent: "#7c3aed" })],
|
|
446
|
+
* exportMap: true,
|
|
447
|
+
* mediaFeature: { ...S.MEDIA },
|
|
448
|
+
* });
|
|
449
|
+
* app.c["app-action"] = S.BUTTON.primary.small;
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
declare class S {
|
|
453
|
+
private static shweet;
|
|
454
|
+
/**
|
|
455
|
+
* Returns the media-feature keys used by S's media-aware declarations.
|
|
456
|
+
* Spread this into the final, saving Shweet instance because custom features
|
|
457
|
+
* are not inherited from imported instances.
|
|
458
|
+
* @example
|
|
459
|
+
* ```ts
|
|
460
|
+
* mediaFeature: { ...S.MEDIA }
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
static get MEDIA(): StrapMediaFeature;
|
|
464
|
+
/**
|
|
465
|
+
* Returns S's reusable, unsaved Shweet library. It is built lazily and
|
|
466
|
+
* cached, so repeated composition uses the same identity and dedupes.
|
|
467
|
+
* @example `shweets: [S.SHWEET]`
|
|
468
|
+
*/
|
|
469
|
+
static get SHWEET(): Shweet;
|
|
470
|
+
/**
|
|
471
|
+
* Builds an independent, unsaved S Shweet instance. Each call has a
|
|
472
|
+
* distinct identity and does not read or change the cached `SHWEET`.
|
|
473
|
+
* @example `shweets: [S.create()]`
|
|
474
|
+
*/
|
|
475
|
+
static create(): Shweet;
|
|
476
|
+
/**
|
|
477
|
+
* Creates an unsaved Shweet theme for a `data-strap-theme="<name>"` root.
|
|
478
|
+
* Supply `st*` token keys; values may use Shweet `med()` pairs for automatic
|
|
479
|
+
* light/dark color-mode values. `modern` and `retro` are reserved theme names.
|
|
480
|
+
* @example
|
|
481
|
+
* ```ts
|
|
482
|
+
* S.theme("brand", { stColorAccent: med("#7c3aed", { dark: "#c4b5fd" }) })
|
|
483
|
+
* ```
|
|
484
|
+
*/
|
|
485
|
+
static theme(name: string, tokens: StrapTokens): Shweet;
|
|
486
|
+
/**
|
|
487
|
+
* Returns a fresh chainable button preset (`primary`, `secondary`, `danger`,
|
|
488
|
+
* `ghost`, sizes, and registered visual variants). Assign it to a Shweet
|
|
489
|
+
* class; composition emits only the selected class rule.
|
|
490
|
+
* @example `app.c["app-save"] = S.BUTTON.primary.small`
|
|
491
|
+
*/
|
|
492
|
+
static get BUTTON(): ButtonPreset;
|
|
493
|
+
/**
|
|
494
|
+
* Returns a fresh chainable card preset: `default`, `header`, `body`,
|
|
495
|
+
* `footer`, and `media` select the matching card class declarations.
|
|
496
|
+
*/
|
|
497
|
+
static get CARD(): CardPreset;
|
|
498
|
+
/**
|
|
499
|
+
* Returns a fresh chainable field preset: `field`, `label`, `input`,
|
|
500
|
+
* `select`, `textarea`, `help`, and `error` select form part declarations.
|
|
501
|
+
*/
|
|
502
|
+
static get FIELD(): FieldPreset;
|
|
503
|
+
/**
|
|
504
|
+
* Returns a fresh chainable layout preset with `container`, `stack`,
|
|
505
|
+
* `cluster`, `grid`, and `divider` declarations.
|
|
506
|
+
*/
|
|
507
|
+
static get LAYOUT(): LayoutPreset;
|
|
508
|
+
/**
|
|
509
|
+
* Returns a fresh chainable table preset for table parts and visual variants:
|
|
510
|
+
* `default`, `caption`, `head`, `headCell`, `cell`, `foot`, `footCell`,
|
|
511
|
+
* `compact`, `striped`, `hover`, `rowSelected`, `bordered`, `sticky`,
|
|
512
|
+
* `sort`, `empty`, `responsive`, and `wrapper`.
|
|
513
|
+
*/
|
|
514
|
+
static get TABLE(): TablePreset;
|
|
515
|
+
/**
|
|
516
|
+
* Returns a fresh chainable choice preset with `group`, `choice`, `checkbox`,
|
|
517
|
+
* `radio`, `switch`, `switchInput`, `label`, `help`, and `error` parts.
|
|
518
|
+
* Native inputs retain their browser behavior and semantics.
|
|
519
|
+
*/
|
|
520
|
+
static get CHOICE(): ChoicePreset;
|
|
521
|
+
/**
|
|
522
|
+
* Returns a fresh chainable navigation preset for breadcrumb, pagination,
|
|
523
|
+
* tabs, and bar parts (`breadcrumb`, `breadcrumbItem`, `breadcrumbLink`,
|
|
524
|
+
* `pagination`, `page`, `pageEllipsis`, `tabs`, `tab`, `tabPanel`, `bar`,
|
|
525
|
+
* `brand`, and `item`). It supplies styles, not tab/menu behavior.
|
|
526
|
+
*/
|
|
527
|
+
static get NAV(): NavPreset;
|
|
528
|
+
/**
|
|
529
|
+
* Returns a fresh chainable menu visual preset with `dropdown`, `item`,
|
|
530
|
+
* `divider`, `header`, and `danger` declarations. Keyboard behavior and
|
|
531
|
+
* positioning are consumer responsibilities.
|
|
532
|
+
*/
|
|
533
|
+
static get MENU(): MenuPreset;
|
|
534
|
+
/**
|
|
535
|
+
* Returns a fresh chainable accordion preset with `accordion`, `item`,
|
|
536
|
+
* `summary`, and `panel` declarations. Use native `<details>` and `<summary>`
|
|
537
|
+
* for built-in disclosure behavior.
|
|
538
|
+
*/
|
|
539
|
+
static get DISCLOSURE(): DisclosurePreset;
|
|
540
|
+
/**
|
|
541
|
+
* Returns a fresh chainable typography preset with `title`, `body`, `lede`,
|
|
542
|
+
* `muted`, `link`, and `code` declarations.
|
|
543
|
+
*/
|
|
544
|
+
static get TYPE(): TypePreset;
|
|
545
|
+
/**
|
|
546
|
+
* Returns a fresh chainable icon-slot preset with `button` and `empty`
|
|
547
|
+
* declarations; the icon itself is supplied by consumer markup.
|
|
548
|
+
*/
|
|
549
|
+
static get ICON(): IconPreset;
|
|
550
|
+
/** Returns a fresh chainable badge preset with `default`, `accent`, and `danger` variants. */
|
|
551
|
+
static get BADGE(): BadgePreset;
|
|
552
|
+
/** Returns a fresh chainable alert preset with `info`, `success`, and `danger` variants. */
|
|
553
|
+
static get ALERT(): AlertPreset;
|
|
554
|
+
private static build;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export { AlertPreset, BadgePreset, ButtonPreset, CardPreset, ChoicePreset, DisclosurePreset, FieldPreset, IconPreset, LayoutPreset, MEDIA_FEATURE, MODERN_TOKENS, MenuPreset, NavPreset, RETRO_TOKENS, S, S as Strap, TablePreset, TypePreset, token };
|
|
558
|
+
export type { AlertData, AlertKind, BadgeData, BadgeKind, ButtonData, ButtonSize, ButtonTone, CardData, CardKind, ChoiceData, ChoiceKind, DisclosureData, DisclosureKind, FieldData, FieldKind, IconData, IconKind, LayoutData, LayoutKind, MenuData, MenuKind, NavData, NavKind, StrapMediaFeature, StrapPreset, StrapTokenValue, StrapTokens, TableData, TableKind, TypeData, TypeKind };
|