create-tigra 5.0.1 → 5.0.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/CHANGELOG.md +12 -0
- package/README.md +12 -0
- package/modules/diagnostics/diagnostics.md +19 -20
- package/package.json +1 -1
- package/template/AGENTS.md +4 -4
- package/template/client/AGENTS.md +2 -0
- package/template/client/src/app/focus-rings.policy.test.ts +14 -73
- package/template/client/src/app/globals.css +59 -36
- package/template/client/src/components/ui/badge.tsx +2 -2
- package/template/client/src/components/ui/button.tsx +2 -2
- package/template/client/src/components/ui/input.tsx +1 -3
- package/template/client/src/components/ui/select.tsx +2 -2
- package/template/client/src/lib/input-modality.ts +2 -2
- package/template/server/src/config/__tests__/rate-limit.config.test.ts +1 -1
- package/template/server/src/libs/__tests__/rate-limiting.test.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
A generated project never changes after it is created: these notes say what new projects get. To bring an older
|
|
4
4
|
project along, port the changes you need; the guides in [docs/](docs/) cover the ones that need care.
|
|
5
5
|
|
|
6
|
+
## 5.0.3 (2026-11-27)
|
|
7
|
+
|
|
8
|
+
- New projects' `AGENTS.md` has a plain Project facts section. It used to name the maintainer's private tools.
|
|
9
|
+
- The guide `create-tigra add diagnostics` installs (`server/docs/diagnostics.md`) reads the diagnostics view with plain
|
|
10
|
+
SQL from any read-only MySQL client, instead of the maintainer's private tooling.
|
|
11
|
+
- The repository is ready for contributions: `CONTRIBUTING.md`, `SECURITY.md` (private vulnerability reporting), issue
|
|
12
|
+
and pull request templates and `CODEOWNERS`. The old Claude Code archive left the repository.
|
|
13
|
+
|
|
14
|
+
## 5.0.2 (2026-11-18)
|
|
15
|
+
|
|
16
|
+
- Give new apps a shared 1px inset focus outline. Keyboard navigation shows the outline from the first frame, and text fields also show it after a click or tap. Adjust the width and style in `client/src/app/globals.css`.
|
|
17
|
+
|
|
6
18
|
## 5.0.1 (2026-11-17)
|
|
7
19
|
|
|
8
20
|
- Pin Next.js and eslint-config-next to 16.4.6 in new projects. This includes the [security fixes released in Next.js 16.4.5](https://github.com/vercel/next.js/releases/tag/v16.4.5).
|
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ secrets in its git-ignored `.env` files.
|
|
|
23
23
|
- [Adding a module later](#adding-a-module-later)
|
|
24
24
|
- [Documentation](#documentation)
|
|
25
25
|
- [Upgrading from 3.x](#upgrading-from-3x)
|
|
26
|
+
- [Contributing](#contributing)
|
|
26
27
|
|
|
27
28
|
## What you get
|
|
28
29
|
|
|
@@ -298,6 +299,8 @@ In every generated project:
|
|
|
298
299
|
In this repository:
|
|
299
300
|
|
|
300
301
|
- [CHANGELOG.md](CHANGELOG.md): what changed in each release.
|
|
302
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md): how to contribute, and how to report a
|
|
303
|
+
vulnerability privately.
|
|
301
304
|
- [Client IP behind proxies and Cloudflare](docs/client-ip-behind-proxies.md): how the visitor address is verified,
|
|
302
305
|
and how to port it to an older project.
|
|
303
306
|
- [Account ban vs email verification](docs/account-ban-vs-email-verification.md) and
|
|
@@ -314,6 +317,15 @@ template (sessions, rate limits, uploads, the admin API, jobs, health checks, te
|
|
|
314
317
|
rules and the client). [CHANGELOG.md](CHANGELOG.md) lists every change by area; the guides in `docs/` show how to port
|
|
315
318
|
the ones that need care. New projects need Node 24 and npm 11.19+ (the 3.3.0 images ran Node 20).
|
|
316
319
|
|
|
320
|
+
## Contributing
|
|
321
|
+
|
|
322
|
+
Contributions of every kind are welcome: bug fixes, modules, core features, docs, tests and ideas. Every pull
|
|
323
|
+
request is reviewed. For a bigger change, open an issue first so we agree on the approach before you build it. The
|
|
324
|
+
template takes no UI pages, since every app designs its own screens. [CONTRIBUTING.md](CONTRIBUTING.md) explains how
|
|
325
|
+
to test a change on freshly generated projects.
|
|
326
|
+
|
|
327
|
+
Found a vulnerability? Report it privately as described in [SECURITY.md](SECURITY.md), never as a public issue.
|
|
328
|
+
|
|
317
329
|
## License
|
|
318
330
|
|
|
319
331
|
MIT
|
|
@@ -6,31 +6,30 @@ and its configured instance. Read the diagnostics through either path below.
|
|
|
6
6
|
Report observed counts and samples separately from what the source suggests
|
|
7
7
|
caused them. Use the recorded release to locate the matching source revision.
|
|
8
8
|
|
|
9
|
-
## Read with
|
|
9
|
+
## Read with SQL
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Connect with any read-only MySQL client (the `mysql` command line, a database GUI, or your own read-only tool) to
|
|
12
|
+
the application's database, and query the `diagnostic_hourly_top` view. Set the UTC hour you are investigating; the
|
|
13
|
+
hour format is `YYYY-MM-DD HH:00:00`.
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
```sql
|
|
16
|
+
SELECT hour_start, severity, group_rank, group_id, occurrence_count, first_seen, last_seen,
|
|
17
|
+
source, label, code, message, frames, `release`
|
|
18
|
+
FROM diagnostic_hourly_top
|
|
19
|
+
WHERE hour_start = '2026-07-21 12:00:00'
|
|
20
|
+
AND severity = 'error'
|
|
21
|
+
ORDER BY group_rank
|
|
22
|
+
LIMIT 10;
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
admin API for custom intervals and for groups outside the hourly top ten.
|
|
25
|
+
Use `severity = 'warning'` for warnings. The view returns at most ten groups for each exact hour and severity. Use
|
|
26
|
+
the admin API for custom intervals and for groups outside the hourly top ten.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
migration and run the new one with a schema-scoped account that will retain
|
|
33
|
-
read access to `diagnostic_buckets`.
|
|
28
|
+
A reader with read access to the whole schema can use the view as it is. For a diagnostics-only SQL account, grant
|
|
29
|
+
`SELECT` on `diagnostic_hourly_top` alone. Its fixed projection runs as the app's stable migration account. Use the
|
|
30
|
+
bundled `modules/diagnostics/prisma/diagnostic-hourly-view.sql` as a new migration when retrofitting an installed
|
|
31
|
+
diagnostics view. Keep the applied migration and run the new one with a schema-scoped account that will retain read
|
|
32
|
+
access to `diagnostic_buckets`.
|
|
34
33
|
|
|
35
34
|
## Read with an existing admin session
|
|
36
35
|
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -25,14 +25,14 @@ Every implementation change MUST include a human-readability pass. Add or update
|
|
|
25
25
|
<!-- project-facts:start -->
|
|
26
26
|
## Project facts
|
|
27
27
|
|
|
28
|
-
>
|
|
28
|
+
> Fill in the TODOs once. This section is where people and agents look first, so keep it true: when your work changes a line (deployment, URLs, hosting, databases, Redis, integrations, rules), update it in the same change. If it conflicts with reality, trust reality and fix it. No secrets here.
|
|
29
29
|
|
|
30
30
|
- **Name:** {{PROJECT_NAME}}
|
|
31
31
|
- **Purpose:** TODO
|
|
32
32
|
- **Production:** TODO (client URL / server URL, or "not deployed")
|
|
33
|
-
- **Hosting:** TODO (Coolify
|
|
34
|
-
- **Local MySQL:** `{{DATABASE_NAME}}`
|
|
35
|
-
- **Production MySQL:** TODO (
|
|
33
|
+
- **Hosting:** TODO (e.g. a Coolify server, or none)
|
|
34
|
+
- **Local MySQL:** `{{DATABASE_NAME}}` (server/docker-compose.yml)
|
|
35
|
+
- **Production MySQL:** TODO (database name and where it runs, or none)
|
|
36
36
|
- **Redis:** TODO (local yes/no / production yes/no)
|
|
37
37
|
- **Talks to:** TODO
|
|
38
38
|
- **Special rules:** none
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
- `src/lib/constants/routes.ts` and `api-endpoints.ts` own application and API paths. `PROTECTED_PATHS` and `AUTH_PATHS` there are the one list each that the proxy and `AuthInitializer` use, matched by whole path segments (`src/lib/utils/paths.ts`): add your protected areas there.
|
|
15
15
|
- The start-up "who am I" check runs only when the browser holds the server's `auth_session` marker (`src/lib/utils/session-marker.ts`), so anonymous visitors make no API calls.
|
|
16
16
|
- `src/styles/themes/default.css` owns color values. Components use semantic Tailwind tokens; do not hardcode palette values or create competing theme variables.
|
|
17
|
+
- Components inherit the inset focus outline from `src/app/globals.css`. Adjust its shared width and style there and keep individual components free of custom focus rings, shadows, and widths. Preserve keyboard focus when adding interactive controls.
|
|
18
|
+
- For a compound control with one visible surface, add `data-focus-surface` to the wrapper and `data-focus-delegate` to its existing focusable direct child. The wrapper draws the outline while the child keeps its normal tab stop. Menu and option rows use their own focus highlight.
|
|
17
19
|
- If a `next/font` CSS variable is referenced by a token declared on `:root`, apply that font's generated variable class to `<html>`. Never attach it only to `<body>`, where it cannot resolve the root-scoped token.
|
|
18
20
|
- `src/proxy.ts` (Next 16's name for middleware) is the single source of truth for security headers and nonce-based CSP. Do not add a second CSP in `next.config.ts`.
|
|
19
21
|
|
|
@@ -2,87 +2,28 @@ import { readdirSync, readFileSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { describe, expect, it } from 'vitest';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Guard: focus rings show only for keyboard users. jsdom cannot evaluate `:focus-visible` or cascade layers, so this
|
|
7
|
-
* pins the wiring and the CSS (proven in a real browser on iAI, 2026-10-25); lib/input-modality.test.ts covers the
|
|
8
|
-
* mode switching itself.
|
|
9
|
-
*/
|
|
10
5
|
const src = join(__dirname, '..');
|
|
11
|
-
const read = (path: string): string => readFileSync(join(src, path), 'utf8')
|
|
12
|
-
const globals = read('app/globals.css');
|
|
6
|
+
const read = (path: string): string => readFileSync(join(src, path), 'utf8');
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
/** Guard the scaffold wiring and keep the primitives from reintroducing a second focus indicator.
|
|
9
|
+
* Computed outlines, geometry, and transitions are checked in Chromium because jsdom cannot render them. */
|
|
10
|
+
describe('shared inset focus outline', () => {
|
|
11
|
+
it('starts in pointer mode and mounts the input modality tracker', () => {
|
|
16
12
|
const layout = read('app/layout.tsx');
|
|
17
13
|
expect(layout).toMatch(/<html[^>]*data-input="pointer"/u);
|
|
18
14
|
expect(layout).toMatch(/<InputModalityTracker\s*\/>/u);
|
|
19
15
|
});
|
|
20
16
|
|
|
21
|
-
it('
|
|
22
|
-
const
|
|
23
|
-
expect(
|
|
24
|
-
expect(variant).toContain(":not([data-input='pointer'] *)");
|
|
25
|
-
for (const field of ['textarea', 'select', "[contenteditable]:not([contenteditable='false'])", 'input:not(']) {
|
|
26
|
-
expect(variant).toContain(field);
|
|
27
|
-
}
|
|
17
|
+
it('keeps the default outline width and style together on the root', () => {
|
|
18
|
+
const globals = read('app/globals.css');
|
|
19
|
+
expect(globals).toMatch(/:root[ \t]*\{[ \t]*--tigra-focus-width:[^;\r\n]+;[ \t]*--tigra-focus-style:[^;\r\n]+;[ \t]*\}/u);
|
|
28
20
|
});
|
|
29
21
|
|
|
30
|
-
it('
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('keyboard focus is one style everywhere: a 1px accent edge on the element and a faint tint, never outside it', () => {
|
|
38
|
-
const rule = globals.match(/\nhtml\[data-input='keyboard'\] :focus-visible:not\(([^{]+)\) \{([^}]+)\}/u);
|
|
39
|
-
expect(rule).not.toBeNull();
|
|
40
|
-
const [, excluded, body] = rule!;
|
|
41
|
-
expect(body).toContain('outline: 1px solid var(--ring) !important;');
|
|
42
|
-
expect(body).toContain('outline-offset: -1px !important;');
|
|
43
|
-
// `transparent` first: Tailwind's build copies the FIRST colour of a color-mix() into a fallback for browsers
|
|
44
|
-
// without it; `var(--ring)` first would fill the whole control with the accent there.
|
|
45
|
-
expect(body).toMatch(/box-shadow: inset 0 0 0 100vmax color-mix\(in srgb, transparent \d+%, var\(--ring\)\) !important;/u);
|
|
46
|
-
// Menus and select options keep their highlight only; programmatic focus targets are not tab stops.
|
|
47
|
-
for (const part of ["[role='menuitem']", "[role='option']", "[tabindex='-1']", 'textarea']) expect(excluded).toContain(part);
|
|
48
|
-
const before = globals.slice(0, rule!.index);
|
|
49
|
-
expect((before.match(/\{/gu) ?? []).length).toBe((before.match(/\}/gu) ?? []).length);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('filled controls add a page-coloured line inside the edge instead of the tint', () => {
|
|
53
|
-
// The primary fill equals --ring here, so the accent edge alone would vanish on a primary button.
|
|
54
|
-
const filled = globals.match(/\nhtml\[data-input='keyboard'\] :is\(([^{]+)\):focus-visible \{([^}]+)\}/u);
|
|
55
|
-
expect(filled).not.toBeNull();
|
|
56
|
-
// Hand-styled fills count too (the welcome page's links are `bg-primary` anchors, not the UI kit's Button).
|
|
57
|
-
for (const part of ["[data-slot='button'][data-variant='default']", "[data-slot='button'][data-variant='destructive']",
|
|
58
|
-
'.bg-primary', '.bg-destructive']) {
|
|
59
|
-
expect(filled![1]).toContain(part);
|
|
60
|
-
}
|
|
61
|
-
expect(filled![2].trim()).toBe('box-shadow: inset 0 0 0 2px var(--background) !important;');
|
|
62
|
-
// Same specificity as the general rule, so it must come after it to win.
|
|
63
|
-
expect(filled!.index).toBeGreaterThan(globals.indexOf("\nhtml[data-input='keyboard'] :focus-visible:not("));
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('text fields show focus by their border turning accent, never a glow outside the field', () => {
|
|
67
|
-
// Text fields keep a focus look for mouse users too (you need to see where you type), so it follows the same
|
|
68
|
-
// "nothing outside the element" rule: accent border on focus, red border when invalid, no ring.
|
|
69
|
-
const input = read('components/ui/input.tsx');
|
|
70
|
-
expect(input).toContain('focus-visible:border-ring');
|
|
71
|
-
expect(input).toContain('aria-invalid:border-destructive');
|
|
72
|
-
expect(input).not.toMatch(/focus-visible:ring|aria-invalid:ring/u);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('a focused invalid field keeps its red border and gets a faint red tint, so focus stays visible', () => {
|
|
76
|
-
// The red border is the same with or without focus; without the old red glow, the tint is what marks focus.
|
|
77
|
-
const rule = globals.match(/\n:is\(([^{]+)\)\[aria-invalid='true'\]:focus-visible \{([^}]+)\}/u);
|
|
78
|
-
expect(rule).not.toBeNull();
|
|
79
|
-
for (const field of ['textarea', 'select', 'input:not(']) expect(rule![1]).toContain(field);
|
|
80
|
-
expect(rule![2]).toMatch(/box-shadow: inset 0 0 0 100vmax color-mix\(in srgb, transparent \d+%, var\(--destructive\)\) !important;/u);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('no UI kit component draws a ring on plain :focus (it would show on every mouse click)', () => {
|
|
84
|
-
const offenders = readdirSync(join(src, 'components/ui')).filter((file) => file.endsWith('.tsx'))
|
|
85
|
-
.filter((file) => /(^|[\s"'`])focus:(ring|outline-(?!hidden|none))/u.test(read(`components/ui/${file}`)));
|
|
22
|
+
it('keeps competing focus rings, outlines and shadows out of the UI primitives', () => {
|
|
23
|
+
const directory = 'components/ui';
|
|
24
|
+
const focusPaint = /(?:^|[\s"'`])(?:[\w-]+:)*(?:focus|focus-visible|focus-within|aria-invalid):(?:ring|outline|shadow)(?=[-\s"'`])/u;
|
|
25
|
+
const offenders = readdirSync(join(src, directory))
|
|
26
|
+
.filter(file => file.endsWith('.tsx') && focusPaint.test(read(directory + '/' + file)));
|
|
86
27
|
expect(offenders).toEqual([]);
|
|
87
28
|
});
|
|
88
|
-
});
|
|
29
|
+
});
|
|
@@ -29,11 +29,8 @@
|
|
|
29
29
|
|
|
30
30
|
@custom-variant dark (&:is(.dark *));
|
|
31
31
|
|
|
32
|
-
/*
|
|
33
|
-
*
|
|
34
|
-
* lib/input-modality.ts). Text fields keep their focus look in every mode: it shows where the visitor is typing.
|
|
35
|
-
* Static selection rings (a plain `ring-2`) are untouched; see "Focus rings" at the end of this file for plain-CSS
|
|
36
|
-
* outlines. */
|
|
32
|
+
/* Keep the modality distinction for Tailwind focus utilities that change other affordances, such as text or
|
|
33
|
+
* backgrounds. The focus outline itself is shared below. */
|
|
37
34
|
@custom-variant focus-visible (&:focus-visible:where(:not([data-input='pointer'] *), textarea, select, [contenteditable]:not([contenteditable='false']), input:not([type='button'], [type='submit'], [type='reset'], [type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='image'])));
|
|
38
35
|
|
|
39
36
|
@theme inline {
|
|
@@ -113,41 +110,67 @@
|
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
/* Focus
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
/* Focus outline. Adjust its width and style here. The inset follows the width. */
|
|
114
|
+
:root { --tigra-focus-width: 1px; --tigra-focus-style: solid; }
|
|
115
|
+
|
|
116
|
+
/* Set geometry and ink before focus so transition-all cannot interpolate from the browser's outside outline.
|
|
117
|
+
* Focus changes only outline-style. Keep these rules outside Tailwind's layers to own the browser outline. */
|
|
118
|
+
:where(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex='-1']), [contenteditable], [data-focus-surface]) {
|
|
119
|
+
--tigra-focus-ink: var(--ring, currentColor);
|
|
120
|
+
--tigra-focus-clearance: 0px;
|
|
121
|
+
outline-width: var(--tigra-focus-width) !important;
|
|
122
|
+
outline-offset: calc(0px - var(--tigra-focus-width) - var(--tigra-focus-clearance)) !important;
|
|
123
|
+
outline-color: var(--tigra-focus-ink) !important;
|
|
124
|
+
outline-style: none !important;
|
|
125
|
+
|
|
126
|
+
@media (forced-colors: active) {
|
|
127
|
+
outline-color: Highlight !important;
|
|
128
|
+
}
|
|
123
129
|
}
|
|
124
130
|
|
|
125
|
-
/*
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* Not here: text fields (their border turns accent, components/ui/input.tsx), menu items and select options (their highlight is the focus), and
|
|
130
|
-
* focus targets that are not tab stops (tabindex -1: a main region after a skip link, menus, dialogs).
|
|
131
|
-
* `transparent` comes first in the color-mix() on purpose: Tailwind's build copies the first colour into a fallback for
|
|
132
|
-
* browsers without color-mix(), so those get no tint (just the edge) instead of a control filled with the accent. */
|
|
133
|
-
html[data-input='keyboard'] :focus-visible:not(textarea, select, [contenteditable]:not([contenteditable='false']), input:not([type='button'], [type='submit'], [type='reset'], [type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='image']), [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='option'], [tabindex='-1']) {
|
|
134
|
-
outline: 1px solid var(--ring) !important;
|
|
135
|
-
outline-offset: -1px !important;
|
|
136
|
-
box-shadow: inset 0 0 0 100vmax color-mix(in srgb, transparent 92%, var(--ring)) !important;
|
|
131
|
+
/* Use the ink that already contrasts with a filled surface. Error fields reserve a pixel so their border still
|
|
132
|
+
* shows when the outline appears. On a compound field, the designated direct child supplies the error state. */
|
|
133
|
+
:where(a[href], button, [tabindex]):where(.bg-primary, .bg-destructive) {
|
|
134
|
+
--tigra-focus-ink: currentColor;
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
* a tint does not show on a strong fill. They keep the edge above and get a 1px page-coloured line just inside it,
|
|
142
|
-
* which reads on any fill. Same specificity as the rule above, so it must stay after it. */
|
|
143
|
-
html[data-input='keyboard'] :is([data-slot='button'][data-variant='default'], [data-slot='button'][data-variant='destructive'], .bg-primary, .bg-destructive, [data-slot='checkbox'][data-state='checked'], [data-slot='switch'][data-state='checked']):focus-visible {
|
|
144
|
-
box-shadow: inset 0 0 0 2px var(--background) !important;
|
|
137
|
+
:where([data-slot='checkbox'], [data-slot='switch']):where([data-state='checked']) {
|
|
138
|
+
--tigra-focus-ink: var(--primary-foreground, currentColor);
|
|
145
139
|
}
|
|
146
140
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* fallback reason as above. */
|
|
151
|
-
:is(textarea, select, input:not([type='button'], [type='submit'], [type='reset'], [type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='image']))[aria-invalid='true']:focus-visible {
|
|
152
|
-
box-shadow: inset 0 0 0 100vmax color-mix(in srgb, transparent 92%, var(--destructive)) !important;
|
|
141
|
+
:where([aria-invalid='true'], [data-focus-surface]:has(> [data-focus-delegate][aria-invalid='true'])) {
|
|
142
|
+
--tigra-focus-ink: var(--foreground, currentColor);
|
|
143
|
+
--tigra-focus-clearance: 1px;
|
|
153
144
|
}
|
|
145
|
+
|
|
146
|
+
/* Keep text entry visible after a pointer press. Other controls use the tracker because Radix can move pointer
|
|
147
|
+
* focus by script and still match :focus-visible. Menu and option rows keep their own highlight. */
|
|
148
|
+
:is(
|
|
149
|
+
:focus:where(textarea, select, [contenteditable]:not([contenteditable='false']),
|
|
150
|
+
input:not([type='button'], [type='submit'], [type='reset'], [type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='image'])),
|
|
151
|
+
html:not([data-input='pointer']) :focus-visible:where(a[href], button, input, select, textarea, summary,
|
|
152
|
+
[tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']))
|
|
153
|
+
):not(:where([data-focus-surface] > [data-focus-delegate], [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='option'])) {
|
|
154
|
+
outline-style: var(--tigra-focus-style) !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Radix options are programmatic tab stops. Their highlight replaces the browser outline. */
|
|
158
|
+
:where([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='option']):focus {
|
|
159
|
+
outline-style: none !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* A direct child delegates the outline to its visible surface while keeping its original tab stop. */
|
|
163
|
+
[data-focus-surface]:has(> [data-focus-delegate]:focus:where(textarea, select, [contenteditable]:not([contenteditable='false']),
|
|
164
|
+
input:not([type='button'], [type='submit'], [type='reset'], [type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='image']))),
|
|
165
|
+
html:not([data-input='pointer']) [data-focus-surface]:has(> [data-focus-delegate]:focus-visible) {
|
|
166
|
+
outline-style: var(--tigra-focus-style) !important;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Forced colors replace custom backgrounds. Give the existing row highlight the system selection colors. */
|
|
170
|
+
@media (forced-colors: active) {
|
|
171
|
+
:where([role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], [role='option']):is(:focus, [data-highlighted]) {
|
|
172
|
+
forced-color-adjust: none;
|
|
173
|
+
background-color: Highlight;
|
|
174
|
+
color: HighlightText;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -5,7 +5,7 @@ import { Slot } from "radix-ui"
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const badgeVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none
|
|
8
|
+
"inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -13,7 +13,7 @@ const badgeVariants = cva(
|
|
|
13
13
|
secondary:
|
|
14
14
|
"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
15
15
|
destructive:
|
|
16
|
-
"bg-destructive text-white [a&]:hover:bg-destructive/90
|
|
16
|
+
"bg-destructive text-white [a&]:hover:bg-destructive/90 dark:bg-destructive/60",
|
|
17
17
|
outline:
|
|
18
18
|
"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
19
19
|
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
@@ -5,13 +5,13 @@ import { Slot } from "radix-ui"
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 aria-invalid:border-destructive",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
13
|
destructive:
|
|
14
|
-
"bg-destructive text-white hover:bg-destructive/90
|
|
14
|
+
"bg-destructive text-white hover:bg-destructive/90 dark:bg-destructive/60",
|
|
15
15
|
outline:
|
|
16
16
|
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
17
17
|
secondary:
|
|
@@ -8,9 +8,7 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
|
8
8
|
type={type}
|
|
9
9
|
data-slot="input"
|
|
10
10
|
className={cn(
|
|
11
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow]
|
|
12
|
-
// Focus and errors show on the field's own border, never as a glow outside it (globals.css "Focus rings").
|
|
13
|
-
"focus-visible:border-ring",
|
|
11
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
14
12
|
"aria-invalid:border-destructive",
|
|
15
13
|
className
|
|
16
14
|
)}
|
|
@@ -37,7 +37,7 @@ function SelectTrigger({
|
|
|
37
37
|
data-slot="select-trigger"
|
|
38
38
|
data-size={size}
|
|
39
39
|
className={cn(
|
|
40
|
-
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
40
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
41
41
|
className
|
|
42
42
|
)}
|
|
43
43
|
{...props}
|
|
@@ -109,7 +109,7 @@ function SelectItem({
|
|
|
109
109
|
<SelectPrimitive.Item
|
|
110
110
|
data-slot="select-item"
|
|
111
111
|
className={cn(
|
|
112
|
-
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm
|
|
112
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
113
113
|
className
|
|
114
114
|
)}
|
|
115
115
|
{...props}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How the visitor last interacted with the page, kept on `<html data-input="pointer" | "keyboard"
|
|
3
|
-
*
|
|
2
|
+
* How the visitor last interacted with the page, kept on `<html data-input="pointer" | "keyboard">`.
|
|
3
|
+
* The shared focus policy uses this for navigation controls. Text entry keeps its outline in either mode.
|
|
4
4
|
*
|
|
5
5
|
* Why the browser's own `:focus-visible` is not enough: Radix menus and selects cancel the default of the mouse press
|
|
6
6
|
* on their trigger and then move focus by script (into the menu, then to the item under the pointer). Chrome then has
|
|
@@ -14,7 +14,7 @@ const MIN = 60_000;
|
|
|
14
14
|
const HOUR = 60 * MIN;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* The shipped defaults (
|
|
17
|
+
* The shipped defaults (set 2026-10-19). Changing a limit means changing it here
|
|
18
18
|
* too, on purpose. The two email-module entries exist only in projects scaffolded with
|
|
19
19
|
* (or patched to add) email verification.
|
|
20
20
|
*/
|
|
@@ -12,8 +12,8 @@ import { DEFAULT_LIMIT } from '@config/rate-limit.config.js';
|
|
|
12
12
|
// Strikes are asserted, never stored: no Redis in unit tests.
|
|
13
13
|
vi.mock('../ip-block.js', () => ({ recordRateLimitViolation: vi.fn() }));
|
|
14
14
|
|
|
15
|
-
const VISITOR = '
|
|
16
|
-
const OTHER_VISITOR = '
|
|
15
|
+
const VISITOR = '93.184.216.34';
|
|
16
|
+
const OTHER_VISITOR = '93.184.216.35';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* A bare Fastify wired exactly like app.ts (same trustProxy, the same rate-limit module and
|