@gnome-ui/react 1.9.0 → 1.9.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.
- 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/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 +130 -0
- package/dist/index.js +4076 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SpinButtonProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
3
|
+
/** Current value. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Called when the value changes. */
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
/** Minimum allowed value. Defaults to `0`. */
|
|
8
|
+
min?: number;
|
|
9
|
+
/** Maximum allowed value. Defaults to `100`. */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** Amount to increment/decrement per step. Defaults to `1`. */
|
|
12
|
+
step?: number;
|
|
13
|
+
/** Number of decimal places shown. Derived from `step` when omitted. */
|
|
14
|
+
decimals?: number;
|
|
15
|
+
/** Disables the control. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Accessible label. Required when no visible `<label>` is associated. */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
/** Associates the control with a visible label element. */
|
|
20
|
+
"aria-labelledby"?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Numeric input with − and + buttons following the Adwaita `GtkSpinButton` style.
|
|
24
|
+
*
|
|
25
|
+
* Supports keyboard interaction: ↑/↓ increment by one step,
|
|
26
|
+
* Page Up/Down increment by 10×, Home/End jump to min/max.
|
|
27
|
+
*
|
|
28
|
+
* @see https://developer.gnome.org/hig/patterns/controls/spin-buttons.html
|
|
29
|
+
*/
|
|
30
|
+
export declare function SpinButton({ value, onChange, min, max, step, decimals, disabled, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: SpinButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SpinRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "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
|
+
/** Current value (controlled). */
|
|
10
|
+
value?: number;
|
|
11
|
+
/** Initial value when uncontrolled. Defaults to `0`. */
|
|
12
|
+
defaultValue?: number;
|
|
13
|
+
/** Called when the value changes. */
|
|
14
|
+
onValueChange?: (value: number) => void;
|
|
15
|
+
/** Minimum allowed value. Defaults to `0`. */
|
|
16
|
+
min?: number;
|
|
17
|
+
/** Maximum allowed value. Defaults to `100`. */
|
|
18
|
+
max?: number;
|
|
19
|
+
/** Amount to increment/decrement per step. Defaults to `1`. */
|
|
20
|
+
step?: number;
|
|
21
|
+
/** Number of decimal places shown. Derived from `step` when omitted. */
|
|
22
|
+
decimals?: number;
|
|
23
|
+
/** Disables the row. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Settings row with an integrated spin button for numeric values.
|
|
28
|
+
*
|
|
29
|
+
* Mirrors `AdwSpinRow` — a standard row layout with − / + buttons at the
|
|
30
|
+
* trailing edge. Use inside a `BoxedList` for settings with numeric ranges
|
|
31
|
+
* (volume, timeout duration, count limits, etc.).
|
|
32
|
+
*
|
|
33
|
+
* Supports both controlled (`value`) and uncontrolled (`defaultValue`) modes.
|
|
34
|
+
*
|
|
35
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SpinRow.html
|
|
36
|
+
*/
|
|
37
|
+
export declare function SpinRow({ title, subtitle, leading, value: controlledValue, defaultValue, onValueChange, min, max, step, decimals, disabled, className, ...props }: SpinRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type SpinnerSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Size of the spinner. Defaults to `"md"`. */
|
|
5
|
+
size?: SpinnerSize;
|
|
6
|
+
/**
|
|
7
|
+
* Accessible label announced by screen readers.
|
|
8
|
+
* Defaults to `"Loading…"`. Set to `""` to silence if a sibling label is present.
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Indeterminate loading indicator following the Adwaita spinner style.
|
|
14
|
+
*
|
|
15
|
+
* Renders a spinning ring using a pure CSS animation that respects
|
|
16
|
+
* `prefers-reduced-motion`.
|
|
17
|
+
*
|
|
18
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html
|
|
19
|
+
*/
|
|
20
|
+
export declare function Spinner({ size, label, className, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SplitButtonVariant = "default" | "suggested" | "destructive";
|
|
3
|
+
export interface SplitButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
4
|
+
/** Label shown in the primary button. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Visual style. Applies to both the primary and toggle halves. */
|
|
7
|
+
variant?: SplitButtonVariant;
|
|
8
|
+
/** Content rendered inside the dropdown panel when the arrow is clicked. */
|
|
9
|
+
dropdownContent: ReactNode;
|
|
10
|
+
/** Accessible label for the dropdown toggle button. Defaults to "More options". */
|
|
11
|
+
dropdownLabel?: string;
|
|
12
|
+
/** Whether both halves are disabled. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Primary action button with an attached dropdown arrow.
|
|
17
|
+
*
|
|
18
|
+
* Clicking the label half fires `onClick`; clicking the arrow half opens a
|
|
19
|
+
* floating panel with `dropdownContent` (menus, options, etc.).
|
|
20
|
+
*
|
|
21
|
+
* Mirrors `AdwSplitButton` — supports `suggested` and `destructive` variants.
|
|
22
|
+
*
|
|
23
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SplitButton.html
|
|
24
|
+
*/
|
|
25
|
+
export declare function SplitButton({ label, variant, dropdownContent, dropdownLabel, disabled, onClick, className, ...props }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { IconDefinition } from '@gnome-ui/icons';
|
|
3
|
+
export interface StatusPageProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Large icon displayed above the title.
|
|
6
|
+
* Use an icon from `@gnome-ui/icons` or omit for a text-only page.
|
|
7
|
+
*/
|
|
8
|
+
icon?: IconDefinition;
|
|
9
|
+
/**
|
|
10
|
+
* Custom icon node. Use when you need an image, emoji, or
|
|
11
|
+
* a rendered SVG that is not part of `@gnome-ui/icons`.
|
|
12
|
+
* Ignored when `icon` is also provided.
|
|
13
|
+
*/
|
|
14
|
+
iconNode?: ReactNode;
|
|
15
|
+
/** Main heading. Keep it short — one noun phrase. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Supporting description rendered below the title. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional action area — typically one or two `<Button>` elements.
|
|
21
|
+
* Rendered below the description.
|
|
22
|
+
*/
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Reduces padding, icon size, and title scale for use in compact
|
|
26
|
+
* contexts such as sidebars, popovers, and small panels.
|
|
27
|
+
* Mirrors the `.compact` style class.
|
|
28
|
+
*/
|
|
29
|
+
compact?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Empty-state / status page following the Adwaita `AdwStatusPage` pattern.
|
|
33
|
+
*
|
|
34
|
+
* Use to fill a view with no content yet, an error state, or a completion
|
|
35
|
+
* confirmation. Centred both horizontally and vertically.
|
|
36
|
+
*
|
|
37
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.StatusPage.html
|
|
38
|
+
* @see https://developer.gnome.org/hig/patterns/feedback/empty-states.html
|
|
39
|
+
*/
|
|
40
|
+
export declare function StatusPage({ icon, iconNode, title, description, children, compact, className, ...props }: StatusPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
3
|
+
/** Accessible label. Required when no visible `<label>` is associated. */
|
|
4
|
+
"aria-label"?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* On/off toggle following the Adwaita switch style.
|
|
8
|
+
*
|
|
9
|
+
* Renders as `<input type="checkbox" role="switch">` so it is natively
|
|
10
|
+
* keyboard-accessible and works with standard form libraries.
|
|
11
|
+
*
|
|
12
|
+
* @see https://developer.gnome.org/hig/patterns/controls/switches.html
|
|
13
|
+
*/
|
|
14
|
+
export declare function Switch({ className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SwitchRowProps 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 switch.
|
|
20
|
+
*
|
|
21
|
+
* The entire row is a button — clicking anywhere toggles the switch.
|
|
22
|
+
* Mirrors `AdwSwitchRow`, which differs from `ActionRow + trailing Switch`
|
|
23
|
+
* because the row itself is the interactive element.
|
|
24
|
+
*
|
|
25
|
+
* Supports both controlled (`checked`) and uncontrolled (`defaultChecked`) modes.
|
|
26
|
+
*
|
|
27
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SwitchRow.html
|
|
28
|
+
*/
|
|
29
|
+
export declare function SwitchRow({ title, subtitle, leading, checked: controlledChecked, defaultChecked, onCheckedChange, disabled, className, onClick, ...props }: SwitchRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TabBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/** Accessible label for the tab list. */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Removes the header-bar background so the tab bar blends into any surface.
|
|
8
|
+
* Use when placing the bar inside a card, content area, or custom container.
|
|
9
|
+
* Mirrors the `.inline` style class.
|
|
10
|
+
*/
|
|
11
|
+
inline?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Horizontal tab bar that holds `TabItem` elements.
|
|
15
|
+
*
|
|
16
|
+
* Manages roving-tabindex keyboard navigation (← → Home End).
|
|
17
|
+
*
|
|
18
|
+
* @see https://developer.gnome.org/hig/patterns/nav/tabs.html
|
|
19
|
+
*/
|
|
20
|
+
export declare function TabBar({ children, className, inline, "aria-label": ariaLabel, ...props }: TabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { IconDefinition } from '@gnome-ui/icons';
|
|
3
|
+
export interface TabItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Tab label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Optional icon from `@gnome-ui/icons`. */
|
|
7
|
+
icon?: IconDefinition;
|
|
8
|
+
/** Marks this tab as the currently selected one. */
|
|
9
|
+
active?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* id of the `TabPanel` this tab controls.
|
|
12
|
+
* Sets `aria-controls` automatically.
|
|
13
|
+
*/
|
|
14
|
+
panelId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When provided, a close (×) button is rendered at the trailing edge.
|
|
17
|
+
* Called when the user clicks the close button.
|
|
18
|
+
*/
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
/** Accessible label for the close button. Defaults to `"Close tab"`. */
|
|
21
|
+
closeLabel?: string;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Individual tab button inside a `TabBar`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function TabItem({ label, icon, active, panelId, onClose, closeLabel, className, disabled, ...props }: TabItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Must match the `panelId` passed to the corresponding `TabItem`. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Controls whether this panel is rendered. */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Content panel associated with a `TabItem`.
|
|
11
|
+
* Hidden panels are kept in the DOM but visually hidden.
|
|
12
|
+
*/
|
|
13
|
+
export declare function TabPanel({ id, active, className, children, ...props }: TabPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TextVariant = "large-title" | "title-1" | "title-2" | "title-3" | "title-4" | "heading" | "body" | "document" | "caption" | "caption-heading" | "monospace" | "numeric";
|
|
3
|
+
export type TextColor = "default" | "dim" | "accent" | "destructive" | "success" | "warning" | "error";
|
|
4
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Typography style. Mirrors Adwaita / GNOME HIG text styles. */
|
|
6
|
+
variant?: TextVariant;
|
|
7
|
+
/** Semantic color. */
|
|
8
|
+
color?: TextColor;
|
|
9
|
+
/** Override the rendered HTML element. */
|
|
10
|
+
as?: ElementType;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Text component following GNOME Human Interface Guidelines typography styles.
|
|
15
|
+
*
|
|
16
|
+
* Variants map directly to Adwaita style classes:
|
|
17
|
+
* `large-title`, `title-1`–`title-4`, `heading`, `body`, `document`,
|
|
18
|
+
* `caption`, `caption-heading`, `monospace`, `numeric`.
|
|
19
|
+
*
|
|
20
|
+
* @see https://developer.gnome.org/hig/guidelines/typography.html
|
|
21
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/style-classes.html
|
|
22
|
+
*/
|
|
23
|
+
export declare function Text({ variant, color, as, className, children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "id"> {
|
|
3
|
+
/** Visible label rendered above the input. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Helper text rendered below the input. Hidden when `error` is set. */
|
|
6
|
+
helperText?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Error message rendered below the input in place of `helperText`.
|
|
9
|
+
* Also applies the error visual state to the input border.
|
|
10
|
+
*/
|
|
11
|
+
error?: string;
|
|
12
|
+
/** Explicit id. Auto-generated when omitted. */
|
|
13
|
+
id?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Single-line text input with label, helper text, and error state.
|
|
17
|
+
*
|
|
18
|
+
* Follows the Adwaita `GtkEntry` / `.entry` style class.
|
|
19
|
+
*
|
|
20
|
+
* @see https://developer.gnome.org/hig/patterns/controls/text-fields.html
|
|
21
|
+
*/
|
|
22
|
+
export declare function TextField({ label, helperText, error, id: idProp, className, disabled, ...props }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
/** The notification message. Keep it short — one sentence. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Auto-dismiss timeout in milliseconds.
|
|
7
|
+
* - Set to `0` to disable auto-dismiss (user must click action or dismiss).
|
|
8
|
+
* - Defaults to `3000`.
|
|
9
|
+
*/
|
|
10
|
+
duration?: number;
|
|
11
|
+
/** Called when the toast should be removed — after timeout or user action. */
|
|
12
|
+
onDismiss?: () => void;
|
|
13
|
+
/** Label for the optional action button. */
|
|
14
|
+
actionLabel?: string;
|
|
15
|
+
/** Called when the user clicks the action button. */
|
|
16
|
+
onAction?: () => void;
|
|
17
|
+
/** Whether to show a manual dismiss (×) button. */
|
|
18
|
+
dismissible?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Non-blocking temporary notification following the Adwaita `AdwToast` pattern.
|
|
22
|
+
*
|
|
23
|
+
* - Auto-dismisses after `duration` ms (default 3 s). Set `duration={0}` to disable.
|
|
24
|
+
* - Timer pauses while the toast is hovered or focused.
|
|
25
|
+
* - Use inside `<Toaster>` for correct positioning and stacking.
|
|
26
|
+
*
|
|
27
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Toast.html
|
|
28
|
+
*/
|
|
29
|
+
export declare function Toast({ title, duration, onDismiss, actionLabel, onAction, dismissible, className, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToasterProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Where to render the toast stack.
|
|
5
|
+
* - `bottom` (default) — bottom-center, following the GNOME HIG.
|
|
6
|
+
* - `top` — top-center.
|
|
7
|
+
*/
|
|
8
|
+
position?: "bottom" | "top";
|
|
9
|
+
/** `<Toast>` elements to display. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* DOM node to render the portal into.
|
|
13
|
+
* Defaults to `document.body`.
|
|
14
|
+
*/
|
|
15
|
+
container?: Element | DocumentFragment;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Fixed-position overlay that stacks `<Toast>` notifications.
|
|
19
|
+
*
|
|
20
|
+
* Renders into a portal (default: `document.body`) so it sits above all
|
|
21
|
+
* other content regardless of where you place it in the React tree.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <Toaster>
|
|
25
|
+
* {toasts.map(t => (
|
|
26
|
+
* <Toast key={t.id} title={t.message} onDismiss={() => remove(t.id)} />
|
|
27
|
+
* ))}
|
|
28
|
+
* </Toaster>
|
|
29
|
+
*/
|
|
30
|
+
export declare function Toaster({ position, children, container, className, ...props }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
interface ToggleGroupContextValue {
|
|
3
|
+
value: string;
|
|
4
|
+
onValueChange: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useToggleGroup(): ToggleGroupContextValue;
|
|
7
|
+
export interface ToggleGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/** Name of the currently active toggle. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Called with the new value when a toggle is selected. */
|
|
11
|
+
onValueChange: (value: string) => void;
|
|
12
|
+
/** Accessible label for the group. */
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Mutually-exclusive group of toggle buttons for in-place option selection.
|
|
18
|
+
*
|
|
19
|
+
* Mirrors `AdwToggleGroup` (libadwaita 1.7 / GNOME 48).
|
|
20
|
+
*
|
|
21
|
+
* Use for formatting controls, view-mode selectors, and toolbar options —
|
|
22
|
+
* wherever a `ViewSwitcher` would be too heavy or is not placed in a HeaderBar.
|
|
23
|
+
*
|
|
24
|
+
* Compose with `ToggleGroupItem`. Keyboard: ← / → cycle, Home / End jump.
|
|
25
|
+
*
|
|
26
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ToggleGroup.html
|
|
27
|
+
*/
|
|
28
|
+
export declare function ToggleGroup({ value, onValueChange, "aria-label": ariaLabel, children, className, ...props }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { IconDefinition } from '@gnome-ui/icons';
|
|
3
|
+
export interface ToggleGroupItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** String identifier — used as the group's `value` when this item is selected. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Visible label. Omit for icon-only items (provide `aria-label` instead). */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Icon from `@gnome-ui/icons`. */
|
|
9
|
+
icon?: IconDefinition;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Individual toggle inside a `ToggleGroup`.
|
|
13
|
+
*
|
|
14
|
+
* Can be icon-only, label-only, or icon + label. For icon-only items always
|
|
15
|
+
* provide an `aria-label` so screen readers can identify the option.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ToggleGroupItem({ name, label, icon, disabled, className, ...props }: ToggleGroupItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SpacerProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Invisible `flex: 1` filler for `Toolbar` and `HeaderBar`.
|
|
6
|
+
*
|
|
7
|
+
* Place between leading and trailing groups to push trailing items to the end.
|
|
8
|
+
* Mirrors `GtkSeparator` with the `.spacer` style class.
|
|
9
|
+
*
|
|
10
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/style-classes.html#spacer
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Toolbar>
|
|
14
|
+
* <Button variant="flat">Back</Button>
|
|
15
|
+
* <Spacer />
|
|
16
|
+
* <Button variant="flat">Done</Button>
|
|
17
|
+
* </Toolbar>
|
|
18
|
+
*/
|
|
19
|
+
export declare function Spacer({ className, ...props }: SpacerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Horizontal action bar following the libadwaita `.toolbar` pattern.
|
|
7
|
+
*
|
|
8
|
+
* Provides 6 px padding and gap — the standard spacing for rows of flat
|
|
9
|
+
* buttons in header bars, action bars, and tool rows. Place `<Spacer />`
|
|
10
|
+
* between leading and trailing groups to push trailing items to the end.
|
|
11
|
+
*
|
|
12
|
+
* Use `<Button variant="flat">` or `<Button variant="raised">` inside:
|
|
13
|
+
* - `flat` for buttons that blend into the bar background.
|
|
14
|
+
* - `raised` for buttons that need explicit elevation within a flat context.
|
|
15
|
+
*
|
|
16
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/style-classes.html#toolbar-style-class
|
|
17
|
+
*/
|
|
18
|
+
export declare function Toolbar({ children, className, ...props }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ToolbarViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Bar(s) pinned to the top — typically a `HeaderBar` or `Toolbar`.
|
|
5
|
+
* Multiple bars stack vertically.
|
|
6
|
+
*/
|
|
7
|
+
topBar?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Bar(s) pinned to the bottom — typically a `Toolbar` or `ViewSwitcherBar`.
|
|
10
|
+
* Multiple bars stack vertically.
|
|
11
|
+
*/
|
|
12
|
+
bottomBar?: ReactNode;
|
|
13
|
+
/** Scrollable content area between the bars. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Layout container that attaches bars at the top and/or bottom while
|
|
18
|
+
* scrolling only the middle content.
|
|
19
|
+
*
|
|
20
|
+
* The top/bottom bars remain fixed; the inner content area gets
|
|
21
|
+
* `overflow-y: auto` so it scrolls independently.
|
|
22
|
+
*
|
|
23
|
+
* Mirrors `AdwToolbarView`.
|
|
24
|
+
*
|
|
25
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ToolbarView.html
|
|
26
|
+
*/
|
|
27
|
+
export declare function ToolbarView({ topBar, bottomBar, children, className, ...props }: ToolbarViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactElement, HTMLAttributes } from 'react';
|
|
2
|
+
export type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/**
|
|
5
|
+
* The tooltip label. Keep it short — a noun phrase or brief description.
|
|
6
|
+
* Do not duplicate information already visible on screen.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Preferred placement relative to the trigger.
|
|
11
|
+
* The tooltip flips automatically if there is not enough space.
|
|
12
|
+
* Defaults to `"top"`.
|
|
13
|
+
*/
|
|
14
|
+
placement?: TooltipPlacement;
|
|
15
|
+
/**
|
|
16
|
+
* Delay in milliseconds before the tooltip appears on hover.
|
|
17
|
+
* Defaults to `500`. Set to `0` for instant.
|
|
18
|
+
*/
|
|
19
|
+
delay?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The element that triggers the tooltip.
|
|
22
|
+
* Must be a single React element that can receive `ref` and event props.
|
|
23
|
+
*/
|
|
24
|
+
children: ReactElement<HTMLAttributes<HTMLElement>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Informational tooltip following the Adwaita / GNOME HIG pattern.
|
|
28
|
+
*
|
|
29
|
+
* Wraps a single trigger element and shows a floating label on hover or
|
|
30
|
+
* keyboard focus. The tooltip is positioned automatically and flips if
|
|
31
|
+
* there is not enough space.
|
|
32
|
+
*
|
|
33
|
+
* - `aria-describedby` is wired to the trigger automatically.
|
|
34
|
+
* - The tooltip itself is `role="tooltip"` and rendered in a portal.
|
|
35
|
+
* - Does not show on touch — touch devices have no hover state.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Tooltip label="Save file (Ctrl+S)">
|
|
39
|
+
* <Button aria-label="Save"><Icon icon={Save} /></Button>
|
|
40
|
+
* </Tooltip>
|
|
41
|
+
*
|
|
42
|
+
* @see https://developer.gnome.org/hig/patterns/feedback/tooltips.html
|
|
43
|
+
*/
|
|
44
|
+
export declare function Tooltip({ label, placement: preferredPlacement, delay, children, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
/** Accessible label for the group. */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Segmented control for switching between major views.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the Adwaita `AdwViewSwitcher` pattern. Place in a `HeaderBar`
|
|
11
|
+
* as the `title` for the canonical GNOME layout.
|
|
12
|
+
*
|
|
13
|
+
* Compose with `ViewSwitcherItem` for each option.
|
|
14
|
+
* Keyboard: ← / → cycle through items, Home / End jump to first / last.
|
|
15
|
+
*
|
|
16
|
+
* @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.ViewSwitcher.html
|
|
17
|
+
* @see https://developer.gnome.org/hig/patterns/nav/view-switchers.html
|
|
18
|
+
*/
|
|
19
|
+
export declare function ViewSwitcher({ children, className, "aria-label": ariaLabel, ...props }: ViewSwitcherProps): import("react/jsx-runtime").JSX.Element;
|