@gnome-ui/react 1.28.0 → 1.29.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/dist/components/AboutDialog/AboutDialog.d.ts +46 -0
- package/dist/components/AboutDialog/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -47
- package/dist/components/Dialog/dialogUtils.d.ts +10 -0
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.d.ts +11 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1101 -1017
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
-
*
|
|
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,
|
|
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,
|
|
2
|
+
export type { DialogProps, DialogButton, AlertDialogResponse, AlertDialogResponseVariant, } from './Dialog';
|
|
@@ -2,6 +2,7 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
interface ViewSwitcherSidebarContextValue {
|
|
3
3
|
value: string;
|
|
4
4
|
onValueChange: (value: string) => void;
|
|
5
|
+
collapsed: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare function useViewSwitcherSidebar(): ViewSwitcherSidebarContextValue;
|
|
7
8
|
export interface ViewSwitcherSidebarProps extends HTMLAttributes<HTMLElement> {
|
|
@@ -11,6 +12,15 @@ export interface ViewSwitcherSidebarProps extends HTMLAttributes<HTMLElement> {
|
|
|
11
12
|
onValueChange: (value: string) => void;
|
|
12
13
|
/** Accessible label for the group. Defaults to `"Views"`. */
|
|
13
14
|
"aria-label"?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When `true`, items render icon-only (labels hidden) and the sidebar
|
|
17
|
+
* shrinks to its compact width. Used by `AdaptiveLayout` on tablet viewports.
|
|
18
|
+
*/
|
|
19
|
+
collapsed?: boolean;
|
|
20
|
+
/** Rendered above the scrollable item list (e.g. user card). */
|
|
21
|
+
header?: ReactNode;
|
|
22
|
+
/** Rendered below the scrollable item list (e.g. collapse toggle). */
|
|
23
|
+
footer?: ReactNode;
|
|
14
24
|
children?: ReactNode;
|
|
15
25
|
}
|
|
16
26
|
/**
|
|
@@ -33,5 +43,5 @@ export interface ViewSwitcherSidebarProps extends HTMLAttributes<HTMLElement> {
|
|
|
33
43
|
* </ViewSwitcherSidebar>
|
|
34
44
|
* ```
|
|
35
45
|
*/
|
|
36
|
-
export declare function ViewSwitcherSidebar({ value, onValueChange, "aria-label": ariaLabel, children, className, ...props }: ViewSwitcherSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function ViewSwitcherSidebar({ value, onValueChange, "aria-label": ariaLabel, collapsed, header, footer, children, className, ...props }: ViewSwitcherSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
37
47
|
export {};
|