@jirawatpyk/aura-tokens 5.7.2 → 5.7.3
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/aura-tailwind.css +1 -1
- package/aura-tailwind.prefixed.css +1 -1
- package/aura.css +1 -1
- package/components/aura.bundle.js +40 -4
- package/components/index.d.ts +4 -1
- package/package.json +1 -1
- package/tokens.json +1 -1
package/aura-tailwind.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.7.
|
|
1
|
+
/* AURA v5.7.3 — Tailwind v4 theme. GENERATED by scripts/build-tokens.mts from tokens.json. Do not edit by hand.
|
|
2
2
|
* @import "tailwindcss";
|
|
3
3
|
* @import "@jirawatpyk/aura-tokens/tailwind.css";
|
|
4
4
|
* Gives bg-bg-surface, text-fg-primary, border-border-strong, p-aura-6, rounded-aura-xl, shadow-aura-overlay,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.7.
|
|
1
|
+
/* AURA v5.7.3 — Tailwind v4 theme with aura- prefixed names. GENERATED by scripts/build-tokens.mts. Do not edit by hand.
|
|
2
2
|
* For apps that already have a Tailwind theme (shadcn): nothing here redefines an existing name.
|
|
3
3
|
* @layer aura-tokens, theme, base, aura, components, utilities;
|
|
4
4
|
* @import "tailwindcss";
|
package/aura.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* AURA v5.7.
|
|
1
|
+
/* AURA v5.7.3 — GENERATED by scripts/build-tokens.mts from tokens.json. Do not edit by hand. */
|
|
2
2
|
/* Fonts: load aura-fonts.css (or the <link> tags in README) separately, so a blocked Google Fonts never breaks this file. */
|
|
3
3
|
|
|
4
4
|
:root, [data-theme="light"] {
|
|
@@ -3394,14 +3394,50 @@ window.Aura = (() => {
|
|
|
3394
3394
|
const auto = uid(), id = props.id || auto;
|
|
3395
3395
|
const list = items(props.errors);
|
|
3396
3396
|
const box = React21.useRef(null);
|
|
3397
|
+
const keyed = props.focusKey !== void 0;
|
|
3398
|
+
const lastKey = React21.useRef(null), armed = React21.useRef(false), hadErrors = React21.useRef(false);
|
|
3399
|
+
const has = list.length > 0;
|
|
3397
3400
|
React21.useEffect(
|
|
3398
3401
|
function() {
|
|
3399
|
-
const
|
|
3400
|
-
|
|
3402
|
+
const appeared = has && !hadErrors.current;
|
|
3403
|
+
hadErrors.current = has;
|
|
3404
|
+
if (!keyed) {
|
|
3405
|
+
lastKey.current = null;
|
|
3406
|
+
if (appeared && box.current) box.current.focus();
|
|
3407
|
+
return;
|
|
3408
|
+
}
|
|
3409
|
+
if (!lastKey.current) {
|
|
3410
|
+
lastKey.current = { v: props.focusKey };
|
|
3411
|
+
armed.current = has;
|
|
3412
|
+
} else if (!Object.is(lastKey.current.v, props.focusKey)) {
|
|
3413
|
+
lastKey.current = { v: props.focusKey };
|
|
3414
|
+
armed.current = true;
|
|
3415
|
+
}
|
|
3416
|
+
if (armed.current && has && box.current) {
|
|
3417
|
+
armed.current = false;
|
|
3418
|
+
box.current.focus();
|
|
3419
|
+
}
|
|
3401
3420
|
},
|
|
3402
|
-
/* focus when errors first appear, and again whenever focusKey changes (each submit) */
|
|
3403
3421
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3404
|
-
[
|
|
3422
|
+
[has, props.focusKey, keyed]
|
|
3423
|
+
);
|
|
3424
|
+
React21.useEffect(
|
|
3425
|
+
function() {
|
|
3426
|
+
if (!keyed) return;
|
|
3427
|
+
function disarm() {
|
|
3428
|
+
armed.current = false;
|
|
3429
|
+
}
|
|
3430
|
+
const events = ["input", "change", "keydown", "pointerdown"];
|
|
3431
|
+
events.forEach(function(n2) {
|
|
3432
|
+
document.addEventListener(n2, disarm, true);
|
|
3433
|
+
});
|
|
3434
|
+
return function() {
|
|
3435
|
+
events.forEach(function(n2) {
|
|
3436
|
+
document.removeEventListener(n2, disarm, true);
|
|
3437
|
+
});
|
|
3438
|
+
};
|
|
3439
|
+
},
|
|
3440
|
+
[keyed]
|
|
3405
3441
|
);
|
|
3406
3442
|
if (!list.length) return null;
|
|
3407
3443
|
return /* @__PURE__ */ React21.createElement(
|
package/components/index.d.ts
CHANGED
|
@@ -355,7 +355,10 @@ export interface FormErrorSummaryProps {
|
|
|
355
355
|
title?: React$1.ReactNode | undefined;
|
|
356
356
|
/** Called with the field when a link is followed, e.g. react-hook-form's `setFocus`. Default: focus the element whose id (or name) is the field. */
|
|
357
357
|
onSelect?: ((field: string) => void) | undefined;
|
|
358
|
-
/** Change it on every submit (e.g. `formState.submitCount`)
|
|
358
|
+
/** Change it on every submit (e.g. `formState.submitCount`). With it, the summary takes focus only after a submit —
|
|
359
|
+
* never while someone types and live errors come and go (5.7.3). Without it, it takes focus whenever errors
|
|
360
|
+
* first appear; with react-hook-form's live `errors`, always pass `focusKey={formState.submitCount}` (a primitive, not a new object
|
|
361
|
+
* each render) and `useForm({ shouldFocusError: false })`, so RHF doesn't move focus to the field first. */
|
|
359
362
|
focusKey?: unknown;
|
|
360
363
|
className?: string | undefined;
|
|
361
364
|
id?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jirawatpyk/aura-tokens",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.3",
|
|
4
4
|
"description": "AURA Design System — tokens (CSS variables, Tailwind preset, Figma variables), theme contrast checks and token lint.",
|
|
5
5
|
"main": "tailwind.tokens.cjs",
|
|
6
6
|
"types": "components/index.d.ts",
|
package/tokens.json
CHANGED