@gnome-ui/react 1.27.0 → 1.28.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.
@@ -0,0 +1,46 @@
1
+ import { ReactNode } from 'react';
2
+ export interface AboutDialogLink {
3
+ label: string;
4
+ url: string;
5
+ }
6
+ export interface AboutDialogProps {
7
+ /** Whether the dialog is visible. */
8
+ open: boolean;
9
+ /** Called on Escape or close button click. */
10
+ onClose?: () => void;
11
+ /** Application name. */
12
+ applicationName: string;
13
+ /** Icon rendered above the app name. */
14
+ applicationIcon?: ReactNode;
15
+ /** Version string (e.g. `"1.0.0"`). */
16
+ version?: string;
17
+ /** One-sentence description. */
18
+ comments?: string;
19
+ /** Developer or organisation name. */
20
+ developerName?: string;
21
+ /** Application website URL. */
22
+ website?: string;
23
+ /** Label for the website link. Defaults to the URL. */
24
+ websiteLabel?: string;
25
+ /** Developer names shown in the Credits tab. */
26
+ developers?: string[];
27
+ /** Designer names shown in the Credits tab. */
28
+ designers?: string[];
29
+ /** Artist names shown in the Credits tab. */
30
+ artists?: string[];
31
+ /** Copyright notice (e.g. `"© 2024 Jane Smith"`). */
32
+ copyright?: string;
33
+ /** SPDX identifier or short name (e.g. `"GPL-3.0"`). */
34
+ licenseType?: string;
35
+ /** Full license text shown in the Legal tab. */
36
+ licenseText?: string;
37
+ /** Extra links shown in the Details section. */
38
+ links?: AboutDialogLink[];
39
+ }
40
+ /**
41
+ * Standard app info dialog with details, credits, and legal tabs.
42
+ * Mirrors `AdwAboutDialog`.
43
+ *
44
+ * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.AboutDialog.html
45
+ */
46
+ export declare function AboutDialog({ open, onClose, applicationName, applicationIcon, version, comments, developerName, website, websiteLabel, developers, designers, artists, copyright, licenseType, licenseText, links, }: AboutDialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { AboutDialog } from './AboutDialog';
2
+ export type { AboutDialogProps, AboutDialogLink } from './AboutDialog';
@@ -13,10 +13,6 @@ export interface AlertDialogResponse {
13
13
  /** Disables the button. */
14
14
  disabled?: boolean;
15
15
  }
16
- export interface AboutDialogLink {
17
- label: string;
18
- url: string;
19
- }
20
16
  export interface DialogButton {
21
17
  /** Button label. */
22
18
  label: string;
@@ -59,46 +55,10 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
59
55
  * Required when `responses` is provided.
60
56
  */
61
57
  onResponse?: (id: string) => void;
62
- /**
63
- * Set to `"about"` to render as an application info dialog.
64
- * When `variant="about"`, `title`/`buttons`/`children` are ignored in favour
65
- * of the about-specific props below.
66
- */
67
- variant?: "about";
68
- /** Application name (required when `variant="about"`). */
69
- applicationName?: string;
70
- /** Icon rendered above the app name. */
71
- applicationIcon?: ReactNode;
72
- /** Version string (e.g. `"1.0.0"`). */
73
- version?: string;
74
- /** One-sentence description. */
75
- comments?: string;
76
- /** Developer or organisation name. */
77
- developerName?: string;
78
- /** Application website URL. */
79
- website?: string;
80
- /** Label for the website link. Defaults to the URL. */
81
- websiteLabel?: string;
82
- /** Developer names shown in the Credits tab. */
83
- developers?: string[];
84
- /** Designer names shown in the Credits tab. */
85
- designers?: string[];
86
- /** Artist names shown in the Credits tab. */
87
- artists?: string[];
88
- /** Copyright notice (e.g. `"© 2024 Jane Smith"`). */
89
- copyright?: string;
90
- /** SPDX identifier or short name (e.g. `"GPL-3.0"`). */
91
- licenseType?: string;
92
- /** Full license text shown in the Legal tab. */
93
- licenseText?: string;
94
- /** Extra links shown in the Details section. */
95
- links?: AboutDialogLink[];
96
58
  }
97
59
  /**
98
60
  * Blocking modal dialog following the Adwaita pattern.
99
61
  *
100
- * Three modes in one component:
101
- *
102
62
  * **Standard** — `title` + `children` + `buttons[]`.
103
63
  *
104
64
  * **Alert** — add `role="alertdialog"` + `responses[]` + `onResponse`.
@@ -106,14 +66,9 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
106
66
  * Escape / backdrop fire the first non-destructive response.
107
67
  * Mirrors `AdwAlertDialog`.
108
68
  *
109
- * **About** add `variant="about"` + `applicationName` + info props.
110
- * Renders app icon, version, details/credits/legal tabs.
111
- * Mirrors `AdwAboutDialog`.
112
- *
113
- * All modes share the same portal, focus-trap, and card/backdrop styles.
69
+ * For the app-info dialog, use `<AboutDialog />` instead.
114
70
  *
115
71
  * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Dialog.html
116
72
  * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.AlertDialog.html
117
- * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.AboutDialog.html
118
73
  */
119
- export declare function Dialog({ open, title, children, buttons, onClose, closeOnBackdrop, role, responses, onResponse, variant, applicationName, applicationIcon, version, comments, developerName, website, websiteLabel, developers, designers, artists, copyright, licenseType, licenseText, links, className, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element | null;
74
+ export declare function Dialog({ open, title, children, buttons, onClose, closeOnBackdrop, role, responses, onResponse, className, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import { CSSProperties, KeyboardEvent, RefObject } from 'react';
2
+ export declare const FOCUSABLE = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
3
+ /**
4
+ * Returns inline styles that anchor a `position:fixed` backdrop to the visual
5
+ * viewport so the dialog stays centered when the virtual keyboard is open on
6
+ * mobile (iOS Safari / Android Chrome shrink `visualViewport` but not the
7
+ * layout viewport that `position:fixed` is relative to).
8
+ */
9
+ export declare function useVisualViewport(): CSSProperties;
10
+ export declare function trapFocus(e: KeyboardEvent<HTMLDivElement>, ref: RefObject<HTMLDivElement | null>): void;
@@ -1,2 +1,2 @@
1
1
  export { Dialog } from './Dialog';
2
- export type { DialogProps, DialogButton, AlertDialogResponse, AlertDialogResponseVariant, AboutDialogLink, } from './Dialog';
2
+ export type { DialogProps, DialogButton, AlertDialogResponse, AlertDialogResponseVariant, } from './Dialog';