@efa-one/sdk 1.23.0 → 1.24.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
CHANGED
|
@@ -262,6 +262,13 @@ Excel export for such data. No backend or kernel change.
|
|
|
262
262
|
permission lookups time out after 5 s. `isFromPlatformParent` also checks `event.origin`.
|
|
263
263
|
- Peer range `i18next-http-backend >=4.0.2`; DataTable bulk bar says „Auswahl aufheben".
|
|
264
264
|
|
|
265
|
+
**1.24.0 — wider dialogs.** No kernel or backend change.
|
|
266
|
+
- `Dialog` defaults to `size="3xl"` (768 px) instead of `md` (448 px), exported as
|
|
267
|
+
`DEFAULT_DIALOG_SIZE`; on small screens it keeps 1 rem margin on each side.
|
|
268
|
+
- `RecordDialog` takes `size` and uses the same default.
|
|
269
|
+
- After the bump every dialog without `size` is 768 px wide. Give short confirmations
|
|
270
|
+
("Wirklich löschen?") `size="sm"`.
|
|
271
|
+
|
|
265
272
|
**Next minor (planned 1.23.0, not yet released) — exchange, cookie and S2S hardening.**
|
|
266
273
|
Needs a kernel with efaware/efa_kernel#106 and #107 first (gateway exchange token
|
|
267
274
|
`gw: 'app'`, provenance `jti`, cookie filter). Then:
|
package/frontend/ui/Dialog.d.ts
CHANGED
|
@@ -9,8 +9,11 @@ interface DialogProps {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
banner?: React.ReactNode;
|
|
11
11
|
footer?: React.ReactNode;
|
|
12
|
-
size?:
|
|
12
|
+
size?: DialogSize;
|
|
13
13
|
}
|
|
14
|
+
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
|
|
15
|
+
export declare const DEFAULT_DIALOG_SIZE: DialogSize;
|
|
16
|
+
export declare function dialogWidthClass(size?: DialogSize): string;
|
|
14
17
|
export declare function Dialog({ open, onOpenChange, trigger, title, description, children, banner, footer, size }: DialogProps): React.JSX.Element;
|
|
15
18
|
export declare const DialogClose: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
19
|
export {};
|
package/frontend/ui/Dialog.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
import { X } from 'lucide-react';
|
|
4
|
+
export const DEFAULT_DIALOG_SIZE = '3xl';
|
|
4
5
|
const SIZE_CLASS = {
|
|
5
6
|
sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-lg',
|
|
6
7
|
xl: 'max-w-xl', '2xl': 'max-w-2xl', '3xl': 'max-w-3xl',
|
|
7
8
|
'4xl': 'max-w-4xl', '5xl': 'max-w-5xl',
|
|
8
9
|
};
|
|
9
|
-
export function
|
|
10
|
-
return
|
|
10
|
+
export function dialogWidthClass(size = DEFAULT_DIALOG_SIZE) {
|
|
11
|
+
return `w-[calc(100%-2rem)] ${SIZE_CLASS[size]}`;
|
|
12
|
+
}
|
|
13
|
+
export function Dialog({ open, onOpenChange, trigger, title, description, children, banner, footer, size = DEFAULT_DIALOG_SIZE }) {
|
|
14
|
+
return (_jsxs(RadixDialog.Root, { open: open, onOpenChange: onOpenChange, children: [trigger && _jsx(RadixDialog.Trigger, { asChild: true, children: trigger }), _jsxs(RadixDialog.Portal, { children: [_jsx(RadixDialog.Overlay, { className: "fixed inset-0 bg-black/40 z-40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), _jsxs(RadixDialog.Content, { className: `fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50 ${dialogWidthClass(size)} flex flex-col max-h-[90vh] rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] shadow-lg focus:outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`, children: [_jsxs("div", { className: "shrink-0 flex items-start justify-between p-5 border-b border-[var(--color-border)]", children: [_jsxs("div", { children: [_jsx(RadixDialog.Title, { className: "text-base font-semibold text-[var(--color-text-primary)]", children: title }), description && (_jsx(RadixDialog.Description, { className: "text-sm text-[var(--color-text-muted)] mt-0.5", children: description }))] }), _jsx(RadixDialog.Close, { className: "ml-4 p-1 rounded-full text-[var(--color-text-muted)] hover:bg-[var(--color-surface-raised)] hover:text-[var(--color-text-primary)] transition-colors", children: _jsx(X, { className: "w-4 h-4" }) })] }), banner && _jsx("div", { className: "shrink-0 px-5 pt-5", children: banner }), _jsx("div", { className: "min-h-0 overflow-y-auto p-5", children: children }), footer && (_jsx("div", { className: "shrink-0 flex items-center justify-end gap-2 px-5 pb-5", children: footer }))] })] })] }));
|
|
11
15
|
}
|
|
12
16
|
export const DialogClose = RadixDialog.Close;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type DialogSize } from './Dialog.js';
|
|
2
3
|
export type RecordDialogMode = 'read' | 'edit' | 'create';
|
|
3
4
|
interface RecordDialogProps {
|
|
4
5
|
open: {
|
|
@@ -19,6 +20,7 @@ interface RecordDialogProps {
|
|
|
19
20
|
saveDisabled?: boolean;
|
|
20
21
|
error?: string;
|
|
21
22
|
onErrorDismiss?: () => void;
|
|
23
|
+
size?: DialogSize;
|
|
22
24
|
labels?: {
|
|
23
25
|
close?: string;
|
|
24
26
|
cancel?: string;
|
|
@@ -27,5 +29,5 @@ interface RecordDialogProps {
|
|
|
27
29
|
edit?: string;
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
|
-
export declare function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeChange, title, readContent, editContent, onSave, saving, saveDisabled, error, onErrorDismiss, labels, }: RecordDialogProps): React.JSX.Element;
|
|
32
|
+
export declare function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeChange, title, readContent, editContent, onSave, saving, saveDisabled, error, onErrorDismiss, size, labels, }: RecordDialogProps): React.JSX.Element;
|
|
31
33
|
export {};
|
|
@@ -4,7 +4,7 @@ import { Pencil } from 'lucide-react';
|
|
|
4
4
|
import { Dialog, DialogClose } from './Dialog.js';
|
|
5
5
|
import { Button } from './Button.js';
|
|
6
6
|
import { Alert } from './Alert.js';
|
|
7
|
-
export function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeChange, title, readContent, editContent, onSave, saving, saveDisabled, error, onErrorDismiss, labels, }) {
|
|
7
|
+
export function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeChange, title, readContent, editContent, onSave, saving, saveDisabled, error, onErrorDismiss, size, labels, }) {
|
|
8
8
|
const [internalMode, setInternalMode] = useState('read');
|
|
9
9
|
const mode = controlledMode ?? internalMode;
|
|
10
10
|
useEffect(() => {
|
|
@@ -34,7 +34,7 @@ export function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeC
|
|
|
34
34
|
const createLabel = labels?.create ?? 'Erstellen';
|
|
35
35
|
const editLabel = labels?.edit ?? 'Bearbeiten';
|
|
36
36
|
return (_jsx(Dialog, { open: open !== null, onOpenChange: (o) => { if (!o)
|
|
37
|
-
handleClose(); }, title: title, banner: mode !== 'read' && error
|
|
37
|
+
handleClose(); }, title: title, size: size, banner: mode !== 'read' && error
|
|
38
38
|
? _jsx(Alert, { variant: "error", onDismiss: onErrorDismiss, children: error })
|
|
39
39
|
: undefined, footer: mode === 'read' ? (_jsxs(_Fragment, { children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "secondary", children: closeLabel }) }), _jsxs(Button, { onClick: () => setMode('edit'), children: [_jsx(Pencil, { className: "w-4 h-4" }), editLabel] })] })) : (_jsxs(_Fragment, { children: [_jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "secondary", children: cancelLabel }) }), _jsx(Button, { onClick: handleSave, loading: !!saving, disabled: !!saveDisabled, children: mode === 'create' ? createLabel : saveLabel })] })), children: mode === 'read' ? (_jsxs("div", { children: [_jsx("div", { className: "flex justify-end mb-2 -mt-1", children: _jsx("button", { onClick: () => setMode('edit'), className: "p-1.5 rounded-md text-[var(--color-text-muted)] hover:text-[var(--color-primary-text)] hover:bg-[var(--color-surface-raised)] transition-colors", title: editLabel, "aria-label": editLabel, children: _jsx(Pencil, { className: "w-4 h-4" }) }) }), readContent] })) : (_jsx("div", { className: "flex flex-col gap-4", children: editContent })) }));
|
|
40
40
|
}
|
package/frontend/ui/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { Button } from './Button.js';
|
|
|
2
2
|
export { Input } from './Input.js';
|
|
3
3
|
export { Badge } from './Badge.js';
|
|
4
4
|
export { Alert, type AlertVariant } from './Alert.js';
|
|
5
|
-
export { Dialog, DialogClose } from './Dialog.js';
|
|
5
|
+
export { Dialog, DialogClose, DEFAULT_DIALOG_SIZE, type DialogSize } from './Dialog.js';
|
|
6
6
|
export * as DropdownMenu from './DropdownMenu.js';
|
|
7
7
|
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
8
8
|
export { EmptyState } from './EmptyState.js';
|
package/frontend/ui/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { Button } from './Button.js';
|
|
|
2
2
|
export { Input } from './Input.js';
|
|
3
3
|
export { Badge } from './Badge.js';
|
|
4
4
|
export { Alert } from './Alert.js';
|
|
5
|
-
export { Dialog, DialogClose } from './Dialog.js';
|
|
5
|
+
export { Dialog, DialogClose, DEFAULT_DIALOG_SIZE } from './Dialog.js';
|
|
6
6
|
export * as DropdownMenu from './DropdownMenu.js';
|
|
7
7
|
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
8
8
|
export { EmptyState } from './EmptyState.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@efa-one/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Offizielles SDK für efa-one-Apps: Auth/Session, Service-Discovery, Gateway-Client, Audit/Reporting/Mail/Notifications, Permission- und Capability-Registrierung sowie das Frontend-IPC-/i18n-Toolkit.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "commonjs",
|