@rexezuge/web 1.1.0 → 1.2.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/README.md +28 -13
- package/dist/AppPage.d.ts +33 -0
- package/dist/AppPage.d.ts.map +1 -0
- package/dist/AppPage.js +7 -0
- package/dist/AppPage.js.map +1 -0
- package/dist/ContextBar.d.ts +43 -0
- package/dist/ContextBar.d.ts.map +1 -0
- package/dist/ContextBar.js +7 -0
- package/dist/ContextBar.js.map +1 -0
- package/dist/LanguageSelector.d.ts +57 -0
- package/dist/LanguageSelector.d.ts.map +1 -0
- package/dist/LanguageSelector.js +12 -0
- package/dist/LanguageSelector.js.map +1 -0
- package/dist/NoticeBar.d.ts +50 -0
- package/dist/NoticeBar.d.ts.map +1 -0
- package/dist/NoticeBar.js +12 -0
- package/dist/NoticeBar.js.map +1 -0
- package/dist/PageHeaderCard.d.ts +40 -0
- package/dist/PageHeaderCard.d.ts.map +1 -0
- package/dist/PageHeaderCard.js +7 -0
- package/dist/PageHeaderCard.js.map +1 -0
- package/dist/ReadOnlyField.d.ts +49 -0
- package/dist/ReadOnlyField.d.ts.map +1 -0
- package/dist/ReadOnlyField.js +17 -0
- package/dist/ReadOnlyField.js.map +1 -0
- package/dist/RefreshButton.d.ts +36 -0
- package/dist/RefreshButton.d.ts.map +1 -0
- package/dist/RefreshButton.js +8 -0
- package/dist/RefreshButton.js.map +1 -0
- package/dist/TypeToConfirmModal.d.ts +47 -0
- package/dist/TypeToConfirmModal.d.ts.map +1 -0
- package/dist/TypeToConfirmModal.js +24 -0
- package/dist/TypeToConfirmModal.js.map +1 -0
- package/dist/Unauthorized.d.ts +45 -0
- package/dist/Unauthorized.d.ts.map +1 -0
- package/dist/Unauthorized.js +11 -0
- package/dist/Unauthorized.js.map +1 -0
- package/dist/index.d.ts +41 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/dist/useCopyToClipboard.d.ts +54 -0
- package/dist/useCopyToClipboard.d.ts.map +1 -0
- package/dist/useCopyToClipboard.js +40 -0
- package/dist/useCopyToClipboard.js.map +1 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
React UI primitives, hooks, and API client for the family SPAs.
|
|
4
4
|
|
|
5
|
-
Depends on `@rexezuge/errors` (every rejection is a `ServiceError`) and `@rexezuge/shared`. Peer-depends on `react` + `react-dom` 19 — the kit stays version-agnostic and the app owns the renderer.
|
|
5
|
+
Depends on `@rexezuge/errors` (every rejection is a `ServiceError`) and `@rexezuge/shared`. Peer-depends on `react` + `react-dom` 19 — the kit stays version-agnostic and the app owns the renderer — and on `lucide-react` `^1.49`, which three of the converged components use for their glyphs.
|
|
6
|
+
|
|
7
|
+
**Glyphs in, strings out.** No component in this package calls `useTranslation`: every label is a prop, because the app rendering a dialog knows what it says. Icons are the exception — vendoring a glyph's path data freezes it at whatever version was current when it was copied, so `lucide-react` is a peer and the icons come from the app's own copy. `Button` deliberately keeps using this package's own `Spinner` rather than lucide's `Loader2`; chrome is cheap to draw, iconography is not.
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
pnpm add @rexezuge/web
|
|
@@ -14,16 +16,28 @@ pnpm add @rexezuge/web
|
|
|
14
16
|
|
|
15
17
|
Class-based primitives over the CSS variables every Tailwind consumer already defines (`--color-accent`, `--color-surface-*`, `--color-text-*`, `--color-{success,error,warning,info,neutral}-{bg,text}`); `Spinner` (and `Button`'s busy state) additionally needs `animate-spin`.
|
|
16
18
|
|
|
17
|
-
| Export | Notes
|
|
18
|
-
| ---------------------------------------------------------- |
|
|
19
|
-
| `Button` / `LoadingButton` | variants + sizes via `buttonClass`; loading state with spinner
|
|
20
|
-
| `Badge` | `badgeClass` / `badgeVariantClass` status pills
|
|
21
|
-
| `Card`, `CardHeader`, `CardTitle` | layout shells
|
|
22
|
-
| `Input`, `Label`, `Select`, `Textarea`, `FocusInput` | form controls, `fieldClass` shared styling
|
|
23
|
-
| `Pagination` (+ `pageWindow`, `pageCountFor`, `clampPage`) | windowed page navigation
|
|
24
|
-
| `Spinner` | standalone busy indicator
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
19
|
+
| Export | Notes |
|
|
20
|
+
| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
21
|
+
| `Button` / `LoadingButton` | variants + sizes via `buttonClass`; loading state with spinner |
|
|
22
|
+
| `Badge` | `badgeClass` / `badgeVariantClass` status pills |
|
|
23
|
+
| `Card`, `CardHeader`, `CardTitle` | layout shells |
|
|
24
|
+
| `Input`, `Label`, `Select`, `Textarea`, `FocusInput` | form controls, `fieldClass` shared styling |
|
|
25
|
+
| `Pagination` (+ `pageWindow`, `pageCountFor`, `clampPage`) | windowed page navigation |
|
|
26
|
+
| `Spinner` | standalone busy indicator |
|
|
27
|
+
| `AppPage` | `wide` / `narrow` / `hero` page container |
|
|
28
|
+
| `PageHeaderCard` | the standard page-title header |
|
|
29
|
+
| `ContextBar` | sticky sub-page bar; `home` is a node, so no router is imposed |
|
|
30
|
+
| `Unauthorized` | the "not signed in" page |
|
|
31
|
+
| `NoticeBar` | renders `useNotice`'s own `Notice`; errors assert, successes are polite |
|
|
32
|
+
| `LanguageSelector` | the 12-locale picker, off `LocaleUtil`'s shared table |
|
|
33
|
+
| `ModalShell` | portal dialog frame; a click inside never reaches the backdrop |
|
|
34
|
+
| `ConfirmDeleteModal` | an always-armed destructive confirmation |
|
|
35
|
+
| `TypeToConfirmModal` | arms only on an exact name match |
|
|
36
|
+
| `RefreshButton` | refresh control, `loading` blocks activation |
|
|
37
|
+
| `ReadOnlyField` | read-only value with an optional copy button |
|
|
38
|
+
| `EmptyState` / `LoadingSpinner` | the shared page states |
|
|
39
|
+
| `theme` (+ `buttonColors`, `inputStyle`, …) | legacy inline-style escape hatch |
|
|
40
|
+
| `cn` | conditional class join |
|
|
27
41
|
|
|
28
42
|
```tsx
|
|
29
43
|
import { Button, Card, CardHeader, CardTitle, useNotice } from '@rexezuge/web';
|
|
@@ -43,8 +57,9 @@ function Panel() {
|
|
|
43
57
|
|
|
44
58
|
## 2. Hooks
|
|
45
59
|
|
|
46
|
-
- **`useNotice`** —
|
|
47
|
-
- **`
|
|
60
|
+
- **`useNotice`** — one transient message, `{ notice, showNotice, dismissNotice }`. `notice` is `null` when there is nothing to say, which is what `NoticeBar` takes. A new notice replaces the old one's pending dismissal rather than stacking a second timer.
|
|
61
|
+
- **`useCopyToClipboard`** — `{ copied, copy }`, where `copied` becomes true **only** after a write that actually resolved. A denied permission or a plain-HTTP deployment leaves it `false`, which is the answer that matters: there is nothing to undo. Every value the family copies is a credential or an identifier, so a false success sends the operator away believing they have something they do not.
|
|
62
|
+
- **`useSpaLanguage`** — `localStorage`-persisted language with `Accept-Language` default (`DEFAULT_SUPPORTED_LANGUAGES`, `resolveLanguageTag`, `canonicalizeLanguageTag`). Hand the resolved tag to `LanguageSelector`.
|
|
48
63
|
- **`useCurrentUser`** — fetches `CURRENT_USER_PATH` (`/user`), with loading/error states for shell gating.
|
|
49
64
|
|
|
50
65
|
## 3. API client
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The one page container.
|
|
4
|
+
*
|
|
5
|
+
* ## Provenance
|
|
6
|
+
*
|
|
7
|
+
* `components/layout/AppPage.tsx` in **Durable-DAV**, **Durable-DAV-Router**,
|
|
8
|
+
* **Edge-Git** and **Edge-Sonic** — four copies, three of them identical.
|
|
9
|
+
*
|
|
10
|
+
* ## The divergence, and which side won
|
|
11
|
+
*
|
|
12
|
+
* Three copies used `max-w-7xl`; Edge-Sonic's used `max-w-5xl` and recorded
|
|
13
|
+
* why: the operator surface is two lists and two forms, and the wider measure
|
|
14
|
+
* only adds line length to prose already at its readable limit. That is the
|
|
15
|
+
* better answer, so it is the one here — with `className` as the documented
|
|
16
|
+
* escape hatch for a repo that genuinely wants the wider measure, because the
|
|
17
|
+
* decision is per-app and a vendored copy would freeze ours.
|
|
18
|
+
*
|
|
19
|
+
* `hero` follows `wide` rather than carrying its own width: a hero that is
|
|
20
|
+
* wider than the page it introduces is a layout bug, not a style.
|
|
21
|
+
*/
|
|
22
|
+
/** `wide` is the default for every view. `narrow` is for centered forms. */
|
|
23
|
+
type AppPageVariant = 'wide' | 'narrow' | 'hero';
|
|
24
|
+
interface AppPageProps {
|
|
25
|
+
variant?: AppPageVariant;
|
|
26
|
+
/** Merged last, so it wins over the variant's own classes. */
|
|
27
|
+
className?: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
declare function AppPage({ variant, className, children }: Readonly<AppPageProps>): import("react").JSX.Element;
|
|
31
|
+
export { AppPage };
|
|
32
|
+
export type { AppPageProps, AppPageVariant };
|
|
33
|
+
//# sourceMappingURL=AppPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppPage.d.ts","sourceRoot":"","sources":["../src/AppPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4EAA4E;AAC5E,KAAK,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,OAAO,CAAC,EAAE,OAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,+BAcjF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/AppPage.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from './utils';
|
|
3
|
+
function AppPage({ variant = 'wide', className, children }) {
|
|
4
|
+
return (_jsx("div", { className: cn('mx-auto w-full px-6', variant === 'wide' && 'max-w-5xl py-8 space-y-4', variant === 'narrow' && 'max-w-2xl py-8 space-y-4', variant === 'hero' && 'max-w-5xl py-16', className), children: children }));
|
|
5
|
+
}
|
|
6
|
+
export { AppPage };
|
|
7
|
+
//# sourceMappingURL=AppPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppPage.js","sourceRoot":"","sources":["../src/AppPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAiC7B,SAAS,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,SAAS,EAAE,QAAQ,EAA0B;IAChF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,OAAO,KAAK,MAAM,IAAI,0BAA0B,EAChD,OAAO,KAAK,QAAQ,IAAI,0BAA0B,EAClD,OAAO,KAAK,MAAM,IAAI,iBAAiB,EACvC,SAAS,CACV,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from './utils';\n\n/**\n * The one page container.\n *\n * ## Provenance\n *\n * `components/layout/AppPage.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git** and **Edge-Sonic** — four copies, three of them identical.\n *\n * ## The divergence, and which side won\n *\n * Three copies used `max-w-7xl`; Edge-Sonic's used `max-w-5xl` and recorded\n * why: the operator surface is two lists and two forms, and the wider measure\n * only adds line length to prose already at its readable limit. That is the\n * better answer, so it is the one here — with `className` as the documented\n * escape hatch for a repo that genuinely wants the wider measure, because the\n * decision is per-app and a vendored copy would freeze ours.\n *\n * `hero` follows `wide` rather than carrying its own width: a hero that is\n * wider than the page it introduces is a layout bug, not a style.\n */\n\n/** `wide` is the default for every view. `narrow` is for centered forms. */\ntype AppPageVariant = 'wide' | 'narrow' | 'hero';\n\ninterface AppPageProps {\n variant?: AppPageVariant;\n /** Merged last, so it wins over the variant's own classes. */\n className?: string;\n children: ReactNode;\n}\n\nfunction AppPage({ variant = 'wide', className, children }: Readonly<AppPageProps>) {\n return (\n <div\n className={cn(\n 'mx-auto w-full px-6',\n variant === 'wide' && 'max-w-5xl py-8 space-y-4',\n variant === 'narrow' && 'max-w-2xl py-8 space-y-4',\n variant === 'hero' && 'max-w-5xl py-16',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport { AppPage };\nexport type { AppPageProps, AppPageVariant };\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The sticky bar every non-root page renders.
|
|
4
|
+
*
|
|
5
|
+
* ## Provenance
|
|
6
|
+
*
|
|
7
|
+
* `components/layout/ContextBar.tsx` in **Durable-DAV**, **Durable-DAV-Router**
|
|
8
|
+
* and **Edge-Git** — three copies differing only in the logo and the
|
|
9
|
+
* `aria-label` on the home link.
|
|
10
|
+
*
|
|
11
|
+
* ## Why `home` is a node and not a `<Link>`
|
|
12
|
+
*
|
|
13
|
+
* All three imports `react-router-dom`, solely to wrap a logo in a `Link` to
|
|
14
|
+
* `/`. That is the whole of their router coupling — and it is why none of them
|
|
15
|
+
* could be lifted into a package the kit's other seven stay clear of, and why
|
|
16
|
+
* a repo on a different router could not use the bar at all.
|
|
17
|
+
*
|
|
18
|
+
* So the caller renders the anchor and passes it in. The bar keeps the part
|
|
19
|
+
* that was genuinely duplicated (the sticky geometry, the breadcrumb slot, the
|
|
20
|
+
* right-aligned actions) and gives up the part that was a routing assumption.
|
|
21
|
+
* The caller also owns the link's accessible name, which is the one thing that
|
|
22
|
+
* genuinely differs between the three copies and could not have been defaulted.
|
|
23
|
+
*/
|
|
24
|
+
interface ContextBarProps {
|
|
25
|
+
/**
|
|
26
|
+
* The home link, already rendered by the caller.
|
|
27
|
+
*
|
|
28
|
+
* Required, even though the bar is usable without one: a bar with no way back
|
|
29
|
+
* to the root is the failure this component exists to prevent, so it should
|
|
30
|
+
* not be omittable. Pass an empty node only if a route genuinely has no home.
|
|
31
|
+
*/
|
|
32
|
+
home: ReactNode;
|
|
33
|
+
/** The current location's name. Usually a `Link` or breadcrumb segment. */
|
|
34
|
+
crumb: ReactNode;
|
|
35
|
+
/** Right-aligned controls — refresh, settings, a sign-out button. */
|
|
36
|
+
actions?: ReactNode;
|
|
37
|
+
/** Merged last onto the bar's outer element. */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
declare function ContextBar({ home, crumb, actions, className }: Readonly<ContextBarProps>): import("react").JSX.Element;
|
|
41
|
+
export { ContextBar };
|
|
42
|
+
export type { ContextBarProps };
|
|
43
|
+
//# sourceMappingURL=ContextBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextBar.d.ts","sourceRoot":"","sources":["../src/ContextBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,2EAA2E;IAC3E,KAAK,EAAE,SAAS,CAAC;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,+BAgBjF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from './utils';
|
|
3
|
+
function ContextBar({ home, crumb, actions, className }) {
|
|
4
|
+
return (_jsx("div", { className: cn('sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur', className), children: _jsxs("div", { className: "max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap", children: [home, _jsx("span", { "aria-hidden": "true", className: "text-[var(--color-text-muted)] font-normal", children: "/" }), _jsx("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: crumb }), actions && _jsx("div", { className: "ml-auto flex items-center gap-2 shrink-0", children: actions })] }) }));
|
|
5
|
+
}
|
|
6
|
+
export { ContextBar };
|
|
7
|
+
//# sourceMappingURL=ContextBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextBar.js","sourceRoot":"","sources":["../src/ContextBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AA0C7B,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAA6B;IAChF,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,sGAAsG,EAAE,SAAS,CAAC,YACnI,eAAK,SAAS,EAAC,+DAA+D,aAC3E,IAAI,EAIL,8BAAkB,MAAM,EAAC,SAAS,EAAC,4CAA4C,kBAExE,EACP,cAAK,SAAS,EAAC,wCAAwC,YAAE,KAAK,GAAO,EACpE,OAAO,IAAI,cAAK,SAAS,EAAC,0CAA0C,YAAE,OAAO,GAAO,IACjF,GACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from './utils';\n\n/**\n * The sticky bar every non-root page renders.\n *\n * ## Provenance\n *\n * `components/layout/ContextBar.tsx` in **Durable-DAV**, **Durable-DAV-Router**\n * and **Edge-Git** — three copies differing only in the logo and the\n * `aria-label` on the home link.\n *\n * ## Why `home` is a node and not a `<Link>`\n *\n * All three imports `react-router-dom`, solely to wrap a logo in a `Link` to\n * `/`. That is the whole of their router coupling — and it is why none of them\n * could be lifted into a package the kit's other seven stay clear of, and why\n * a repo on a different router could not use the bar at all.\n *\n * So the caller renders the anchor and passes it in. The bar keeps the part\n * that was genuinely duplicated (the sticky geometry, the breadcrumb slot, the\n * right-aligned actions) and gives up the part that was a routing assumption.\n * The caller also owns the link's accessible name, which is the one thing that\n * genuinely differs between the three copies and could not have been defaulted.\n */\n\ninterface ContextBarProps {\n /**\n * The home link, already rendered by the caller.\n *\n * Required, even though the bar is usable without one: a bar with no way back\n * to the root is the failure this component exists to prevent, so it should\n * not be omittable. Pass an empty node only if a route genuinely has no home.\n */\n home: ReactNode;\n /** The current location's name. Usually a `Link` or breadcrumb segment. */\n crumb: ReactNode;\n /** Right-aligned controls — refresh, settings, a sign-out button. */\n actions?: ReactNode;\n /** Merged last onto the bar's outer element. */\n className?: string;\n}\n\nfunction ContextBar({ home, crumb, actions, className }: Readonly<ContextBarProps>) {\n return (\n <div className={cn('sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur', className)}>\n <div className=\"max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap\">\n {home}\n {/* Decorative: the breadcrumb and the home link already separate these\n regions for a screen reader, and a stray \"/\" read aloud between them\n is noise. */}\n <span aria-hidden=\"true\" className=\"text-[var(--color-text-muted)] font-normal\">\n /\n </span>\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">{crumb}</div>\n {actions && <div className=\"ml-auto flex items-center gap-2 shrink-0\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport { ContextBar };\nexport type { ContextBarProps };\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The language picker.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `components/shared/LanguageSelector.tsx` in **AWS-AccessBridge**,
|
|
7
|
+
* **CalDAV-Bridge**, **ChordDHT-Tracker**, **Durable-DAV**, **Durable-DAV-Router**,
|
|
8
|
+
* **Edge-Git**, **Mail-Meow** and **Mail-Otter** — six real copies plus two
|
|
9
|
+
* smaller ones, in two shapes.
|
|
10
|
+
*
|
|
11
|
+
* ## What converges away
|
|
12
|
+
*
|
|
13
|
+
* **The 12-locale table.** Every copy declared its own `LANGUAGE_LABELS` /
|
|
14
|
+
* `NATIVE_NAMES` map — the same twelve entries, `en` through `ko`, re-typed in
|
|
15
|
+
* each repo. `@rexezuge/shared`'s `LocaleUtil` already holds that table and its
|
|
16
|
+
* `displayName`, converged from AWS-AccessBridge, Mail-Meow and Mail-Otter. So
|
|
17
|
+
* this component now has no table of its own, and the two would have had to
|
|
18
|
+
* agree by hand otherwise.
|
|
19
|
+
*
|
|
20
|
+
* **The `'unknown'` sentinel.** Mail-Otter spelled "the browser asked for a
|
|
21
|
+
* language this app does not have" as the string `'unknown'`, which then had to
|
|
22
|
+
* be compared against at every call site and could not be distinguished from a
|
|
23
|
+
* locale literally spelled `unknown`. It is `null` here — absent, per the kit's
|
|
24
|
+
* `AGENTS.md` — and the disabled branch renders from that.
|
|
25
|
+
*
|
|
26
|
+
* **The `i18n.resolvedLanguage ?? i18n.language` fallback.** The copies read
|
|
27
|
+
* i18next's own state to decide what is selected. In the kit that resolution
|
|
28
|
+
* belongs to `useSpaLanguage`, which already does it; this component takes the
|
|
29
|
+
* resolved tag and normalizes defensively, so a caller passing a raw browser
|
|
30
|
+
* tag (`en-US`) still lands on a real option.
|
|
31
|
+
*/
|
|
32
|
+
interface LanguageSelectorProps {
|
|
33
|
+
/**
|
|
34
|
+
* The current tag, or `null` when the app could not resolve one.
|
|
35
|
+
*
|
|
36
|
+
* `null` renders a disabled control reading {@link LanguageSelectorProps.unknownLabel}.
|
|
37
|
+
*/
|
|
38
|
+
value: string | null;
|
|
39
|
+
onChange: (languageTag: string) => void;
|
|
40
|
+
/** The control's accessible name. Required — a bare `<select>` has none. */
|
|
41
|
+
label: string;
|
|
42
|
+
/** Shown instead of the language list when `value` is `null`. */
|
|
43
|
+
unknownLabel: string;
|
|
44
|
+
/**
|
|
45
|
+
* The offered tags.
|
|
46
|
+
*
|
|
47
|
+
* Defaults to the family's twelve. A caller narrows this; it cannot widen it,
|
|
48
|
+
* because an option with no display name in the shared table renders as its
|
|
49
|
+
* raw tag.
|
|
50
|
+
*/
|
|
51
|
+
supported?: readonly string[];
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare function LanguageSelector({ value, onChange, label, unknownLabel, supported, disabled, }: Readonly<LanguageSelectorProps>): import("react").JSX.Element;
|
|
55
|
+
export { LanguageSelector };
|
|
56
|
+
export type { LanguageSelectorProps };
|
|
57
|
+
//# sourceMappingURL=LanguageSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../src/LanguageSelector.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,UAAU,qBAAqB;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,SAA6B,EAC7B,QAAQ,GACT,EAAE,QAAQ,CAAC,qBAAqB,CAAC,+BAsBjC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LocaleUtil, SUPPORTED_LOCALES } from '@rexezuge/shared';
|
|
3
|
+
import { Select } from './Input';
|
|
4
|
+
function LanguageSelector({ value, onChange, label, unknownLabel, supported = SUPPORTED_LOCALES, disabled, }) {
|
|
5
|
+
if (value === null) {
|
|
6
|
+
return (_jsx(Select, { "aria-label": label, value: "", disabled: true, onChange: () => undefined, children: _jsx("option", { value: "", children: unknownLabel }) }));
|
|
7
|
+
}
|
|
8
|
+
const current = LocaleUtil.normalize(value);
|
|
9
|
+
return (_jsx(Select, { "aria-label": label, value: current, disabled: disabled, onChange: (event) => onChange(event.target.value), children: supported.map((tag) => (_jsx("option", { value: tag, children: LocaleUtil.displayName(tag) }, tag))) }));
|
|
10
|
+
}
|
|
11
|
+
export { LanguageSelector };
|
|
12
|
+
//# sourceMappingURL=LanguageSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageSelector.js","sourceRoot":"","sources":["../src/LanguageSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAyDjC,SAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,iBAAiB,EAC7B,QAAQ,GACwB;IAChC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,CACL,KAAC,MAAM,kBAAa,KAAK,EAAE,KAAK,EAAC,EAAE,EAAC,QAAQ,QAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,YACpE,iBAAQ,KAAK,EAAC,EAAE,YAAE,YAAY,GAAU,GACjC,CACV,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CACL,KAAC,MAAM,kBAAa,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,YAC7G,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACtB,iBAAkB,KAAK,EAAE,GAAG,YAGzB,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,IAHjB,GAAG,CAIP,CACV,CAAC,GACK,CACV,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { LocaleUtil, SUPPORTED_LOCALES } from '@rexezuge/shared';\nimport { Select } from './Input';\n\n/**\n * The language picker.\n *\n * ## Provenance\n *\n * `components/shared/LanguageSelector.tsx` in **AWS-AccessBridge**,\n * **CalDAV-Bridge**, **ChordDHT-Tracker**, **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git**, **Mail-Meow** and **Mail-Otter** — six real copies plus two\n * smaller ones, in two shapes.\n *\n * ## What converges away\n *\n * **The 12-locale table.** Every copy declared its own `LANGUAGE_LABELS` /\n * `NATIVE_NAMES` map — the same twelve entries, `en` through `ko`, re-typed in\n * each repo. `@rexezuge/shared`'s `LocaleUtil` already holds that table and its\n * `displayName`, converged from AWS-AccessBridge, Mail-Meow and Mail-Otter. So\n * this component now has no table of its own, and the two would have had to\n * agree by hand otherwise.\n *\n * **The `'unknown'` sentinel.** Mail-Otter spelled \"the browser asked for a\n * language this app does not have\" as the string `'unknown'`, which then had to\n * be compared against at every call site and could not be distinguished from a\n * locale literally spelled `unknown`. It is `null` here — absent, per the kit's\n * `AGENTS.md` — and the disabled branch renders from that.\n *\n * **The `i18n.resolvedLanguage ?? i18n.language` fallback.** The copies read\n * i18next's own state to decide what is selected. In the kit that resolution\n * belongs to `useSpaLanguage`, which already does it; this component takes the\n * resolved tag and normalizes defensively, so a caller passing a raw browser\n * tag (`en-US`) still lands on a real option.\n */\n\ninterface LanguageSelectorProps {\n /**\n * The current tag, or `null` when the app could not resolve one.\n *\n * `null` renders a disabled control reading {@link LanguageSelectorProps.unknownLabel}.\n */\n value: string | null;\n onChange: (languageTag: string) => void;\n /** The control's accessible name. Required — a bare `<select>` has none. */\n label: string;\n /** Shown instead of the language list when `value` is `null`. */\n unknownLabel: string;\n /**\n * The offered tags.\n *\n * Defaults to the family's twelve. A caller narrows this; it cannot widen it,\n * because an option with no display name in the shared table renders as its\n * raw tag.\n */\n supported?: readonly string[];\n disabled?: boolean;\n}\n\nfunction LanguageSelector({\n value,\n onChange,\n label,\n unknownLabel,\n supported = SUPPORTED_LOCALES,\n disabled,\n}: Readonly<LanguageSelectorProps>) {\n if (value === null) {\n return (\n <Select aria-label={label} value=\"\" disabled onChange={() => undefined}>\n <option value=\"\">{unknownLabel}</option>\n </Select>\n );\n }\n\n const current = LocaleUtil.normalize(value);\n\n return (\n <Select aria-label={label} value={current} disabled={disabled} onChange={(event) => onChange(event.target.value)}>\n {supported.map((tag) => (\n <option key={tag} value={tag}>\n {/* `displayName` normalizes first, so a supported-but-unspelled tag\n still resolves against the shared table rather than rendering raw. */}\n {LocaleUtil.displayName(tag)}\n </option>\n ))}\n </Select>\n );\n}\n\nexport { LanguageSelector };\nexport type { LanguageSelectorProps };\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Notice, NoticeKind } from './useNotice';
|
|
2
|
+
/**
|
|
3
|
+
* The transient status banner.
|
|
4
|
+
*
|
|
5
|
+
* ## Provenance
|
|
6
|
+
*
|
|
7
|
+
* `components/layout/NoticeBar.tsx` in **CalDAV-Bridge**, **Durable-DAV**,
|
|
8
|
+
* **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** —
|
|
9
|
+
* six copies in three distinct shapes.
|
|
10
|
+
*
|
|
11
|
+
* ## This renders the kit's own `Notice`
|
|
12
|
+
*
|
|
13
|
+
* Every copy took `{ type: 'success' | 'error'; text: string }`, while
|
|
14
|
+
* `@rexezuge/web`'s `useNotice` — converged from the same six repos, and
|
|
15
|
+
* already shipping — returns `{ kind, message }`. The copies were therefore
|
|
16
|
+
* each doing a field-by-field shuffle at their call site to feed a component
|
|
17
|
+
* the hook had already produced.
|
|
18
|
+
*
|
|
19
|
+
* Taking the kit's own type makes the pair compose directly. Consumers rename
|
|
20
|
+
* two fields at their call sites; in exchange the banner and the hook can never
|
|
21
|
+
* drift apart, because there is only one shape.
|
|
22
|
+
*
|
|
23
|
+
* ## Durable-DAV's fix is the one that shipped
|
|
24
|
+
*
|
|
25
|
+
* All six used `role="status"`, which implies `aria-live="polite"`. A failed
|
|
26
|
+
* credential revoke was therefore announced at the same priority as a
|
|
27
|
+
* background update, and a screen-reader user might never hear it. Durable-DAV's
|
|
28
|
+
* copy splits it: errors assert, successes stay polite. That is the base here.
|
|
29
|
+
*
|
|
30
|
+
* Mail-Otter's copy dropped the screen-reader-only status prefix entirely,
|
|
31
|
+
* which loses the kind for a user who cannot see the colour.
|
|
32
|
+
*/
|
|
33
|
+
/** The two accessible names, keyed by the kind they announce. */
|
|
34
|
+
type NoticeStatusLabels = Record<NoticeKind, string>;
|
|
35
|
+
interface NoticeBarProps {
|
|
36
|
+
/** The notice to show, or `null` for nothing — which is what `useNotice` hands back when idle. */
|
|
37
|
+
notice: Notice | null;
|
|
38
|
+
/**
|
|
39
|
+
* The screen-reader prefix for each kind, e.g. `{ success: 'Success', error: 'Error' }`.
|
|
40
|
+
*
|
|
41
|
+
* Required, and keyed rather than a single string, because the label depends
|
|
42
|
+
* on the kind: one label would either mislabel half the notices or need a
|
|
43
|
+
* conditional at every call site — which is where the copies diverged.
|
|
44
|
+
*/
|
|
45
|
+
statusLabels: NoticeStatusLabels;
|
|
46
|
+
}
|
|
47
|
+
declare function NoticeBar({ notice, statusLabels }: Readonly<NoticeBarProps>): import("react").JSX.Element | null;
|
|
48
|
+
export { NoticeBar };
|
|
49
|
+
export type { NoticeBarProps, NoticeStatusLabels };
|
|
50
|
+
//# sourceMappingURL=NoticeBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeBar.d.ts","sourceRoot":"","sources":["../src/NoticeBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,iEAAiE;AACjE,KAAK,kBAAkB,GAAG,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAErD,UAAU,cAAc;IACtB,kGAAkG;IAClG,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;;OAMG;IACH,YAAY,EAAE,kBAAkB,CAAC;CAClC;AAED,iBAAS,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,cAAc,CAAC,sCAgBpE;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
function NoticeBar({ notice, statusLabels }) {
|
|
3
|
+
if (notice === null)
|
|
4
|
+
return null;
|
|
5
|
+
const isError = notice.kind === 'error';
|
|
6
|
+
return (_jsxs("div", {
|
|
7
|
+
// Errors assert; successes stay polite. See the file header for why this
|
|
8
|
+
// is not one role for both.
|
|
9
|
+
role: isError ? 'alert' : 'status', className: "fixed top-20 left-1/2 -translate-x-1/2 z-50 animate-slide-down px-5 py-3 rounded-xl shadow-xl bg-[var(--color-surface-2)] border border-[var(--color-border-muted)] max-w-[calc(100vw-2rem)]", children: [_jsxs("span", { className: "sr-only", children: [statusLabels[notice.kind], ": "] }), _jsx("span", { className: isError ? 'text-[var(--color-error-text)]' : 'text-[var(--color-success-text)]', children: notice.message })] }));
|
|
10
|
+
}
|
|
11
|
+
export { NoticeBar };
|
|
12
|
+
//# sourceMappingURL=NoticeBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeBar.js","sourceRoot":"","sources":["../src/NoticeBar.tsx"],"names":[],"mappings":";AAkDA,SAAS,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAA4B;IACnE,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC;IAExC,OAAO,CACL;QACE,yEAAyE;QACzE,4BAA4B;QAC5B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAClC,SAAS,EAAC,8LAA8L,aAExM,gBAAM,SAAS,EAAC,SAAS,aAAE,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAC9D,eAAM,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,kCAAkC,YAAG,MAAM,CAAC,OAAO,GAAQ,IACrH,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import type { Notice, NoticeKind } from './useNotice';\n\n/**\n * The transient status banner.\n *\n * ## Provenance\n *\n * `components/layout/NoticeBar.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** —\n * six copies in three distinct shapes.\n *\n * ## This renders the kit's own `Notice`\n *\n * Every copy took `{ type: 'success' | 'error'; text: string }`, while\n * `@rexezuge/web`'s `useNotice` — converged from the same six repos, and\n * already shipping — returns `{ kind, message }`. The copies were therefore\n * each doing a field-by-field shuffle at their call site to feed a component\n * the hook had already produced.\n *\n * Taking the kit's own type makes the pair compose directly. Consumers rename\n * two fields at their call sites; in exchange the banner and the hook can never\n * drift apart, because there is only one shape.\n *\n * ## Durable-DAV's fix is the one that shipped\n *\n * All six used `role=\"status\"`, which implies `aria-live=\"polite\"`. A failed\n * credential revoke was therefore announced at the same priority as a\n * background update, and a screen-reader user might never hear it. Durable-DAV's\n * copy splits it: errors assert, successes stay polite. That is the base here.\n *\n * Mail-Otter's copy dropped the screen-reader-only status prefix entirely,\n * which loses the kind for a user who cannot see the colour.\n */\n\n/** The two accessible names, keyed by the kind they announce. */\ntype NoticeStatusLabels = Record<NoticeKind, string>;\n\ninterface NoticeBarProps {\n /** The notice to show, or `null` for nothing — which is what `useNotice` hands back when idle. */\n notice: Notice | null;\n /**\n * The screen-reader prefix for each kind, e.g. `{ success: 'Success', error: 'Error' }`.\n *\n * Required, and keyed rather than a single string, because the label depends\n * on the kind: one label would either mislabel half the notices or need a\n * conditional at every call site — which is where the copies diverged.\n */\n statusLabels: NoticeStatusLabels;\n}\n\nfunction NoticeBar({ notice, statusLabels }: Readonly<NoticeBarProps>) {\n if (notice === null) return null;\n\n const isError = notice.kind === 'error';\n\n return (\n <div\n // Errors assert; successes stay polite. See the file header for why this\n // is not one role for both.\n role={isError ? 'alert' : 'status'}\n className=\"fixed top-20 left-1/2 -translate-x-1/2 z-50 animate-slide-down px-5 py-3 rounded-xl shadow-xl bg-[var(--color-surface-2)] border border-[var(--color-border-muted)] max-w-[calc(100vw-2rem)]\"\n >\n <span className=\"sr-only\">{statusLabels[notice.kind]}: </span>\n <span className={isError ? 'text-[var(--color-error-text)]' : 'text-[var(--color-success-text)]'}>{notice.message}</span>\n </div>\n );\n}\n\nexport { NoticeBar };\nexport type { NoticeBarProps, NoticeStatusLabels };\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The standard page-title header.
|
|
4
|
+
*
|
|
5
|
+
* ## Provenance
|
|
6
|
+
*
|
|
7
|
+
* `components/layout/PageHeaderCard.tsx` in **Durable-DAV**, **Durable-DAV-Router**
|
|
8
|
+
* and **Edge-Git** — three copies, byte-identical apart from which views each
|
|
9
|
+
* doc comment listed.
|
|
10
|
+
*
|
|
11
|
+
* It replaced the four ad-hoc title-`Card` variants those repos had grown, one
|
|
12
|
+
* per page, which is how a header bar came to sit at four different heights.
|
|
13
|
+
*/
|
|
14
|
+
interface PageHeaderCardProps {
|
|
15
|
+
/** Leading avatar. Omitted renders no avatar slot at all, not an empty one. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The page's name.
|
|
19
|
+
*
|
|
20
|
+
* **Required.** An optional title would render a header bar with no text in
|
|
21
|
+
* it — a silent no-op that looks deliberate. Forcing it means the compiler
|
|
22
|
+
* asks rather than letting a page ship a nameless header.
|
|
23
|
+
*/
|
|
24
|
+
title: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The line under the title.
|
|
27
|
+
*
|
|
28
|
+
* **Required**, though it may be an empty fragment. Same reason: the three
|
|
29
|
+
* copies all rendered a description slot, and the ones that omitted it had
|
|
30
|
+
* each re-derived the vertical rhythm with a different ad-hoc fix. Declaring
|
|
31
|
+
* it means the layout is the same whether or not there is something to say.
|
|
32
|
+
*/
|
|
33
|
+
description: ReactNode;
|
|
34
|
+
/** Right-aligned. Omitted renders no actions slot. */
|
|
35
|
+
actions?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function PageHeaderCard({ icon, title, description, actions }: Readonly<PageHeaderCardProps>): import("react").JSX.Element;
|
|
38
|
+
export { PageHeaderCard };
|
|
39
|
+
export type { PageHeaderCardProps };
|
|
40
|
+
//# sourceMappingURL=PageHeaderCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeaderCard.d.ts","sourceRoot":"","sources":["../src/PageHeaderCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;GAWG;AAEH,UAAU,mBAAmB;IAC3B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;OAOG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,mBAAmB,CAAC,+BAa3F;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card } from './Card';
|
|
3
|
+
function PageHeaderCard({ icon, title, description, actions }) {
|
|
4
|
+
return (_jsxs(Card, { className: "flex flex-col lg:flex-row lg:items-center justify-between gap-4 py-4", children: [_jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [icon && _jsx("div", { className: "flex items-center justify-center w-10 h-10 rounded-full bg-[var(--color-surface-3)] shrink-0", children: icon }), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)] truncate", children: title }), description && _jsx("div", { className: "text-sm text-[var(--color-text-muted)] truncate", children: description })] })] }), actions && _jsx("div", { className: "flex flex-wrap items-center gap-3 shrink-0", children: actions })] }));
|
|
5
|
+
}
|
|
6
|
+
export { PageHeaderCard };
|
|
7
|
+
//# sourceMappingURL=PageHeaderCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHeaderCard.js","sourceRoot":"","sources":["../src/PageHeaderCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAuC9B,SAAS,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAiC;IAC1F,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAC,sEAAsE,aACpF,eAAK,SAAS,EAAC,iCAAiC,aAC7C,IAAI,IAAI,cAAK,SAAS,EAAC,8FAA8F,YAAE,IAAI,GAAO,EACnI,eAAK,SAAS,EAAC,SAAS,aACtB,aAAI,SAAS,EAAC,iEAAiE,YAAE,KAAK,GAAM,EAC3F,WAAW,IAAI,cAAK,SAAS,EAAC,iDAAiD,YAAE,WAAW,GAAO,IAChG,IACF,EACL,OAAO,IAAI,cAAK,SAAS,EAAC,4CAA4C,YAAE,OAAO,GAAO,IAClF,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { Card } from './Card';\n\n/**\n * The standard page-title header.\n *\n * ## Provenance\n *\n * `components/layout/PageHeaderCard.tsx` in **Durable-DAV**, **Durable-DAV-Router**\n * and **Edge-Git** — three copies, byte-identical apart from which views each\n * doc comment listed.\n *\n * It replaced the four ad-hoc title-`Card` variants those repos had grown, one\n * per page, which is how a header bar came to sit at four different heights.\n */\n\ninterface PageHeaderCardProps {\n /** Leading avatar. Omitted renders no avatar slot at all, not an empty one. */\n icon?: ReactNode;\n /**\n * The page's name.\n *\n * **Required.** An optional title would render a header bar with no text in\n * it — a silent no-op that looks deliberate. Forcing it means the compiler\n * asks rather than letting a page ship a nameless header.\n */\n title: ReactNode;\n /**\n * The line under the title.\n *\n * **Required**, though it may be an empty fragment. Same reason: the three\n * copies all rendered a description slot, and the ones that omitted it had\n * each re-derived the vertical rhythm with a different ad-hoc fix. Declaring\n * it means the layout is the same whether or not there is something to say.\n */\n description: ReactNode;\n /** Right-aligned. Omitted renders no actions slot. */\n actions?: ReactNode;\n}\n\nfunction PageHeaderCard({ icon, title, description, actions }: Readonly<PageHeaderCardProps>) {\n return (\n <Card className=\"flex flex-col lg:flex-row lg:items-center justify-between gap-4 py-4\">\n <div className=\"flex items-center gap-3 min-w-0\">\n {icon && <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-[var(--color-surface-3)] shrink-0\">{icon}</div>}\n <div className=\"min-w-0\">\n <h1 className=\"text-xl font-semibold text-[var(--color-text-primary)] truncate\">{title}</h1>\n {description && <div className=\"text-sm text-[var(--color-text-muted)] truncate\">{description}</div>}\n </div>\n </div>\n {actions && <div className=\"flex flex-wrap items-center gap-3 shrink-0\">{actions}</div>}\n </Card>\n );\n}\n\nexport { PageHeaderCard };\nexport type { PageHeaderCardProps };\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A labelled, read-only value with an optional copy button.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `components/shared/ReadOnlyField.tsx` in **Durable-DAV**, **Durable-DAV-Router**,
|
|
7
|
+
* **Edge-Git** and **Mail-Otter** — four copies in two shapes. The three outside
|
|
8
|
+
* Durable-DAV inlined the clipboard handler; Durable-DAV's called its
|
|
9
|
+
* `useCopyToClipboard` hook, which is the version that converged into
|
|
10
|
+
* `@rexezuge/web` and is the one this uses.
|
|
11
|
+
*
|
|
12
|
+
* ## The third bug, which all four copies carried
|
|
13
|
+
*
|
|
14
|
+
* Every copy rendered `<Label>{label}</Label>` with no `htmlFor`, so the value
|
|
15
|
+
* input had **no accessible name** — announced as a bare "edit text" for a field
|
|
16
|
+
* whose contents are, in every call site in the family, a credential or an
|
|
17
|
+
* identifier. The click target and the name both depend on the `for`, and
|
|
18
|
+
* neither is visible in the markup that omits it. `useId` pairs them here so a
|
|
19
|
+
* caller cannot forget.
|
|
20
|
+
*
|
|
21
|
+
* The difference was not cosmetic. The inlined three called
|
|
22
|
+
* `navigator.clipboard.writeText` unguarded, so on a plain-HTTP deployment the
|
|
23
|
+
* handler threw synchronously before reporting anything — and where they did
|
|
24
|
+
* guard it, a denied permission still showed the checkmark for a copy that never
|
|
25
|
+
* happened. Every value this component is pointed at in the family is a secret
|
|
26
|
+
* or an identifier, so the false success sends the operator away believing they
|
|
27
|
+
* have something they do not. See `useCopyToClipboard` for both failures.
|
|
28
|
+
*/
|
|
29
|
+
interface ReadOnlyFieldProps {
|
|
30
|
+
/** The field's label. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** The value, shown verbatim and selectable. */
|
|
33
|
+
value: string;
|
|
34
|
+
/** Show the copy button. Defaults to false. */
|
|
35
|
+
showCopy?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The copy button's accessible name and tooltip.
|
|
38
|
+
*
|
|
39
|
+
* Required whenever `showCopy` is set — a copy button carrying only an icon is
|
|
40
|
+
* announced as "button" with nothing else.
|
|
41
|
+
*/
|
|
42
|
+
copyLabel?: string;
|
|
43
|
+
/** Merged last onto the value's `<input>`. */
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
declare function ReadOnlyField({ label, value, showCopy, copyLabel, className }: Readonly<ReadOnlyFieldProps>): import("react").JSX.Element;
|
|
47
|
+
export { ReadOnlyField };
|
|
48
|
+
export type { ReadOnlyFieldProps };
|
|
49
|
+
//# sourceMappingURL=ReadOnlyField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadOnlyField.d.ts","sourceRoot":"","sources":["../src/ReadOnlyField.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,UAAU,kBAAkB;IAC1B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,kBAAkB,CAAC,+BA8C5G;AAED,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { Check, Copy } from 'lucide-react';
|
|
4
|
+
import { Label } from './Input';
|
|
5
|
+
import { cn } from './utils';
|
|
6
|
+
import { useCopyToClipboard } from './useCopyToClipboard';
|
|
7
|
+
function ReadOnlyField({ label, value, showCopy = false, copyLabel, className }) {
|
|
8
|
+
const { copied, copy } = useCopyToClipboard();
|
|
9
|
+
// The four copies rendered `<Label>{label}</Label>` with no `htmlFor`, so the
|
|
10
|
+
// value input had **no accessible name** — a screen reader announced a bare
|
|
11
|
+
// "edit text" for a field holding a secret. The kit's own `Input.tsx` records
|
|
12
|
+
// this hazard; `useId` pairs the label without asking a caller for an id.
|
|
13
|
+
const inputId = useId();
|
|
14
|
+
return (_jsxs("div", { children: [_jsx(Label, { className: "mb-1.5", htmlFor: inputId, children: label }), _jsxs("div", { className: "flex", children: [_jsx("input", { id: inputId, readOnly: true, value: value, className: cn('min-w-0 px-3 py-2 bg-[var(--color-surface-base)] border border-[var(--color-border)] text-[var(--color-text-secondary)] text-sm flex-1', showCopy ? 'rounded-l-lg border-r-0' : 'rounded-lg', className) }), showCopy && (_jsx("button", { type: "button", onClick: () => copy(value), title: copyLabel, "aria-label": copyLabel, "aria-live": "polite", className: "px-3 py-2 rounded-r-lg bg-[var(--color-surface-3)] hover:bg-[var(--color-surface-4)] border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors duration-150", children: copied ? (_jsx(Check, { className: "h-3.5 w-3.5 text-[var(--color-success-text)]", "aria-hidden": "true" })) : (_jsx(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })) }))] })] }));
|
|
15
|
+
}
|
|
16
|
+
export { ReadOnlyField };
|
|
17
|
+
//# sourceMappingURL=ReadOnlyField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadOnlyField.js","sourceRoot":"","sources":["../src/ReadOnlyField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAY,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiD1D,SAAS,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,SAAS,EAAE,SAAS,EAAgC;IAC3G,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC9C,8EAA8E;IAC9E,4EAA4E;IAC5E,8EAA8E;IAC9E,0EAA0E;IAC1E,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IAExB,OAAO,CACL,0BACE,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,OAAO,YACvC,KAAK,GACA,EACR,eAAK,SAAS,EAAC,MAAM,aACnB,gBACE,EAAE,EAAE,OAAO,EACX,QAAQ,QACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CACX,wIAAwI,EACxI,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,YAAY,EACnD,SAAS,CACV,GACD,EACD,QAAQ,IAAI,CACX,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAC1B,KAAK,EAAE,SAAS,gBACJ,SAAS,eAIX,QAAQ,EAClB,SAAS,EAAC,4LAA4L,YAErM,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,KAAK,IAAC,SAAS,EAAC,8CAA8C,iBAAa,MAAM,GAAG,CACtF,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,SAAS,EAAC,aAAa,iBAAa,MAAM,GAAG,CACpD,GACM,CACV,IACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { useId, useState } from 'react';\nimport { Check, Copy } from 'lucide-react';\nimport { Label } from './Input';\nimport { cn } from './utils';\nimport { useCopyToClipboard } from './useCopyToClipboard';\n\n/**\n * A labelled, read-only value with an optional copy button.\n *\n * ## Provenance\n *\n * `components/shared/ReadOnlyField.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git** and **Mail-Otter** — four copies in two shapes. The three outside\n * Durable-DAV inlined the clipboard handler; Durable-DAV's called its\n * `useCopyToClipboard` hook, which is the version that converged into\n * `@rexezuge/web` and is the one this uses.\n *\n * ## The third bug, which all four copies carried\n *\n * Every copy rendered `<Label>{label}</Label>` with no `htmlFor`, so the value\n * input had **no accessible name** — announced as a bare \"edit text\" for a field\n * whose contents are, in every call site in the family, a credential or an\n * identifier. The click target and the name both depend on the `for`, and\n * neither is visible in the markup that omits it. `useId` pairs them here so a\n * caller cannot forget.\n *\n * The difference was not cosmetic. The inlined three called\n * `navigator.clipboard.writeText` unguarded, so on a plain-HTTP deployment the\n * handler threw synchronously before reporting anything — and where they did\n * guard it, a denied permission still showed the checkmark for a copy that never\n * happened. Every value this component is pointed at in the family is a secret\n * or an identifier, so the false success sends the operator away believing they\n * have something they do not. See `useCopyToClipboard` for both failures.\n */\n\ninterface ReadOnlyFieldProps {\n /** The field's label. */\n label: string;\n /** The value, shown verbatim and selectable. */\n value: string;\n /** Show the copy button. Defaults to false. */\n showCopy?: boolean;\n /**\n * The copy button's accessible name and tooltip.\n *\n * Required whenever `showCopy` is set — a copy button carrying only an icon is\n * announced as \"button\" with nothing else.\n */\n copyLabel?: string;\n /** Merged last onto the value's `<input>`. */\n className?: string;\n}\n\nfunction ReadOnlyField({ label, value, showCopy = false, copyLabel, className }: Readonly<ReadOnlyFieldProps>) {\n const { copied, copy } = useCopyToClipboard();\n // The four copies rendered `<Label>{label}</Label>` with no `htmlFor`, so the\n // value input had **no accessible name** — a screen reader announced a bare\n // \"edit text\" for a field holding a secret. The kit's own `Input.tsx` records\n // this hazard; `useId` pairs the label without asking a caller for an id.\n const inputId = useId();\n\n return (\n <div>\n <Label className=\"mb-1.5\" htmlFor={inputId}>\n {label}\n </Label>\n <div className=\"flex\">\n <input\n id={inputId}\n readOnly\n value={value}\n className={cn(\n 'min-w-0 px-3 py-2 bg-[var(--color-surface-base)] border border-[var(--color-border)] text-[var(--color-text-secondary)] text-sm flex-1',\n showCopy ? 'rounded-l-lg border-r-0' : 'rounded-lg',\n className,\n )}\n />\n {showCopy && (\n <button\n type=\"button\"\n onClick={() => copy(value)}\n title={copyLabel}\n aria-label={copyLabel}\n // `aria-live` so the confirmation is announced. The icon swap alone\n // is invisible to a screen reader, which would make the success\n // state silent for exactly the users copying a secret by hand.\n aria-live=\"polite\"\n className=\"px-3 py-2 rounded-r-lg bg-[var(--color-surface-3)] hover:bg-[var(--color-surface-4)] border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors duration-150\"\n >\n {copied ? (\n <Check className=\"h-3.5 w-3.5 text-[var(--color-success-text)]\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n )}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport { ReadOnlyField };\nexport type { ReadOnlyFieldProps };\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The refresh control.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `components/shared/RefreshButton.tsx` in **Durable-DAV**, **Durable-DAV-Router**,
|
|
7
|
+
* **Edge-Git** and **Mail-Otter** — four byte-identical copies.
|
|
8
|
+
*
|
|
9
|
+
* ## Why the icon stays but the label does not
|
|
10
|
+
*
|
|
11
|
+
* This is the one place the kit takes `lucide-react` as a peer, and the split is
|
|
12
|
+
* deliberate. `RefreshCw` is iconography: reimplementing its path data in this
|
|
13
|
+
* package would fork lucide's artwork and freeze it at whatever version the kit
|
|
14
|
+
* vendored it. A label, by contrast, is the consuming app's string catalogue —
|
|
15
|
+
* the app knows whether this reads "Refresh" or "Neu laden", and a kit that
|
|
16
|
+
* hard-codes English text for it has taken over something it should not own.
|
|
17
|
+
*
|
|
18
|
+
* So: glyph in, string out. That is also why the kit's own `Button` keeps
|
|
19
|
+
* using its own `Spinner` rather than lucide's `Loader2` — chrome is cheap to
|
|
20
|
+
* draw, iconography is not.
|
|
21
|
+
*
|
|
22
|
+
* `loading` is passed straight through to `Button`, which already blocks
|
|
23
|
+
* activation while busy, so a caller does not also thread `disabled`.
|
|
24
|
+
*/
|
|
25
|
+
interface RefreshButtonProps {
|
|
26
|
+
onRefresh: () => void;
|
|
27
|
+
/** Shows the spinner and blocks activation until the caller's work clears. */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/** The button's text. */
|
|
30
|
+
label: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
declare function RefreshButton({ onRefresh, loading, label, className }: Readonly<RefreshButtonProps>): import("react").JSX.Element;
|
|
34
|
+
export { RefreshButton };
|
|
35
|
+
export type { RefreshButtonProps };
|
|
36
|
+
//# sourceMappingURL=RefreshButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshButton.d.ts","sourceRoot":"","sources":["../src/RefreshButton.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,UAAU,kBAAkB;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,kBAAkB,CAAC,+BAO5F;AAED,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw } from 'lucide-react';
|
|
3
|
+
import { Button } from './Button';
|
|
4
|
+
function RefreshButton({ onRefresh, loading, label, className }) {
|
|
5
|
+
return (_jsxs(Button, { variant: "secondary", size: "sm", onClick: onRefresh, loading: loading, className: className, children: [_jsx(RefreshCw, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), label] }));
|
|
6
|
+
}
|
|
7
|
+
export { RefreshButton };
|
|
8
|
+
//# sourceMappingURL=RefreshButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshButton.js","sourceRoot":"","sources":["../src/RefreshButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAoClC,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAgC;IAC3F,OAAO,CACL,MAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,aAC9F,KAAC,SAAS,IAAC,SAAS,EAAC,aAAa,iBAAa,MAAM,GAAG,EACvD,KAAK,IACC,CACV,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { RefreshCw } from 'lucide-react';\nimport { Button } from './Button';\n\n/**\n * The refresh control.\n *\n * ## Provenance\n *\n * `components/shared/RefreshButton.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git** and **Mail-Otter** — four byte-identical copies.\n *\n * ## Why the icon stays but the label does not\n *\n * This is the one place the kit takes `lucide-react` as a peer, and the split is\n * deliberate. `RefreshCw` is iconography: reimplementing its path data in this\n * package would fork lucide's artwork and freeze it at whatever version the kit\n * vendored it. A label, by contrast, is the consuming app's string catalogue —\n * the app knows whether this reads \"Refresh\" or \"Neu laden\", and a kit that\n * hard-codes English text for it has taken over something it should not own.\n *\n * So: glyph in, string out. That is also why the kit's own `Button` keeps\n * using its own `Spinner` rather than lucide's `Loader2` — chrome is cheap to\n * draw, iconography is not.\n *\n * `loading` is passed straight through to `Button`, which already blocks\n * activation while busy, so a caller does not also thread `disabled`.\n */\n\ninterface RefreshButtonProps {\n onRefresh: () => void;\n /** Shows the spinner and blocks activation until the caller's work clears. */\n loading?: boolean;\n /** The button's text. */\n label: string;\n className?: string;\n}\n\nfunction RefreshButton({ onRefresh, loading, label, className }: Readonly<RefreshButtonProps>) {\n return (\n <Button variant=\"secondary\" size=\"sm\" onClick={onRefresh} loading={loading} className={className}>\n <RefreshCw className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {label}\n </Button>\n );\n}\n\nexport { RefreshButton };\nexport type { RefreshButtonProps };\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "type the name to confirm this destructive action" dialog.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `components/modals/TypeToConfirmModal.tsx` in **Durable-DAV**,
|
|
7
|
+
* **Durable-DAV-Router**, **Edge-Git** and **Mail-Otter** — four copies that
|
|
8
|
+
* agreed on the interaction and each carried its own clipboard handler.
|
|
9
|
+
*
|
|
10
|
+
* ## Why this exists alongside `ConfirmDeleteModal`
|
|
11
|
+
*
|
|
12
|
+
* The two are not interchangeable, and merging them would lose the distinction
|
|
13
|
+
* that makes either useful. A confirmation whose button is always armed asks
|
|
14
|
+
* nothing of the operator; this one requires typing the exact name, which is
|
|
15
|
+
* the right price for deleting a volume, a branch, or a credential. A repo
|
|
16
|
+
* that wants the cheap one uses {@link ConfirmDeleteModal}; a repo that wants
|
|
17
|
+
* this one names the thing twice.
|
|
18
|
+
*
|
|
19
|
+
* ## The match is exact, not case-insensitive
|
|
20
|
+
*
|
|
21
|
+
* All four copies compared `input.trim() === expectedName`. That is
|
|
22
|
+
* intentional and is kept: a confirmation the operator has to get exactly right
|
|
23
|
+
* is a confirmation they read. Trimming is allowed because it is invisible; case
|
|
24
|
+
* folding is not, because a name differing only in case may well be a different
|
|
25
|
+
* resource on a case-insensitive backend.
|
|
26
|
+
*/
|
|
27
|
+
interface TypeToConfirmModalProps {
|
|
28
|
+
/** The dialog's heading, and its accessible name. */
|
|
29
|
+
title: string;
|
|
30
|
+
/** The line under the heading, explaining what happens on confirm. */
|
|
31
|
+
description: string;
|
|
32
|
+
/** The string the operator must type. Shown, and offered as a copy. */
|
|
33
|
+
expectedName: string;
|
|
34
|
+
confirmLabel: string;
|
|
35
|
+
cancelLabel: string;
|
|
36
|
+
/** The copy button's accessible name and tooltip. */
|
|
37
|
+
copyLabel: string;
|
|
38
|
+
/** The prompt over the input. Name the thing: `Type "prod" to confirm`. */
|
|
39
|
+
promptLabel: string;
|
|
40
|
+
onConfirm: () => void;
|
|
41
|
+
onCancel: () => void;
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
}
|
|
44
|
+
declare function TypeToConfirmModal({ title, description, expectedName, confirmLabel, cancelLabel, copyLabel, promptLabel, onConfirm, onCancel, loading, }: Readonly<TypeToConfirmModalProps>): import("react").JSX.Element;
|
|
45
|
+
export { TypeToConfirmModal };
|
|
46
|
+
export type { TypeToConfirmModalProps };
|
|
47
|
+
//# sourceMappingURL=TypeToConfirmModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeToConfirmModal.d.ts","sourceRoot":"","sources":["../src/TypeToConfirmModal.tsx"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,UAAU,uBAAuB;IAC/B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,OAAe,GAChB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,+BA2EnC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { AlertTriangle, Check, Copy } from 'lucide-react';
|
|
4
|
+
import { Button } from './Button';
|
|
5
|
+
import { Input, Label } from './Input';
|
|
6
|
+
import { ModalShell } from './ModalShell';
|
|
7
|
+
import { useCopyToClipboard } from './useCopyToClipboard';
|
|
8
|
+
function TypeToConfirmModal({ title, description, expectedName, confirmLabel, cancelLabel, copyLabel, promptLabel, onConfirm, onCancel, loading = false, }) {
|
|
9
|
+
const [input, setInput] = useState('');
|
|
10
|
+
const { copied, copy } = useCopyToClipboard();
|
|
11
|
+
const matched = input.trim() === expectedName;
|
|
12
|
+
return (_jsx(ModalShell, { onClose: onCancel, widthClass: "w-full max-w-md mx-4", ariaLabel: title, children: _jsxs("div", { className: "p-6", children: [_jsx("div", { className: "flex items-center justify-center w-10 h-10 rounded-full bg-[var(--color-error-bg)] mb-4 mx-auto", children: _jsx(AlertTriangle, { className: "h-5 w-5 text-[var(--color-error-text)]", "aria-hidden": "true" }) }), _jsx("h2", { className: "text-base font-semibold text-[var(--color-text-primary)] text-center mb-2", children: title }), _jsx("p", { className: "text-sm text-[var(--color-text-secondary)] text-center mb-4", children: description }), _jsxs("div", { className: "flex items-center justify-center gap-2 mb-4", children: [_jsx("code", { className: "px-2.5 py-1.5 rounded-lg bg-[var(--color-surface-base)] border border-[var(--color-border)] text-sm font-mono text-[var(--color-text-primary)] break-all", children: expectedName }), _jsx("button", { type: "button", onClick: () => copy(expectedName), title: copyLabel, "aria-label": copyLabel, className: "px-2.5 py-2 rounded-lg bg-[var(--color-surface-3)] hover:bg-[var(--color-surface-4)] border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors duration-150", children: copied ? (_jsx(Check, { className: "h-3.5 w-3.5 text-[var(--color-success-text)]", "aria-hidden": "true" })) : (_jsx(Copy, { className: "h-3.5 w-3.5", "aria-hidden": "true" })) })] }), _jsxs("div", { className: "space-y-1.5 mb-6", children: [_jsx(Label, { htmlFor: "danger-confirm-input", children: promptLabel }), _jsx(Input, { id: "danger-confirm-input", value: input, onChange: (event) => setInput(event.target.value), placeholder: expectedName, autoComplete: "off", autoFocus: true })] }), _jsxs("div", { className: "flex gap-3", children: [_jsx(Button, { variant: "ghost", className: "flex-1", onClick: (event) => {
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
onCancel();
|
|
15
|
+
}, children: cancelLabel }), _jsx(Button, { variant: "danger", className: "flex-1",
|
|
16
|
+
// Armed only on an exact match. `loading` is forwarded separately
|
|
17
|
+
// so a confirm already in flight cannot be fired a second time.
|
|
18
|
+
disabled: !matched, loading: loading, onClick: (event) => {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
onConfirm();
|
|
21
|
+
}, children: confirmLabel })] })] }) }));
|
|
22
|
+
}
|
|
23
|
+
export { TypeToConfirmModal };
|
|
24
|
+
//# sourceMappingURL=TypeToConfirmModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeToConfirmModal.js","sourceRoot":"","sources":["../src/TypeToConfirmModal.tsx"],"names":[],"mappings":"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","sourcesContent":["import { useState } from 'react';\nimport { AlertTriangle, Check, Copy } from 'lucide-react';\nimport { Button } from './Button';\nimport { Input, Label } from './Input';\nimport { ModalShell } from './ModalShell';\nimport { useCopyToClipboard } from './useCopyToClipboard';\n\n/**\n * The \"type the name to confirm this destructive action\" dialog.\n *\n * ## Provenance\n *\n * `components/modals/TypeToConfirmModal.tsx` in **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git** and **Mail-Otter** — four copies that\n * agreed on the interaction and each carried its own clipboard handler.\n *\n * ## Why this exists alongside `ConfirmDeleteModal`\n *\n * The two are not interchangeable, and merging them would lose the distinction\n * that makes either useful. A confirmation whose button is always armed asks\n * nothing of the operator; this one requires typing the exact name, which is\n * the right price for deleting a volume, a branch, or a credential. A repo\n * that wants the cheap one uses {@link ConfirmDeleteModal}; a repo that wants\n * this one names the thing twice.\n *\n * ## The match is exact, not case-insensitive\n *\n * All four copies compared `input.trim() === expectedName`. That is\n * intentional and is kept: a confirmation the operator has to get exactly right\n * is a confirmation they read. Trimming is allowed because it is invisible; case\n * folding is not, because a name differing only in case may well be a different\n * resource on a case-insensitive backend.\n */\n\ninterface TypeToConfirmModalProps {\n /** The dialog's heading, and its accessible name. */\n title: string;\n /** The line under the heading, explaining what happens on confirm. */\n description: string;\n /** The string the operator must type. Shown, and offered as a copy. */\n expectedName: string;\n confirmLabel: string;\n cancelLabel: string;\n /** The copy button's accessible name and tooltip. */\n copyLabel: string;\n /** The prompt over the input. Name the thing: `Type \"prod\" to confirm`. */\n promptLabel: string;\n onConfirm: () => void;\n onCancel: () => void;\n loading?: boolean;\n}\n\nfunction TypeToConfirmModal({\n title,\n description,\n expectedName,\n confirmLabel,\n cancelLabel,\n copyLabel,\n promptLabel,\n onConfirm,\n onCancel,\n loading = false,\n}: Readonly<TypeToConfirmModalProps>) {\n const [input, setInput] = useState('');\n const { copied, copy } = useCopyToClipboard();\n\n const matched = input.trim() === expectedName;\n\n return (\n // `closeLabel` is deliberately not `cancelLabel`: a dialog whose corner\n // close button and body cancel button share a name is announced as two\n // identical buttons. `ModalShell` defaults it to \"Close\" for that reason.\n <ModalShell onClose={onCancel} widthClass=\"w-full max-w-md mx-4\" ariaLabel={title}>\n <div className=\"p-6\">\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-[var(--color-error-bg)] mb-4 mx-auto\">\n <AlertTriangle className=\"h-5 w-5 text-[var(--color-error-text)]\" aria-hidden=\"true\" />\n </div>\n <h2 className=\"text-base font-semibold text-[var(--color-text-primary)] text-center mb-2\">{title}</h2>\n <p className=\"text-sm text-[var(--color-text-secondary)] text-center mb-4\">{description}</p>\n <div className=\"flex items-center justify-center gap-2 mb-4\">\n <code className=\"px-2.5 py-1.5 rounded-lg bg-[var(--color-surface-base)] border border-[var(--color-border)] text-sm font-mono text-[var(--color-text-primary)] break-all\">\n {expectedName}\n </code>\n <button\n type=\"button\"\n onClick={() => copy(expectedName)}\n title={copyLabel}\n aria-label={copyLabel}\n className=\"px-2.5 py-2 rounded-lg bg-[var(--color-surface-3)] hover:bg-[var(--color-surface-4)] border border-[var(--color-border)] text-[var(--color-text-secondary)] transition-colors duration-150\"\n >\n {copied ? (\n <Check className=\"h-3.5 w-3.5 text-[var(--color-success-text)]\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n )}\n </button>\n </div>\n <div className=\"space-y-1.5 mb-6\">\n <Label htmlFor=\"danger-confirm-input\">{promptLabel}</Label>\n <Input\n id=\"danger-confirm-input\"\n value={input}\n onChange={(event) => setInput(event.target.value)}\n placeholder={expectedName}\n autoComplete=\"off\"\n autoFocus\n />\n </div>\n <div className=\"flex gap-3\">\n <Button\n variant=\"ghost\"\n className=\"flex-1\"\n onClick={(event) => {\n event.stopPropagation();\n onCancel();\n }}\n >\n {cancelLabel}\n </Button>\n <Button\n variant=\"danger\"\n className=\"flex-1\"\n // Armed only on an exact match. `loading` is forwarded separately\n // so a confirm already in flight cannot be fired a second time.\n disabled={!matched}\n loading={loading}\n onClick={(event) => {\n event.stopPropagation();\n onConfirm();\n }}\n >\n {confirmLabel}\n </Button>\n </div>\n </div>\n </ModalShell>\n );\n}\n\nexport { TypeToConfirmModal };\nexport type { TypeToConfirmModalProps };\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "you are not signed in" page.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `components/layout/Unauthorized.tsx` in **Durable-DAV**, **Durable-DAV-Router**,
|
|
7
|
+
* **Edge-Git**, **Mail-Otter** and **Edge-Sonic** — five copies, byte-identical
|
|
8
|
+
* apart from the doc comment — plus `Unauthorized.tsx` at the components root
|
|
9
|
+
* in **AWS-AccessBridge** and **CalDAV-Bridge**.
|
|
10
|
+
*
|
|
11
|
+
* ## Why `onAuthenticate` is an argument and not a fixed `location.assign`
|
|
12
|
+
*
|
|
13
|
+
* All seven copies hard-coded `globalThis.location.assign(ZERO_TRUST_AUTHENTICATION_PATH)`.
|
|
14
|
+
* That is untestable — jsdom refuses to navigate, so the one branch that
|
|
15
|
+
* matters (what happens when the operator actually clicks the button) had no
|
|
16
|
+
* assertions at all — and it hard-codes a routing assumption into a component
|
|
17
|
+
* that a repo may not share.
|
|
18
|
+
*
|
|
19
|
+
* The default keeps the original behaviour for a repo that wants it, and a
|
|
20
|
+
* caller with a different sign-in route passes its own.
|
|
21
|
+
*/
|
|
22
|
+
interface UnauthorizedProps {
|
|
23
|
+
/** The heading. Required: this is the page's only `h1`. */
|
|
24
|
+
title: string;
|
|
25
|
+
/**
|
|
26
|
+
* Why they are being stopped.
|
|
27
|
+
*
|
|
28
|
+
* Optional, and `null`/omitted renders no paragraph rather than an empty one.
|
|
29
|
+
* A blank line under the heading reads as a rendering bug.
|
|
30
|
+
*/
|
|
31
|
+
message?: string;
|
|
32
|
+
/** The sign-in button's label. Required. */
|
|
33
|
+
actionLabel: string;
|
|
34
|
+
/**
|
|
35
|
+
* What the button does.
|
|
36
|
+
*
|
|
37
|
+
* Defaults to navigating to {@link ZERO_TRUST_AUTHENTICATION_PATH}, which is
|
|
38
|
+
* what every copy in the family did.
|
|
39
|
+
*/
|
|
40
|
+
onAuthenticate?: () => void;
|
|
41
|
+
}
|
|
42
|
+
declare function Unauthorized({ title, message, actionLabel, onAuthenticate }: Readonly<UnauthorizedProps>): import("react").JSX.Element;
|
|
43
|
+
export { Unauthorized };
|
|
44
|
+
export type { UnauthorizedProps };
|
|
45
|
+
//# sourceMappingURL=Unauthorized.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unauthorized.d.ts","sourceRoot":"","sources":["../src/Unauthorized.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,UAAU,iBAAiB;IACzB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,iBAAiB,CAAC,+BAsBjG;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ZERO_TRUST_AUTHENTICATION_PATH } from './constants';
|
|
3
|
+
function Unauthorized({ title, message, actionLabel, onAuthenticate }) {
|
|
4
|
+
const authenticate = onAuthenticate ??
|
|
5
|
+
(() => {
|
|
6
|
+
globalThis.location.assign(ZERO_TRUST_AUTHENTICATION_PATH);
|
|
7
|
+
});
|
|
8
|
+
return (_jsx("div", { className: "bg-[var(--color-surface-base)] text-[var(--color-text-primary)] flex items-center justify-center py-16", children: _jsxs("div", { className: "text-center px-6", children: [_jsx("h1", { className: "text-lg font-medium mt-4 mb-1", children: title }), message && _jsx("p", { className: "text-[var(--color-text-secondary)] text-sm", children: message }), _jsx("button", { type: "button", onClick: authenticate, className: "mt-6 inline-flex items-center justify-center rounded-xl bg-[var(--color-accent)] px-5 py-2.5 text-sm font-medium text-[#0d1008] transition-colors hover:bg-[var(--color-accent-dim)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-accent)]", children: actionLabel })] }) }));
|
|
9
|
+
}
|
|
10
|
+
export { Unauthorized };
|
|
11
|
+
//# sourceMappingURL=Unauthorized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unauthorized.js","sourceRoot":"","sources":["../src/Unauthorized.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AA6C7D,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAA+B;IAChG,MAAM,YAAY,GAChB,cAAc;QACd,CAAC,GAAS,EAAE;YACV,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IAEL,OAAO,CACL,cAAK,SAAS,EAAC,wGAAwG,YACrH,eAAK,SAAS,EAAC,kBAAkB,aAC/B,aAAI,SAAS,EAAC,+BAA+B,YAAE,KAAK,GAAM,EACzD,OAAO,IAAI,YAAG,SAAS,EAAC,4CAA4C,YAAE,OAAO,GAAK,EACnF,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,YAAY,EACrB,SAAS,EAAC,+SAA+S,YAExT,WAAW,GACL,IACL,GACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { ZERO_TRUST_AUTHENTICATION_PATH } from './constants';\n\n/**\n * The \"you are not signed in\" page.\n *\n * ## Provenance\n *\n * `components/layout/Unauthorized.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git**, **Mail-Otter** and **Edge-Sonic** — five copies, byte-identical\n * apart from the doc comment — plus `Unauthorized.tsx` at the components root\n * in **AWS-AccessBridge** and **CalDAV-Bridge**.\n *\n * ## Why `onAuthenticate` is an argument and not a fixed `location.assign`\n *\n * All seven copies hard-coded `globalThis.location.assign(ZERO_TRUST_AUTHENTICATION_PATH)`.\n * That is untestable — jsdom refuses to navigate, so the one branch that\n * matters (what happens when the operator actually clicks the button) had no\n * assertions at all — and it hard-codes a routing assumption into a component\n * that a repo may not share.\n *\n * The default keeps the original behaviour for a repo that wants it, and a\n * caller with a different sign-in route passes its own.\n */\n\ninterface UnauthorizedProps {\n /** The heading. Required: this is the page's only `h1`. */\n title: string;\n /**\n * Why they are being stopped.\n *\n * Optional, and `null`/omitted renders no paragraph rather than an empty one.\n * A blank line under the heading reads as a rendering bug.\n */\n message?: string;\n /** The sign-in button's label. Required. */\n actionLabel: string;\n /**\n * What the button does.\n *\n * Defaults to navigating to {@link ZERO_TRUST_AUTHENTICATION_PATH}, which is\n * what every copy in the family did.\n */\n onAuthenticate?: () => void;\n}\n\nfunction Unauthorized({ title, message, actionLabel, onAuthenticate }: Readonly<UnauthorizedProps>) {\n const authenticate =\n onAuthenticate ??\n ((): void => {\n globalThis.location.assign(ZERO_TRUST_AUTHENTICATION_PATH);\n });\n\n return (\n <div className=\"bg-[var(--color-surface-base)] text-[var(--color-text-primary)] flex items-center justify-center py-16\">\n <div className=\"text-center px-6\">\n <h1 className=\"text-lg font-medium mt-4 mb-1\">{title}</h1>\n {message && <p className=\"text-[var(--color-text-secondary)] text-sm\">{message}</p>}\n <button\n type=\"button\"\n onClick={authenticate}\n className=\"mt-6 inline-flex items-center justify-center rounded-xl bg-[var(--color-accent)] px-5 py-2.5 text-sm font-medium text-[#0d1008] transition-colors hover:bg-[var(--color-accent-dim)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-accent)]\"\n >\n {actionLabel}\n </button>\n </div>\n </div>\n );\n}\n\nexport { Unauthorized };\nexport type { UnauthorizedProps };\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* module for what it replaced and which copy won.
|
|
8
8
|
*
|
|
9
9
|
* ```ts
|
|
10
|
-
* import { Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';
|
|
10
|
+
* import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
13
|
* ## What a consumer must provide
|
|
@@ -23,6 +23,26 @@
|
|
|
23
23
|
* - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for
|
|
24
24
|
* `ServiceError` and the status classes.
|
|
25
25
|
*
|
|
26
|
+
* ## Glyphs in, strings out
|
|
27
|
+
*
|
|
28
|
+
* Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take
|
|
29
|
+
* their icon from `lucide-react`, which is why it is a peer rather than a
|
|
30
|
+
* dependency. Everything *sayable* is a prop: no component here calls
|
|
31
|
+
* `useTranslation`, because the app rendering a dialog knows what it says and a
|
|
32
|
+
* kit that hard-codes English for it has taken over the app's string catalogue.
|
|
33
|
+
*
|
|
34
|
+
* The dividing line is deliberate. `Button` keeps using this package's own
|
|
35
|
+
* `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography
|
|
36
|
+
* is not, and vendoring a glyph's path data freezes it at whatever version was
|
|
37
|
+
* current when it was copied.
|
|
38
|
+
*
|
|
39
|
+
* ## Migrating the copies
|
|
40
|
+
*
|
|
41
|
+
* `codemods/` rewrites the family's `../components/…` imports onto this package
|
|
42
|
+
* for every component converged here, and names the ones it has not. Those
|
|
43
|
+
* imports are **relative**, so this is a separate transform from the
|
|
44
|
+
* `@scope/pkg` one — see `codemods/src/web-components.ts`.
|
|
45
|
+
*
|
|
26
46
|
* ## What is deliberately not here
|
|
27
47
|
*
|
|
28
48
|
* Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth
|
|
@@ -46,6 +66,26 @@ export type { LoadingButtonProps } from './LoadingButton';
|
|
|
46
66
|
export { ModalShell } from './ModalShell';
|
|
47
67
|
export type { ModalShellProps } from './ModalShell';
|
|
48
68
|
export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
|
|
69
|
+
export { AppPage } from './AppPage';
|
|
70
|
+
export type { AppPageProps, AppPageVariant } from './AppPage';
|
|
71
|
+
export { PageHeaderCard } from './PageHeaderCard';
|
|
72
|
+
export type { PageHeaderCardProps } from './PageHeaderCard';
|
|
73
|
+
export { ContextBar } from './ContextBar';
|
|
74
|
+
export type { ContextBarProps } from './ContextBar';
|
|
75
|
+
export { Unauthorized } from './Unauthorized';
|
|
76
|
+
export type { UnauthorizedProps } from './Unauthorized';
|
|
77
|
+
export { NoticeBar } from './NoticeBar';
|
|
78
|
+
export type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar';
|
|
79
|
+
export { LanguageSelector } from './LanguageSelector';
|
|
80
|
+
export type { LanguageSelectorProps } from './LanguageSelector';
|
|
81
|
+
export { RefreshButton } from './RefreshButton';
|
|
82
|
+
export type { RefreshButtonProps } from './RefreshButton';
|
|
83
|
+
export { ReadOnlyField } from './ReadOnlyField';
|
|
84
|
+
export type { ReadOnlyFieldProps } from './ReadOnlyField';
|
|
85
|
+
export { TypeToConfirmModal } from './TypeToConfirmModal';
|
|
86
|
+
export type { TypeToConfirmModalProps } from './TypeToConfirmModal';
|
|
87
|
+
export { useCopyToClipboard } from './useCopyToClipboard';
|
|
88
|
+
export type { UseCopyToClipboardResult } from './useCopyToClipboard';
|
|
49
89
|
export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
|
|
50
90
|
export type { PaginationLabels, PaginationProps } from './Pagination';
|
|
51
91
|
export { Spinner } from './Spinner';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* module for what it replaced and which copy won.
|
|
8
8
|
*
|
|
9
9
|
* ```ts
|
|
10
|
-
* import { Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';
|
|
10
|
+
* import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
13
|
* ## What a consumer must provide
|
|
@@ -23,6 +23,26 @@
|
|
|
23
23
|
* - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for
|
|
24
24
|
* `ServiceError` and the status classes.
|
|
25
25
|
*
|
|
26
|
+
* ## Glyphs in, strings out
|
|
27
|
+
*
|
|
28
|
+
* Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take
|
|
29
|
+
* their icon from `lucide-react`, which is why it is a peer rather than a
|
|
30
|
+
* dependency. Everything *sayable* is a prop: no component here calls
|
|
31
|
+
* `useTranslation`, because the app rendering a dialog knows what it says and a
|
|
32
|
+
* kit that hard-codes English for it has taken over the app's string catalogue.
|
|
33
|
+
*
|
|
34
|
+
* The dividing line is deliberate. `Button` keeps using this package's own
|
|
35
|
+
* `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography
|
|
36
|
+
* is not, and vendoring a glyph's path data freezes it at whatever version was
|
|
37
|
+
* current when it was copied.
|
|
38
|
+
*
|
|
39
|
+
* ## Migrating the copies
|
|
40
|
+
*
|
|
41
|
+
* `codemods/` rewrites the family's `../components/…` imports onto this package
|
|
42
|
+
* for every component converged here, and names the ones it has not. Those
|
|
43
|
+
* imports are **relative**, so this is a separate transform from the
|
|
44
|
+
* `@scope/pkg` one — see `codemods/src/web-components.ts`.
|
|
45
|
+
*
|
|
26
46
|
* ## What is deliberately not here
|
|
27
47
|
*
|
|
28
48
|
* Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth
|
|
@@ -43,6 +63,20 @@ export { LoadingButton } from './LoadingButton';
|
|
|
43
63
|
// adopting these does not require a translation library or an icon set.
|
|
44
64
|
export { ModalShell } from './ModalShell';
|
|
45
65
|
export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
|
|
66
|
+
// The second convergence round: page layout, the notice banner, the access
|
|
67
|
+
// page, the language picker, and the two clipboard-bearing controls. Same rule
|
|
68
|
+
// on labels — the app owns its string catalogue. Three of these need
|
|
69
|
+
// `lucide-react`, which is why it is a peer and not a dependency.
|
|
70
|
+
export { AppPage } from './AppPage';
|
|
71
|
+
export { PageHeaderCard } from './PageHeaderCard';
|
|
72
|
+
export { ContextBar } from './ContextBar';
|
|
73
|
+
export { Unauthorized } from './Unauthorized';
|
|
74
|
+
export { NoticeBar } from './NoticeBar';
|
|
75
|
+
export { LanguageSelector } from './LanguageSelector';
|
|
76
|
+
export { RefreshButton } from './RefreshButton';
|
|
77
|
+
export { ReadOnlyField } from './ReadOnlyField';
|
|
78
|
+
export { TypeToConfirmModal } from './TypeToConfirmModal';
|
|
79
|
+
export { useCopyToClipboard } from './useCopyToClipboard';
|
|
46
80
|
export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
|
|
47
81
|
export { Spinner } from './Spinner';
|
|
48
82
|
export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, } from './theme';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG/E,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGrG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGjG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7E,2EAA2E;AAC3E,+EAA+E;AAC/E,qEAAqE;AACrE,kEAAkE;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,KAAK,EACL,OAAO,GACR,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE1G,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/**\n * `@rexezuge/web` — the SPA layer of the kit.\n *\n * React primitives, the hooks every app's shell needs, and the one API client.\n * Every export is the converged form of a framework that lived as copies inside\n * the nine consumer repos; see the `## Provenance` block at the top of each\n * module for what it replaced and which copy won.\n *\n * ```ts\n * import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';\n * ```\n *\n * ## What a consumer must provide\n *\n * - **The CSS variables the class-based components read.** All six Tailwind\n * repos define the same set, so this is usually already present:\n * `--color-accent`, `--color-accent-dim`, `--color-border`,\n * `--color-surface-base`, `--color-surface-1..4`,\n * `--color-text-primary`, `--color-text-secondary`, `--color-text-muted`, and\n * `--color-{success,error,warning,info,neutral}-{bg,text}`.\n * - **`animate-spin`**, for `Spinner` (and therefore `Button`'s busy state).\n * Tailwind ships it; a non-Tailwind app defines the keyframes once.\n * - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for\n * `ServiceError` and the status classes.\n *\n * ## Glyphs in, strings out\n *\n * Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take\n * their icon from `lucide-react`, which is why it is a peer rather than a\n * dependency. Everything *sayable* is a prop: no component here calls\n * `useTranslation`, because the app rendering a dialog knows what it says and a\n * kit that hard-codes English for it has taken over the app's string catalogue.\n *\n * The dividing line is deliberate. `Button` keeps using this package's own\n * `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography\n * is not, and vendoring a glyph's path data freezes it at whatever version was\n * current when it was copied.\n *\n * ## Migrating the copies\n *\n * `codemods/` rewrites the family's `../components/…` imports onto this package\n * for every component converged here, and names the ones it has not. Those\n * imports are **relative**, so this is a separate transform from the\n * `@scope/pkg` one — see `codemods/src/web-components.ts`.\n *\n * ## What is deliberately not here\n *\n * Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth\n * `?oauth2=` notice seeding, the D1 bookmark header, WebDAV `207` handling, the\n * authed-first public fallback, and every app's `SUPPORTED_LANGUAGES`. Each had\n * exactly one consumer, so each stays with it — see `constants.ts` and the\n * per-module provenance notes for the list.\n */\n\nexport { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge';\nexport type { BadgeProps, BadgeVariant } from './Badge';\n\nexport { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button';\nexport type { ButtonProps, ButtonSize, ButtonVariant } from './Button';\n\nexport { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card';\nexport type { CardHeaderProps, CardProps, CardTitleProps } from './Card';\n\nexport { FocusInput } from './FocusInput';\nexport type { FocusInputProps } from './FocusInput';\n\nexport { Input, Label, Select, Textarea, fieldClass } from './Input';\nexport type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input';\n\nexport { LoadingButton } from './LoadingButton';\nexport type { LoadingButtonProps } from './LoadingButton';\n\n// Converged from the `ModalShell` / `ConfirmDeleteModal` / `PageState` copies\n// that Durable-DAV, Durable-DAV-Router, Mail-Otter and Edge-Git each shipped.\n// Deliberately dependency-free — labels are props, not `useTranslation` — so\n// adopting these does not require a translation library or an icon set.\nexport { ModalShell } from './ModalShell';\nexport type { ModalShellProps } from './ModalShell';\nexport { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';\n\n// The second convergence round: page layout, the notice banner, the access\n// page, the language picker, and the two clipboard-bearing controls. Same rule\n// on labels — the app owns its string catalogue. Three of these need\n// `lucide-react`, which is why it is a peer and not a dependency.\nexport { AppPage } from './AppPage';\nexport type { AppPageProps, AppPageVariant } from './AppPage';\nexport { PageHeaderCard } from './PageHeaderCard';\nexport type { PageHeaderCardProps } from './PageHeaderCard';\nexport { ContextBar } from './ContextBar';\nexport type { ContextBarProps } from './ContextBar';\nexport { Unauthorized } from './Unauthorized';\nexport type { UnauthorizedProps } from './Unauthorized';\nexport { NoticeBar } from './NoticeBar';\nexport type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar';\nexport { LanguageSelector } from './LanguageSelector';\nexport type { LanguageSelectorProps } from './LanguageSelector';\nexport { RefreshButton } from './RefreshButton';\nexport type { RefreshButtonProps } from './RefreshButton';\nexport { ReadOnlyField } from './ReadOnlyField';\nexport type { ReadOnlyFieldProps } from './ReadOnlyField';\nexport { TypeToConfirmModal } from './TypeToConfirmModal';\nexport type { TypeToConfirmModalProps } from './TypeToConfirmModal';\nexport { useCopyToClipboard } from './useCopyToClipboard';\nexport type { UseCopyToClipboardResult } from './useCopyToClipboard';\n\nexport { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';\nexport type { PaginationLabels, PaginationProps } from './Pagination';\n\nexport { Spinner } from './Spinner';\nexport type { SpinnerProps } from './Spinner';\n\nexport {\n btnBase,\n btnBlueStyle,\n btnGreenStyle,\n btnSmallStyle,\n buttonColors,\n cardStyle,\n inputStyle,\n paginationBtnStyle,\n tableCardStyle,\n tdStyle,\n theme,\n thStyle,\n} from './theme';\n\nexport { cn } from './utils';\nexport type { ClassDictionary, ClassValue } from './utils';\n\nexport { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants';\n\nexport { useNotice } from './useNotice';\nexport type { Notice, NoticeKind, ShowNotice, UseNoticeOptions, UseNoticeResult } from './useNotice';\n\nexport {\n canonicalizeLanguageTag,\n DEFAULT_FALLBACK_LANGUAGE,\n DEFAULT_LANGUAGE_STORAGE_KEY,\n DEFAULT_SUPPORTED_LANGUAGES,\n resolveLanguageTag,\n useSpaLanguage,\n} from './useSpaLanguage';\nexport type { LanguageTag, UseSpaLanguageOptions, UseSpaLanguageResult } from './useSpaLanguage';\n\nexport { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser';\nexport type { CurrentUser, UseCurrentUserOptions, UseCurrentUserResult } from './useCurrentUser';\n\nexport { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api';\nexport type { ApiClient, ApiRequestInit, CreateApiClientOptions, FetchFn, QueryParams, QueryValue } from './api';\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy text to the clipboard, reporting success only when it happened.
|
|
3
|
+
*
|
|
4
|
+
* ## Provenance
|
|
5
|
+
*
|
|
6
|
+
* `hooks/useCopyToClipboard.ts` in **Durable-DAV** — the one copy that had
|
|
7
|
+
* solved the two failures the others carried. The other three handlers were
|
|
8
|
+
* inlined into `ReadOnlyField` (Edge-Git, Mail-Otter, Durable-DAV-Router) and
|
|
9
|
+
* `TypeToConfirmModal`, and were byte-identical to each other.
|
|
10
|
+
*
|
|
11
|
+
* ## The two live bugs this converges away
|
|
12
|
+
*
|
|
13
|
+
* 1. **`navigator.clipboard` is absent in an insecure context.** A plain
|
|
14
|
+
* `navigator.clipboard.writeText` throws *synchronously* there, so the
|
|
15
|
+
* handler dies before setting state. Where it was guarded with
|
|
16
|
+
* `if (clipboard)`, the guard fell through to `setCopied(true)` anyway and
|
|
17
|
+
* showed a checkmark for a copy that never happened.
|
|
18
|
+
* 2. **The write is a promise that rejects on a denied permission.** Awaiting
|
|
19
|
+
* it is not enough; the rejection has to be handled, or it surfaces as an
|
|
20
|
+
* unhandled rejection *and* the checkmark still appears.
|
|
21
|
+
*
|
|
22
|
+
* That second case is why this is a hook rather than a helper. The honest
|
|
23
|
+
* answer — "nothing was copied, so there is nothing to undo" — is expressed by
|
|
24
|
+
* `copied` simply never becoming true, which is state a helper function cannot
|
|
25
|
+
* hold.
|
|
26
|
+
*
|
|
27
|
+
* Every call site in the family is a secret reveal: a bucket credential's
|
|
28
|
+
* copy-once password, a resource name typed to confirm a destructive action.
|
|
29
|
+
* A false success sends the operator away believing they have something they do
|
|
30
|
+
* not.
|
|
31
|
+
*
|
|
32
|
+
* ## Timer handling
|
|
33
|
+
*
|
|
34
|
+
* The reset timer is a ref and is cleared on unmount. Local `setTimeout` handles
|
|
35
|
+
* in the inlined copies leaked both ways: a modal closed inside the feedback
|
|
36
|
+
* window set state on an unmounted component, and repeated clicks each replaced
|
|
37
|
+
* the timer without cancelling the previous one, so an early timer could clear
|
|
38
|
+
* the checkmark while a later copy was still pending.
|
|
39
|
+
*/
|
|
40
|
+
interface UseCopyToClipboardResult {
|
|
41
|
+
/**
|
|
42
|
+
* True only after a write that actually resolved.
|
|
43
|
+
*
|
|
44
|
+
* Never optimistically set: a denied permission or an insecure context leaves
|
|
45
|
+
* this `false`, which is the answer that matters — there is nothing to undo.
|
|
46
|
+
*/
|
|
47
|
+
copied: boolean;
|
|
48
|
+
/** Writes `text`, or does nothing if the clipboard is unavailable. */
|
|
49
|
+
copy: (text: string) => void;
|
|
50
|
+
}
|
|
51
|
+
declare function useCopyToClipboard(): UseCopyToClipboardResult;
|
|
52
|
+
export { useCopyToClipboard };
|
|
53
|
+
export type { UseCopyToClipboardResult };
|
|
54
|
+
//# sourceMappingURL=useCopyToClipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../src/useCopyToClipboard.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,UAAU,wBAAwB;IAChC;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,iBAAS,kBAAkB,IAAI,wBAAwB,CAuCtD;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { COPY_FEEDBACK_TIMEOUT_MS } from './constants';
|
|
3
|
+
function useCopyToClipboard() {
|
|
4
|
+
const [copied, setCopied] = useState(false);
|
|
5
|
+
const resetTimer = useRef(null);
|
|
6
|
+
useEffect(() => () => {
|
|
7
|
+
if (resetTimer.current !== null)
|
|
8
|
+
clearTimeout(resetTimer.current);
|
|
9
|
+
}, []);
|
|
10
|
+
const copy = useCallback((text) => {
|
|
11
|
+
// Optional chaining rather than an assumption: `navigator.clipboard` is
|
|
12
|
+
// genuinely absent over plain HTTP, and for a self-hosted deployment over
|
|
13
|
+
// plain HTTP that is a normal configuration, not an error to surface.
|
|
14
|
+
const clipboard = globalThis.navigator?.clipboard;
|
|
15
|
+
// Nothing was copied, so there is nothing to report and nothing to undo.
|
|
16
|
+
if (!clipboard)
|
|
17
|
+
return;
|
|
18
|
+
void clipboard
|
|
19
|
+
.writeText(text)
|
|
20
|
+
.then(() => {
|
|
21
|
+
setCopied(true);
|
|
22
|
+
// Cancel any pending reset before arming a new one. Replacing the
|
|
23
|
+
// handle without clearing leaves the earlier timer live, and it can
|
|
24
|
+
// clear the checkmark for a copy that is still being reported.
|
|
25
|
+
if (resetTimer.current !== null)
|
|
26
|
+
clearTimeout(resetTimer.current);
|
|
27
|
+
resetTimer.current = setTimeout(() => {
|
|
28
|
+
resetTimer.current = null;
|
|
29
|
+
setCopied(false);
|
|
30
|
+
}, COPY_FEEDBACK_TIMEOUT_MS);
|
|
31
|
+
})
|
|
32
|
+
// Leave `copied` false rather than flashing and clearing it: a rejection
|
|
33
|
+
// means the text is still on screen and unread, so the affordance must
|
|
34
|
+
// not claim otherwise.
|
|
35
|
+
.catch(() => undefined);
|
|
36
|
+
}, []);
|
|
37
|
+
return { copied, copy };
|
|
38
|
+
}
|
|
39
|
+
export { useCopyToClipboard };
|
|
40
|
+
//# sourceMappingURL=useCopyToClipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCopyToClipboard.js","sourceRoot":"","sources":["../src/useCopyToClipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAsDvD,SAAS,kBAAkB;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEtE,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,IAAY,EAAQ,EAAE;QAC9C,wEAAwE;QACxE,0EAA0E;QAC1E,sEAAsE;QACtE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAkC,CAAC;QAC3E,yEAAyE;QACzE,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,KAAK,SAAS;aACX,SAAS,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,EAAE;YACT,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,kEAAkE;YAClE,oEAAoE;YACpE,+DAA+D;YAC/D,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;gBAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAClE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC1B,SAAS,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,EAAE,wBAAwB,CAAC,CAAC;QAC/B,CAAC,CAAC;YACF,yEAAyE;YACzE,uEAAuE;YACvE,uBAAuB;aACtB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { COPY_FEEDBACK_TIMEOUT_MS } from './constants';\n\n/**\n * Copy text to the clipboard, reporting success only when it happened.\n *\n * ## Provenance\n *\n * `hooks/useCopyToClipboard.ts` in **Durable-DAV** — the one copy that had\n * solved the two failures the others carried. The other three handlers were\n * inlined into `ReadOnlyField` (Edge-Git, Mail-Otter, Durable-DAV-Router) and\n * `TypeToConfirmModal`, and were byte-identical to each other.\n *\n * ## The two live bugs this converges away\n *\n * 1. **`navigator.clipboard` is absent in an insecure context.** A plain\n * `navigator.clipboard.writeText` throws *synchronously* there, so the\n * handler dies before setting state. Where it was guarded with\n * `if (clipboard)`, the guard fell through to `setCopied(true)` anyway and\n * showed a checkmark for a copy that never happened.\n * 2. **The write is a promise that rejects on a denied permission.** Awaiting\n * it is not enough; the rejection has to be handled, or it surfaces as an\n * unhandled rejection *and* the checkmark still appears.\n *\n * That second case is why this is a hook rather than a helper. The honest\n * answer — \"nothing was copied, so there is nothing to undo\" — is expressed by\n * `copied` simply never becoming true, which is state a helper function cannot\n * hold.\n *\n * Every call site in the family is a secret reveal: a bucket credential's\n * copy-once password, a resource name typed to confirm a destructive action.\n * A false success sends the operator away believing they have something they do\n * not.\n *\n * ## Timer handling\n *\n * The reset timer is a ref and is cleared on unmount. Local `setTimeout` handles\n * in the inlined copies leaked both ways: a modal closed inside the feedback\n * window set state on an unmounted component, and repeated clicks each replaced\n * the timer without cancelling the previous one, so an early timer could clear\n * the checkmark while a later copy was still pending.\n */\n\ninterface UseCopyToClipboardResult {\n /**\n * True only after a write that actually resolved.\n *\n * Never optimistically set: a denied permission or an insecure context leaves\n * this `false`, which is the answer that matters — there is nothing to undo.\n */\n copied: boolean;\n /** Writes `text`, or does nothing if the clipboard is unavailable. */\n copy: (text: string) => void;\n}\n\nfunction useCopyToClipboard(): UseCopyToClipboardResult {\n const [copied, setCopied] = useState(false);\n const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n },\n [],\n );\n\n const copy = useCallback((text: string): void => {\n // Optional chaining rather than an assumption: `navigator.clipboard` is\n // genuinely absent over plain HTTP, and for a self-hosted deployment over\n // plain HTTP that is a normal configuration, not an error to surface.\n const clipboard = globalThis.navigator?.clipboard as Clipboard | undefined;\n // Nothing was copied, so there is nothing to report and nothing to undo.\n if (!clipboard) return;\n\n void clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n // Cancel any pending reset before arming a new one. Replacing the\n // handle without clearing leaves the earlier timer live, and it can\n // clear the checkmark for a copy that is still being reported.\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n resetTimer.current = setTimeout(() => {\n resetTimer.current = null;\n setCopied(false);\n }, COPY_FEEDBACK_TIMEOUT_MS);\n })\n // Leave `copied` false rather than flashing and clearing it: a rejection\n // means the text is still on screen and unread, so the affordance must\n // not claim otherwise.\n .catch(() => undefined);\n }, []);\n\n return { copied, copy };\n}\n\nexport { useCopyToClipboard };\nexport type { UseCopyToClipboardResult };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexezuge/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@rexezuge/errors": "1.
|
|
29
|
-
"@rexezuge/shared": "1.
|
|
28
|
+
"@rexezuge/errors": "1.2.0",
|
|
29
|
+
"@rexezuge/shared": "1.2.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
+
"lucide-react": "^1.49.0",
|
|
32
33
|
"react": "^19.3.0",
|
|
33
34
|
"react-dom": "^19.3.0"
|
|
34
35
|
},
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@types/react-dom": "19.3.0",
|
|
41
42
|
"i18next": "26.4.2",
|
|
42
43
|
"jsdom": "30.1.1",
|
|
44
|
+
"lucide-react": "1.52.0",
|
|
43
45
|
"react": "19.3.0",
|
|
44
46
|
"react-dom": "19.3.0",
|
|
45
47
|
"react-i18next": "17.0.15",
|