@efa-one/sdk 1.12.0 → 1.13.1
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/frontend/index.d.ts +3 -3
- package/frontend/index.js +3 -3
- package/frontend/ui/Button.js +1 -1
- package/frontend/ui/DataTable.d.ts +1 -1
- package/frontend/ui/DataTable.js +3 -3
- package/frontend/ui/Dialog.d.ts +3 -1
- package/frontend/ui/Dialog.js +7 -2
- package/frontend/ui/DropdownMenu.js +2 -2
- package/frontend/ui/Input.js +1 -1
- package/frontend/ui/RecordDialog.js +6 -4
- package/frontend/ui/Tooltip.js +1 -1
- package/frontend/ui/index.d.ts +11 -11
- package/frontend/ui/index.js +11 -11
- package/package.json +2 -2
package/frontend/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './ipc';
|
|
2
|
-
export * from './i18n';
|
|
3
|
-
export { default as DevHeader } from './DevHeader';
|
|
1
|
+
export * from './ipc.js';
|
|
2
|
+
export * from './i18n.js';
|
|
3
|
+
export { default as DevHeader } from './DevHeader.js';
|
package/frontend/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './ipc';
|
|
2
|
-
export * from './i18n';
|
|
3
|
-
export { default as DevHeader } from './DevHeader';
|
|
1
|
+
export * from './ipc.js';
|
|
2
|
+
export * from './i18n.js';
|
|
3
|
+
export { default as DevHeader } from './DevHeader.js';
|
package/frontend/ui/Button.js
CHANGED
|
@@ -11,5 +11,5 @@ const sizeClasses = {
|
|
|
11
11
|
md: 'text-sm px-4 py-2 gap-2',
|
|
12
12
|
};
|
|
13
13
|
export function Button({ variant = 'primary', size = 'md', loading = false, disabled, children, className = '', ...props }) {
|
|
14
|
-
return (_jsxs("button", { disabled: disabled || loading, className: `inline-flex items-center justify-center font-medium rounded-
|
|
14
|
+
return (_jsxs("button", { disabled: disabled || loading, className: `inline-flex items-center justify-center font-medium rounded-sm border transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${variantClasses[variant]} ${sizeClasses[size]} ${className}`, ...props, children: [loading && _jsx(Loader2, { className: "w-4 h-4 animate-spin" }), children] }));
|
|
15
15
|
}
|
package/frontend/ui/DataTable.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
|
-
import * as DropdownMenu from './DropdownMenu';
|
|
3
|
+
import * as DropdownMenu from './DropdownMenu.js';
|
|
4
4
|
import { ChevronDown, ChevronUp, ChevronRight, Settings, EyeOff, Filter, RotateCcw, ArrowUp, ArrowDown, Layers, X } from 'lucide-react';
|
|
5
|
-
import { Button } from './Button';
|
|
6
|
-
import { useViewPreferences } from '../viewPreferences';
|
|
5
|
+
import { Button } from './Button.js';
|
|
6
|
+
import { useViewPreferences } from '../viewPreferences.js';
|
|
7
7
|
const GROUP_KEY_SEP = '\x1f';
|
|
8
8
|
const EMPTY_GROUP_LABEL = '– ohne –';
|
|
9
9
|
export const DEFAULT_VIEW_VERSION = 2;
|
package/frontend/ui/Dialog.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ interface DialogProps {
|
|
|
7
7
|
title: string;
|
|
8
8
|
description?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
+
banner?: React.ReactNode;
|
|
10
11
|
footer?: React.ReactNode;
|
|
12
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
|
|
11
13
|
}
|
|
12
|
-
export declare function Dialog({ open, onOpenChange, trigger, title, description, children, footer }: DialogProps): React.JSX.Element;
|
|
14
|
+
export declare function Dialog({ open, onOpenChange, trigger, title, description, children, banner, footer, size }: DialogProps): React.JSX.Element;
|
|
13
15
|
export declare const DialogClose: React.ForwardRefExoticComponent<RadixDialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
16
|
export {};
|
package/frontend/ui/Dialog.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
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
|
-
|
|
5
|
-
|
|
4
|
+
const SIZE_CLASS = {
|
|
5
|
+
sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-lg',
|
|
6
|
+
xl: 'max-w-xl', '2xl': 'max-w-2xl', '3xl': 'max-w-3xl',
|
|
7
|
+
'4xl': 'max-w-4xl', '5xl': 'max-w-5xl',
|
|
8
|
+
};
|
|
9
|
+
export function Dialog({ open, onOpenChange, trigger, title, description, children, banner, footer, size = 'md' }) {
|
|
10
|
+
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 w-full ${SIZE_CLASS[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 }))] })] })] }));
|
|
6
11
|
}
|
|
7
12
|
export const DialogClose = RadixDialog.Close;
|
|
@@ -4,9 +4,9 @@ import * as Radix from '@radix-ui/react-dropdown-menu';
|
|
|
4
4
|
export const Root = Radix.Root;
|
|
5
5
|
export const Trigger = Radix.Trigger;
|
|
6
6
|
export const Portal = Radix.Portal;
|
|
7
|
-
export const Content = React.forwardRef(({ className = '', sideOffset = 4, ...props }, ref) => (_jsx(Radix.Portal, { children: _jsx(Radix.Content, { ref: ref, sideOffset: sideOffset, className: `z-50 min-w-[160px] rounded-
|
|
7
|
+
export const Content = React.forwardRef(({ className = '', sideOffset = 4, ...props }, ref) => (_jsx(Radix.Portal, { children: _jsx(Radix.Content, { ref: ref, sideOffset: sideOffset, className: `z-50 min-w-[160px] max-w-[calc(100vw-2rem)] rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-1 shadow-lg 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 ${className}`, ...props }) })));
|
|
8
8
|
Content.displayName = 'DropdownMenu.Content';
|
|
9
|
-
export const Item = React.forwardRef(({ className = '', variant = 'default', ...props }, ref) => (_jsx(Radix.Item, { ref: ref, className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-
|
|
9
|
+
export const Item = React.forwardRef(({ className = '', variant = 'default', ...props }, ref) => (_jsx(Radix.Item, { ref: ref, className: `flex items-center gap-2 px-3 py-1.5 text-sm rounded-sm cursor-pointer outline-none select-none transition-colors data-[disabled]:opacity-50 data-[disabled]:pointer-events-none ${variant === 'danger'
|
|
10
10
|
? 'text-[var(--color-danger)] data-[highlighted]:bg-[var(--color-surface-raised)]'
|
|
11
11
|
: 'text-[var(--color-text-primary)] data-[highlighted]:bg-[var(--color-surface-raised)]'} ${className}`, ...props })));
|
|
12
12
|
Item.displayName = 'DropdownMenu.Item';
|
package/frontend/ui/Input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export function Input({ className = '', ...props }) {
|
|
3
|
-
return (_jsx("input", { className: `w-full px-3 py-2 border border-[var(--color-border)] rounded-
|
|
3
|
+
return (_jsx("input", { className: `w-full px-3 py-2 border border-[var(--color-border)] rounded-sm text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] transition-colors ${className}`, ...props }));
|
|
4
4
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Pencil } from 'lucide-react';
|
|
4
|
-
import { Dialog, DialogClose } from './Dialog';
|
|
5
|
-
import { Button } from './Button';
|
|
6
|
-
import { Alert } from './Alert';
|
|
4
|
+
import { Dialog, DialogClose } from './Dialog.js';
|
|
5
|
+
import { Button } from './Button.js';
|
|
6
|
+
import { Alert } from './Alert.js';
|
|
7
7
|
export function RecordDialog({ open, onOpenChange, mode: controlledMode, onModeChange, title, readContent, editContent, onSave, saving, saveDisabled, error, onErrorDismiss, labels, }) {
|
|
8
8
|
const [internalMode, setInternalMode] = useState('read');
|
|
9
9
|
const mode = controlledMode ?? internalMode;
|
|
@@ -34,5 +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,
|
|
37
|
+
handleClose(); }, title: title, banner: mode !== 'read' && error
|
|
38
|
+
? _jsx(Alert, { variant: "error", onDismiss: onErrorDismiss, children: error })
|
|
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)] 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 })) }));
|
|
38
40
|
}
|
package/frontend/ui/Tooltip.js
CHANGED
|
@@ -4,5 +4,5 @@ export function TooltipProvider({ children }) {
|
|
|
4
4
|
return _jsx(RadixTooltip.Provider, { children: children });
|
|
5
5
|
}
|
|
6
6
|
export function Tooltip({ content, children, side = 'top', delayDuration = 300 }) {
|
|
7
|
-
return (_jsxs(RadixTooltip.Root, { delayDuration: delayDuration, children: [_jsx(RadixTooltip.Trigger, { asChild: true, children: children }), _jsx(RadixTooltip.Portal, { children: _jsxs(RadixTooltip.Content, { side: side, sideOffset: 6, className: "z-50 rounded-
|
|
7
|
+
return (_jsxs(RadixTooltip.Root, { delayDuration: delayDuration, children: [_jsx(RadixTooltip.Trigger, { asChild: true, children: children }), _jsx(RadixTooltip.Portal, { children: _jsxs(RadixTooltip.Content, { side: side, sideOffset: 6, className: "z-50 rounded-sm border border-[var(--color-border)] bg-[var(--color-surface)] px-3 py-1.5 text-xs text-[var(--color-text-primary)] shadow-md animate-in fade-in-0 zoom-in-95", children: [content, _jsx(RadixTooltip.Arrow, { className: "fill-[var(--color-border)]" })] }) })] }));
|
|
8
8
|
}
|
package/frontend/ui/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { Button } from './Button';
|
|
2
|
-
export { Input } from './Input';
|
|
3
|
-
export { Badge } from './Badge';
|
|
4
|
-
export { Alert, type AlertVariant } from './Alert';
|
|
5
|
-
export { Dialog, DialogClose } from './Dialog';
|
|
6
|
-
export * as DropdownMenu from './DropdownMenu';
|
|
7
|
-
export { Tooltip, TooltipProvider } from './Tooltip';
|
|
8
|
-
export { EmptyState } from './EmptyState';
|
|
9
|
-
export { Skeleton, SkeletonRow } from './Skeleton';
|
|
10
|
-
export { RecordDialog, type RecordDialogMode } from './RecordDialog';
|
|
11
|
-
export { DataTable, DEFAULT_VIEW_VERSION, type ColumnDef, type FilterDef, type DataTableSelectionProps, } from './DataTable';
|
|
1
|
+
export { Button } from './Button.js';
|
|
2
|
+
export { Input } from './Input.js';
|
|
3
|
+
export { Badge } from './Badge.js';
|
|
4
|
+
export { Alert, type AlertVariant } from './Alert.js';
|
|
5
|
+
export { Dialog, DialogClose } from './Dialog.js';
|
|
6
|
+
export * as DropdownMenu from './DropdownMenu.js';
|
|
7
|
+
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
8
|
+
export { EmptyState } from './EmptyState.js';
|
|
9
|
+
export { Skeleton, SkeletonRow } from './Skeleton.js';
|
|
10
|
+
export { RecordDialog, type RecordDialogMode } from './RecordDialog.js';
|
|
11
|
+
export { DataTable, DEFAULT_VIEW_VERSION, type ColumnDef, type FilterDef, type DataTableSelectionProps, } from './DataTable.js';
|
package/frontend/ui/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { Button } from './Button';
|
|
2
|
-
export { Input } from './Input';
|
|
3
|
-
export { Badge } from './Badge';
|
|
4
|
-
export { Alert } from './Alert';
|
|
5
|
-
export { Dialog, DialogClose } from './Dialog';
|
|
6
|
-
export * as DropdownMenu from './DropdownMenu';
|
|
7
|
-
export { Tooltip, TooltipProvider } from './Tooltip';
|
|
8
|
-
export { EmptyState } from './EmptyState';
|
|
9
|
-
export { Skeleton, SkeletonRow } from './Skeleton';
|
|
10
|
-
export { RecordDialog } from './RecordDialog';
|
|
11
|
-
export { DataTable, DEFAULT_VIEW_VERSION, } from './DataTable';
|
|
1
|
+
export { Button } from './Button.js';
|
|
2
|
+
export { Input } from './Input.js';
|
|
3
|
+
export { Badge } from './Badge.js';
|
|
4
|
+
export { Alert } from './Alert.js';
|
|
5
|
+
export { Dialog, DialogClose } from './Dialog.js';
|
|
6
|
+
export * as DropdownMenu from './DropdownMenu.js';
|
|
7
|
+
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
8
|
+
export { EmptyState } from './EmptyState.js';
|
|
9
|
+
export { Skeleton, SkeletonRow } from './Skeleton.js';
|
|
10
|
+
export { RecordDialog } from './RecordDialog.js';
|
|
11
|
+
export { DataTable, DEFAULT_VIEW_VERSION, } from './DataTable.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@efa-one/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.1",
|
|
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",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"clean": "rm -rf backend frontend",
|
|
43
43
|
"build:backend": "tsc -p tsconfig.backend.json",
|
|
44
|
-
"build:frontend": "tsc -p tsconfig.frontend.json && node -
|
|
44
|
+
"build:frontend": "tsc -p tsconfig.frontend.json && node scripts/postbuild-frontend.mjs",
|
|
45
45
|
"build": "npm run clean && npm run build:backend && npm run build:frontend",
|
|
46
46
|
"typecheck": "tsc -p tsconfig.backend.json --noEmit && tsc -p tsconfig.frontend.json --noEmit",
|
|
47
47
|
"test": "vitest run",
|