@viglet/viglet-design-system 2026.2.28 → 2026.2.30

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.
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Centralized "is the backend reachable" indicator.
3
+ *
4
+ * - Wrap your app in `<BackendStatusProvider>` (with a health endpoint).
5
+ * - From your axios interceptors, call `reportBackendOffline()` when a request
6
+ * fails with no response, and `reportBackendOnline()` on any success.
7
+ * - The provider polls the health endpoint while offline to detect recovery
8
+ * and renders a sticky banner at the top of the viewport.
9
+ *
10
+ * @since 2026.2.29
11
+ */
12
+ type Status = "online" | "offline" | "checking";
13
+ /** Call from an axios response error handler when `!error.response`. */
14
+ export declare function reportBackendOffline(): void;
15
+ /** Call from an axios response success handler (or after a recovered request). */
16
+ export declare function reportBackendOnline(): void;
17
+ interface BackendStatusContextValue {
18
+ status: Status;
19
+ retry: () => void;
20
+ }
21
+ export declare function useBackendStatus(): BackendStatusContextValue;
22
+ interface BackendStatusProviderProps {
23
+ /** Health endpoint URL polled while offline. Defaults to `/api/v2/ping`. */
24
+ healthEndpoint?: string;
25
+ /** Polling interval in ms while offline. Defaults to 5000. */
26
+ pollInterval?: number;
27
+ /** When true (default), renders the built-in sticky banner. */
28
+ showBanner?: boolean;
29
+ children: React.ReactNode;
30
+ }
31
+ export declare function BackendStatusProvider({ healthEndpoint, pollInterval, showBanner, children, }: Readonly<BackendStatusProviderProps>): import("react/jsx-runtime").JSX.Element;
32
+ export declare function BackendStatusBanner(): import("react/jsx-runtime").JSX.Element | null;
33
+ export {};
34
+ //# sourceMappingURL=backend-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backend-status.d.ts","sourceRoot":"","sources":["../../../src/components/backend-status.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AAEH,KAAK,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AA8BhD,wEAAwE;AACxE,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAID,UAAU,yBAAyB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID,wBAAgB,gBAAgB,IAAI,yBAAyB,CAM5D;AAID,UAAU,0BAA0B;IAClC,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,cAA+B,EAC/B,YAAmB,EACnB,UAAiB,EACjB,QAAQ,GACT,EAAE,QAAQ,CAAC,0BAA0B,CAAC,2CA+BtC;AAID,wBAAgB,mBAAmB,mDAqClC"}
@@ -0,0 +1,35 @@
1
+ import { default as React, ErrorInfo, ReactNode } from 'react';
2
+ /**
3
+ * Top-level boundary that catches React render errors and displays a friendly
4
+ * fallback with a reload button. Logs the stack trace to the console.
5
+ *
6
+ * Usage:
7
+ * ```tsx
8
+ * <ErrorBoundary>
9
+ * <App />
10
+ * </ErrorBoundary>
11
+ * ```
12
+ *
13
+ * @since 2026.2.29
14
+ */
15
+ interface Props {
16
+ children: ReactNode;
17
+ /** Custom fallback. Receives the captured error and a `reset()` callback. */
18
+ fallback?: (props: {
19
+ error: Error;
20
+ reset: () => void;
21
+ }) => ReactNode;
22
+ }
23
+ interface State {
24
+ hasError: boolean;
25
+ error?: Error;
26
+ }
27
+ export declare class ErrorBoundary extends React.Component<Props, State> {
28
+ state: State;
29
+ static getDerivedStateFromError(error: Error): State;
30
+ componentDidCatch(error: Error, info: ErrorInfo): void;
31
+ reset: () => void;
32
+ render(): ReactNode;
33
+ }
34
+ export {};
35
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9D;;;;;;;;;;;;GAYG;AAEH,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,SAAS,CAAC;CACtE;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAuB;IAEnC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAIpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAKtD,KAAK,QAAO,IAAI,CAEd;IAEF,MAAM,IAAI,SAAS;CASpB"}
@@ -2,7 +2,9 @@ export * from './ui';
2
2
  export { AppFooter } from './app-footer';
3
3
  export { BadgeColorful } from './badge-colorful';
4
4
  export { BadgeLocale, getLocaleCountryCode } from './badge-locale';
5
+ export { BackendStatusBanner, BackendStatusProvider, reportBackendOffline, reportBackendOnline, useBackendStatus, } from './backend-status';
5
6
  export { BlankSlate } from './blank-slate';
7
+ export { ErrorBoundary } from './error-boundary';
6
8
  export { DialogDelete, type VigBlockedByItem } from './dialog.delete';
7
9
  export { GridList } from './grid.list';
8
10
  export { InternalSidebar } from './internal.sidebar';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[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105
  openNavigation: string;
106
106
  connectionError: string;
107
107
  };
108
+ backendStatus: {
109
+ offline: string;
110
+ checking: string;
111
+ retry: string;
112
+ };
113
+ errorBoundary: {
114
+ title: string;
115
+ description: string;
116
+ reload: string;
117
+ };
108
118
  };
109
119
  pt: {
110
120
  theme: {
@@ -211,6 +221,16 @@ export declare const vigDesignSystemTranslations: {
211
221
  openNavigation: string;
212
222
  connectionError: string;
213
223
  };
224
+ backendStatus: {
225
+ offline: string;
226
+ checking: string;
227
+ retry: string;
228
+ };
229
+ errorBoundary: {
230
+ title: string;
231
+ description: string;
232
+ reload: string;
233
+ };
214
234
  };
215
235
  };
216
236
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAoB3B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBvC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,0BA+BpF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,OAAO,IAAI,QAWhE;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAoB3B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;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