docthub-core-components 2.60.0 → 2.62.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.
@@ -48,6 +48,8 @@ interface AutocompleteProps<T> {
48
48
  minSearchLength?: number;
49
49
  /** Control built-in bolding of matched query segments (default: false) */
50
50
  ntt?: boolean;
51
+ /** If true, clears the input text after selecting an option (default: true, for backward compatibility) */
52
+ clearInputOnSelect?: boolean;
51
53
  }
52
- export declare const DoctAutocomplete: <T extends OptionType>({ options, dataSource, value, onChange, change, onInputChange, placeholder, multiple, freeSolo, disabled, loading, size, variant, label, helperText, error, required, fullWidth, clearable, disableCloseOnSelect, filterOptions, getOptionLabel, getOptionValue, isOptionEqualToValue, renderOption, renderTags, fields, noOptionsText, emptyMessage, className, inputClassName, chipClassName, debounceMs, minSearchLength, ntt, ...props }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const DoctAutocomplete: <T extends OptionType>({ options, dataSource, value, onChange, change, onInputChange, placeholder, multiple, freeSolo, disabled, loading, size, variant, label, helperText, error, required, fullWidth, clearable, disableCloseOnSelect, filterOptions, getOptionLabel, getOptionValue, isOptionEqualToValue, renderOption, renderTags, fields, noOptionsText, emptyMessage, className, inputClassName, chipClassName, debounceMs, minSearchLength, ntt, clearInputOnSelect, ...props }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
53
55
  export {};
@@ -0,0 +1,2 @@
1
+ import { DoctNavigationMenuProps } from './types';
2
+ export declare function DoctNavigationMenu({ groups, className, isMobileOverride, variant, }: Readonly<DoctNavigationMenuProps>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { DoctNavigationMenu } from './doct-navigation-menu';
2
+ export type { DoctNavigationMenuProps, DoctNavigationMenuVariant, MobileMenuCategory, NavigationMenuGroup, NavigationMenuGroupVariant, NavigationMenuItem, NavigationMenuSection, } from './types';
@@ -0,0 +1,4 @@
1
+ import { DoctNavigationMenuVariant, MobileMenuCategory, NavigationMenuGroup } from './types';
2
+ export declare function getDesktopGroups(variant: DoctNavigationMenuVariant): NavigationMenuGroup[];
3
+ /** Mobile: top-level \"For Individuals\" and \"For Organizations\" — each expands to nested accordion. */
4
+ export declare function getMobileCategoriesFromPresets(): MobileMenuCategory[];
@@ -0,0 +1,11 @@
1
+ import { NavigationMenuGroup } from './types';
2
+ interface NavigationMenuDesktopProps {
3
+ readonly groups: NavigationMenuGroup[];
4
+ readonly className?: string;
5
+ }
6
+ /**
7
+ * Desktop mega menu rendered at widths >= 1024px.
8
+ * Uses fixed 16px side gutters for 1024-1279px and keeps centered max width on larger screens.
9
+ */
10
+ export declare function NavigationMenuDesktop({ groups, className }: NavigationMenuDesktopProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ import { NavigationMenuItem, NavigationMenuSection } from './types';
3
+ interface NavItemRootProps {
4
+ readonly item: NavigationMenuItem;
5
+ readonly className?: string;
6
+ readonly children: ReactNode;
7
+ }
8
+ export declare function NavItemRoot({ item, className, children }: NavItemRootProps): import("react/jsx-runtime").JSX.Element;
9
+ interface SectionItemsProps {
10
+ readonly section: NavigationMenuSection;
11
+ readonly renderItem: (item: NavigationMenuItem, index: number) => ReactNode;
12
+ }
13
+ export declare function SectionItems({ section, renderItem }: SectionItemsProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { MobileMenuCategory, NavigationMenuGroup } from './types';
2
+ interface NavigationMenuMobileProps {
3
+ /** Nested accordion: For Individuals, For Organizations, About Docthub. */
4
+ readonly categories?: MobileMenuCategory[];
5
+ /** Flat groups (custom / legacy). */
6
+ readonly groups?: NavigationMenuGroup[];
7
+ readonly className?: string;
8
+ }
9
+ /**
10
+ * Mobile accordion menu. With categories: top-level "For Individuals", "For Organizations",
11
+ * "About Docthub" — each expands to show nested groups. With flat groups: legacy single-level.
12
+ */
13
+ export declare function NavigationMenuMobile({ categories, groups, className }: NavigationMenuMobileProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import { NavigationMenuGroup } from './types';
2
+ export declare const individualNavigationGroups: NavigationMenuGroup[];
3
+ /**
4
+ * Organization navigation presets — structure matches Figma Design System
5
+ * @see https://www.figma.com/design/R1AZDuYlTmwqN75mieBIMz (node 8194-3964)
6
+ */
7
+ export declare const organizationNavigationGroups: NavigationMenuGroup[];
@@ -0,0 +1,83 @@
1
+ import { ReactNode } from 'react';
2
+ export interface NavigationMenuItem {
3
+ id: string;
4
+ label: string;
5
+ description?: string;
6
+ icon?: ReactNode;
7
+ href?: string;
8
+ active?: boolean;
9
+ onClick?: () => void;
10
+ }
11
+ export interface NavigationMenuSection {
12
+ id: string;
13
+ title: string;
14
+ items: NavigationMenuItem[];
15
+ /**
16
+ * Zero-based index after which a visual separator should be rendered.
17
+ * Useful for splitting groups like links vs. meta pages within a section.
18
+ */
19
+ hasSeparatorAfterIndex?: number;
20
+ /**
21
+ * Optional footer area rendered below the section items in mobile layout.
22
+ * Useful for cards or grouped links that conceptually belong to this section.
23
+ */
24
+ footer?: ReactNode;
25
+ }
26
+ export type NavigationMenuGroupVariant = "default" | "highlighted";
27
+ export interface NavigationMenuGroup {
28
+ id: string;
29
+ title: string;
30
+ sections: NavigationMenuSection[];
31
+ /**
32
+ * When set to `"highlighted"`, the group is rendered with a subtle
33
+ * background emphasis (used for the \"About Docthub\" column).
34
+ */
35
+ variant?: NavigationMenuGroupVariant;
36
+ /**
37
+ * Optional footer area rendered at the bottom of the group, e.g. a CTA card.
38
+ */
39
+ footer?: ReactNode;
40
+ /**
41
+ * Controls the default open state for the group in the mobile layout.
42
+ */
43
+ defaultOpen?: boolean;
44
+ /**
45
+ * In mobile layout: "vertical" = label above tagline; "horizontal" = label and tagline on one line.
46
+ * Used when responsive menu shows both individual + organization groups.
47
+ */
48
+ taglineLayout?: "vertical" | "horizontal";
49
+ }
50
+ /**
51
+ * Mobile category for nested accordion: "For Individuals", "For Organizations", "About Docthub".
52
+ * Each category expands to show its groups (Explore, Professional Tools, etc.).
53
+ */
54
+ export interface MobileMenuCategory {
55
+ id: string;
56
+ title: string;
57
+ groups: NavigationMenuGroup[];
58
+ }
59
+ /**
60
+ * High-level menu presets that the navigation component can render.
61
+ * When `groups` is not provided, the `variant` determines which preset
62
+ * structure is used.
63
+ */
64
+ export type DoctNavigationMenuVariant = "individual" | "organization";
65
+ export interface DoctNavigationMenuProps {
66
+ /**
67
+ * Optional preset variant. When provided and `groups` is omitted,
68
+ * the component will render a predefined navigation structure that
69
+ * matches the Docthub design system for the given audience.
70
+ */
71
+ variant?: DoctNavigationMenuVariant;
72
+ /**
73
+ * Fully custom navigation structure. When provided, this takes
74
+ * precedence over the `variant` presets.
75
+ */
76
+ groups?: NavigationMenuGroup[];
77
+ className?: string;
78
+ /**
79
+ * Optional override to force mobile or desktop layout, primarily for stories
80
+ * and tests. When undefined, the layout is derived from `useIsMobile`.
81
+ */
82
+ isMobileOverride?: boolean;
83
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docthub-core-components",
3
- "version": "2.60.0",
3
+ "version": "2.62.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",