canny-ui-react 3.0.0 → 4.0.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.
@@ -0,0 +1,33 @@
1
+ import type { HTMLAttributes, PointerEvent } from 'react';
2
+ export type PanelDirection = 'horizontal' | 'vertical';
3
+ export interface PanelProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** Initial size as a percentage of the group. */
5
+ defaultSize?: number;
6
+ /** Minimum size in percent. Default 10. */
7
+ minSize?: number;
8
+ /** Maximum size in percent. Default 90. */
9
+ maxSize?: number;
10
+ }
11
+ export declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ interface HandleInternal {
13
+ direction: PanelDirection;
14
+ valueNow: number;
15
+ valueMin: number;
16
+ valueMax: number;
17
+ onResizeStart: (e: PointerEvent<HTMLDivElement>) => void;
18
+ onKeyResize: (dir: 1 | -1) => void;
19
+ }
20
+ export interface PanelResizeHandleProps extends HTMLAttributes<HTMLDivElement> {
21
+ disabled?: boolean;
22
+ /** @internal injected by PanelGroup */
23
+ __internal?: HandleInternal;
24
+ }
25
+ export declare const PanelResizeHandle: import("react").ForwardRefExoticComponent<PanelResizeHandleProps & import("react").RefAttributes<HTMLDivElement>>;
26
+ export interface PanelGroupProps extends HTMLAttributes<HTMLDivElement> {
27
+ /** Layout axis. Default `'horizontal'`. */
28
+ direction?: PanelDirection;
29
+ }
30
+ export declare const PanelGroup: import("react").ForwardRefExoticComponent<PanelGroupProps & import("react").RefAttributes<HTMLDivElement>>;
31
+ /** No-op kept for drop-in compatibility with `react-resizable-panels`. */
32
+ export declare function disableGlobalCursorStyles(): void;
33
+ export {};
@@ -0,0 +1,2 @@
1
+ export { PanelGroup, Panel, PanelResizeHandle, disableGlobalCursorStyles } from './PanelGroup';
2
+ export type { PanelGroupProps, PanelProps, PanelResizeHandleProps, PanelDirection, } from './PanelGroup';
@@ -0,0 +1,55 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type TimelineDotColor = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
3
+ /** Which side the content sits on relative to the central rail. */
4
+ export type TimelinePosition = 'right' | 'left' | 'alternate';
5
+ /** Rail direction. */
6
+ export type TimelineOrientation = 'vertical' | 'horizontal';
7
+ /** Density preset — scales dots, connector thickness, and type. */
8
+ export type TimelineSize = 'sm' | 'md' | 'lg';
9
+ export interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
10
+ /** Side the content sits on relative to the rail. Default `'right'`. (Vertical only.) */
11
+ position?: TimelinePosition;
12
+ /** Rail direction. Default `'vertical'`. */
13
+ orientation?: TimelineOrientation;
14
+ /** Density preset. Default `'md'`. */
15
+ size?: TimelineSize;
16
+ }
17
+ export declare const Timeline: import("react").ForwardRefExoticComponent<TimelineProps & import("react").RefAttributes<HTMLOListElement>>;
18
+ export type TimelineItemProps = HTMLAttributes<HTMLLIElement>;
19
+ export declare const TimelineItem: import("react").ForwardRefExoticComponent<TimelineItemProps & import("react").RefAttributes<HTMLLIElement>>;
20
+ export type TimelineSeparatorProps = HTMLAttributes<HTMLDivElement>;
21
+ export declare const TimelineSeparator: import("react").ForwardRefExoticComponent<TimelineSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
22
+ /** Dot fill treatment. */
23
+ export type TimelineDotVariant = 'filled' | 'outlined' | 'soft';
24
+ export interface TimelineDotProps extends HTMLAttributes<HTMLSpanElement> {
25
+ /** Semantic color. Default `'neutral'`. */
26
+ color?: TimelineDotColor;
27
+ /** Fill treatment: filled (default), outlined ring, or soft tint. */
28
+ variant?: TimelineDotVariant;
29
+ /** Optional icon (or number) rendered inside the dot. */
30
+ icon?: ReactNode;
31
+ /** Pulsing ring to mark the current step. Respects reduced-motion. */
32
+ active?: boolean;
33
+ }
34
+ export declare const TimelineDot: import("react").ForwardRefExoticComponent<TimelineDotProps & import("react").RefAttributes<HTMLSpanElement>>;
35
+ /** Connector line style. */
36
+ export type TimelineConnectorLineStyle = 'solid' | 'dashed' | 'dotted';
37
+ export interface TimelineConnectorProps extends HTMLAttributes<HTMLSpanElement> {
38
+ /** Tint the segment to show a completed step. Omit for a neutral hairline. */
39
+ color?: TimelineDotColor;
40
+ /** Line style. Default `'solid'`. */
41
+ lineStyle?: TimelineConnectorLineStyle;
42
+ }
43
+ export declare const TimelineConnector: import("react").ForwardRefExoticComponent<TimelineConnectorProps & import("react").RefAttributes<HTMLSpanElement>>;
44
+ /** Content treatment: plain, bordered card, or elevated card. */
45
+ export type TimelineContentVariant = 'plain' | 'card' | 'elevated';
46
+ export interface TimelineContentProps extends HTMLAttributes<HTMLDivElement> {
47
+ /** `'card'` = bordered block, `'elevated'` = card with shadow. Default `'plain'`. */
48
+ variant?: TimelineContentVariant;
49
+ /** Adds a colored left-accent border to a card, matched to a status color. */
50
+ accentColor?: TimelineDotColor;
51
+ }
52
+ export declare const TimelineContent: import("react").ForwardRefExoticComponent<TimelineContentProps & import("react").RefAttributes<HTMLDivElement>>;
53
+ /** Slot rendered on the opposite side of the rail from the content (e.g. a timestamp). */
54
+ export type TimelineOppositeContentProps = HTMLAttributes<HTMLDivElement>;
55
+ export declare const TimelineOppositeContent: import("react").ForwardRefExoticComponent<TimelineOppositeContentProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { Timeline, TimelineItem, TimelineSeparator, TimelineDot, TimelineConnector, TimelineContent, TimelineOppositeContent, } from './Timeline';
2
+ export type { TimelineDotColor, TimelinePosition, TimelineOrientation, TimelineSize, TimelineDotVariant, TimelineConnectorLineStyle, TimelineContentVariant, TimelineDotProps, TimelineProps, TimelineItemProps, TimelineSeparatorProps, TimelineConnectorProps, TimelineContentProps, TimelineOppositeContentProps, } from './Timeline';
@@ -0,0 +1,28 @@
1
+ import type { ReactElement, ReactNode, Ref } from 'react';
2
+ import type { TreeViewProps } from './TreeView';
3
+ /** Minimal shape RichTreeView expects; extra fields are passed through untouched. */
4
+ export type RichTreeViewItem = {
5
+ id?: string;
6
+ label?: ReactNode;
7
+ children?: RichTreeViewItem[];
8
+ [key: string]: unknown;
9
+ };
10
+ export interface RichTreeViewProps<T extends RichTreeViewItem = RichTreeViewItem> extends TreeViewProps {
11
+ /** Hierarchical data. */
12
+ items: T[];
13
+ /** Derive a stable id. Default `item.id`. */
14
+ getItemId?: (item: T) => string;
15
+ /** Derive the row label. Default `item.label`. */
16
+ getItemLabel?: (item: T) => ReactNode;
17
+ /** Derive child items. Default `item.children`. */
18
+ getItemChildren?: (item: T) => T[] | undefined;
19
+ /** Optional per-item leading icon. */
20
+ getItemIcon?: (item: T) => ReactNode;
21
+ }
22
+ /**
23
+ * Data-driven tree. Renders a `TreeView` from a `items` array; all expansion /
24
+ * selection props are forwarded to the underlying `TreeView`.
25
+ */
26
+ export declare const RichTreeView: <T extends RichTreeViewItem = RichTreeViewItem>(props: RichTreeViewProps<T> & {
27
+ ref?: Ref<HTMLUListElement>;
28
+ }) => ReactElement;
@@ -0,0 +1,31 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export interface TreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onSelect'> {
3
+ /** Controlled set of expanded item ids. */
4
+ expandedIds?: string[];
5
+ /** Initial expanded ids when uncontrolled. */
6
+ defaultExpandedIds?: string[];
7
+ /** Fired with the next expanded ids whenever an item expands or collapses. */
8
+ onExpandedChange?: (ids: string[]) => void;
9
+ /** Controlled selected item id. */
10
+ selectedId?: string | null;
11
+ /** Initial selected id when uncontrolled. */
12
+ defaultSelectedId?: string | null;
13
+ /** Fired with the selected id. */
14
+ onSelectedChange?: (id: string) => void;
15
+ /** Fired when a specific item toggles — `(id, willExpand)`. Use for lazy loading. */
16
+ onItemExpandToggle?: (id: string, expanded: boolean) => void;
17
+ /** Auto folder/file icons for items without their own icon. Default `true`. */
18
+ defaultIcons?: boolean;
19
+ }
20
+ export declare const TreeView: import("react").ForwardRefExoticComponent<TreeViewProps & import("react").RefAttributes<HTMLUListElement>>;
21
+ export interface TreeItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
22
+ /** Stable id for this node. */
23
+ itemId: string;
24
+ /** Row label. */
25
+ label: ReactNode;
26
+ /** Optional leading icon. */
27
+ icon?: ReactNode;
28
+ /** Child TreeItems. */
29
+ children?: ReactNode;
30
+ }
31
+ export declare const TreeItem: import("react").ForwardRefExoticComponent<TreeItemProps & import("react").RefAttributes<HTMLLIElement>>;
@@ -0,0 +1,4 @@
1
+ export { TreeView, TreeItem } from './TreeView';
2
+ export type { TreeViewProps, TreeItemProps } from './TreeView';
3
+ export { RichTreeView } from './RichTreeView';
4
+ export type { RichTreeViewProps, RichTreeViewItem } from './RichTreeView';