highsoft-ui 1.0.141 → 1.0.144
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/CLAUDE.md +75 -0
- package/dist/components/Sidebar/NavDisclosure.js +39 -0
- package/dist/components/Sidebar/NavGroup.js +74 -0
- package/dist/components/Sidebar/NavItem.js +28 -0
- package/dist/components/Sidebar/Sidebar.js +107 -0
- package/dist/components/Sidebar/SidebarLayout.js +95 -0
- package/dist/components/Sidebar/SidebarResizer.js +59 -0
- package/dist/components/Sidebar/context.js +18 -0
- package/dist/components/Sidebar/index.js +8 -0
- package/dist/highsoft-ui.css +1 -1
- package/dist/lib/components/Sidebar/NavDisclosure.d.ts +14 -0
- package/dist/lib/components/Sidebar/NavGroup.d.ts +25 -0
- package/dist/lib/components/Sidebar/NavItem.d.ts +15 -0
- package/dist/lib/components/Sidebar/Sidebar.d.ts +46 -0
- package/dist/lib/components/Sidebar/SidebarLayout.d.ts +41 -0
- package/dist/lib/components/Sidebar/SidebarResizer.d.ts +6 -0
- package/dist/lib/components/Sidebar/context.d.ts +29 -0
- package/dist/lib/components/Sidebar/index.d.ts +13 -0
- package/dist/lib/main.d.ts +2 -0
- package/dist/main.js +10 -2
- package/dist/styles.module-Bd4HbnpA.js +42 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface NavDisclosureProps {
|
|
3
|
+
/** Label on the tap-to-expand toggle (shown only on narrow screens). */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a nav tree so that on narrow / docked layouts it collapses behind a
|
|
10
|
+
* tap-to-expand toggle, keeping content above the fold. On desktop the wrapper
|
|
11
|
+
* is inert (`display: contents`) — the children stay direct flex descendants of
|
|
12
|
+
* the sidebar body and keep their fill-and-scroll behaviour.
|
|
13
|
+
*/
|
|
14
|
+
export declare function NavDisclosure({ label, children, className }: NavDisclosureProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface NavGroupProps {
|
|
3
|
+
/** The group's label, shown on the toggle row. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Leading icon (16×16) shown before the label. */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** Open on first render (uncontrolled). Ignored when `open` is provided. */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/** Controlled open state. Provide together with `onOpenChange`. */
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Marks this group as lying on the path to the active item — tints its
|
|
15
|
+
* guide-line so the trail to the current page stands out. Set it when a
|
|
16
|
+
* descendant <NavItem> is `active`.
|
|
17
|
+
*/
|
|
18
|
+
active?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An expandable nav node — a toggle row that discloses a nested list of
|
|
23
|
+
* <NavItem>s (or further <NavGroup>s). Works controlled or uncontrolled.
|
|
24
|
+
*/
|
|
25
|
+
export declare function NavGroup({ label, children, icon, defaultOpen, open: openProp, onOpenChange, active, className }: NavGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElementType, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type NavItemProps<T extends ElementType = 'a'> = {
|
|
3
|
+
as?: T;
|
|
4
|
+
/** Marks the item as the current page (brand-tinted, aria-current). */
|
|
5
|
+
active?: boolean;
|
|
6
|
+
/** Leading icon (16×16). */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
} & Omit<ComponentPropsWithoutRef<T>, 'as'>;
|
|
10
|
+
/**
|
|
11
|
+
* A single navigation link. Polymorphic — renders as `<a>` by default, or pass
|
|
12
|
+
* `as={RouterLink}` / `as="button"` for SPA navigation. Selecting an item
|
|
13
|
+
* automatically closes the mobile drawer when inside a <SidebarLayout>.
|
|
14
|
+
*/
|
|
15
|
+
export declare const NavItem: import('react').ForwardRefExoticComponent<Omit<NavItemProps<ElementType>, "ref"> & import('react').RefAttributes<any>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SidebarProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Accessible label for the navigation landmark. */
|
|
5
|
+
'aria-label'?: string;
|
|
6
|
+
/** Label on the mobile drawer's close button. Default "Close navigation". */
|
|
7
|
+
closeLabel?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The sidebar column. On desktop it's a fixed-position-free flex column filling
|
|
12
|
+
* the layout's first grid track; on narrow screens it becomes an off-canvas
|
|
13
|
+
* drawer driven by the layout's mobile state. Auto-renders the resize handle
|
|
14
|
+
* (when the layout is resizable) and the mobile close button.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Sidebar({ children, 'aria-label': ariaLabel, closeLabel, className }: SidebarProps): import("react").JSX.Element;
|
|
17
|
+
/** Fixed top region of the sidebar (switchers, search, logo). Does not scroll. */
|
|
18
|
+
export declare function SidebarHeader({ children, className }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/** Scrollable body of the sidebar — put nav sections / trees here. */
|
|
23
|
+
export declare function SidebarBody({ children, className }: {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export interface SidebarSectionProps {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
/** Section heading shown above the items. */
|
|
30
|
+
label?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Surface a "Minimize" control that collapses every open <NavGroup> in this
|
|
33
|
+
* section. It appears only while at least one group is open. Default false.
|
|
34
|
+
*/
|
|
35
|
+
collapsible?: boolean;
|
|
36
|
+
/** Label on the auto Minimize control. Default "Minimize". */
|
|
37
|
+
minimizeLabel?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Custom control aligned to the right of the label. Overrides the auto
|
|
40
|
+
* Minimize button when provided.
|
|
41
|
+
*/
|
|
42
|
+
action?: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/** A labelled group of nav items within the sidebar body. */
|
|
46
|
+
export declare function SidebarSection({ children, label, collapsible, minimizeLabel, action, className }: SidebarSectionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export interface SidebarLayoutProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Initial sidebar width in px. Default 320. */
|
|
5
|
+
defaultWidth?: number;
|
|
6
|
+
/** Smallest the sidebar can be dragged. Default 230. */
|
|
7
|
+
minWidth?: number;
|
|
8
|
+
/** Largest the sidebar can be dragged. Default 460. */
|
|
9
|
+
maxWidth?: number;
|
|
10
|
+
/** Show the drag-to-resize handle on desktop. Default true. */
|
|
11
|
+
resizable?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* localStorage key under which the chosen width is remembered. Omit to keep
|
|
14
|
+
* the width only for the current session (no persistence).
|
|
15
|
+
*/
|
|
16
|
+
storageKey?: string;
|
|
17
|
+
/** Label on the mobile "open navigation" trigger bar. Default "Menu". */
|
|
18
|
+
mobileTriggerLabel?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Grow to fill a flex/grid parent (sets `flex: 1 1 auto; min-height: 0`) so
|
|
21
|
+
* the shell takes the available height and the content column scrolls on its
|
|
22
|
+
* own. Default `true` — set `false` for a layout sized to its content.
|
|
23
|
+
*/
|
|
24
|
+
fill?: boolean;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The resizable two-column shell: a sidebar column (`--hs-sidebar-w` wide) and a
|
|
30
|
+
* fluid content column. Owns the resize width and the mobile drawer state, which
|
|
31
|
+
* <Sidebar>, <SidebarMain> and <NavItem> read from context.
|
|
32
|
+
*
|
|
33
|
+
* On narrow screens (<=760px) the grid collapses to a single column, the sidebar
|
|
34
|
+
* becomes an off-canvas drawer, and a sticky trigger bar appears at the top.
|
|
35
|
+
*/
|
|
36
|
+
export declare function SidebarLayout({ children, defaultWidth, minWidth, maxWidth, resizable, storageKey, mobileTriggerLabel, fill, className, style }: SidebarLayoutProps): import("react").JSX.Element;
|
|
37
|
+
/** The fluid content column that sits beside the sidebar. */
|
|
38
|
+
export declare function SidebarMain({ children, className, ...rest }: {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
} & React.ComponentPropsWithoutRef<'main'>): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag handle on the sidebar's right edge. Reads/writes the width through the
|
|
3
|
+
* layout context (which clamps and persists it) and is keyboard-operable via
|
|
4
|
+
* its `role="separator"` + arrow keys. The hatched edge is decorative.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SidebarResizer(): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SidebarLayoutContextValue {
|
|
2
|
+
/** Whether the sidebar shows a drag-to-resize handle on desktop. */
|
|
3
|
+
resizable: boolean;
|
|
4
|
+
/** Current sidebar width in px (desktop). */
|
|
5
|
+
width: number;
|
|
6
|
+
/** Clamp + apply + persist a new sidebar width. */
|
|
7
|
+
setWidth: (w: number) => void;
|
|
8
|
+
minWidth: number;
|
|
9
|
+
maxWidth: number;
|
|
10
|
+
/** Whether the mobile off-canvas drawer is open. */
|
|
11
|
+
mobileOpen: boolean;
|
|
12
|
+
openMobile: () => void;
|
|
13
|
+
closeMobile: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const SidebarLayoutContext: import('react').Context<SidebarLayoutContextValue | null>;
|
|
16
|
+
/** Throws when used outside <SidebarLayout> — for components that require it. */
|
|
17
|
+
export declare function useSidebarLayout(): SidebarLayoutContextValue;
|
|
18
|
+
/** Non-throwing accessor — for components that also work standalone (NavItem). */
|
|
19
|
+
export declare function useOptionalSidebarLayout(): SidebarLayoutContextValue | null;
|
|
20
|
+
export interface SidebarSectionContextValue {
|
|
21
|
+
/** Bumped by the section's Minimize control to collapse its open groups. */
|
|
22
|
+
collapseNonce: number;
|
|
23
|
+
/** A descendant <NavGroup> reports its open state so the section knows
|
|
24
|
+
* whether to surface the Minimize control. */
|
|
25
|
+
reportOpen: (id: string, open: boolean) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const SidebarSectionContext: import('react').Context<SidebarSectionContextValue | null>;
|
|
28
|
+
/** Lets a <NavGroup> participate in its section's collapse-all behaviour. */
|
|
29
|
+
export declare function useOptionalSidebarSection(): SidebarSectionContextValue | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { SidebarLayout, SidebarMain } from './SidebarLayout';
|
|
2
|
+
export type { SidebarLayoutProps } from './SidebarLayout';
|
|
3
|
+
export { Sidebar, SidebarHeader, SidebarBody, SidebarSection } from './Sidebar';
|
|
4
|
+
export type { SidebarProps, SidebarSectionProps } from './Sidebar';
|
|
5
|
+
export { SidebarResizer } from './SidebarResizer';
|
|
6
|
+
export { NavItem } from './NavItem';
|
|
7
|
+
export type { NavItemProps } from './NavItem';
|
|
8
|
+
export { NavGroup } from './NavGroup';
|
|
9
|
+
export type { NavGroupProps } from './NavGroup';
|
|
10
|
+
export { NavDisclosure } from './NavDisclosure';
|
|
11
|
+
export type { NavDisclosureProps } from './NavDisclosure';
|
|
12
|
+
export { useSidebarLayout, useOptionalSidebarLayout } from './context';
|
|
13
|
+
export type { SidebarLayoutContextValue } from './context';
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export { ModalContactFooter } from './components/Modal/ModalContactFooter';
|
|
|
55
55
|
export type { ModalProps, ModalFooterType, ModalSubmitVariant } from './components/Modal';
|
|
56
56
|
export type { ModalContactFooterProps } from './components/Modal/ModalContactFooter';
|
|
57
57
|
export { Notification } from './components/Notification';
|
|
58
|
+
export { SidebarLayout, SidebarMain, Sidebar, SidebarHeader, SidebarBody, SidebarSection, SidebarResizer, NavItem, NavGroup, NavDisclosure, useSidebarLayout, useOptionalSidebarLayout } from './components/Sidebar';
|
|
59
|
+
export type { SidebarLayoutProps, SidebarProps, SidebarSectionProps, NavItemProps, NavGroupProps, NavDisclosureProps, SidebarLayoutContextValue } from './components/Sidebar';
|
|
58
60
|
export { PrefPanel } from './components/PrefPanel';
|
|
59
61
|
export { ThemeLoader, themeLoaderScript } from './components/ThemeLoader';
|
|
60
62
|
export { useTheme, useClipboard, useSuccessFlash } from './utils';
|
package/dist/main.js
CHANGED
|
@@ -30,5 +30,13 @@ import { n as B, t as V } from "./Checkbox-CrF45NBl.js";
|
|
|
30
30
|
import { Modal as H } from "./components/Modal/index.js";
|
|
31
31
|
import { t as U } from "./RoadmapDetails-DsLtsnqg.js";
|
|
32
32
|
import { ModalContactFooter as W } from "./components/Modal/ModalContactFooter.js";
|
|
33
|
-
import {
|
|
34
|
-
|
|
33
|
+
import { useOptionalSidebarLayout as G, useSidebarLayout as K } from "./components/Sidebar/context.js";
|
|
34
|
+
import { SidebarLayout as q, SidebarMain as J } from "./components/Sidebar/SidebarLayout.js";
|
|
35
|
+
import { SidebarResizer as Y } from "./components/Sidebar/SidebarResizer.js";
|
|
36
|
+
import { Sidebar as X, SidebarBody as Z, SidebarHeader as Q, SidebarSection as $ } from "./components/Sidebar/Sidebar.js";
|
|
37
|
+
import { NavItem as ee } from "./components/Sidebar/NavItem.js";
|
|
38
|
+
import { NavGroup as te } from "./components/Sidebar/NavGroup.js";
|
|
39
|
+
import { NavDisclosure as ne } from "./components/Sidebar/NavDisclosure.js";
|
|
40
|
+
import "./components/Sidebar/index.js";
|
|
41
|
+
import { ThemeLoader as re, themeLoaderScript as ie } from "./components/ThemeLoader/index.js";
|
|
42
|
+
export { a as Box, o as Button, p as ButtonGroup, V as Checkbox, B as CheckboxGroup, l as CodeBlock, b as Container, s as CopyCode, x as DiscordInvite, O as Dropdown, E as DropdownItem, D as DropdownSeparator, M as Footer, y as FormGroup, _ as FormRow, c as FrameworkIcon, N as GPTInput, I as Header, S as Heading, u as Icon, v as InputGrouped, m as InputSolo, j as Label, d as Link, w as Logo, H as Modal, W as ModalContactFooter, ne as NavDisclosure, te as NavGroup, ee as NavItem, A as NewTag, T as NewsletterSignup, P as Notification, k as PrefPanel, f as ProductIcon, z as RadioBox, R as RadioBoxGroup, U as RoadmapDetails, h as SearchDropdown, g as SelectGrouped, X as Sidebar, Z as SidebarBody, Q as SidebarHeader, q as SidebarLayout, J as SidebarMain, Y as SidebarResizer, $ as SidebarSection, F as SubHeader, L as Tabs, re as ThemeLoader, i as ThemeProvider, C as Typography, ie as themeLoaderScript, n as useClipboard, t as useNextTheme, G as useOptionalSidebarLayout, K as useSidebarLayout, r as useSuccessFlash, e as useTheme };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
backdrop: "UvvIVG_backdrop",
|
|
3
|
+
backdropOpen: "UvvIVG_backdropOpen",
|
|
4
|
+
body: "UvvIVG_body",
|
|
5
|
+
close: "UvvIVG_close",
|
|
6
|
+
disclosure: "UvvIVG_disclosure",
|
|
7
|
+
disclosureBody: "UvvIVG_disclosureBody",
|
|
8
|
+
disclosureChevron: "UvvIVG_disclosureChevron",
|
|
9
|
+
disclosureToggle: "UvvIVG_disclosureToggle",
|
|
10
|
+
fill: "UvvIVG_fill",
|
|
11
|
+
groupActive: "UvvIVG_groupActive",
|
|
12
|
+
groupChevron: "UvvIVG_groupChevron",
|
|
13
|
+
groupChildren: "UvvIVG_groupChildren",
|
|
14
|
+
groupChildrenInner: "UvvIVG_groupChildrenInner",
|
|
15
|
+
groupLabel: "UvvIVG_groupLabel",
|
|
16
|
+
groupOpen: "UvvIVG_groupOpen",
|
|
17
|
+
groupToggle: "UvvIVG_groupToggle",
|
|
18
|
+
handle: "UvvIVG_handle",
|
|
19
|
+
hasStickyHead: "UvvIVG_hasStickyHead",
|
|
20
|
+
hatchClip: "UvvIVG_hatchClip",
|
|
21
|
+
hatchDrag: "UvvIVG_hatchDrag",
|
|
22
|
+
hatchHi: "UvvIVG_hatchHi",
|
|
23
|
+
hatchInner: "UvvIVG_hatchInner",
|
|
24
|
+
header: "UvvIVG_header",
|
|
25
|
+
item: "UvvIVG_item",
|
|
26
|
+
itemActive: "UvvIVG_itemActive",
|
|
27
|
+
itemIcon: "UvvIVG_itemIcon",
|
|
28
|
+
itemLabel: "UvvIVG_itemLabel",
|
|
29
|
+
layout: "UvvIVG_layout",
|
|
30
|
+
main: "UvvIVG_main",
|
|
31
|
+
minimizeBtn: "UvvIVG_minimizeBtn",
|
|
32
|
+
mobileBar: "UvvIVG_mobileBar",
|
|
33
|
+
overlay: "UvvIVG_overlay",
|
|
34
|
+
section: "UvvIVG_section",
|
|
35
|
+
sectionHead: "UvvIVG_sectionHead",
|
|
36
|
+
sectionLabel: "UvvIVG_sectionLabel",
|
|
37
|
+
sidebar: "UvvIVG_sidebar",
|
|
38
|
+
sidebarOpen: "UvvIVG_sidebarOpen",
|
|
39
|
+
trigger: "UvvIVG_trigger"
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { e as t };
|