cssints 0.9.0 → 0.10.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 +15 -14
- package/package.json +2 -2
package/docs/API.md
CHANGED
|
@@ -1224,33 +1224,34 @@ Two primitives with no APG pattern behind them, so no Quint spec: `createField`
|
|
|
1224
1224
|
|
|
1225
1225
|
```ts skip
|
|
1226
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;
|
|
1227
|
+
id?: string | undefined;
|
|
1228
|
+
required?: boolean | undefined;
|
|
1229
|
+
invalid?: boolean | string | undefined; // a string is the flag and the message; false wins over an error
|
|
1230
|
+
hint?: string | undefined;
|
|
1231
|
+
error?: string | undefined;
|
|
1232
|
+
describedby?: string | readonly string[] | undefined; // host-owned ids, after the hint and the error
|
|
1232
1233
|
}): {
|
|
1233
1234
|
invalid(): boolean;
|
|
1234
1235
|
hint(): string | undefined;
|
|
1235
1236
|
error(): string | undefined; // only while invalid
|
|
1236
|
-
describedIds(): readonly string[]; // hint, then error
|
|
1237
|
+
describedIds(): readonly string[]; // hint, then error (the ones that are shown), then describedby
|
|
1237
1238
|
controlProps: { id; "aria-describedby"; "aria-invalid"; "aria-required"; required };
|
|
1238
1239
|
labelProps: { id; for };
|
|
1239
1240
|
hintProps: { id; hidden };
|
|
1240
|
-
errorProps: { id; hidden };
|
|
1241
|
+
errorProps: { id; hidden; role }; // role "alert" while the error is shown, else undefined
|
|
1241
1242
|
};
|
|
1242
1243
|
```
|
|
1243
1244
|
|
|
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
|
+
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. `errorProps.role` is `"alert"` only while the error is shown; `hintProps` has no role. `describedby` is for one refusal that belongs to two controls: a form-level error element, with its own id and role, whose id is passed to both fields (a getter, so the id is there only while the element is shown); it follows the field's own ids in `aria-describedby` and is dropped when empty. Every option accepts `undefined`, so a getter over an optional prop typechecks under `exactOptionalPropertyTypes`.
|
|
1245
1246
|
|
|
1246
1247
|
```ts skip
|
|
1247
|
-
createConfirm(options?: { id?: string; onOpenChange?(open: boolean): void }): {
|
|
1248
|
+
createConfirm(options?: { id?: string | undefined; onOpenChange?(open: boolean): void }): {
|
|
1248
1249
|
confirm(request: {
|
|
1249
1250
|
title: string;
|
|
1250
|
-
description?: string;
|
|
1251
|
-
confirmLabel?: string; // "Confirm"
|
|
1252
|
-
cancelLabel?: string; // "Cancel"
|
|
1253
|
-
destructive?: boolean;
|
|
1251
|
+
description?: string | undefined;
|
|
1252
|
+
confirmLabel?: string | undefined; // "Confirm": English; a translating host passes both labels
|
|
1253
|
+
cancelLabel?: string | undefined; // "Cancel"
|
|
1254
|
+
destructive?: boolean | undefined;
|
|
1254
1255
|
}): Promise<boolean>;
|
|
1255
1256
|
open(): boolean;
|
|
1256
1257
|
request(): ConfirmView | undefined; // the request with its defaults, kept after it settles
|
|
@@ -1264,7 +1265,7 @@ createConfirm(options?: { id?: string; onOpenChange?(open: boolean): void }): {
|
|
|
1264
1265
|
};
|
|
1265
1266
|
```
|
|
1266
1267
|
|
|
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
|
+
`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. While it is open the dialog has a shell: Tab and Shift+Tab cycle inside it, `overflow: hidden` is set on `document.documentElement` (restored on close; counted, so nested confirms restore it once), and Escape is read from the document in the capture phase, so it works with the focus outside the dialog. Confirms from different `createConfirm` calls may be open together: the last opened gets Escape and Tab. The default labels stay English; a translating host passes `confirmLabel` and `cancelLabel` with each request.
|
|
1268
1269
|
|
|
1269
1270
|
### Publishing a library (decided 2026-10-02, cssints-0l3f)
|
|
1270
1271
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssints",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.10.0",
|
|
72
72
|
"culori": "^4.0.2",
|
|
73
73
|
"effect": "4.0.6",
|
|
74
74
|
"happy-dom": "^20.14.5",
|