@gnome-ui/react 1.40.1 → 1.42.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/README.md +42 -0
- package/dist/components/AvatarRotator/AvatarRotator.cjs +2 -0
- package/dist/components/AvatarRotator/AvatarRotator.cjs.map +1 -0
- package/dist/components/AvatarRotator/AvatarRotator.d.ts +36 -0
- package/dist/components/AvatarRotator/AvatarRotator.js +84 -0
- package/dist/components/AvatarRotator/AvatarRotator.js.map +1 -0
- package/dist/components/AvatarRotator/AvatarRotator.module.css.cjs +2 -0
- package/dist/components/AvatarRotator/AvatarRotator.module.css.cjs.map +1 -0
- package/dist/components/AvatarRotator/AvatarRotator.module.css.js +13 -0
- package/dist/components/AvatarRotator/AvatarRotator.module.css.js.map +1 -0
- package/dist/components/AvatarRotator/index.d.ts +2 -0
- package/dist/components/AvatarRotator.cjs +1 -0
- package/dist/components/AvatarRotator.d.ts +2 -0
- package/dist/components/AvatarRotator.js +2 -0
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.cjs.map +1 -1
- package/dist/components/Chip/Chip.js +19 -19
- package/dist/components/ContributionGraph/ContributionGraph.cjs +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.cjs.map +1 -1
- package/dist/components/ContributionGraph/ContributionGraph.js +108 -117
- package/dist/components/ContributionGraph/ContributionGraph.js.map +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.cjs +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.cjs.map +1 -1
- package/dist/components/CountDownTimer/CountDownTimer.js +37 -28
- package/dist/components/CountDownTimer/CountDownTimer.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +45 -46
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/GnomeProvider/GnomeContext.cjs +2 -0
- package/dist/components/GnomeProvider/GnomeContext.cjs.map +1 -0
- package/dist/components/GnomeProvider/GnomeContext.d.ts +16 -0
- package/dist/components/GnomeProvider/GnomeContext.js +40 -0
- package/dist/components/GnomeProvider/GnomeContext.js.map +1 -0
- package/dist/components/GnomeProvider/GnomeProvider.cjs +2 -0
- package/dist/components/GnomeProvider/GnomeProvider.cjs.map +1 -0
- package/dist/components/GnomeProvider/GnomeProvider.d.ts +24 -0
- package/dist/components/GnomeProvider/GnomeProvider.js +25 -0
- package/dist/components/GnomeProvider/GnomeProvider.js.map +1 -0
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.cjs +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.cjs.map +1 -1
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.js +8 -8
- package/dist/components/NavigationSplitView/NavigationSplitView.module.css.js.map +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.cjs +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.cjs.map +1 -1
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.js +12 -12
- package/dist/components/OverlaySplitView/OverlaySplitView.module.css.js.map +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.cjs.map +1 -1
- package/dist/components/PasswordEntryRow/PasswordEntryRow.js +11 -12
- package/dist/components/PasswordEntryRow/PasswordEntryRow.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.cjs +1 -1
- package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.js +38 -39
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.css.js +2 -2
- package/dist/components/Sidebar/Sidebar.module.css.js.map +1 -1
- package/dist/components/Sidebar/SidebarSection.cjs +1 -1
- package/dist/components/Sidebar/SidebarSection.cjs.map +1 -1
- package/dist/components/Sidebar/SidebarSection.js +41 -42
- package/dist/components/Sidebar/SidebarSection.js.map +1 -1
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.js +18 -18
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +3 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +90 -87
- package/dist/style.css +1 -1
- package/package.json +19 -2
- package/dist/icons/dist/icons/Check.cjs +0 -2
- package/dist/icons/dist/icons/Check.cjs.map +0 -1
- package/dist/icons/dist/icons/Check.js +0 -12
- package/dist/icons/dist/icons/Check.js.map +0 -1
- package/dist/icons/dist/icons/Close.cjs +0 -2
- package/dist/icons/dist/icons/Close.cjs.map +0 -1
- package/dist/icons/dist/icons/Close.js +0 -12
- package/dist/icons/dist/icons/Close.js.map +0 -1
- package/dist/icons/dist/icons/PanDown.cjs +0 -2
- package/dist/icons/dist/icons/PanDown.cjs.map +0 -1
- package/dist/icons/dist/icons/PanDown.js +0 -12
- package/dist/icons/dist/icons/PanDown.js.map +0 -1
- package/dist/icons/dist/icons/PanUp.cjs +0 -2
- package/dist/icons/dist/icons/PanUp.cjs.map +0 -1
- package/dist/icons/dist/icons/PanUp.js +0 -12
- package/dist/icons/dist/icons/PanUp.js.map +0 -1
- package/dist/icons/dist/icons/Search.cjs +0 -2
- package/dist/icons/dist/icons/Search.cjs.map +0 -1
- package/dist/icons/dist/icons/Search.js +0 -12
- package/dist/icons/dist/icons/Search.js.map +0 -1
- package/dist/icons/dist/icons/ViewConceal.cjs +0 -2
- package/dist/icons/dist/icons/ViewConceal.cjs.map +0 -1
- package/dist/icons/dist/icons/ViewConceal.js +0 -12
- package/dist/icons/dist/icons/ViewConceal.js.map +0 -1
- package/dist/icons/dist/icons/ViewReveal.cjs +0 -2
- package/dist/icons/dist/icons/ViewReveal.cjs.map +0 -1
- package/dist/icons/dist/icons/ViewReveal.js +0 -12
- package/dist/icons/dist/icons/ViewReveal.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarSection.cjs","names":[],"sources":["../../../src/components/Sidebar/SidebarSection.tsx"],"sourcesContent":["import {\n forwardRef,\n useImperativeHandle,\n useState,\n useContext,\n useId,\n isValidElement,\n Children,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport type { IconDefinition } from \"@gnome-ui/icons\";\nimport { PanDown, PanUp } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport { useSidebarCollapsed, SidebarFilterContext } from \"./Sidebar\";\nimport styles from \"./Sidebar.module.css\";\n\n// ─── Filter helper ────────────────────────────────────────────────────────────\n\nfunction countMatchingItems(children: ReactNode, filter: string): number {\n let count = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as Record<string, unknown>;\n if (typeof props.label === \"string\") {\n if (props.label.toLowerCase().includes(filter.toLowerCase())) count++;\n } else if (props.children) {\n count += countMatchingItems(props.children as ReactNode, filter);\n }\n });\n return count;\n}\n\n// ─── Handle ───────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionHandle {\n expand: () => void;\n collapse: () => void;\n toggle: () => void;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * Section heading. Rendered in small caps above the items.\n * Omit for an untitled section (e.g. the first group in a sidebar).\n */\n title?: string;\n /** Icon rendered left of the title. Same type as `SidebarItem.icon`. */\n icon?: IconDefinition;\n /** Whether the section body can be toggled open/closed. Defaults to `false`. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` is true. Defaults to `true`. */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n /** Called when open state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Named group of `SidebarItem` entries inside a `Sidebar`.\n *\n * Sections are separated by a thin divider. The title and icon are optional.\n * When `collapsible` is true the body can be toggled via the header button or\n * imperatively via a `ref` (`expand`, `collapse`, `toggle`).\n *\n * In rail (icon-only) mode the body is always visible regardless of open state.\n * When a sidebar filter is active and no children match, the section is hidden.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Sidebar.html\n */\nexport const SidebarSection = forwardRef<SidebarSectionHandle, SidebarSectionProps>(\n function SidebarSection(\n {\n title,\n icon,\n collapsible = false,\n defaultOpen = true,\n open: controlledOpen,\n onOpenChange,\n children,\n className,\n ...props\n },\n ref,\n ) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n const sidebarCollapsed = useSidebarCollapsed();\n const filterValue = useContext(SidebarFilterContext);\n const bodyId = useId();\n\n const setAndNotify = (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n expand: () => setAndNotify(true),\n collapse: () => setAndNotify(false),\n toggle: () => setAndNotify(!open),\n }));\n\n // Hide section entirely when filter is active and no children match\n const hasVisibleChildren =\n filterValue.length === 0 || countMatchingItems(children, filterValue) > 0;\n\n if (!hasVisibleChildren) return null;\n\n // In rail mode the body is always visible\n const isOpen = sidebarCollapsed ? true : open;\n\n const showHeader = !!(title || icon || (collapsible && !sidebarCollapsed));\n\n return (\n <section\n className={[styles.section, className].filter(Boolean).join(\" \")}\n {...props}\n >\n {showHeader && (\n collapsible && !sidebarCollapsed ? (\n <button\n type=\"button\"\n className={styles.sectionHeader}\n onClick={() => setAndNotify(!open)}\n aria-expanded={open}\n aria-controls={bodyId}\n >\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n <span className={styles.sectionChevron}>\n <Icon icon={open ? PanUp : PanDown} size=\"sm\" aria-hidden />\n </span>\n </button>\n ) : (\n <div className={styles.sectionHeader}>\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n </div>\n )\n )}\n\n <div\n id={bodyId}\n className={[\n styles.sectionBody,\n !isOpen ? styles.sectionBodyCollapsed : null,\n ]\n .filter(Boolean)\n .join(\" \")}\n aria-hidden={!isOpen || undefined}\n >\n <div className={styles.sectionBodyInner}>\n <ul role=\"list\" className={styles.list}>\n {children}\n </ul>\n </div>\n </div>\n </section>\n );\n },\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarSection.cjs","names":[],"sources":["../../../src/components/Sidebar/SidebarSection.tsx"],"sourcesContent":["import {\n forwardRef,\n useImperativeHandle,\n useState,\n useContext,\n useId,\n isValidElement,\n Children,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport type { IconDefinition } from \"@gnome-ui/icons\";\nimport { PanDown, PanUp } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport { useSidebarCollapsed, SidebarFilterContext } from \"./Sidebar\";\nimport styles from \"./Sidebar.module.css\";\n\n// ─── Filter helper ────────────────────────────────────────────────────────────\n\nfunction countMatchingItems(children: ReactNode, filter: string): number {\n let count = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as Record<string, unknown>;\n if (typeof props.label === \"string\") {\n if (props.label.toLowerCase().includes(filter.toLowerCase())) count++;\n } else if (props.children) {\n count += countMatchingItems(props.children as ReactNode, filter);\n }\n });\n return count;\n}\n\n// ─── Handle ───────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionHandle {\n expand: () => void;\n collapse: () => void;\n toggle: () => void;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * Section heading. Rendered in small caps above the items.\n * Omit for an untitled section (e.g. the first group in a sidebar).\n */\n title?: string;\n /** Icon rendered left of the title. Same type as `SidebarItem.icon`. */\n icon?: IconDefinition;\n /** Whether the section body can be toggled open/closed. Defaults to `false`. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` is true. Defaults to `true`. */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n /** Called when open state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Named group of `SidebarItem` entries inside a `Sidebar`.\n *\n * Sections are separated by a thin divider. The title and icon are optional.\n * When `collapsible` is true the body can be toggled via the header button or\n * imperatively via a `ref` (`expand`, `collapse`, `toggle`).\n *\n * In rail (icon-only) mode the body is always visible regardless of open state.\n * When a sidebar filter is active and no children match, the section is hidden.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Sidebar.html\n */\nexport const SidebarSection = forwardRef<SidebarSectionHandle, SidebarSectionProps>(\n function SidebarSection(\n {\n title,\n icon,\n collapsible = false,\n defaultOpen = true,\n open: controlledOpen,\n onOpenChange,\n children,\n className,\n ...props\n },\n ref,\n ) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n const sidebarCollapsed = useSidebarCollapsed();\n const filterValue = useContext(SidebarFilterContext);\n const bodyId = useId();\n\n const setAndNotify = (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n expand: () => setAndNotify(true),\n collapse: () => setAndNotify(false),\n toggle: () => setAndNotify(!open),\n }));\n\n // Hide section entirely when filter is active and no children match\n const hasVisibleChildren =\n filterValue.length === 0 || countMatchingItems(children, filterValue) > 0;\n\n if (!hasVisibleChildren) return null;\n\n // In rail mode the body is always visible\n const isOpen = sidebarCollapsed ? true : open;\n\n const showHeader = !!(title || icon || (collapsible && !sidebarCollapsed));\n\n return (\n <section\n className={[styles.section, className].filter(Boolean).join(\" \")}\n {...props}\n >\n {showHeader && (\n collapsible && !sidebarCollapsed ? (\n <button\n type=\"button\"\n className={styles.sectionHeader}\n onClick={() => setAndNotify(!open)}\n aria-expanded={open}\n aria-controls={bodyId}\n >\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n <span className={styles.sectionChevron}>\n <Icon icon={open ? PanUp : PanDown} size=\"sm\" aria-hidden />\n </span>\n </button>\n ) : (\n <div className={styles.sectionHeader}>\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n </div>\n )\n )}\n\n <div\n id={bodyId}\n className={[\n styles.sectionBody,\n !isOpen ? styles.sectionBodyCollapsed : null,\n ]\n .filter(Boolean)\n .join(\" \")}\n aria-hidden={!isOpen || undefined}\n >\n <div className={styles.sectionBodyInner}>\n <ul role=\"list\" className={styles.list}>\n {children}\n </ul>\n </div>\n </div>\n </section>\n );\n },\n);\n"],"mappings":"wLAmBA,SAAS,EAAmB,EAAqB,EAAwB,CACvE,IAAI,EAAQ,EAUZ,OATA,EAAA,SAAS,QAAQ,EAAW,GAAU,CACpC,GAAI,EAAA,EAAA,EAAA,gBAAgB,EAAM,CAAE,OAC5B,IAAM,EAAQ,EAAM,MAChB,OAAO,EAAM,OAAU,SACrB,EAAM,MAAM,aAAa,CAAC,SAAS,EAAO,aAAa,CAAC,EAAE,IACrD,EAAM,WACf,GAAS,EAAmB,EAAM,SAAuB,EAAO,GAElE,CACK,EA8CT,IAAa,GAAA,EAAA,EAAA,YACX,SACE,CACE,QACA,OACA,cAAc,GACd,cAAc,GACd,KAAM,EACN,eACA,WACA,YACA,GAAG,GAEL,EACA,CACA,GAAM,CAAC,EAAc,IAAA,EAAA,EAAA,UAA4B,EAAY,CACvD,EAAe,IAAmB,IAAA,GAClC,EAAO,EAAe,EAAiB,EAEvC,EAAmB,EAAA,qBAAqB,CACxC,GAAA,EAAA,EAAA,YAAyB,EAAA,qBAAqB,CAC9C,GAAA,EAAA,EAAA,QAAgB,CAEhB,EAAgB,GAAkB,CACjC,GAAc,EAAgB,EAAK,CACxC,IAAe,EAAK,EAatB,IAVA,EAAA,EAAA,qBAAoB,OAAY,CAC9B,WAAc,EAAa,GAAK,CAChC,aAAgB,EAAa,GAAM,CACnC,WAAc,EAAa,CAAC,EAAK,CAClC,EAAE,CAMC,EAFF,EAAY,SAAW,GAAK,EAAmB,EAAU,EAAY,CAAG,GAEjD,OAAO,KAGhC,IAAM,EAAS,EAAmB,GAAO,EAEnC,EAAa,CAAC,EAAE,GAAS,GAAS,GAAe,CAAC,GAExD,OACE,EAAA,EAAA,MAAC,UAAD,CACE,UAAW,CAAC,EAAA,QAAO,QAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,CAChE,GAAI,WAFN,CAIG,IACC,GAAe,CAAC,GACd,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,cAClB,YAAe,EAAa,CAAC,EAAK,CAClC,gBAAe,EACf,gBAAe,WALjB,CAOG,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,4BACtB,EAAA,EAAA,KAAC,EAAA,KAAD,CAAY,OAAM,KAAK,KAAK,cAAA,GAAc,CAAA,CACrC,CAAA,CAER,IAAS,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,sBAAe,EAAa,CAAA,EAC9D,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,yBACtB,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAM,EAAO,EAAA,MAAQ,EAAA,QAAS,KAAK,KAAK,cAAA,GAAc,CAAA,CACvD,CAAA,CACA,IAET,EAAA,EAAA,MAAC,MAAD,CAAK,UAAW,EAAA,QAAO,uBAAvB,CACG,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,4BACtB,EAAA,EAAA,KAAC,EAAA,KAAD,CAAY,OAAM,KAAK,KAAK,cAAA,GAAc,CAAA,CACrC,CAAA,CAER,IAAS,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,sBAAe,EAAa,CAAA,CAC1D,KAIV,EAAA,EAAA,KAAC,MAAD,CACE,GAAI,EACJ,UAAW,CACT,EAAA,QAAO,YACN,EAAuC,KAA9B,EAAA,QAAO,qBAClB,CACE,OAAO,QAAQ,CACf,KAAK,IAAI,CACZ,cAAa,CAAC,GAAU,IAAA,aAExB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,QAAO,2BACrB,EAAA,EAAA,KAAC,KAAD,CAAI,KAAK,OAAO,UAAW,EAAA,QAAO,KAC/B,WACE,CAAA,CACD,CAAA,CACF,CAAA,CACE,IAGf"}
|
|
@@ -1,82 +1,81 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import t from "./Sidebar.module.css.js";
|
|
3
|
+
import { SidebarFilterContext as n, useSidebarCollapsed as r } from "./Sidebar.js";
|
|
4
|
+
import { Children as i, forwardRef as a, isValidElement as o, useContext as s, useId as c, useImperativeHandle as l, useState as u } from "react";
|
|
5
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import { PanDown as p, PanUp as m } from "@gnome-ui/icons";
|
|
8
7
|
//#region src/components/Sidebar/SidebarSection.tsx
|
|
9
8
|
function h(e, t) {
|
|
10
9
|
let n = 0;
|
|
11
|
-
return
|
|
12
|
-
if (!
|
|
10
|
+
return i.forEach(e, (e) => {
|
|
11
|
+
if (!o(e)) return;
|
|
13
12
|
let r = e.props;
|
|
14
13
|
typeof r.label == "string" ? r.label.toLowerCase().includes(t.toLowerCase()) && n++ : r.children && (n += h(r.children, t));
|
|
15
14
|
}), n;
|
|
16
15
|
}
|
|
17
|
-
var g =
|
|
18
|
-
let [C, w] =
|
|
16
|
+
var g = a(function({ title: i, icon: a, collapsible: o = !1, defaultOpen: g = !0, open: _, onOpenChange: v, children: y, className: b, ...x }, S) {
|
|
17
|
+
let [C, w] = u(g), T = _ !== void 0, E = T ? _ : C, D = r(), O = s(n), k = c(), A = (e) => {
|
|
19
18
|
T || w(e), v?.(e);
|
|
20
19
|
};
|
|
21
|
-
if (
|
|
20
|
+
if (l(S, () => ({
|
|
22
21
|
expand: () => A(!0),
|
|
23
22
|
collapse: () => A(!1),
|
|
24
23
|
toggle: () => A(!E)
|
|
25
24
|
})), !(O.length === 0 || h(y, O) > 0)) return null;
|
|
26
|
-
let j = D ? !0 : E, M = !!(
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
className: [
|
|
25
|
+
let j = D ? !0 : E, M = !!(i || a || o && !D);
|
|
26
|
+
return /* @__PURE__ */ f("section", {
|
|
27
|
+
className: [t.section, b].filter(Boolean).join(" "),
|
|
29
28
|
...x,
|
|
30
|
-
children: [M && (
|
|
29
|
+
children: [M && (o && !D ? /* @__PURE__ */ f("button", {
|
|
31
30
|
type: "button",
|
|
32
|
-
className:
|
|
31
|
+
className: t.sectionHeader,
|
|
33
32
|
onClick: () => A(!E),
|
|
34
33
|
"aria-expanded": E,
|
|
35
34
|
"aria-controls": k,
|
|
36
35
|
children: [
|
|
37
|
-
|
|
38
|
-
className:
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
icon:
|
|
36
|
+
a && /* @__PURE__ */ d("span", {
|
|
37
|
+
className: t.sectionHeaderIcon,
|
|
38
|
+
children: /* @__PURE__ */ d(e, {
|
|
39
|
+
icon: a,
|
|
41
40
|
size: "sm",
|
|
42
41
|
"aria-hidden": !0
|
|
43
42
|
})
|
|
44
43
|
}),
|
|
45
|
-
|
|
46
|
-
className:
|
|
47
|
-
children:
|
|
44
|
+
i && /* @__PURE__ */ d("span", {
|
|
45
|
+
className: t.sectionTitle,
|
|
46
|
+
children: i
|
|
48
47
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className:
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
icon: E ?
|
|
48
|
+
/* @__PURE__ */ d("span", {
|
|
49
|
+
className: t.sectionChevron,
|
|
50
|
+
children: /* @__PURE__ */ d(e, {
|
|
51
|
+
icon: E ? m : p,
|
|
53
52
|
size: "sm",
|
|
54
53
|
"aria-hidden": !0
|
|
55
54
|
})
|
|
56
55
|
})
|
|
57
56
|
]
|
|
58
|
-
}) : /* @__PURE__ */
|
|
59
|
-
className:
|
|
60
|
-
children: [
|
|
61
|
-
className:
|
|
62
|
-
children: /* @__PURE__ */
|
|
63
|
-
icon:
|
|
57
|
+
}) : /* @__PURE__ */ f("div", {
|
|
58
|
+
className: t.sectionHeader,
|
|
59
|
+
children: [a && /* @__PURE__ */ d("span", {
|
|
60
|
+
className: t.sectionHeaderIcon,
|
|
61
|
+
children: /* @__PURE__ */ d(e, {
|
|
62
|
+
icon: a,
|
|
64
63
|
size: "sm",
|
|
65
64
|
"aria-hidden": !0
|
|
66
65
|
})
|
|
67
|
-
}),
|
|
68
|
-
className:
|
|
69
|
-
children:
|
|
66
|
+
}), i && /* @__PURE__ */ d("span", {
|
|
67
|
+
className: t.sectionTitle,
|
|
68
|
+
children: i
|
|
70
69
|
})]
|
|
71
|
-
})), /* @__PURE__ */
|
|
70
|
+
})), /* @__PURE__ */ d("div", {
|
|
72
71
|
id: k,
|
|
73
|
-
className: [
|
|
72
|
+
className: [t.sectionBody, j ? null : t.sectionBodyCollapsed].filter(Boolean).join(" "),
|
|
74
73
|
"aria-hidden": !j || void 0,
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
className:
|
|
77
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ d("div", {
|
|
75
|
+
className: t.sectionBodyInner,
|
|
76
|
+
children: /* @__PURE__ */ d("ul", {
|
|
78
77
|
role: "list",
|
|
79
|
-
className:
|
|
78
|
+
className: t.list,
|
|
80
79
|
children: y
|
|
81
80
|
})
|
|
82
81
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarSection.js","names":[],"sources":["../../../src/components/Sidebar/SidebarSection.tsx"],"sourcesContent":["import {\n forwardRef,\n useImperativeHandle,\n useState,\n useContext,\n useId,\n isValidElement,\n Children,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport type { IconDefinition } from \"@gnome-ui/icons\";\nimport { PanDown, PanUp } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport { useSidebarCollapsed, SidebarFilterContext } from \"./Sidebar\";\nimport styles from \"./Sidebar.module.css\";\n\n// ─── Filter helper ────────────────────────────────────────────────────────────\n\nfunction countMatchingItems(children: ReactNode, filter: string): number {\n let count = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as Record<string, unknown>;\n if (typeof props.label === \"string\") {\n if (props.label.toLowerCase().includes(filter.toLowerCase())) count++;\n } else if (props.children) {\n count += countMatchingItems(props.children as ReactNode, filter);\n }\n });\n return count;\n}\n\n// ─── Handle ───────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionHandle {\n expand: () => void;\n collapse: () => void;\n toggle: () => void;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * Section heading. Rendered in small caps above the items.\n * Omit for an untitled section (e.g. the first group in a sidebar).\n */\n title?: string;\n /** Icon rendered left of the title. Same type as `SidebarItem.icon`. */\n icon?: IconDefinition;\n /** Whether the section body can be toggled open/closed. Defaults to `false`. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` is true. Defaults to `true`. */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n /** Called when open state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Named group of `SidebarItem` entries inside a `Sidebar`.\n *\n * Sections are separated by a thin divider. The title and icon are optional.\n * When `collapsible` is true the body can be toggled via the header button or\n * imperatively via a `ref` (`expand`, `collapse`, `toggle`).\n *\n * In rail (icon-only) mode the body is always visible regardless of open state.\n * When a sidebar filter is active and no children match, the section is hidden.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Sidebar.html\n */\nexport const SidebarSection = forwardRef<SidebarSectionHandle, SidebarSectionProps>(\n function SidebarSection(\n {\n title,\n icon,\n collapsible = false,\n defaultOpen = true,\n open: controlledOpen,\n onOpenChange,\n children,\n className,\n ...props\n },\n ref,\n ) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n const sidebarCollapsed = useSidebarCollapsed();\n const filterValue = useContext(SidebarFilterContext);\n const bodyId = useId();\n\n const setAndNotify = (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n expand: () => setAndNotify(true),\n collapse: () => setAndNotify(false),\n toggle: () => setAndNotify(!open),\n }));\n\n // Hide section entirely when filter is active and no children match\n const hasVisibleChildren =\n filterValue.length === 0 || countMatchingItems(children, filterValue) > 0;\n\n if (!hasVisibleChildren) return null;\n\n // In rail mode the body is always visible\n const isOpen = sidebarCollapsed ? true : open;\n\n const showHeader = !!(title || icon || (collapsible && !sidebarCollapsed));\n\n return (\n <section\n className={[styles.section, className].filter(Boolean).join(\" \")}\n {...props}\n >\n {showHeader && (\n collapsible && !sidebarCollapsed ? (\n <button\n type=\"button\"\n className={styles.sectionHeader}\n onClick={() => setAndNotify(!open)}\n aria-expanded={open}\n aria-controls={bodyId}\n >\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n <span className={styles.sectionChevron}>\n <Icon icon={open ? PanUp : PanDown} size=\"sm\" aria-hidden />\n </span>\n </button>\n ) : (\n <div className={styles.sectionHeader}>\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n </div>\n )\n )}\n\n <div\n id={bodyId}\n className={[\n styles.sectionBody,\n !isOpen ? styles.sectionBodyCollapsed : null,\n ]\n .filter(Boolean)\n .join(\" \")}\n aria-hidden={!isOpen || undefined}\n >\n <div className={styles.sectionBodyInner}>\n <ul role=\"list\" className={styles.list}>\n {children}\n </ul>\n </div>\n </div>\n </section>\n );\n },\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarSection.js","names":[],"sources":["../../../src/components/Sidebar/SidebarSection.tsx"],"sourcesContent":["import {\n forwardRef,\n useImperativeHandle,\n useState,\n useContext,\n useId,\n isValidElement,\n Children,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport type { IconDefinition } from \"@gnome-ui/icons\";\nimport { PanDown, PanUp } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport { useSidebarCollapsed, SidebarFilterContext } from \"./Sidebar\";\nimport styles from \"./Sidebar.module.css\";\n\n// ─── Filter helper ────────────────────────────────────────────────────────────\n\nfunction countMatchingItems(children: ReactNode, filter: string): number {\n let count = 0;\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as Record<string, unknown>;\n if (typeof props.label === \"string\") {\n if (props.label.toLowerCase().includes(filter.toLowerCase())) count++;\n } else if (props.children) {\n count += countMatchingItems(props.children as ReactNode, filter);\n }\n });\n return count;\n}\n\n// ─── Handle ───────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionHandle {\n expand: () => void;\n collapse: () => void;\n toggle: () => void;\n}\n\n// ─── Props ────────────────────────────────────────────────────────────────────\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * Section heading. Rendered in small caps above the items.\n * Omit for an untitled section (e.g. the first group in a sidebar).\n */\n title?: string;\n /** Icon rendered left of the title. Same type as `SidebarItem.icon`. */\n icon?: IconDefinition;\n /** Whether the section body can be toggled open/closed. Defaults to `false`. */\n collapsible?: boolean;\n /** Initial open state when `collapsible` is true. Defaults to `true`. */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n /** Called when open state changes. */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/**\n * Named group of `SidebarItem` entries inside a `Sidebar`.\n *\n * Sections are separated by a thin divider. The title and icon are optional.\n * When `collapsible` is true the body can be toggled via the header button or\n * imperatively via a `ref` (`expand`, `collapse`, `toggle`).\n *\n * In rail (icon-only) mode the body is always visible regardless of open state.\n * When a sidebar filter is active and no children match, the section is hidden.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Sidebar.html\n */\nexport const SidebarSection = forwardRef<SidebarSectionHandle, SidebarSectionProps>(\n function SidebarSection(\n {\n title,\n icon,\n collapsible = false,\n defaultOpen = true,\n open: controlledOpen,\n onOpenChange,\n children,\n className,\n ...props\n },\n ref,\n ) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n const sidebarCollapsed = useSidebarCollapsed();\n const filterValue = useContext(SidebarFilterContext);\n const bodyId = useId();\n\n const setAndNotify = (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n useImperativeHandle(ref, () => ({\n expand: () => setAndNotify(true),\n collapse: () => setAndNotify(false),\n toggle: () => setAndNotify(!open),\n }));\n\n // Hide section entirely when filter is active and no children match\n const hasVisibleChildren =\n filterValue.length === 0 || countMatchingItems(children, filterValue) > 0;\n\n if (!hasVisibleChildren) return null;\n\n // In rail mode the body is always visible\n const isOpen = sidebarCollapsed ? true : open;\n\n const showHeader = !!(title || icon || (collapsible && !sidebarCollapsed));\n\n return (\n <section\n className={[styles.section, className].filter(Boolean).join(\" \")}\n {...props}\n >\n {showHeader && (\n collapsible && !sidebarCollapsed ? (\n <button\n type=\"button\"\n className={styles.sectionHeader}\n onClick={() => setAndNotify(!open)}\n aria-expanded={open}\n aria-controls={bodyId}\n >\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n <span className={styles.sectionChevron}>\n <Icon icon={open ? PanUp : PanDown} size=\"sm\" aria-hidden />\n </span>\n </button>\n ) : (\n <div className={styles.sectionHeader}>\n {icon && (\n <span className={styles.sectionHeaderIcon}>\n <Icon icon={icon} size=\"sm\" aria-hidden />\n </span>\n )}\n {title && <span className={styles.sectionTitle}>{title}</span>}\n </div>\n )\n )}\n\n <div\n id={bodyId}\n className={[\n styles.sectionBody,\n !isOpen ? styles.sectionBodyCollapsed : null,\n ]\n .filter(Boolean)\n .join(\" \")}\n aria-hidden={!isOpen || undefined}\n >\n <div className={styles.sectionBodyInner}>\n <ul role=\"list\" className={styles.list}>\n {children}\n </ul>\n </div>\n </div>\n </section>\n );\n },\n);\n"],"mappings":";;;;;;;AAmBA,SAAS,EAAmB,GAAqB,GAAwB;CACvE,IAAI,IAAQ;AAUZ,QATA,EAAS,QAAQ,IAAW,MAAU;AACpC,MAAI,CAAC,EAAe,EAAM,CAAE;EAC5B,IAAM,IAAQ,EAAM;AACpB,EAAI,OAAO,EAAM,SAAU,WACrB,EAAM,MAAM,aAAa,CAAC,SAAS,EAAO,aAAa,CAAC,IAAE,MACrD,EAAM,aACf,KAAS,EAAmB,EAAM,UAAuB,EAAO;GAElE,EACK;;AA8CT,IAAa,IAAiB,EAC5B,SACE,EACE,UACA,SACA,iBAAc,IACd,iBAAc,IACd,MAAM,GACN,iBACA,aACA,cACA,GAAG,KAEL,GACA;CACA,IAAM,CAAC,GAAc,KAAmB,EAAS,EAAY,EACvD,IAAe,MAAmB,KAAA,GAClC,IAAO,IAAe,IAAiB,GAEvC,IAAmB,GAAqB,EACxC,IAAc,EAAW,EAAqB,EAC9C,IAAS,GAAO,EAEhB,KAAgB,MAAkB;AAEtC,EADK,KAAc,EAAgB,EAAK,EACxC,IAAe,EAAK;;AAatB,KAVA,EAAoB,UAAY;EAC9B,cAAc,EAAa,GAAK;EAChC,gBAAgB,EAAa,GAAM;EACnC,cAAc,EAAa,CAAC,EAAK;EAClC,EAAE,EAMC,EAFF,EAAY,WAAW,KAAK,EAAmB,GAAU,EAAY,GAAG,GAEjD,QAAO;CAGhC,IAAM,IAAS,IAAmB,KAAO,GAEnC,IAAa,CAAC,EAAE,KAAS,KAAS,KAAe,CAAC;AAExD,QACE,kBAAC,WAAD;EACE,WAAW,CAAC,EAAO,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,GAAI;YAFN,CAIG,MACC,KAAe,CAAC,IACd,kBAAC,UAAD;GACE,MAAK;GACL,WAAW,EAAO;GAClB,eAAe,EAAa,CAAC,EAAK;GAClC,iBAAe;GACf,iBAAe;aALjB;IAOG,KACC,kBAAC,QAAD;KAAM,WAAW,EAAO;eACtB,kBAAC,GAAD;MAAY;MAAM,MAAK;MAAK,eAAA;MAAc,CAAA;KACrC,CAAA;IAER,KAAS,kBAAC,QAAD;KAAM,WAAW,EAAO;eAAe;KAAa,CAAA;IAC9D,kBAAC,QAAD;KAAM,WAAW,EAAO;eACtB,kBAAC,GAAD;MAAM,MAAM,IAAO,IAAQ;MAAS,MAAK;MAAK,eAAA;MAAc,CAAA;KACvD,CAAA;IACA;OAET,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAvB,CACG,KACC,kBAAC,QAAD;IAAM,WAAW,EAAO;cACtB,kBAAC,GAAD;KAAY;KAAM,MAAK;KAAK,eAAA;KAAc,CAAA;IACrC,CAAA,EAER,KAAS,kBAAC,QAAD;IAAM,WAAW,EAAO;cAAe;IAAa,CAAA,CAC1D;OAIV,kBAAC,OAAD;GACE,IAAI;GACJ,WAAW,CACT,EAAO,aACN,IAAuC,OAA9B,EAAO,qBAClB,CACE,OAAO,QAAQ,CACf,KAAK,IAAI;GACZ,eAAa,CAAC,KAAU,KAAA;aAExB,kBAAC,OAAD;IAAK,WAAW,EAAO;cACrB,kBAAC,MAAD;KAAI,MAAK;KAAO,WAAW,EAAO;KAC/B;KACE,CAAA;IACD,CAAA;GACF,CAAA,CACE;;EAGf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../Icon/Icon.cjs`),t=require(
|
|
1
|
+
const e=require(`../Icon/Icon.cjs`),t=require(`./Toast.module.css.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`@gnome-ui/icons`);function a({title:a,duration:o=3e3,onDismiss:s,actionLabel:c,onAction:l,dismissible:u=!1,className:d,...f}){let p=(0,n.useRef)(null),m=(0,n.useRef)(o),h=(0,n.useRef)(0),g=()=>{p.current&&=(clearTimeout(p.current),null)},_=e=>{e<=0||!s||(g(),h.current=Date.now(),p.current=setTimeout(()=>s(),e))};(0,n.useEffect)(()=>(o>0&&(m.current=o,_(o)),g),[o]);let v=()=>{if(p.current){let e=Date.now()-h.current;m.current=Math.max(0,m.current-e),g()}},y=()=>{_(m.current)},b=()=>{g(),l?.(),s?.()};return(0,r.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:[t.default.toast,d].filter(Boolean).join(` `),onMouseEnter:v,onMouseLeave:y,onFocus:v,onBlur:y,...f,children:[(0,r.jsx)(`span`,{className:t.default.title,children:a}),(c||u)&&(0,r.jsxs)(`span`,{className:t.default.actions,children:[c&&(0,r.jsx)(`button`,{type:`button`,className:t.default.actionBtn,onClick:b,children:c}),u&&(0,r.jsx)(`button`,{type:`button`,className:t.default.dismissBtn,"aria-label":`Dismiss`,onClick:()=>{g(),s?.()},children:(0,r.jsx)(e.Icon,{icon:i.Close,size:`md`,"aria-hidden":!0})})]})]})}exports.Toast=a;
|
|
2
2
|
//# sourceMappingURL=Toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import {\n useEffect,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Close } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport styles from \"./Toast.module.css\";\n\nexport interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** The notification message. Keep it short — one sentence. */\n title: ReactNode;\n /**\n * Auto-dismiss timeout in milliseconds.\n * - Set to `0` to disable auto-dismiss (user must click action or dismiss).\n * - Defaults to `3000`.\n */\n duration?: number;\n /** Called when the toast should be removed — after timeout or user action. */\n onDismiss?: () => void;\n /** Label for the optional action button. */\n actionLabel?: string;\n /** Called when the user clicks the action button. */\n onAction?: () => void;\n /** Whether to show a manual dismiss (×) button. */\n dismissible?: boolean;\n}\n\n/**\n * Non-blocking temporary notification following the Adwaita `AdwToast` pattern.\n *\n * - Auto-dismisses after `duration` ms (default 3 s). Set `duration={0}` to disable.\n * - Timer pauses while the toast is hovered or focused.\n * - Use inside `<Toaster>` for correct positioning and stacking.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Toast.html\n */\nexport function Toast({\n title,\n duration = 3000,\n onDismiss,\n actionLabel,\n onAction,\n dismissible = false,\n className,\n ...props\n}: ToastProps) {\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const remainingRef = useRef(duration);\n const startedAtRef = useRef<number>(0);\n\n const clearTimer = () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n\n const startTimer = (ms: number) => {\n if (ms <= 0 || !onDismiss) return;\n clearTimer();\n startedAtRef.current = Date.now();\n timerRef.current = setTimeout(() => onDismiss(), ms);\n };\n\n // Start auto-dismiss on mount\n useEffect(() => {\n if (duration > 0) {\n remainingRef.current = duration;\n startTimer(duration);\n }\n return clearTimer;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [duration]);\n\n // Pause timer on hover/focus\n const handleMouseEnter = () => {\n if (timerRef.current) {\n const elapsed = Date.now() - startedAtRef.current;\n remainingRef.current = Math.max(0, remainingRef.current - elapsed);\n clearTimer();\n }\n };\n\n const handleMouseLeave = () => {\n startTimer(remainingRef.current);\n };\n\n const handleAction = () => {\n clearTimer();\n onAction?.();\n onDismiss?.();\n };\n\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className={[styles.toast, className].filter(Boolean).join(\" \")}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleMouseEnter}\n onBlur={handleMouseLeave}\n {...props}\n >\n <span className={styles.title}>{title}</span>\n\n {(actionLabel || dismissible) && (\n <span className={styles.actions}>\n {actionLabel && (\n <button\n type=\"button\"\n className={styles.actionBtn}\n onClick={handleAction}\n >\n {actionLabel}\n </button>\n )}\n {dismissible && (\n <button\n type=\"button\"\n className={styles.dismissBtn}\n aria-label=\"Dismiss\"\n onClick={() => { clearTimer(); onDismiss?.(); }}\n >\n <Icon icon={Close} size=\"md\" aria-hidden />\n </button>\n )}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.cjs","names":[],"sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import {\n useEffect,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Close } from \"@gnome-ui/icons\";\nimport { Icon } from \"../Icon\";\nimport styles from \"./Toast.module.css\";\n\nexport interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** The notification message. Keep it short — one sentence. */\n title: ReactNode;\n /**\n * Auto-dismiss timeout in milliseconds.\n * - Set to `0` to disable auto-dismiss (user must click action or dismiss).\n * - Defaults to `3000`.\n */\n duration?: number;\n /** Called when the toast should be removed — after timeout or user action. */\n onDismiss?: () => void;\n /** Label for the optional action button. */\n actionLabel?: string;\n /** Called when the user clicks the action button. */\n onAction?: () => void;\n /** Whether to show a manual dismiss (×) button. */\n dismissible?: boolean;\n}\n\n/**\n * Non-blocking temporary notification following the Adwaita `AdwToast` pattern.\n *\n * - Auto-dismisses after `duration` ms (default 3 s). Set `duration={0}` to disable.\n * - Timer pauses while the toast is hovered or focused.\n * - Use inside `<Toaster>` for correct positioning and stacking.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Toast.html\n */\nexport function Toast({\n title,\n duration = 3000,\n onDismiss,\n actionLabel,\n onAction,\n dismissible = false,\n className,\n ...props\n}: ToastProps) {\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const remainingRef = useRef(duration);\n const startedAtRef = useRef<number>(0);\n\n const clearTimer = () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n\n const startTimer = (ms: number) => {\n if (ms <= 0 || !onDismiss) return;\n clearTimer();\n startedAtRef.current = Date.now();\n timerRef.current = setTimeout(() => onDismiss(), ms);\n };\n\n // Start auto-dismiss on mount\n useEffect(() => {\n if (duration > 0) {\n remainingRef.current = duration;\n startTimer(duration);\n }\n return clearTimer;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [duration]);\n\n // Pause timer on hover/focus\n const handleMouseEnter = () => {\n if (timerRef.current) {\n const elapsed = Date.now() - startedAtRef.current;\n remainingRef.current = Math.max(0, remainingRef.current - elapsed);\n clearTimer();\n }\n };\n\n const handleMouseLeave = () => {\n startTimer(remainingRef.current);\n };\n\n const handleAction = () => {\n clearTimer();\n onAction?.();\n onDismiss?.();\n };\n\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className={[styles.toast, className].filter(Boolean).join(\" \")}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleMouseEnter}\n onBlur={handleMouseLeave}\n {...props}\n >\n <span className={styles.title}>{title}</span>\n\n {(actionLabel || dismissible) && (\n <span className={styles.actions}>\n {actionLabel && (\n <button\n type=\"button\"\n className={styles.actionBtn}\n onClick={handleAction}\n >\n {actionLabel}\n </button>\n )}\n {dismissible && (\n <button\n type=\"button\"\n className={styles.dismissBtn}\n aria-label=\"Dismiss\"\n onClick={() => { clearTimer(); onDismiss?.(); }}\n >\n <Icon icon={Close} size=\"md\" aria-hidden />\n </button>\n )}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":"2JAsCA,SAAgB,EAAM,CACpB,QACA,WAAW,IACX,YACA,cACA,WACA,cAAc,GACd,YACA,GAAG,GACU,CACb,IAAM,GAAA,EAAA,EAAA,QAAwD,KAAK,CAC7D,GAAA,EAAA,EAAA,QAAsB,EAAS,CAC/B,GAAA,EAAA,EAAA,QAA8B,EAAE,CAEhC,MAAmB,CACvB,AAEE,EAAS,WADT,aAAa,EAAS,QAAQ,CACX,OAIjB,EAAc,GAAe,CAC7B,GAAM,GAAK,CAAC,IAChB,GAAY,CACZ,EAAa,QAAU,KAAK,KAAK,CACjC,EAAS,QAAU,eAAiB,GAAW,CAAE,EAAG,IAItD,EAAA,EAAA,gBACM,EAAW,IACb,EAAa,QAAU,EACvB,EAAW,EAAS,EAEf,GAEN,CAAC,EAAS,CAAC,CAGd,IAAM,MAAyB,CAC7B,GAAI,EAAS,QAAS,CACpB,IAAM,EAAU,KAAK,KAAK,CAAG,EAAa,QAC1C,EAAa,QAAU,KAAK,IAAI,EAAG,EAAa,QAAU,EAAQ,CAClE,GAAY,GAIV,MAAyB,CAC7B,EAAW,EAAa,QAAQ,EAG5B,MAAqB,CACzB,GAAY,CACZ,KAAY,CACZ,KAAa,EAGf,OACE,EAAA,EAAA,MAAC,MAAD,CACE,KAAK,SACL,YAAU,SACV,cAAY,OACZ,UAAW,CAAC,EAAA,QAAO,MAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,CAC9D,aAAc,EACd,aAAc,EACd,QAAS,EACT,OAAQ,EACR,GAAI,WATN,EAWE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,QAAO,eAAQ,EAAa,CAAA,EAE3C,GAAe,KACf,EAAA,EAAA,MAAC,OAAD,CAAM,UAAW,EAAA,QAAO,iBAAxB,CACG,IACC,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,UAClB,QAAS,WAER,EACM,CAAA,CAEV,IACC,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAA,QAAO,WAClB,aAAW,UACX,YAAe,CAAE,GAAY,CAAE,KAAa,YAE5C,EAAA,EAAA,KAAC,EAAA,KAAD,CAAM,KAAM,EAAA,MAAO,KAAK,KAAK,cAAA,GAAc,CAAA,CACpC,CAAA,CAEN,GAEL"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import t from "./Toast.module.css.js";
|
|
3
|
+
import { useEffect as n, useRef as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { Close as o } from "@gnome-ui/icons";
|
|
6
6
|
//#region src/components/Toast/Toast.tsx
|
|
7
7
|
function s({ title: s, duration: c = 3e3, onDismiss: l, actionLabel: u, onAction: d, dismissible: f = !1, className: p, ...m }) {
|
|
8
|
-
let h =
|
|
8
|
+
let h = r(null), g = r(c), _ = r(0), v = () => {
|
|
9
9
|
h.current &&= (clearTimeout(h.current), null);
|
|
10
10
|
}, y = (e) => {
|
|
11
11
|
e <= 0 || !l || (v(), _.current = Date.now(), h.current = setTimeout(() => l(), e));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
n(() => (c > 0 && (g.current = c, y(c)), v), [c]);
|
|
14
14
|
let b = () => {
|
|
15
15
|
if (h.current) {
|
|
16
16
|
let e = Date.now() - _.current;
|
|
@@ -21,35 +21,35 @@ function s({ title: s, duration: c = 3e3, onDismiss: l, actionLabel: u, onAction
|
|
|
21
21
|
}, S = () => {
|
|
22
22
|
v(), d?.(), l?.();
|
|
23
23
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ a("div", {
|
|
25
25
|
role: "status",
|
|
26
26
|
"aria-live": "polite",
|
|
27
27
|
"aria-atomic": "true",
|
|
28
|
-
className: [
|
|
28
|
+
className: [t.toast, p].filter(Boolean).join(" "),
|
|
29
29
|
onMouseEnter: b,
|
|
30
30
|
onMouseLeave: x,
|
|
31
31
|
onFocus: b,
|
|
32
32
|
onBlur: x,
|
|
33
33
|
...m,
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
className:
|
|
34
|
+
children: [/* @__PURE__ */ i("span", {
|
|
35
|
+
className: t.title,
|
|
36
36
|
children: s
|
|
37
|
-
}), (u || f) && /* @__PURE__ */
|
|
38
|
-
className:
|
|
39
|
-
children: [u && /* @__PURE__ */
|
|
37
|
+
}), (u || f) && /* @__PURE__ */ a("span", {
|
|
38
|
+
className: t.actions,
|
|
39
|
+
children: [u && /* @__PURE__ */ i("button", {
|
|
40
40
|
type: "button",
|
|
41
|
-
className:
|
|
41
|
+
className: t.actionBtn,
|
|
42
42
|
onClick: S,
|
|
43
43
|
children: u
|
|
44
|
-
}), f && /* @__PURE__ */
|
|
44
|
+
}), f && /* @__PURE__ */ i("button", {
|
|
45
45
|
type: "button",
|
|
46
|
-
className:
|
|
46
|
+
className: t.dismissBtn,
|
|
47
47
|
"aria-label": "Dismiss",
|
|
48
48
|
onClick: () => {
|
|
49
49
|
v(), l?.();
|
|
50
50
|
},
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
icon:
|
|
51
|
+
children: /* @__PURE__ */ i(e, {
|
|
52
|
+
icon: o,
|
|
53
53
|
size: "md",
|
|
54
54
|
"aria-hidden": !0
|
|
55
55
|
})
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { useBreakpoint, GNOME_BREAKPOINTS } from './useBreakpoint';
|
|
2
2
|
export type { BreakpointState, GnomeBreakpointName } from './useBreakpoint';
|
|
3
|
+
export { useLocale, useDir, useNumberFormatter, useDateTimeFormatter, } from '../components/GnomeProvider/GnomeContext';
|
|
4
|
+
export type { GnomeDir } from '../components/GnomeProvider/GnomeContext';
|
package/dist/hooks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./hooks/useBreakpoint.cjs`);exports.GNOME_BREAKPOINTS=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components/GnomeProvider/GnomeContext.cjs`),t=require(`./hooks/useBreakpoint.cjs`);exports.GNOME_BREAKPOINTS=t.GNOME_BREAKPOINTS,exports.useBreakpoint=t.useBreakpoint,exports.useDateTimeFormatter=e.useDateTimeFormatter,exports.useDir=e.useDir,exports.useLocale=e.useLocale,exports.useNumberFormatter=e.useNumberFormatter;
|
package/dist/hooks.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useDateTimeFormatter as e, useDir as t, useLocale as n, useNumberFormatter as r } from "./components/GnomeProvider/GnomeContext.js";
|
|
2
|
+
import { GNOME_BREAKPOINTS as i, useBreakpoint as a } from "./hooks/useBreakpoint.js";
|
|
3
|
+
export { i as GNOME_BREAKPOINTS, a as useBreakpoint, e as useDateTimeFormatter, t as useDir, n as useLocale, r as useNumberFormatter };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components/AboutDialog/AboutDialog.cjs`),t=require(`./components/ActionRow/ActionRow.cjs`),n=require(`./components/Avatar/Avatar.cjs`),r=require(`./components/Badge/Badge.cjs`),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components/AboutDialog/AboutDialog.cjs`),t=require(`./components/ActionRow/ActionRow.cjs`),n=require(`./components/Avatar/Avatar.cjs`),r=require(`./components/AvatarRotator/AvatarRotator.cjs`),i=require(`./components/Badge/Badge.cjs`),a=require(`./components/Banner/Banner.cjs`),o=require(`./components/Bin/Bin.cjs`),ee=require(`./components/Blockquote/Blockquote.cjs`),s=require(`./components/BottomSheet/BottomSheet.cjs`),c=require(`./components/Box/Box.cjs`),l=require(`./components/Separator/Separator.cjs`),u=require(`./components/BoxedList/BoxedList.cjs`),d=require(`./components/BreakpointBin/BreakpointBin.cjs`),f=require(`./components/Button/Button.cjs`),p=require(`./components/ButtonContent/ButtonContent.cjs`),m=require(`./components/ButtonRow/ButtonRow.cjs`),h=require(`./components/Card/Card.cjs`),g=require(`./components/Carousel/Carousel.cjs`),_=require(`./components/CheckRow/CheckRow.cjs`),v=require(`./components/Checkbox/Checkbox.cjs`),y=require(`./components/Icon/Icon.cjs`),b=require(`./components/Chip/Chip.cjs`),x=require(`./components/Clamp/Clamp.cjs`),S=require(`./components/ColorPicker/ColorPicker.cjs`),C=require(`./components/ColumnView/ColumnView.cjs`),w=require(`./components/ComboRow/ComboRow.cjs`),T=require(`./components/GnomeProvider/GnomeContext.cjs`),E=require(`./components/ContributionGraph/ContributionGraph.cjs`),D=require(`./components/CountDownTimer/CountDownTimer.cjs`),O=require(`./components/Dialog/Dialog.cjs`),k=require(`./components/Dropdown/Dropdown.cjs`),A=require(`./components/EntryRow/EntryRow.cjs`),j=require(`./components/ExpanderRow/ExpanderRow.cjs`),M=require(`./components/Footer/Footer.cjs`),N=require(`./components/Frame/Frame.cjs`),P=require(`./components/GnomeProvider/GnomeProvider.cjs`),F=require(`./components/HeaderBar/HeaderBar.cjs`),I=require(`./components/Tooltip/Tooltip.cjs`),L=require(`./components/IconButton/IconButton.cjs`),R=require(`./components/InlineViewSwitcher/InlineViewSwitcher.cjs`),z=require(`./components/InlineViewSwitcher/InlineViewSwitcherItem.cjs`),B=require(`./components/Link/Link.cjs`),V=require(`./components/LinkedGroup/LinkedGroup.cjs`),H=require(`./hooks/useBreakpoint.cjs`),U=require(`./components/NavigationSplitView/NavigationSplitView.cjs`),W=require(`./components/NavigationView/NavigationView.cjs`),G=require(`./components/OverlaySplitView/OverlaySplitView.cjs`),K=require(`./components/PasswordEntryRow/PasswordEntryRow.cjs`),q=require(`./components/PathBar/PathBar.cjs`),J=require(`./components/Popover/Popover.cjs`),Y=require(`./components/PreferencesDialog/PreferencesDialog.cjs`),te=require(`./components/PreferencesGroup/PreferencesGroup.cjs`),X=require(`./components/PreferencesPage/PreferencesPage.cjs`),Z=require(`./components/ProgressBar/ProgressBar.cjs`),Q=require(`./components/RadioButton/RadioButton.cjs`),ne=require(`./components/Spinner/Spinner.cjs`),re=require(`./components/SearchBar/SearchBar.cjs`),ie=require(`./components/ShortcutLabel/ShortcutLabel.cjs`),ae=require(`./components/ShortcutsDialog/ShortcutsDialog.cjs`),oe=require(`./components/StatusPage/StatusPage.cjs`),$=require(`./components/Sidebar/Sidebar.cjs`),se=require(`./components/Sidebar/SidebarSection.cjs`),ce=require(`./components/Sidebar/SidebarItem.cjs`),le=require(`./components/Skeleton/Skeleton.cjs`),ue=require(`./components/Slider/Slider.cjs`),de=require(`./components/SpinButton/SpinButton.cjs`),fe=require(`./components/SpinRow/SpinRow.cjs`),pe=require(`./components/SplitButton/SplitButton.cjs`),me=require(`./components/StatusBadge/StatusBadge.cjs`),he=require(`./components/Switch/Switch.cjs`),ge=require(`./components/SwitchRow/SwitchRow.cjs`),_e=require(`./components/Tabs/TabBar.cjs`),ve=require(`./components/Tabs/TabItem.cjs`),ye=require(`./components/Tabs/TabPanel.cjs`),be=require(`./components/TerminalView/TerminalView.cjs`),xe=require(`./components/Text/Text.cjs`),Se=require(`./components/TextField/TextField.cjs`),Ce=require(`./components/Timeline/Timeline.cjs`),we=require(`./components/Toast/Toast.cjs`),Te=require(`./components/Toast/Toaster.cjs`),Ee=require(`./components/ToggleGroup/ToggleGroup.cjs`),De=require(`./components/ToggleGroup/ToggleGroupItem.cjs`),Oe=require(`./components/Toolbar/Toolbar.cjs`),ke=require(`./components/Toolbar/Spacer.cjs`),Ae=require(`./components/ToolbarView/ToolbarView.cjs`),je=require(`./components/ViewSwitcher/ViewSwitcher.cjs`),Me=require(`./components/ViewSwitcher/ViewSwitcherItem.cjs`),Ne=require(`./components/ViewSwitcherBar/ViewSwitcherBar.cjs`),Pe=require(`./components/ViewSwitcherSidebar/ViewSwitcherSidebar.cjs`),Fe=require(`./components/ViewSwitcherSidebar/ViewSwitcherSidebarItem.cjs`),Ie=require(`./components/WindowTitle/WindowTitle.cjs`),Le=require(`./components/WrapBox/WrapBox.cjs`);exports.AboutDialog=e.AboutDialog,exports.ActionRow=t.ActionRow,exports.Avatar=n.Avatar,exports.AvatarRotator=r.AvatarRotator,exports.Badge=i.Badge,exports.Banner=a.Banner,exports.Bin=o.Bin,exports.Blockquote=ee.Blockquote,exports.BottomSheet=s.BottomSheet,exports.Box=c.Box,exports.BoxedList=u.BoxedList,exports.BreakpointBin=d.BreakpointBin,exports.Button=f.Button,exports.ButtonContent=p.ButtonContent,exports.ButtonRow=m.ButtonRow,exports.Card=h.Card,exports.Carousel=g.Carousel,exports.CarouselIndicatorDots=g.CarouselIndicatorDots,exports.CarouselIndicatorLines=g.CarouselIndicatorLines,exports.CheckRow=_.CheckRow,exports.Checkbox=v.Checkbox,exports.Chip=b.Chip,exports.Clamp=x.Clamp,exports.ColorPicker=S.ColorPicker,exports.ColorSwatch=S.ColorSwatch,exports.ColumnView=C.ColumnView,exports.ComboRow=w.ComboRow,exports.ContributionGraph=E.ContributionGraph,exports.CountDownTimer=D.CountDownTimer,exports.Dialog=O.Dialog,exports.Dropdown=k.Dropdown,exports.EntryRow=A.EntryRow,exports.ExpanderRow=j.ExpanderRow,exports.Footer=M.Footer,exports.Frame=N.Frame,exports.GNOME_BREAKPOINTS=H.GNOME_BREAKPOINTS,exports.GNOME_PALETTE=S.GNOME_PALETTE,exports.GnomeProvider=P.GnomeProvider,exports.HeaderBar=F.HeaderBar,exports.Icon=y.Icon,exports.IconButton=L.IconButton,exports.InlineViewSwitcher=R.InlineViewSwitcher,exports.InlineViewSwitcherItem=z.InlineViewSwitcherItem,exports.Link=B.Link,exports.LinkedGroup=V.LinkedGroup,exports.NavigationPage=W.NavigationPage,exports.NavigationSplitView=U.NavigationSplitView,exports.NavigationView=W.NavigationView,exports.OverlaySplitView=G.OverlaySplitView,exports.PasswordEntryRow=K.PasswordEntryRow,exports.PathBar=q.PathBar,exports.Popover=J.Popover,exports.PreferencesDialog=Y.PreferencesDialog,exports.PreferencesGroup=te.PreferencesGroup,exports.PreferencesPage=X.PreferencesPage,exports.ProgressBar=Z.ProgressBar,exports.RadioButton=Q.RadioButton,exports.SearchBar=re.SearchBar,exports.Separator=l.Separator,exports.ShortcutLabel=ie.ShortcutLabel,exports.ShortcutsDialog=ae.ShortcutsDialog,exports.Sidebar=$.Sidebar,exports.SidebarCollapsedContext=$.SidebarCollapsedContext,exports.SidebarItem=ce.SidebarItem,exports.SidebarSection=se.SidebarSection,exports.Skeleton=le.Skeleton,exports.Slider=ue.Slider,exports.Spacer=ke.Spacer,exports.SpinButton=de.SpinButton,exports.SpinRow=fe.SpinRow,exports.Spinner=ne.Spinner,exports.SplitButton=pe.SplitButton,exports.StatusBadge=me.StatusBadge,exports.StatusPage=oe.StatusPage,exports.Switch=he.Switch,exports.SwitchRow=ge.SwitchRow,exports.TabBar=_e.TabBar,exports.TabItem=ve.TabItem,exports.TabPanel=ye.TabPanel,exports.TerminalView=be.TerminalView,exports.Text=xe.Text,exports.TextField=Se.TextField,exports.Timeline=Ce.Timeline,exports.Toast=we.Toast,exports.Toaster=Te.Toaster,exports.ToggleGroup=Ee.ToggleGroup,exports.ToggleGroupItem=De.ToggleGroupItem,exports.Toolbar=Oe.Toolbar,exports.ToolbarView=Ae.ToolbarView,exports.Tooltip=I.Tooltip,exports.ViewSwitcher=je.ViewSwitcher,exports.ViewSwitcherBar=Ne.ViewSwitcherBar,exports.ViewSwitcherItem=Me.ViewSwitcherItem,exports.ViewSwitcherSidebar=Pe.ViewSwitcherSidebar,exports.ViewSwitcherSidebarItem=Fe.ViewSwitcherSidebarItem,exports.WindowTitle=Ie.WindowTitle,exports.WrapBox=Le.WrapBox,exports.useBreakpoint=H.useBreakpoint,exports.useDateTimeFormatter=T.useDateTimeFormatter,exports.useDir=T.useDir,exports.useLocale=T.useLocale,exports.useNavigation=W.useNavigation,exports.useNumberFormatter=T.useNumberFormatter,exports.useSidebarCollapsed=$.useSidebarCollapsed;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { Skeleton } from './components/Skeleton';
|
|
|
12
12
|
export type { SkeletonProps, SkeletonVariant } from './components/Skeleton';
|
|
13
13
|
export { Avatar } from './components/Avatar';
|
|
14
14
|
export type { AvatarProps, AvatarSize, AvatarColor } from './components/Avatar';
|
|
15
|
+
export { AvatarRotator } from './components/AvatarRotator';
|
|
16
|
+
export type { AvatarRotatorProps } from './components/AvatarRotator';
|
|
15
17
|
export { Separator } from './components/Separator';
|
|
16
18
|
export type { SeparatorProps, SeparatorOrientation } from './components/Separator';
|
|
17
19
|
export { Switch } from './components/Switch';
|
|
@@ -156,3 +158,7 @@ export { TerminalView } from './components/TerminalView';
|
|
|
156
158
|
export type { TerminalViewProps, TerminalVariant } from './components/TerminalView';
|
|
157
159
|
export { StatusBadge } from './components/StatusBadge';
|
|
158
160
|
export type { StatusBadgeProps, StatusBadgeVariant } from './components/StatusBadge';
|
|
161
|
+
export { GnomeProvider } from './components/GnomeProvider/GnomeProvider';
|
|
162
|
+
export type { GnomeProviderProps } from './components/GnomeProvider/GnomeProvider';
|
|
163
|
+
export { useLocale, useDir, useNumberFormatter, useDateTimeFormatter, } from './components/GnomeProvider/GnomeContext';
|
|
164
|
+
export type { GnomeDir } from './components/GnomeProvider/GnomeContext';
|