@gnome-ui/react 1.9.0 → 1.10.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/ActionRow/ActionRow.d.ts +37 -0
- package/dist/components/ActionRow/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +34 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +31 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Banner/Banner.d.ts +38 -0
- package/dist/components/Banner/index.d.ts +2 -0
- package/dist/components/Bin/Bin.d.ts +18 -0
- package/dist/components/Bin/index.d.ts +2 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +27 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/BoxedList/BoxedList.d.ts +25 -0
- package/dist/components/BoxedList/index.d.ts +2 -0
- package/dist/components/BreakpointBin/BreakpointBin.d.ts +66 -0
- package/dist/components/BreakpointBin/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +34 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ButtonContent/ButtonContent.d.ts +30 -0
- package/dist/components/ButtonContent/index.d.ts +2 -0
- package/dist/components/ButtonRow/ButtonRow.d.ts +22 -0
- package/dist/components/ButtonRow/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +24 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Carousel/Carousel.d.ts +64 -0
- package/dist/components/Carousel/index.d.ts +2 -0
- package/dist/components/CheckRow/CheckRow.d.ts +28 -0
- package/dist/components/CheckRow/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +22 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Chip/Chip.d.ts +38 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Clamp/Clamp.d.ts +32 -0
- package/dist/components/Clamp/index.d.ts +2 -0
- package/dist/components/ComboRow/ComboRow.d.ts +34 -0
- package/dist/components/ComboRow/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +119 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dropdown/Dropdown.d.ts +36 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/EntryRow/EntryRow.d.ts +24 -0
- package/dist/components/EntryRow/index.d.ts +2 -0
- package/dist/components/ExpanderRow/ExpanderRow.d.ts +35 -0
- package/dist/components/ExpanderRow/index.d.ts +2 -0
- package/dist/components/Footer/Footer.d.ts +23 -0
- package/dist/components/Footer/index.d.ts +2 -0
- package/dist/components/Frame/Frame.d.ts +14 -0
- package/dist/components/Frame/index.d.ts +2 -0
- package/dist/components/HeaderBar/HeaderBar.d.ts +25 -0
- package/dist/components/HeaderBar/index.d.ts +2 -0
- package/dist/components/Icon/Icon.d.ts +30 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/InlineViewSwitcher/InlineViewSwitcher.d.ts +36 -0
- package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.d.ts +17 -0
- package/dist/components/InlineViewSwitcher/index.d.ts +4 -0
- package/dist/components/Link/Link.d.ts +18 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/LinkedGroup/LinkedGroup.d.ts +31 -0
- package/dist/components/LinkedGroup/index.d.ts +2 -0
- package/dist/components/NavigationSplitView/NavigationSplitView.d.ts +55 -0
- package/dist/components/NavigationSplitView/index.d.ts +2 -0
- package/dist/components/NavigationView/NavigationView.d.ts +55 -0
- package/dist/components/NavigationView/index.d.ts +2 -0
- package/dist/components/OverlaySplitView/OverlaySplitView.d.ts +59 -0
- package/dist/components/OverlaySplitView/index.d.ts +2 -0
- package/dist/components/PasswordEntryRow/PasswordEntryRow.d.ts +16 -0
- package/dist/components/PasswordEntryRow/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +50 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/PreferencesDialog/PreferencesDialog.d.ts +43 -0
- package/dist/components/PreferencesDialog/index.d.ts +2 -0
- package/dist/components/PreferencesGroup/PreferencesGroup.d.ts +23 -0
- package/dist/components/PreferencesGroup/index.d.ts +2 -0
- package/dist/components/PreferencesPage/PreferencesPage.d.ts +26 -0
- package/dist/components/PreferencesPage/index.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +24 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +15 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/SearchBar/SearchBar.d.ts +34 -0
- package/dist/components/SearchBar/index.d.ts +2 -0
- package/dist/components/Separator/Separator.d.ts +15 -0
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/ShortcutLabel/ShortcutLabel.d.ts +38 -0
- package/dist/components/ShortcutLabel/index.d.ts +2 -0
- package/dist/components/ShortcutsDialog/ShortcutsDialog.d.ts +37 -0
- package/dist/components/ShortcutsDialog/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +50 -0
- package/dist/components/Sidebar/SidebarItem.d.ts +58 -0
- package/dist/components/Sidebar/SidebarSection.d.ts +32 -0
- package/dist/components/Sidebar/index.d.ts +6 -0
- package/dist/components/Slider/Slider.d.ts +45 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/SpinButton/SpinButton.d.ts +30 -0
- package/dist/components/SpinButton/index.d.ts +2 -0
- package/dist/components/SpinRow/SpinRow.d.ts +37 -0
- package/dist/components/SpinRow/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +20 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/SplitButton/SplitButton.d.ts +25 -0
- package/dist/components/SplitButton/index.d.ts +2 -0
- package/dist/components/StatusPage/StatusPage.d.ts +40 -0
- package/dist/components/StatusPage/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +14 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/SwitchRow/SwitchRow.d.ts +29 -0
- package/dist/components/SwitchRow/index.d.ts +2 -0
- package/dist/components/Tabs/TabBar.d.ts +20 -0
- package/dist/components/Tabs/TabItem.d.ts +27 -0
- package/dist/components/Tabs/TabPanel.d.ts +13 -0
- package/dist/components/Tabs/index.d.ts +6 -0
- package/dist/components/Text/Text.d.ts +23 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextField/TextField.d.ts +22 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +29 -0
- package/dist/components/Toast/Toaster.d.ts +30 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +29 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +17 -0
- package/dist/components/ToggleGroup/index.d.ts +4 -0
- package/dist/components/Toolbar/Spacer.d.ts +19 -0
- package/dist/components/Toolbar/Toolbar.d.ts +18 -0
- package/dist/components/Toolbar/index.d.ts +4 -0
- package/dist/components/ToolbarView/ToolbarView.d.ts +27 -0
- package/dist/components/ToolbarView/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +44 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/ViewSwitcher/ViewSwitcher.d.ts +19 -0
- package/dist/components/ViewSwitcher/ViewSwitcherItem.d.ts +16 -0
- package/dist/components/ViewSwitcher/index.d.ts +4 -0
- package/dist/components/ViewSwitcherBar/ViewSwitcherBar.d.ts +38 -0
- package/dist/components/ViewSwitcherBar/index.d.ts +2 -0
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebar.d.ts +37 -0
- package/dist/components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.d.ts +27 -0
- package/dist/components/ViewSwitcherSidebar/index.d.ts +4 -0
- package/dist/components/WindowTitle/WindowTitle.d.ts +23 -0
- package/dist/components/WindowTitle/index.d.ts +2 -0
- package/dist/components/WrapBox/WrapBox.d.ts +29 -0
- package/dist/components/WrapBox/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useBreakpoint.d.ts +42 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4109 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ActionRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Primary label. */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Secondary line below the title. */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Icon or image placed at the leading edge. */
|
|
8
|
+
leading?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Widget placed at the trailing edge (Switch, Button, Text…).
|
|
11
|
+
* For interactive end widgets prefer a controlled component and stop
|
|
12
|
+
* event propagation inside it so the row's own onClick isn't triggered.
|
|
13
|
+
*/
|
|
14
|
+
trailing?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* When true the entire row becomes clickable (renders as `<button>`).
|
|
17
|
+
* Use for rows that navigate or trigger an action.
|
|
18
|
+
*/
|
|
19
|
+
interactive?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* `"property"` flips the visual hierarchy: the subtitle becomes the
|
|
22
|
+
* prominent value and the title shrinks to a dim label above it.
|
|
23
|
+
* Use for read-only property display (e.g. "OS Version / Ubuntu 24.04").
|
|
24
|
+
* Mirrors the `.property` style class.
|
|
25
|
+
*/
|
|
26
|
+
variant?: "default" | "property";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Standard settings row with title, optional subtitle, and end widget.
|
|
30
|
+
*
|
|
31
|
+
* Mirrors the Adwaita `AdwActionRow` pattern — the fundamental building block
|
|
32
|
+
* inside a `BoxedList`.
|
|
33
|
+
*
|
|
34
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ActionRow.html
|
|
35
|
+
* @see https://developer.gnome.org/hig/patterns/containers.html
|
|
36
|
+
*/
|
|
37
|
+
export declare function ActionRow({ title, subtitle, leading, trailing, interactive, variant, className, ...props }: ActionRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type AvatarSize = "sm" | "md" | "lg" | "xl";
|
|
3
|
+
/**
|
|
4
|
+
* Named color palette for the initials fallback.
|
|
5
|
+
* Mirrors libadwaita's avatar color set.
|
|
6
|
+
*/
|
|
7
|
+
export type AvatarColor = "blue" | "green" | "yellow" | "orange" | "red" | "purple" | "brown" | "teal" | "slate";
|
|
8
|
+
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
/**
|
|
10
|
+
* Full name used to generate initials and — when `color` is omitted —
|
|
11
|
+
* to deterministically pick a background color.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Image URL. When provided the initials fallback is hidden. */
|
|
15
|
+
src?: string;
|
|
16
|
+
/** Alt text for the image. Defaults to `name`. */
|
|
17
|
+
alt?: string;
|
|
18
|
+
/** Size of the avatar. Defaults to `"md"`. */
|
|
19
|
+
size?: AvatarSize;
|
|
20
|
+
/**
|
|
21
|
+
* Override the auto-derived background color for the initials fallback.
|
|
22
|
+
* When omitted a color is derived from `name` via a stable hash.
|
|
23
|
+
*/
|
|
24
|
+
color?: AvatarColor;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Circular avatar with image or initials fallback.
|
|
28
|
+
*
|
|
29
|
+
* Follows the Adwaita `AdwAvatar` pattern — deterministic color from name,
|
|
30
|
+
* up to two initials when no image is supplied.
|
|
31
|
+
*
|
|
32
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Avatar.html
|
|
33
|
+
*/
|
|
34
|
+
export declare function Avatar({ name, src, alt, size, color, className, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BadgeVariant = "accent" | "success" | "warning" | "error" | "neutral";
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Visual style. Defaults to `"accent"`.
|
|
6
|
+
* - `accent` — blue, for counts and highlights.
|
|
7
|
+
* - `success` — green, for positive status.
|
|
8
|
+
* - `warning` — yellow, for cautionary status.
|
|
9
|
+
* - `error` — red, for failures or urgent counts.
|
|
10
|
+
* - `neutral` — gray, for inactive or secondary counts.
|
|
11
|
+
*/
|
|
12
|
+
variant?: BadgeVariant;
|
|
13
|
+
/**
|
|
14
|
+
* When true, renders a small dot with no label — used for unread/online indicators.
|
|
15
|
+
* The `children` are ignored in dot mode.
|
|
16
|
+
*/
|
|
17
|
+
dot?: boolean;
|
|
18
|
+
/** Number or short text to display. Keep to 1–3 characters. */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* When provided, the badge is absolutely positioned over this child element
|
|
22
|
+
* at the top-right corner. The wrapper becomes `position: relative`.
|
|
23
|
+
*/
|
|
24
|
+
anchor?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Counter or status indicator, optionally overlaid on another element.
|
|
28
|
+
*
|
|
29
|
+
* @see https://developer.gnome.org/hig/patterns/feedback/badges.html
|
|
30
|
+
*/
|
|
31
|
+
export declare function Badge({ variant, dot, children, anchor, className, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BannerVariant = "info" | "warning" | "error" | "success";
|
|
3
|
+
export interface BannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Visual emphasis level.
|
|
6
|
+
* - `info` (default) — neutral, accent-colored. Use for tips and notices.
|
|
7
|
+
* - `warning` — yellow. Use for recoverable problems.
|
|
8
|
+
* - `error` — red. Use for failures that need attention.
|
|
9
|
+
* - `success` — green. Use for confirmations.
|
|
10
|
+
*/
|
|
11
|
+
variant?: BannerVariant;
|
|
12
|
+
/** The message text. Keep it short — one or two sentences. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the optional action button placed at the trailing end.
|
|
16
|
+
* When provided, `onAction` should also be supplied.
|
|
17
|
+
*/
|
|
18
|
+
actionLabel?: string;
|
|
19
|
+
/** Called when the user clicks the action button. */
|
|
20
|
+
onAction?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* When true a dismiss (×) button is shown at the trailing edge.
|
|
23
|
+
* Provide `onDismiss` to handle removal from the DOM.
|
|
24
|
+
*/
|
|
25
|
+
dismissible?: boolean;
|
|
26
|
+
/** Called when the user clicks the dismiss button. */
|
|
27
|
+
onDismiss?: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Persistent message strip displayed at the top of a view.
|
|
31
|
+
*
|
|
32
|
+
* Mirrors the Adwaita `AdwBanner` pattern. Use for important information
|
|
33
|
+
* that persists until the user acts or explicitly dismisses it.
|
|
34
|
+
*
|
|
35
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Banner.html
|
|
36
|
+
* @see https://developer.gnome.org/hig/patterns/feedback/banners.html
|
|
37
|
+
*/
|
|
38
|
+
export declare function Banner({ variant, children, actionLabel, onAction, dismissible, onDismiss, className, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface BinProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Single child. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Single-child container with no visual styling.
|
|
8
|
+
*
|
|
9
|
+
* A transparent wrapper that constrains its content to one child while
|
|
10
|
+
* forwarding all HTML div attributes. Useful as a base for custom components
|
|
11
|
+
* that need a neutral container — e.g. to apply layout or size constraints
|
|
12
|
+
* without introducing visual chrome.
|
|
13
|
+
*
|
|
14
|
+
* Mirrors `AdwBin`.
|
|
15
|
+
*
|
|
16
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Bin.html
|
|
17
|
+
*/
|
|
18
|
+
export declare function Bin({ children, ...props }: BinProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface BottomSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
/** Whether the sheet is visible. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Optional heading shown in the drag handle area.
|
|
7
|
+
*/
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** Called when the user dismisses the sheet (Escape or backdrop click). */
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Whether clicking the backdrop closes the sheet.
|
|
14
|
+
* Defaults to `true`.
|
|
15
|
+
*/
|
|
16
|
+
closeOnBackdrop?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Slide-up panel that overlays content from the bottom edge.
|
|
20
|
+
*
|
|
21
|
+
* Mirrors `AdwBottomSheet` (libadwaita 1.6+). Renders into a portal on
|
|
22
|
+
* `document.body`. Traps focus, closes on Escape or backdrop click.
|
|
23
|
+
* The handle bar is decorative — drag-to-close is not implemented.
|
|
24
|
+
*
|
|
25
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.BottomSheet.html
|
|
26
|
+
*/
|
|
27
|
+
export declare function BottomSheet({ open, title, children, onClose, closeOnBackdrop, className, ...props }: BottomSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BoxedListVariant = "default" | "separate";
|
|
3
|
+
export interface BoxedListProps extends HTMLAttributes<HTMLUListElement> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* `"separate"` renders each child as its own standalone rounded card
|
|
7
|
+
* instead of a single joined list — mirrors `.boxed-list-separate`.
|
|
8
|
+
* Use when rows are independent items rather than a continuous group.
|
|
9
|
+
*/
|
|
10
|
+
variant?: BoxedListVariant;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Rounded bordered list — the most common container pattern in GNOME apps.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the Adwaita `.boxed-list` style applied to a `GtkListBox`.
|
|
16
|
+
* Separators between rows are inserted automatically.
|
|
17
|
+
* Each child is wrapped in a `<li>` — use with `ActionRow` or any row-shaped element.
|
|
18
|
+
*
|
|
19
|
+
* Use `variant="separate"` to render each child as its own card, mirroring
|
|
20
|
+
* the `.boxed-list-separate` style class.
|
|
21
|
+
*
|
|
22
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html#boxed-lists-cards
|
|
23
|
+
* @see https://developer.gnome.org/hig/patterns/containers.html
|
|
24
|
+
*/
|
|
25
|
+
export declare function BoxedList({ children, variant, className, ...props }: BoxedListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface BreakpointDefinition {
|
|
3
|
+
/**
|
|
4
|
+
* Identifier for this breakpoint, e.g. `"compact"` or `"narrow"`.
|
|
5
|
+
* Exposed as `data-breakpoint` on the container element for CSS targeting.
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Container width threshold in pixels.
|
|
10
|
+
* This breakpoint becomes active when the container width is ≤ this value.
|
|
11
|
+
*/
|
|
12
|
+
maxWidth: number;
|
|
13
|
+
}
|
|
14
|
+
export interface BreakpointBinState {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the currently active breakpoint, or `null` when the container
|
|
17
|
+
* is wider than all defined breakpoints.
|
|
18
|
+
*/
|
|
19
|
+
activeBreakpoint: string | null;
|
|
20
|
+
/** Current container width in px (from `ResizeObserver`). */
|
|
21
|
+
width: number;
|
|
22
|
+
}
|
|
23
|
+
export interface BreakpointBinProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
24
|
+
/**
|
|
25
|
+
* Breakpoint definitions sorted by `maxWidth` ascending.
|
|
26
|
+
* The active breakpoint is the smallest `maxWidth` ≥ the container's current width.
|
|
27
|
+
*/
|
|
28
|
+
breakpoints: BreakpointDefinition[];
|
|
29
|
+
/**
|
|
30
|
+
* Render prop that receives the current breakpoint state.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <BreakpointBin breakpoints={[{ name: "compact", maxWidth: 400 }]}>
|
|
35
|
+
* {({ activeBreakpoint }) =>
|
|
36
|
+
* activeBreakpoint === "compact" ? <CompactLayout /> : <WideLayout />
|
|
37
|
+
* }
|
|
38
|
+
* </BreakpointBin>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
children: (state: BreakpointBinState) => ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Container that fires layout changes when **its own width** crosses defined
|
|
45
|
+
* thresholds — the CSS container-query equivalent of `AdwBreakpointBin`
|
|
46
|
+
* (libadwaita 1.9 / GNOME 50).
|
|
47
|
+
*
|
|
48
|
+
* Unlike `useBreakpoint` (which watches the viewport), `BreakpointBin` uses
|
|
49
|
+
* `ResizeObserver` to watch the element itself. This makes it composable:
|
|
50
|
+
* the same component can behave differently depending on how much space it
|
|
51
|
+
* is given by its parent, regardless of the viewport size.
|
|
52
|
+
*
|
|
53
|
+
* ### How it works
|
|
54
|
+
* - Breakpoints are evaluated in ascending `maxWidth` order.
|
|
55
|
+
* - The active breakpoint is the first one whose `maxWidth` ≥ the container width.
|
|
56
|
+
* - When no breakpoint matches (container is wider than all), `activeBreakpoint` is `null`.
|
|
57
|
+
* - The active name is set as `data-breakpoint` on the wrapper `<div>` for CSS targeting.
|
|
58
|
+
*
|
|
59
|
+
* ### CSS targeting
|
|
60
|
+
* ```css
|
|
61
|
+
* .myWidget[data-breakpoint="compact"] .layout { flex-direction: column; }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.BreakpointBin.html
|
|
65
|
+
*/
|
|
66
|
+
export declare function BreakpointBin({ breakpoints, children, className, style, ...props }: BreakpointBinProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonVariant = "default" | "suggested" | "destructive" | "flat" | "raised";
|
|
3
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
4
|
+
export type ButtonShape = "default" | "pill" | "circular";
|
|
5
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/** Visual style of the button. Follows GNOME HIG button types. */
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
/** Size of the button. */
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
/** Shape of the button. "pill" for primary actions in open space, "circular" for icon-only buttons. */
|
|
11
|
+
shape?: ButtonShape;
|
|
12
|
+
/**
|
|
13
|
+
* Dark semi-transparent overlay style for buttons placed on top of
|
|
14
|
+
* media or images — mirrors the `.osd` style class.
|
|
15
|
+
*/
|
|
16
|
+
osd?: boolean;
|
|
17
|
+
/** Icon placed before the label. */
|
|
18
|
+
leadingIcon?: ReactNode;
|
|
19
|
+
/** Icon placed after the label. */
|
|
20
|
+
trailingIcon?: ReactNode;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Button component following GNOME Human Interface Guidelines.
|
|
25
|
+
*
|
|
26
|
+
* Variants:
|
|
27
|
+
* - `default` — Standard action, flat appearance with subtle border.
|
|
28
|
+
* - `suggested` — Affirmative/primary action (accent color). Use at most once per view.
|
|
29
|
+
* - `destructive` — Dangerous or irreversible action (red). Use sparingly.
|
|
30
|
+
* - `flat` — No border or background; ideal for header bars and toolbars.
|
|
31
|
+
*
|
|
32
|
+
* @see https://developer.gnome.org/hig/patterns/controls/buttons.html
|
|
33
|
+
*/
|
|
34
|
+
export declare function Button({ variant, size, shape, osd, leadingIcon, trailingIcon, children, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ButtonContentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/** Icon element placed before the label. */
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
/** Text label. */
|
|
6
|
+
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Position of the icon relative to the label.
|
|
9
|
+
* Defaults to `"start"`.
|
|
10
|
+
*/
|
|
11
|
+
iconPosition?: "start" | "end";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Icon + label layout helper for buttons that contain both an icon and text.
|
|
15
|
+
*
|
|
16
|
+
* Pass as the `children` of a `Button` to get the correct Adwaita spacing
|
|
17
|
+
* between the icon and label (4 px gap, icon centred vertically with the text).
|
|
18
|
+
*
|
|
19
|
+
* Mirrors `AdwButtonContent`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Button>
|
|
24
|
+
* <ButtonContent icon={<Icon name="document-save-symbolic" />} label="Save" />
|
|
25
|
+
* </Button>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ButtonContent.html
|
|
29
|
+
*/
|
|
30
|
+
export declare function ButtonContent({ icon, label, iconPosition, className, ...props }: ButtonContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonRowVariant = "default" | "suggested" | "destructive";
|
|
3
|
+
export interface ButtonRowProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Label displayed centered in the row. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Visual style that colours the title text. */
|
|
7
|
+
variant?: ButtonRowVariant;
|
|
8
|
+
/** Icon placed at the leading edge. */
|
|
9
|
+
leading?: ReactNode;
|
|
10
|
+
/** Icon placed at the trailing edge. */
|
|
11
|
+
trailing?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Full-width activatable row styled as a button inside a `BoxedList`.
|
|
15
|
+
*
|
|
16
|
+
* Mirrors `AdwButtonRow` — use when an entire list row should trigger a single
|
|
17
|
+
* action. Prefer `ActionRow` with `interactive` when the row also needs a
|
|
18
|
+
* title/subtitle layout; prefer `ButtonRow` for single-label CTA rows.
|
|
19
|
+
*
|
|
20
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ButtonRow.html
|
|
21
|
+
*/
|
|
22
|
+
export declare function ButtonRow({ title, variant, leading, trailing, className, ...props }: ButtonRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type CardPadding = "none" | "sm" | "md" | "lg";
|
|
3
|
+
export interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* When true the card becomes clickable (Adwaita `.activatable`).
|
|
6
|
+
* Renders as `<button>` by default; override with `as`.
|
|
7
|
+
*/
|
|
8
|
+
interactive?: boolean;
|
|
9
|
+
/** Internal spacing. Defaults to `"md"`. */
|
|
10
|
+
padding?: CardPadding;
|
|
11
|
+
/** Override the rendered HTML element. */
|
|
12
|
+
as?: ElementType;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Card component following the GNOME HIG and Adwaita `.card` style class.
|
|
17
|
+
*
|
|
18
|
+
* Use for grouping related content on an elevated surface.
|
|
19
|
+
* For clickable cards (e.g. grid item, settings shortcut) set `interactive`.
|
|
20
|
+
*
|
|
21
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html
|
|
22
|
+
* @see https://developer.gnome.org/hig/patterns/containers.html
|
|
23
|
+
*/
|
|
24
|
+
export declare function Card({ interactive, padding, as, className, children, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface CarouselIndicatorDotsProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Total number of pages. */
|
|
4
|
+
pages: number;
|
|
5
|
+
/** Zero-based index of the current page. */
|
|
6
|
+
currentPage: number;
|
|
7
|
+
/** Called when the user clicks a dot. */
|
|
8
|
+
onPageSelected?: (index: number) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Dot-style page indicator for `Carousel`.
|
|
12
|
+
* Mirrors `AdwCarouselIndicatorDots`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function CarouselIndicatorDots({ pages, currentPage, onPageSelected, className, ...props }: CarouselIndicatorDotsProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export interface CarouselIndicatorLinesProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** Total number of pages. */
|
|
17
|
+
pages: number;
|
|
18
|
+
/** Zero-based index of the current page. */
|
|
19
|
+
currentPage: number;
|
|
20
|
+
/** Called when the user clicks a line. */
|
|
21
|
+
onPageSelected?: (index: number) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Line-style page indicator for `Carousel`.
|
|
25
|
+
* Mirrors `AdwCarouselIndicatorLines`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function CarouselIndicatorLines({ pages, currentPage, onPageSelected, className, ...props }: CarouselIndicatorLinesProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Scroll orientation.
|
|
32
|
+
* @default "horizontal"
|
|
33
|
+
*/
|
|
34
|
+
orientation?: "horizontal" | "vertical";
|
|
35
|
+
/**
|
|
36
|
+
* Gap between pages in px.
|
|
37
|
+
* @default 0
|
|
38
|
+
*/
|
|
39
|
+
spacing?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Allow infinite looping (wraps around on the last/first page).
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
loop?: boolean;
|
|
45
|
+
/** Called whenever the visible page changes. */
|
|
46
|
+
onPageChanged?: (index: number) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Controlled current page index.
|
|
49
|
+
* When omitted the carousel manages page state internally.
|
|
50
|
+
*/
|
|
51
|
+
page?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Swipeable content carousel.
|
|
55
|
+
*
|
|
56
|
+
* Mirrors `AdwCarousel`. Uses CSS scroll-snapping for smooth, native-feeling
|
|
57
|
+
* page transitions. Supports keyboard navigation (arrow keys) and touch/mouse
|
|
58
|
+
* drag via the browser's native scroll handling.
|
|
59
|
+
*
|
|
60
|
+
* Pair with `CarouselIndicatorDots` or `CarouselIndicatorLines` for pagination UI.
|
|
61
|
+
*
|
|
62
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Carousel.html
|
|
63
|
+
*/
|
|
64
|
+
export declare function Carousel({ children, orientation, spacing, loop, onPageChanged, page: controlledPage, className, ...props }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface CheckRowProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
3
|
+
/** Primary label. */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Secondary line below the title. */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Icon or image placed at the leading edge. */
|
|
8
|
+
leading?: ReactNode;
|
|
9
|
+
/** Controlled checked state. */
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
/** Initial checked state when uncontrolled. Defaults to `false`. */
|
|
12
|
+
defaultChecked?: boolean;
|
|
13
|
+
/** Called when the checked state changes. */
|
|
14
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
15
|
+
/** Disables the row. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Activatable row with an integrated checkbox.
|
|
20
|
+
*
|
|
21
|
+
* The entire row is a button — clicking anywhere toggles the checkbox.
|
|
22
|
+
* Mirrors the `AdwCheckButton`-in-a-row pattern used in list selection contexts.
|
|
23
|
+
*
|
|
24
|
+
* Supports both controlled (`checked`) and uncontrolled (`defaultChecked`) modes.
|
|
25
|
+
*
|
|
26
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.CheckButton.html
|
|
27
|
+
*/
|
|
28
|
+
export declare function CheckRow({ title, subtitle, leading, checked: controlledChecked, defaultChecked, onCheckedChange, disabled, className, onClick, ...props }: CheckRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
3
|
+
/**
|
|
4
|
+
* Indeterminate state — shown when only some children in a group are checked.
|
|
5
|
+
* Takes visual precedence over `checked`.
|
|
6
|
+
*/
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
/** Accessible label. Required when no visible `<label>` is associated. */
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Checkbox for multi-selection, following the GNOME HIG and Adwaita style.
|
|
13
|
+
*
|
|
14
|
+
* Supports three states: unchecked, checked, and indeterminate (mixed).
|
|
15
|
+
* Use `indeterminate` for "select all" controls when only some items are selected.
|
|
16
|
+
*
|
|
17
|
+
* Renders as `<input type="checkbox">` — natively keyboard-accessible and
|
|
18
|
+
* compatible with standard form libraries.
|
|
19
|
+
*
|
|
20
|
+
* @see https://developer.gnome.org/hig/patterns/controls/checkboxes.html
|
|
21
|
+
*/
|
|
22
|
+
export declare function Checkbox({ indeterminate, className, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { IconDefinition } from '@gnome-ui/icons';
|
|
3
|
+
export interface ChipProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Text label displayed inside the chip. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Leading icon from `@gnome-ui/icons`. */
|
|
7
|
+
icon?: IconDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* When provided, renders a remove (×) button and calls this handler.
|
|
10
|
+
* The chip root becomes a `<span>`; only the remove button is interactive.
|
|
11
|
+
*/
|
|
12
|
+
onRemove?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* When true the chip renders as a toggle button.
|
|
15
|
+
* Use `selected` + `onToggle` to control its state.
|
|
16
|
+
*/
|
|
17
|
+
selectable?: boolean;
|
|
18
|
+
/** Active/selected state. Only relevant when `selectable` is true. */
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Called when a selectable chip is clicked.
|
|
22
|
+
* Only relevant when `selectable` is true.
|
|
23
|
+
*/
|
|
24
|
+
onToggle?: () => void;
|
|
25
|
+
/** Disabled state — applies to both selectable chips and the remove button. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compact pill-shaped label for tags, filters, and selection states.
|
|
30
|
+
*
|
|
31
|
+
* Three usage modes:
|
|
32
|
+
* - **Static** — just a visual label (no `onRemove`, no `selectable`).
|
|
33
|
+
* - **Removable** — add `onRemove` to show a × button.
|
|
34
|
+
* - **Selectable** — add `selectable` + `selected` + `onToggle` for toggle behaviour.
|
|
35
|
+
*
|
|
36
|
+
* Pair with `WrapBox` for multi-chip layouts.
|
|
37
|
+
*/
|
|
38
|
+
export declare function Chip({ label, icon, onRemove, selectable, selected, onToggle, disabled, className, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
|