cssints 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/API.md +48 -0
- package/package.json +2 -2
package/docs/API.md
CHANGED
|
@@ -1218,6 +1218,54 @@ More plugins on `scope()`, each a package of its own with its rules and limits i
|
|
|
1218
1218
|
| [`@cssints/rybitten`](../packages/rybitten/README.md) | `color(hue, { cube })`, `wheel(steps, { cube })`, `shades(hue, lightness)`, `overrides(group)` | RYBitten's red-yellow-blue colours (36 historical cubes) as DTCG data for `createTokens`: a hue, a wheel of hues, a hue at several lightnesses |
|
|
1219
1219
|
| [`@cssints/skeleton`](../packages/skeleton/README.md) | `skeleton().radius().color().highlight()` | Loading placeholders whose shimmer is in phase across the page (one clock on `:root`), static under reduced motion |
|
|
1220
1220
|
|
|
1221
|
+
### Headless: `createField` and `createConfirm` (`@cssints/headless`)
|
|
1222
|
+
|
|
1223
|
+
Two primitives with no APG pattern behind them, so no Quint spec: `createField` is the ARIA contract of a form field, `createConfirm` a promise over `createDialogModal({ role: "alertdialog" })`. Like the rest of the package they return state and attribute objects, no elements, no styling; the README has the examples.
|
|
1224
|
+
|
|
1225
|
+
```ts skip
|
|
1226
|
+
createField(options?: {
|
|
1227
|
+
id?: string;
|
|
1228
|
+
required?: boolean;
|
|
1229
|
+
invalid?: boolean | string; // a string is the flag and the message; false wins over an error
|
|
1230
|
+
hint?: string;
|
|
1231
|
+
error?: string;
|
|
1232
|
+
}): {
|
|
1233
|
+
invalid(): boolean;
|
|
1234
|
+
hint(): string | undefined;
|
|
1235
|
+
error(): string | undefined; // only while invalid
|
|
1236
|
+
describedIds(): readonly string[]; // hint, then error; the ones that are shown
|
|
1237
|
+
controlProps: { id; "aria-describedby"; "aria-invalid"; "aria-required"; required };
|
|
1238
|
+
labelProps: { id; for };
|
|
1239
|
+
hintProps: { id; hidden };
|
|
1240
|
+
errorProps: { id; hidden };
|
|
1241
|
+
};
|
|
1242
|
+
```
|
|
1243
|
+
|
|
1244
|
+
The hint and the error are both listed in `aria-describedby` (hint first; the error does not replace it), `aria-invalid` is set only when invalid, and no attribute names an id that is hidden.
|
|
1245
|
+
|
|
1246
|
+
```ts skip
|
|
1247
|
+
createConfirm(options?: { id?: string; onOpenChange?(open: boolean): void }): {
|
|
1248
|
+
confirm(request: {
|
|
1249
|
+
title: string;
|
|
1250
|
+
description?: string;
|
|
1251
|
+
confirmLabel?: string; // "Confirm"
|
|
1252
|
+
cancelLabel?: string; // "Cancel"
|
|
1253
|
+
destructive?: boolean;
|
|
1254
|
+
}): Promise<boolean>;
|
|
1255
|
+
open(): boolean;
|
|
1256
|
+
request(): ConfirmView | undefined; // the request with its defaults, kept after it settles
|
|
1257
|
+
triggerProps: { id; "aria-haspopup"; "aria-expanded"; "aria-controls" }; // dialog-modal's, without the handlers
|
|
1258
|
+
dialogProps: DialogContentProps; // role alertdialog, aria-labelledby the title, aria-describedby always the description
|
|
1259
|
+
backdropProps: DialogBackdropProps;
|
|
1260
|
+
titleProps: { id };
|
|
1261
|
+
descriptionProps: { id; hidden }; // render it always
|
|
1262
|
+
cancelProps: { id; type; onClick };
|
|
1263
|
+
confirmProps: { id; type; onClick };
|
|
1264
|
+
};
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1267
|
+
`confirm()` resolves `true` on confirm and `false` on cancel, Escape and a backdrop click. A second request while one is pending rejects with `ConfirmPendingError` (it is not queued). Focus goes to the cancel button on open and back to the element that had it when `confirm()` was called.
|
|
1268
|
+
|
|
1221
1269
|
### Publishing a library (decided 2026-10-02, cssints-0l3f)
|
|
1222
1270
|
|
|
1223
1271
|
A package written on cssints ships JavaScript that still has the attribute, and its `.d.ts`. The app that installs it evaluates the package with its own engine: one sheet, the app's browserslist and themes, and a token, a kernel or an `@property` of the package is made once however many modules use it. Nothing is declared: the engine recognises a file by `with { type: "cssints" }`, the same marker as in app code.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssints",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "CSS in TypeScript: typed css.* calls compiled to atomic CSS at build time (a Vite plugin)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@cssints/css-grammar": "^0.
|
|
71
|
+
"@cssints/css-grammar": "^0.9.0",
|
|
72
72
|
"culori": "^4.0.2",
|
|
73
73
|
"effect": "4.0.6",
|
|
74
74
|
"happy-dom": "^20.14.5",
|