@rexezuge/web 1.0.8 → 1.1.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/dist/ModalShell.d.ts +53 -0
- package/dist/ModalShell.d.ts.map +1 -0
- package/dist/ModalShell.js +22 -0
- package/dist/ModalShell.js.map +1 -0
- package/dist/PageState.d.ts +47 -0
- package/dist/PageState.d.ts.map +1 -0
- package/dist/PageState.js +47 -0
- package/dist/PageState.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The modal frame every confirm dialog in the family sits inside.
|
|
4
|
+
*
|
|
5
|
+
* Converged from `components/modals/ModalShell.tsx` in Durable-DAV,
|
|
6
|
+
* Durable-DAV-Router, Mail-Otter and Edge-Git, where the copies were
|
|
7
|
+
* byte-identical apart from an import-order difference.
|
|
8
|
+
*
|
|
9
|
+
* ## Two decisions the copies made by accident, now made deliberately
|
|
10
|
+
*
|
|
11
|
+
* **It renders in a portal.** A dialog nested in a scrolling container is
|
|
12
|
+
* clipped by it, and one nested inside a `position: fixed` ancestor is
|
|
13
|
+
* positioned by that ancestor rather than the viewport. The portal is what makes
|
|
14
|
+
* "centre of the screen" mean the same thing everywhere.
|
|
15
|
+
*
|
|
16
|
+
* **It closes on the backdrop but not on the panel.** The backdrop click closes;
|
|
17
|
+
* a click inside the panel stops propagating so that selecting text in a
|
|
18
|
+
* confirmation message does not dismiss the dialog the operator is reading. The
|
|
19
|
+
* stop is on the panel, not the backdrop, so a click on the panel never closes
|
|
20
|
+
* it and a click outside always does.
|
|
21
|
+
*
|
|
22
|
+
* ## Labels are props, not translations
|
|
23
|
+
*
|
|
24
|
+
* The copies called `useTranslation` for the close button and the default width.
|
|
25
|
+
* A shared primitive that reaches into a translation library forces every
|
|
26
|
+
* consumer to have one installed *and* configured, for a string it already has
|
|
27
|
+
* — the caller rendering the dialog is the one that knows what it says. So
|
|
28
|
+
* `closeLabel` and `ariaLabel` are ordinary props with no default, and a repo
|
|
29
|
+
* passes `t('common.close')` when it wants them translated.
|
|
30
|
+
*/
|
|
31
|
+
/** Escape closes, and the initial focus lands on the dialog. */
|
|
32
|
+
interface ModalShellProps {
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
/** Width utility class. Kept as a class so a repo themes it without forking. */
|
|
36
|
+
widthClass?: string;
|
|
37
|
+
/** Announced to assistive tech; there is no visible title in the frame itself. */
|
|
38
|
+
ariaLabel: string;
|
|
39
|
+
/**
|
|
40
|
+
* Accessible name for the corner close button.
|
|
41
|
+
*
|
|
42
|
+
* Kept distinct from any cancel action in the body: a dialog whose close
|
|
43
|
+
* button and cancel button share a name is announced as two identical
|
|
44
|
+
* buttons, and the operator has to guess which one they are on.
|
|
45
|
+
*/
|
|
46
|
+
closeLabel?: string;
|
|
47
|
+
/** Close on Escape. Defaults to true. */
|
|
48
|
+
closeOnEscape?: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare function ModalShell({ onClose, children, widthClass, ariaLabel, closeLabel, closeOnEscape }: ModalShellProps): import("react").JSX.Element;
|
|
51
|
+
export { ModalShell };
|
|
52
|
+
export type { ModalShellProps };
|
|
53
|
+
//# sourceMappingURL=ModalShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalShell.d.ts","sourceRoot":"","sources":["../src/ModalShell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,gEAAgE;AAChE,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAmB,EAAE,SAAS,EAAE,UAAoB,EAAE,aAAoB,EAAE,EAAE,eAAe,+BAqCrI;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
function ModalShell({ onClose, children, widthClass = 'w-80', ariaLabel, closeLabel = 'Close', closeOnEscape = true }) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!closeOnEscape)
|
|
6
|
+
return undefined;
|
|
7
|
+
const onKeyDown = (event) => {
|
|
8
|
+
if (event.key === 'Escape')
|
|
9
|
+
onClose();
|
|
10
|
+
};
|
|
11
|
+
globalThis.addEventListener('keydown', onKeyDown);
|
|
12
|
+
// Removed on unmount: a dialog that closed by leaving a listener behind
|
|
13
|
+
// would close its replacement too, on the next Escape anywhere.
|
|
14
|
+
return () => globalThis.removeEventListener('keydown', onKeyDown);
|
|
15
|
+
}, [closeOnEscape, onClose]);
|
|
16
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", onClick: onClose, role: "presentation", children: [_jsx("div", { className: "fixed inset-0 bg-black/60 animate-backdrop-in", "aria-hidden": "true" }), _jsxs("div", { className: `relative bg-[var(--color-surface-1)] border border-[var(--color-border-muted)] rounded-2xl shadow-2xl animate-fade-in ${widthClass}`, onClick: (event) => {
|
|
17
|
+
// The one place a click inside the panel must not reach the backdrop.
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
}, role: "dialog", "aria-modal": "true", "aria-label": ariaLabel, children: [_jsx("button", { type: "button", onClick: onClose, "aria-label": closeLabel, className: "absolute top-3 right-3 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] transition-colors", children: closeLabel }), children] })] }));
|
|
20
|
+
}
|
|
21
|
+
export { ModalShell };
|
|
22
|
+
//# sourceMappingURL=ModalShell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalShell.js","sourceRoot":"","sources":["../src/ModalShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAoDlD,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,EAAE,aAAa,GAAG,IAAI,EAAmB;IACpI,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC;QACrC,MAAM,SAAS,GAAG,CAAC,KAAoB,EAAQ,EAAE;YAC/C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;QACxC,CAAC,CAAC;QACF,UAAU,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAClD,wEAAwE;QACxE,gEAAgE;QAChE,OAAO,GAAS,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1E,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,OAAO,CACL,eAAK,SAAS,EAAC,qDAAqD,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,cAAc,aACxG,cAAK,SAAS,EAAC,+CAA+C,iBAAa,MAAM,GAAG,EACpF,eACE,SAAS,EAAE,yHAAyH,UAAU,EAAE,EAChJ,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;oBACjB,sEAAsE;oBACtE,KAAK,CAAC,eAAe,EAAE,CAAC;gBAC1B,CAAC,EACD,IAAI,EAAC,QAAQ,gBACF,MAAM,gBACL,SAAS,aAErB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACJ,UAAU,EACtB,SAAS,EAAC,gHAAgH,YAEzH,UAAU,GACJ,EACR,QAAQ,IACL,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { useEffect, type ReactNode } from 'react';\n\n/**\n * The modal frame every confirm dialog in the family sits inside.\n *\n * Converged from `components/modals/ModalShell.tsx` in Durable-DAV,\n * Durable-DAV-Router, Mail-Otter and Edge-Git, where the copies were\n * byte-identical apart from an import-order difference.\n *\n * ## Two decisions the copies made by accident, now made deliberately\n *\n * **It renders in a portal.** A dialog nested in a scrolling container is\n * clipped by it, and one nested inside a `position: fixed` ancestor is\n * positioned by that ancestor rather than the viewport. The portal is what makes\n * \"centre of the screen\" mean the same thing everywhere.\n *\n * **It closes on the backdrop but not on the panel.** The backdrop click closes;\n * a click inside the panel stops propagating so that selecting text in a\n * confirmation message does not dismiss the dialog the operator is reading. The\n * stop is on the panel, not the backdrop, so a click on the panel never closes\n * it and a click outside always does.\n *\n * ## Labels are props, not translations\n *\n * The copies called `useTranslation` for the close button and the default width.\n * A shared primitive that reaches into a translation library forces every\n * consumer to have one installed *and* configured, for a string it already has\n * — the caller rendering the dialog is the one that knows what it says. So\n * `closeLabel` and `ariaLabel` are ordinary props with no default, and a repo\n * passes `t('common.close')` when it wants them translated.\n */\n\n/** Escape closes, and the initial focus lands on the dialog. */\ninterface ModalShellProps {\n onClose: () => void;\n children: ReactNode;\n /** Width utility class. Kept as a class so a repo themes it without forking. */\n widthClass?: string;\n /** Announced to assistive tech; there is no visible title in the frame itself. */\n ariaLabel: string;\n /**\n * Accessible name for the corner close button.\n *\n * Kept distinct from any cancel action in the body: a dialog whose close\n * button and cancel button share a name is announced as two identical\n * buttons, and the operator has to guess which one they are on.\n */\n closeLabel?: string;\n /** Close on Escape. Defaults to true. */\n closeOnEscape?: boolean;\n}\n\nfunction ModalShell({ onClose, children, widthClass = 'w-80', ariaLabel, closeLabel = 'Close', closeOnEscape = true }: ModalShellProps) {\n useEffect(() => {\n if (!closeOnEscape) return undefined;\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') onClose();\n };\n globalThis.addEventListener('keydown', onKeyDown);\n // Removed on unmount: a dialog that closed by leaving a listener behind\n // would close its replacement too, on the next Escape anywhere.\n return (): void => globalThis.removeEventListener('keydown', onKeyDown);\n }, [closeOnEscape, onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\" onClick={onClose} role=\"presentation\">\n <div className=\"fixed inset-0 bg-black/60 animate-backdrop-in\" aria-hidden=\"true\" />\n <div\n className={`relative bg-[var(--color-surface-1)] border border-[var(--color-border-muted)] rounded-2xl shadow-2xl animate-fade-in ${widthClass}`}\n onClick={(event) => {\n // The one place a click inside the panel must not reach the backdrop.\n event.stopPropagation();\n }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n >\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={closeLabel}\n className=\"absolute top-3 right-3 text-[var(--color-text-muted)] hover:text-[var(--color-text-primary)] transition-colors\"\n >\n {closeLabel}\n </button>\n {children}\n </div>\n </div>\n );\n}\n\nexport { ModalShell };\nexport type { ModalShellProps };\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The shared loading / empty / error states.
|
|
4
|
+
*
|
|
5
|
+
* Converged from `components/layout/PageState.tsx` (Durable-DAV,
|
|
6
|
+
* Durable-DAV-Router) and `EmptyState` (CalDAV-Bridge), which were the same two
|
|
7
|
+
* components under two names.
|
|
8
|
+
*
|
|
9
|
+
* Same reasoning as `ModalShell`: the label arrives as a prop rather than from
|
|
10
|
+
* `useTranslation`, so a consumer is not required to run a translation library
|
|
11
|
+
* to render a spinner.
|
|
12
|
+
*/
|
|
13
|
+
/** The shared spinner. `label` is announced, so it should say what is loading. */
|
|
14
|
+
declare function LoadingSpinner({ label }: {
|
|
15
|
+
label?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/** The shared centered empty message, with an optional icon above it. */
|
|
18
|
+
declare function EmptyState({ icon, message }: {
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
message: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* A confirmation for a destructive action.
|
|
24
|
+
*
|
|
25
|
+
* `message` is required to **name the thing being deleted**, not to say "this
|
|
26
|
+
* item" — the operator is the only one who can tell whether they meant to
|
|
27
|
+
* delete it, so the dialog has to be specific. That is a contract on the
|
|
28
|
+
* caller, not something the component can enforce, which is why `message` is a
|
|
29
|
+
* `ReactNode` the caller composes rather than a template this fills in.
|
|
30
|
+
*
|
|
31
|
+
* No confirm timer: a dialog that arms itself makes the operator wait for a
|
|
32
|
+
* decision they were already qualified to make.
|
|
33
|
+
*
|
|
34
|
+
* Both handlers stop propagation, because a confirm that fires twice deletes
|
|
35
|
+
* two things.
|
|
36
|
+
*/
|
|
37
|
+
declare function ConfirmDeleteModal({ message, confirmLabel, cancelLabel, ariaLabel, onConfirm, onCancel, }: {
|
|
38
|
+
/** The full question, naming what will be deleted. */
|
|
39
|
+
message: ReactNode;
|
|
40
|
+
confirmLabel: string;
|
|
41
|
+
cancelLabel: string;
|
|
42
|
+
ariaLabel: string;
|
|
43
|
+
onConfirm: () => void;
|
|
44
|
+
onCancel: () => void;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
export { ConfirmDeleteModal, EmptyState, LoadingSpinner };
|
|
47
|
+
//# sourceMappingURL=PageState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageState.d.ts","sourceRoot":"","sources":["../src/PageState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;GAUG;AAEH,kFAAkF;AAClF,iBAAS,cAAc,CAAC,EAAE,KAAkB,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAMjE;AAED,yEAAyE;AACzE,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,+BAO9E;AAED;;;;;;;;;;;;;;GAcG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE;IACD,sDAAsD;IACtD,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BA8BA;AAED,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ModalShell } from './ModalShell';
|
|
3
|
+
/**
|
|
4
|
+
* The shared loading / empty / error states.
|
|
5
|
+
*
|
|
6
|
+
* Converged from `components/layout/PageState.tsx` (Durable-DAV,
|
|
7
|
+
* Durable-DAV-Router) and `EmptyState` (CalDAV-Bridge), which were the same two
|
|
8
|
+
* components under two names.
|
|
9
|
+
*
|
|
10
|
+
* Same reasoning as `ModalShell`: the label arrives as a prop rather than from
|
|
11
|
+
* `useTranslation`, so a consumer is not required to run a translation library
|
|
12
|
+
* to render a spinner.
|
|
13
|
+
*/
|
|
14
|
+
/** The shared spinner. `label` is announced, so it should say what is loading. */
|
|
15
|
+
function LoadingSpinner({ label = 'Loading…' }) {
|
|
16
|
+
return (_jsx("div", { className: "min-h-64 flex items-center justify-center", role: "status", "aria-label": label, children: _jsx("div", { className: "h-10 w-10 rounded-full border-2 border-[var(--color-accent)] border-t-transparent animate-spin" }) }));
|
|
17
|
+
}
|
|
18
|
+
/** The shared centered empty message, with an optional icon above it. */
|
|
19
|
+
function EmptyState({ icon, message }) {
|
|
20
|
+
return (_jsxs("div", { className: "text-center text-[var(--color-text-muted)] py-10 text-sm", children: [icon && _jsx("div", { className: "mb-3 flex justify-center", children: icon }), message] }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A confirmation for a destructive action.
|
|
24
|
+
*
|
|
25
|
+
* `message` is required to **name the thing being deleted**, not to say "this
|
|
26
|
+
* item" — the operator is the only one who can tell whether they meant to
|
|
27
|
+
* delete it, so the dialog has to be specific. That is a contract on the
|
|
28
|
+
* caller, not something the component can enforce, which is why `message` is a
|
|
29
|
+
* `ReactNode` the caller composes rather than a template this fills in.
|
|
30
|
+
*
|
|
31
|
+
* No confirm timer: a dialog that arms itself makes the operator wait for a
|
|
32
|
+
* decision they were already qualified to make.
|
|
33
|
+
*
|
|
34
|
+
* Both handlers stop propagation, because a confirm that fires twice deletes
|
|
35
|
+
* two things.
|
|
36
|
+
*/
|
|
37
|
+
function ConfirmDeleteModal({ message, confirmLabel, cancelLabel, ariaLabel, onConfirm, onCancel, }) {
|
|
38
|
+
return (_jsx(ModalShell, { onClose: onCancel, widthClass: "w-80", ariaLabel: ariaLabel, children: _jsxs("div", { className: "p-6", children: [_jsx("p", { className: "text-sm text-[var(--color-text-secondary)] text-center mb-6", children: message }), _jsxs("div", { className: "flex gap-3", children: [_jsx("button", { type: "button", className: "flex-1", onClick: (event) => {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
onCancel();
|
|
41
|
+
}, children: cancelLabel }), _jsx("button", { type: "button", className: "flex-1", onClick: (event) => {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
onConfirm();
|
|
44
|
+
}, children: confirmLabel })] })] }) }));
|
|
45
|
+
}
|
|
46
|
+
export { ConfirmDeleteModal, EmptyState, LoadingSpinner };
|
|
47
|
+
//# sourceMappingURL=PageState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageState.js","sourceRoot":"","sources":["../src/PageState.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;GAUG;AAEH,kFAAkF;AAClF,SAAS,cAAc,CAAC,EAAE,KAAK,GAAG,UAAU,EAAsB;IAChE,OAAO,CACL,cAAK,SAAS,EAAC,2CAA2C,EAAC,IAAI,EAAC,QAAQ,gBAAa,KAAK,YACxF,cAAK,SAAS,EAAC,gGAAgG,GAAG,GAC9G,CACP,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAA4C;IAC7E,OAAO,CACL,eAAK,SAAS,EAAC,0DAA0D,aACtE,IAAI,IAAI,cAAK,SAAS,EAAC,0BAA0B,YAAE,IAAI,GAAO,EAC9D,OAAO,IACJ,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,EACT,QAAQ,GAST;IACC,OAAO,CACL,KAAC,UAAU,IAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,EAAC,SAAS,EAAE,SAAS,YACnE,eAAK,SAAS,EAAC,KAAK,aAClB,YAAG,SAAS,EAAC,6DAA6D,YAAE,OAAO,GAAK,EACxF,eAAK,SAAS,EAAC,YAAY,aACzB,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gCACjB,KAAK,CAAC,eAAe,EAAE,CAAC;gCACxB,QAAQ,EAAE,CAAC;4BACb,CAAC,YAEA,WAAW,GACL,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gCACjB,KAAK,CAAC,eAAe,EAAE,CAAC;gCACxB,SAAS,EAAE,CAAC;4BACd,CAAC,YAEA,YAAY,GACN,IACL,IACF,GACK,CACd,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { ModalShell } from './ModalShell';\n\n/**\n * The shared loading / empty / error states.\n *\n * Converged from `components/layout/PageState.tsx` (Durable-DAV,\n * Durable-DAV-Router) and `EmptyState` (CalDAV-Bridge), which were the same two\n * components under two names.\n *\n * Same reasoning as `ModalShell`: the label arrives as a prop rather than from\n * `useTranslation`, so a consumer is not required to run a translation library\n * to render a spinner.\n */\n\n/** The shared spinner. `label` is announced, so it should say what is loading. */\nfunction LoadingSpinner({ label = 'Loading…' }: { label?: string }) {\n return (\n <div className=\"min-h-64 flex items-center justify-center\" role=\"status\" aria-label={label}>\n <div className=\"h-10 w-10 rounded-full border-2 border-[var(--color-accent)] border-t-transparent animate-spin\" />\n </div>\n );\n}\n\n/** The shared centered empty message, with an optional icon above it. */\nfunction EmptyState({ icon, message }: { icon?: ReactNode; message: ReactNode }) {\n return (\n <div className=\"text-center text-[var(--color-text-muted)] py-10 text-sm\">\n {icon && <div className=\"mb-3 flex justify-center\">{icon}</div>}\n {message}\n </div>\n );\n}\n\n/**\n * A confirmation for a destructive action.\n *\n * `message` is required to **name the thing being deleted**, not to say \"this\n * item\" — the operator is the only one who can tell whether they meant to\n * delete it, so the dialog has to be specific. That is a contract on the\n * caller, not something the component can enforce, which is why `message` is a\n * `ReactNode` the caller composes rather than a template this fills in.\n *\n * No confirm timer: a dialog that arms itself makes the operator wait for a\n * decision they were already qualified to make.\n *\n * Both handlers stop propagation, because a confirm that fires twice deletes\n * two things.\n */\nfunction ConfirmDeleteModal({\n message,\n confirmLabel,\n cancelLabel,\n ariaLabel,\n onConfirm,\n onCancel,\n}: {\n /** The full question, naming what will be deleted. */\n message: ReactNode;\n confirmLabel: string;\n cancelLabel: string;\n ariaLabel: string;\n onConfirm: () => void;\n onCancel: () => void;\n}) {\n return (\n <ModalShell onClose={onCancel} widthClass=\"w-80\" ariaLabel={ariaLabel}>\n <div className=\"p-6\">\n <p className=\"text-sm text-[var(--color-text-secondary)] text-center mb-6\">{message}</p>\n <div className=\"flex gap-3\">\n <button\n type=\"button\"\n className=\"flex-1\"\n onClick={(event) => {\n event.stopPropagation();\n onCancel();\n }}\n >\n {cancelLabel}\n </button>\n <button\n type=\"button\"\n className=\"flex-1\"\n onClick={(event) => {\n event.stopPropagation();\n onConfirm();\n }}\n >\n {confirmLabel}\n </button>\n </div>\n </div>\n </ModalShell>\n );\n}\n\nexport { ConfirmDeleteModal, EmptyState, LoadingSpinner };\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ export { Input, Label, Select, Textarea, fieldClass } from './Input';
|
|
|
43
43
|
export type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input';
|
|
44
44
|
export { LoadingButton } from './LoadingButton';
|
|
45
45
|
export type { LoadingButtonProps } from './LoadingButton';
|
|
46
|
+
export { ModalShell } from './ModalShell';
|
|
47
|
+
export type { ModalShellProps } from './ModalShell';
|
|
48
|
+
export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
|
|
46
49
|
export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
|
|
47
50
|
export type { PaginationLabels, PaginationProps } from './Pagination';
|
|
48
51
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACrG,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,12 @@ export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle
|
|
|
37
37
|
export { FocusInput } from './FocusInput';
|
|
38
38
|
export { Input, Label, Select, Textarea, fieldClass } from './Input';
|
|
39
39
|
export { LoadingButton } from './LoadingButton';
|
|
40
|
+
// Converged from the `ModalShell` / `ConfirmDeleteModal` / `PageState` copies
|
|
41
|
+
// that Durable-DAV, Durable-DAV-Router, Mail-Otter and Edge-Git each shipped.
|
|
42
|
+
// Deliberately dependency-free — labels are props, not `useTranslation` — so
|
|
43
|
+
// adopting these does not require a translation library or an icon set.
|
|
44
|
+
export { ModalShell } from './ModalShell';
|
|
45
|
+
export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
|
|
40
46
|
export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
|
|
41
47
|
export { Spinner } from './Spinner';
|
|
42
48
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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,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 { 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 * ## 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\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"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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,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 { 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 * ## 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\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexezuge/web",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@rexezuge/errors": "1.0
|
|
29
|
-
"@rexezuge/shared": "1.0
|
|
28
|
+
"@rexezuge/errors": "1.1.0",
|
|
29
|
+
"@rexezuge/shared": "1.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "^19.3.0",
|