@airdraft/react-ui 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.28](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.25...react-ui@v0.1.28) (2026-06-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **schema-editor:** add optional custom authorization check for schema mutations ([96d7608](https://github.com/aevrHQ/airdraft/commit/96d760829f97034fd7671e7af4958b06f9c71290))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Code Refactoring
|
|
14
|
+
|
|
15
|
+
* simplify format compatibility checks in checkFormatCompatibility function ([eeb595c](https://github.com/aevrHQ/airdraft/commit/eeb595c8ad981a2b1a387062ada1e35909ba2642))
|
|
16
|
+
|
|
5
17
|
### [0.1.25](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.24...react-ui@v0.1.25) (2026-06-01)
|
|
6
18
|
|
|
7
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorAlert.d.ts","sourceRoot":"","sources":["../../src/components/ErrorAlert.tsx"],"names":[],"mappings":"AAWA,KAAK,SAAS,GAAG,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAA;AAEpE,MAAM,WAAW,eAAe;IAC9B,kGAAkG;IAClG,KAAK,EAAE,SAAS,CAAA;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"ErrorAlert.d.ts","sourceRoot":"","sources":["../../src/components/ErrorAlert.tsx"],"names":[],"mappings":"AAWA,KAAK,SAAS,GAAG,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAA;AAEpE,MAAM,WAAW,eAAe;IAC9B,kGAAkG;IAClG,KAAK,EAAE,SAAS,CAAA;IAChB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAkBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAA8B,EAAE,OAAO,EAAE,OAAe,EAAE,SAAS,EAAE,EAAE,eAAe,2CA8DzH"}
|
|
@@ -4,14 +4,11 @@ import { AlertCircle, RefreshCw } from 'lucide-react';
|
|
|
4
4
|
import { Alert, AlertTitle, AlertDescription, AlertAction } from '../ui/alert.js';
|
|
5
5
|
import { Button } from '../ui/button.js';
|
|
6
6
|
import { cn } from '../lib/utils.js';
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
// Helpers
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
7
|
function toErrorParts(error) {
|
|
11
8
|
if (typeof error === 'string')
|
|
12
9
|
return { message: error };
|
|
13
10
|
const e = error;
|
|
14
|
-
return { message: e.message, code: e.code };
|
|
11
|
+
return { message: e.message, code: e.code, details: e.details };
|
|
15
12
|
}
|
|
16
13
|
// ---------------------------------------------------------------------------
|
|
17
14
|
// ErrorAlert
|
|
@@ -31,10 +28,10 @@ function toErrorParts(error) {
|
|
|
31
28
|
* <ErrorAlert error={mutError} compact />
|
|
32
29
|
*/
|
|
33
30
|
export function ErrorAlert({ error, title = 'Something went wrong', onRetry, compact = false, className }) {
|
|
34
|
-
const { message, code } = toErrorParts(error);
|
|
31
|
+
const { message, code, details } = toErrorParts(error);
|
|
35
32
|
if (compact) {
|
|
36
|
-
return (_jsxs("
|
|
33
|
+
return (_jsxs("div", { className: cn('flex items-start gap-1.5 text-xs text-destructive', className), children: [_jsx(AlertCircle, { className: "mt-px h-3.5 w-3.5 shrink-0" }), _jsxs("span", { children: [code && _jsxs("code", { className: "font-mono mr-1", children: ["[", code, "]"] }), message, details && details.length > 0 && (_jsx("ul", { className: "mt-1 list-disc list-inside space-y-0.5", children: details.map((d, i) => (_jsxs("li", { children: [_jsxs("span", { className: "font-medium", children: [d.field, ":"] }), " ", d.message] }, i))) })), onRetry && (_jsx("button", { type: "button", onClick: onRetry, className: "ml-2 underline hover:no-underline", children: "Retry" }))] })] }));
|
|
37
34
|
}
|
|
38
|
-
return (_jsxs(Alert, { variant: "destructive", className: className, children: [_jsx(AlertCircle, {}), _jsx(AlertTitle, { children: title }), _jsxs(AlertDescription, { children: [code && _jsxs("code", { className: "font-mono text-xs mr-1.5", children: ["[", code, "]"] }), message] }), onRetry && (_jsx(AlertAction, { children: _jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onRetry, className: "h-6 gap-1.5 px-2 text-xs", children: [_jsx(RefreshCw, { className: "h-3 w-3" }), "Retry"] }) }))] }));
|
|
35
|
+
return (_jsxs(Alert, { variant: "destructive", className: className, children: [_jsx(AlertCircle, {}), _jsx(AlertTitle, { children: title }), _jsxs(AlertDescription, { children: [code && _jsxs("code", { className: "font-mono text-xs mr-1.5", children: ["[", code, "]"] }), message, details && details.length > 0 && (_jsx("ul", { className: "mt-1.5 list-disc list-inside space-y-0.5 text-xs", children: details.map((d, i) => (_jsxs("li", { children: [_jsxs("span", { className: "font-medium", children: [d.field, ":"] }), " ", d.message] }, i))) }))] }), onRetry && (_jsx(AlertAction, { children: _jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onRetry, className: "h-6 gap-1.5 px-2 text-xs", children: [_jsx(RefreshCw, { className: "h-3 w-3" }), "Retry"] }) }))] }));
|
|
39
36
|
}
|
|
40
37
|
//# sourceMappingURL=ErrorAlert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../src/components/ErrorAlert.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"ErrorAlert.js","sourceRoot":"","sources":["../../src/components/ErrorAlert.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AA0BpC,SAAS,YAAY,CAAC,KAAgB;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;IACxD,MAAM,CAAC,GAAG,KAAyE,CAAA;IACnF,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CA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