@particle-academy/react-fancy 2.5.0 → 2.6.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/dist/{diagram.serializers-OK4HP7AB.js → diagram.serializers-6RPUO46U.js} +11 -11
- package/dist/diagram.serializers-6RPUO46U.js.map +1 -0
- package/dist/index.cjs +300 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +163 -1
- package/dist/index.d.ts +163 -1
- package/dist/index.js +289 -27
- package/dist/index.js.map +1 -1
- package/docs/AccordionPanel.md +135 -0
- package/package.json +1 -1
- package/dist/diagram.serializers-OK4HP7AB.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -53,6 +53,168 @@ interface ActionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "col
|
|
|
53
53
|
|
|
54
54
|
declare const Action: react.ForwardRefExoticComponent<ActionProps & react.RefAttributes<HTMLButtonElement>>;
|
|
55
55
|
|
|
56
|
+
type AccordionOrientation = "horizontal" | "vertical";
|
|
57
|
+
/**
|
|
58
|
+
* Render-prop or static node accepted by Trigger.children — lets the
|
|
59
|
+
* caller branch rendering on the section state.
|
|
60
|
+
*/
|
|
61
|
+
type SectionRenderable = ReactNode | ((state: SectionRenderState) => ReactNode);
|
|
62
|
+
interface SectionRenderState {
|
|
63
|
+
/** Section's id */
|
|
64
|
+
id: string;
|
|
65
|
+
/** True when the section is currently open */
|
|
66
|
+
open: boolean;
|
|
67
|
+
/** Direction the panel is laid out in */
|
|
68
|
+
orientation: AccordionOrientation;
|
|
69
|
+
/** Toggle this section open/closed */
|
|
70
|
+
toggle: () => void;
|
|
71
|
+
}
|
|
72
|
+
interface AccordionPanelProps {
|
|
73
|
+
/** Layout direction. Horizontal for menus/toolbars, vertical for sidebars/panels. */
|
|
74
|
+
orientation?: AccordionOrientation;
|
|
75
|
+
/** Controlled list of open section ids */
|
|
76
|
+
value?: string[];
|
|
77
|
+
/** Default open section ids (uncontrolled) */
|
|
78
|
+
defaultValue?: string[];
|
|
79
|
+
/** Fires whenever the open set changes */
|
|
80
|
+
onValueChange?: (open: string[]) => void;
|
|
81
|
+
/** Optional class on the root container */
|
|
82
|
+
className?: string;
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}
|
|
85
|
+
interface AccordionPanelSectionProps {
|
|
86
|
+
/** Stable id used for open-state tracking */
|
|
87
|
+
id: string;
|
|
88
|
+
/**
|
|
89
|
+
* Pinned sections never collapse. Useful for an "anchor" item like a
|
|
90
|
+
* Home button at the start of a menu.
|
|
91
|
+
*/
|
|
92
|
+
pinned?: boolean;
|
|
93
|
+
/** Class on the section's outer container */
|
|
94
|
+
className?: string;
|
|
95
|
+
/** Class applied only when the section is open */
|
|
96
|
+
openClassName?: string;
|
|
97
|
+
/** Class applied only when the section is collapsed */
|
|
98
|
+
closedClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Children. Compose with `<AccordionPanel.Trigger>` and
|
|
101
|
+
* `<AccordionPanel.Content>` — Trigger always renders, Content only
|
|
102
|
+
* renders when the section is open.
|
|
103
|
+
*/
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
}
|
|
106
|
+
interface AccordionPanelTriggerProps {
|
|
107
|
+
/**
|
|
108
|
+
* Custom render. Receives section state — `{ open, toggle, ... }`. If
|
|
109
|
+
* omitted, the default chevron-divider is rendered.
|
|
110
|
+
*/
|
|
111
|
+
children?: SectionRenderable;
|
|
112
|
+
/** Class on the trigger element */
|
|
113
|
+
className?: string;
|
|
114
|
+
/** Aria label override (default: "Toggle section") */
|
|
115
|
+
"aria-label"?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* One collapsible section inside an AccordionPanel.
|
|
120
|
+
*
|
|
121
|
+
* Compose with `<AccordionPanel.Trigger>` and `<AccordionPanel.Content>`
|
|
122
|
+
* children — Content renders only when open, Trigger always renders and
|
|
123
|
+
* adapts its look by state. Children that are not Trigger/Content are
|
|
124
|
+
* rendered as-is, regardless of state, so static decorations stay put.
|
|
125
|
+
*
|
|
126
|
+
* Pinned sections never collapse and don't need a Trigger.
|
|
127
|
+
*/
|
|
128
|
+
declare function AccordionPanelSection({ id, pinned, className, openClassName, closedClassName, children, }: AccordionPanelSectionProps): react_jsx_runtime.JSX.Element;
|
|
129
|
+
declare namespace AccordionPanelSection {
|
|
130
|
+
var displayName: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Trigger for an AccordionPanel.Section.
|
|
135
|
+
*
|
|
136
|
+
* Has two visual roles, picked automatically from section state:
|
|
137
|
+
*
|
|
138
|
+
* - When the section is OPEN: renders as a thin divider on the section's
|
|
139
|
+
* trailing edge. Hovering reveals an inset chevron pointing toward the
|
|
140
|
+
* section so the user knows clicking will collapse it.
|
|
141
|
+
*
|
|
142
|
+
* - When the section is CLOSED: renders as a standalone chevron button
|
|
143
|
+
* in place of the section content. Clicking re-expands the section.
|
|
144
|
+
*
|
|
145
|
+
* Supply `children` (node or render-prop) to fully replace the default
|
|
146
|
+
* rendering. The render-prop receives `{ open, toggle, orientation, id }`.
|
|
147
|
+
*/
|
|
148
|
+
declare function AccordionPanelTrigger({ children, className, "aria-label": ariaLabel, }: AccordionPanelTriggerProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
declare namespace AccordionPanelTrigger {
|
|
150
|
+
var displayName: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface AccordionPanelContentProps {
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Wrapper for the open-state content of a Section. Renders its children
|
|
159
|
+
* only when the parent Section is open; returns `null` otherwise.
|
|
160
|
+
*
|
|
161
|
+
* Use this so siblings of `<AccordionPanel.Trigger>` inside a section can
|
|
162
|
+
* cleanly toggle in/out of the DOM. Layout style flows through the
|
|
163
|
+
* `className` prop (defaults to a flex row/column matching orientation).
|
|
164
|
+
*/
|
|
165
|
+
declare function AccordionPanelContent({ children, className, }: AccordionPanelContentProps): react_jsx_runtime.JSX.Element | null;
|
|
166
|
+
declare namespace AccordionPanelContent {
|
|
167
|
+
var displayName: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Horizontal or vertical accordion of collapsible sections.
|
|
172
|
+
*
|
|
173
|
+
* Use the compound parts:
|
|
174
|
+
* <AccordionPanel orientation="horizontal" defaultValue={["wishlist"]}>
|
|
175
|
+
* <AccordionPanel.Section id="home" pinned>
|
|
176
|
+
* <Action icon="home" />
|
|
177
|
+
* </AccordionPanel.Section>
|
|
178
|
+
* <AccordionPanel.Section id="wishlist">
|
|
179
|
+
* <Action icon="list">Wishlist</Action>
|
|
180
|
+
* </AccordionPanel.Section>
|
|
181
|
+
* </AccordionPanel>
|
|
182
|
+
*
|
|
183
|
+
* Each non-pinned section renders a trigger (default chevron-divider) that
|
|
184
|
+
* collapses/expands. Pass a custom `trigger` prop on a Section, or use the
|
|
185
|
+
* exported `AccordionPanel.Trigger` directly to compose your own.
|
|
186
|
+
*/
|
|
187
|
+
declare function AccordionPanelRoot({ orientation, value: controlledValue, defaultValue, onValueChange, className, children, }: AccordionPanelProps): react_jsx_runtime.JSX.Element;
|
|
188
|
+
declare namespace AccordionPanelRoot {
|
|
189
|
+
var displayName: string;
|
|
190
|
+
}
|
|
191
|
+
type AccordionPanelType = typeof AccordionPanelRoot & {
|
|
192
|
+
Section: typeof AccordionPanelSection;
|
|
193
|
+
Trigger: typeof AccordionPanelTrigger;
|
|
194
|
+
Content: typeof AccordionPanelContent;
|
|
195
|
+
};
|
|
196
|
+
declare const AccordionPanel: AccordionPanelType;
|
|
197
|
+
|
|
198
|
+
interface AccordionPanelContextValue {
|
|
199
|
+
orientation: AccordionOrientation;
|
|
200
|
+
isOpen: (id: string) => boolean;
|
|
201
|
+
toggle: (id: string) => void;
|
|
202
|
+
open: (id: string) => void;
|
|
203
|
+
close: (id: string) => void;
|
|
204
|
+
/** Ordered list of all section ids registered in this panel */
|
|
205
|
+
sectionIds: string[];
|
|
206
|
+
registerSection: (id: string) => () => void;
|
|
207
|
+
}
|
|
208
|
+
declare function useAccordionPanel(): AccordionPanelContextValue;
|
|
209
|
+
interface AccordionSectionContextValue {
|
|
210
|
+
id: string;
|
|
211
|
+
open: boolean;
|
|
212
|
+
pinned: boolean;
|
|
213
|
+
orientation: AccordionOrientation;
|
|
214
|
+
toggle: () => void;
|
|
215
|
+
}
|
|
216
|
+
declare function useAccordionSection(): AccordionSectionContextValue;
|
|
217
|
+
|
|
56
218
|
interface FieldProps {
|
|
57
219
|
label?: string;
|
|
58
220
|
description?: string;
|
|
@@ -2322,4 +2484,4 @@ declare function useAnimation({ open, enterClass, exitClass, }: UseAnimationOpti
|
|
|
2322
2484
|
|
|
2323
2485
|
declare function useId(prefix?: string): string;
|
|
2324
2486
|
|
|
2325
|
-
export { Accordion, type AccordionContentProps, type AccordionContextValue, type AccordionItemProps, type AccordionProps, type AccordionTriggerProps, Action, type ActionColor, type ActionProps, type AffixPosition, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Brand, type BrandProps, Breadcrumbs, type BreadcrumbsItemProps, type BreadcrumbsProps, Calendar, type CalendarMode, type CalendarProps, Callout, type CalloutProps, Canvas, type CanvasContextValue, type CanvasControlsProps, type CanvasEdgeProps, type CanvasMinimapProps, type CanvasNodeProps, type CanvasProps, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, Carousel, type CarouselContextValue, type CarouselControlsProps, type CarouselPanelsProps, type CarouselProps, type CarouselSlideProps, type CarouselStepsProps, type CarouselVariant, Chart, type ChartAreaProps, type ChartBarData, type ChartBarProps, type ChartCommonProps, type ChartDonutData, type ChartDonutProps, type ChartHorizontalBarProps, type ChartLineProps, type ChartPieData, type ChartPieProps, type ChartSeries, type ChartSparklineProps, type ChartStackedBarProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type Color, ColorPicker, type ColorPickerProps, Command, type CommandContextValue, type CommandEmptyProps, type CommandGroupProps, type CommandInputProps, type CommandItemProps, type CommandListProps, type CommandProps, Composer, type ComposerProps, ContentRenderer, type ContentRendererProps, ContextMenu, type ContextMenuContentProps, type ContextMenuContextValue, type ContextMenuItemProps, type ContextMenuProps, type ContextMenuSeparatorProps, type ContextMenuTriggerProps, DatePicker, type DatePickerProps, type DateRange, Diagram, type DiagramContextValue, type DiagramEntityData, type DiagramEntityProps, type DiagramFieldData, type DiagramFieldProps, type DiagramProps, type DiagramRelationData, type DiagramRelationProps, type DiagramSchema, type DiagramToolbarProps, type DiagramType, type DropPosition, Dropdown, type DropdownContextValue, type DropdownItemProps, type DropdownItemsProps, type DropdownProps, type DropdownSeparatorProps, type DropdownTriggerProps, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, type EdgeAnchor, Editor, type EditorAction, type EditorContentProps, type EditorContextValue, type EditorProps, type EditorToolbarProps, Emoji, type EmojiCategory, type EmojiCategoryKey, type EmojiEntry, type EmojiFlatEntry, type EmojiProps, EmojiSelect, type EmojiSelectProps, type ExportFormat, Field, type FieldProps, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, Heading, type HeadingProps, Icon, type IconProps, type IconSet, Input, type InputAffixProps, type InputBaseProps, type InputOption, type InputOptionGroup, type InputProps, Kanban, type KanbanCardProps, type KanbanColumnProps, type KanbanContextValue, type KanbanProps, Menu, type MenuContextValue, type MenuGroupProps, type MenuItemProps, type MenuOrientation, type MenuProps, type MenuSubmenuProps, MobileMenu, type MobileMenuBottomBarProps, type MobileMenuContextValue, type MobileMenuFlyoutProps, type MobileMenuItemProps, type MobileMenuSide, type MobileMenuVariant, Modal, type ModalBodyProps, type ModalContextValue, type ModalFooterProps, type ModalHeaderProps, type ModalProps, MultiSwitch, type MultiSwitchProps, Navbar, type NavbarBrandProps, type NavbarContextValue, type NavbarItemProps, type NavbarItemsProps, type NavbarProps, type NavbarToggleProps, type NodeRect, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Pillbox, type PillboxProps, type Placement, Popover, type PopoverContentProps, type PopoverContextValue, type PopoverProps, type PopoverTriggerProps, Portal, type PortalProps, Profile, type ProfileProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RelationType, type RenderExtension, type RenderExtensionProps, SKIN_TONES, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarCollapseMode, type SidebarContextValue, type SidebarGroupProps, type SidebarItemProps, type SidebarProps, type SidebarSubmenuProps, type SidebarToggleProps, type Size, Skeleton, type SkeletonProps, type SkinTone, Slider, type SliderProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableHeadProps, type TablePaginationProps, type TableProps, type TableRowProps, type TableRowTrayProps, type TableSearchProps, type TableTrayProps, Tabs, type TabsContextValue, type TabsListProps, type TabsPanelProps, type TabsPanelsProps, type TabsProps, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Timeline, type TimelineBlockProps, type TimelineEvent, type TimelineItemProps, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toast, type ToastContextValue, type ToastData, type ToastPosition, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, TreeNav, type TreeNavContextValue, type TreeNavProps, type TreeNodeData, type TreeNodeProps, type Variant, type ViewportState, applyTone, cn, configureIcons, find, hasSkinTones, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, useAccordion, useAnimation, useCanvas, useCarousel, useCommand, useContextMenu, useControllableState, useDiagram, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|
|
2487
|
+
export { Accordion, type AccordionContentProps, type AccordionContextValue, type AccordionItemProps, type AccordionOrientation, AccordionPanel, AccordionPanelContent, type AccordionPanelContentProps, type AccordionPanelProps, AccordionPanelSection, type AccordionPanelSectionProps, AccordionPanelTrigger, type AccordionPanelTriggerProps, type AccordionProps, type AccordionTriggerProps, Action, type ActionColor, type ActionProps, type AffixPosition, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Brand, type BrandProps, Breadcrumbs, type BreadcrumbsItemProps, type BreadcrumbsProps, Calendar, type CalendarMode, type CalendarProps, Callout, type CalloutProps, Canvas, type CanvasContextValue, type CanvasControlsProps, type CanvasEdgeProps, type CanvasMinimapProps, type CanvasNodeProps, type CanvasProps, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, Carousel, type CarouselContextValue, type CarouselControlsProps, type CarouselPanelsProps, type CarouselProps, type CarouselSlideProps, type CarouselStepsProps, type CarouselVariant, Chart, type ChartAreaProps, type ChartBarData, type ChartBarProps, type ChartCommonProps, type ChartDonutData, type ChartDonutProps, type ChartHorizontalBarProps, type ChartLineProps, type ChartPieData, type ChartPieProps, type ChartSeries, type ChartSparklineProps, type ChartStackedBarProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type Color, ColorPicker, type ColorPickerProps, Command, type CommandContextValue, type CommandEmptyProps, type CommandGroupProps, type CommandInputProps, type CommandItemProps, type CommandListProps, type CommandProps, Composer, type ComposerProps, ContentRenderer, type ContentRendererProps, ContextMenu, type ContextMenuContentProps, type ContextMenuContextValue, type ContextMenuItemProps, type ContextMenuProps, type ContextMenuSeparatorProps, type ContextMenuTriggerProps, DatePicker, type DatePickerProps, type DateRange, Diagram, type DiagramContextValue, type DiagramEntityData, type DiagramEntityProps, type DiagramFieldData, type DiagramFieldProps, type DiagramProps, type DiagramRelationData, type DiagramRelationProps, type DiagramSchema, type DiagramToolbarProps, type DiagramType, type DropPosition, Dropdown, type DropdownContextValue, type DropdownItemProps, type DropdownItemsProps, type DropdownProps, type DropdownSeparatorProps, type DropdownTriggerProps, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, type EdgeAnchor, Editor, type EditorAction, type EditorContentProps, type EditorContextValue, type EditorProps, type EditorToolbarProps, Emoji, type EmojiCategory, type EmojiCategoryKey, type EmojiEntry, type EmojiFlatEntry, type EmojiProps, EmojiSelect, type EmojiSelectProps, type ExportFormat, Field, type FieldProps, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, Heading, type HeadingProps, Icon, type IconProps, type IconSet, Input, type InputAffixProps, type InputBaseProps, type InputOption, type InputOptionGroup, type InputProps, Kanban, type KanbanCardProps, type KanbanColumnProps, type KanbanContextValue, type KanbanProps, Menu, type MenuContextValue, type MenuGroupProps, type MenuItemProps, type MenuOrientation, type MenuProps, type MenuSubmenuProps, MobileMenu, type MobileMenuBottomBarProps, type MobileMenuContextValue, type MobileMenuFlyoutProps, type MobileMenuItemProps, type MobileMenuSide, type MobileMenuVariant, Modal, type ModalBodyProps, type ModalContextValue, type ModalFooterProps, type ModalHeaderProps, type ModalProps, MultiSwitch, type MultiSwitchProps, Navbar, type NavbarBrandProps, type NavbarContextValue, type NavbarItemProps, type NavbarItemsProps, type NavbarProps, type NavbarToggleProps, type NodeRect, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Pillbox, type PillboxProps, type Placement, Popover, type PopoverContentProps, type PopoverContextValue, type PopoverProps, type PopoverTriggerProps, Portal, type PortalProps, Profile, type ProfileProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RelationType, type RenderExtension, type RenderExtensionProps, SKIN_TONES, type SectionRenderState, type SectionRenderable, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarCollapseMode, type SidebarContextValue, type SidebarGroupProps, type SidebarItemProps, type SidebarProps, type SidebarSubmenuProps, type SidebarToggleProps, type Size, Skeleton, type SkeletonProps, type SkinTone, Slider, type SliderProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableHeadProps, type TablePaginationProps, type TableProps, type TableRowProps, type TableRowTrayProps, type TableSearchProps, type TableTrayProps, Tabs, type TabsContextValue, type TabsListProps, type TabsPanelProps, type TabsPanelsProps, type TabsProps, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Timeline, type TimelineBlockProps, type TimelineEvent, type TimelineItemProps, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toast, type ToastContextValue, type ToastData, type ToastPosition, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, TreeNav, type TreeNavContextValue, type TreeNavProps, type TreeNodeData, type TreeNodeProps, type Variant, type ViewportState, applyTone, cn, configureIcons, find, hasSkinTones, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, useAccordion, useAccordionPanel, useAccordionSection, useAnimation, useCanvas, useCarousel, useCommand, useContextMenu, useControllableState, useDiagram, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,168 @@ interface ActionProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "col
|
|
|
53
53
|
|
|
54
54
|
declare const Action: react.ForwardRefExoticComponent<ActionProps & react.RefAttributes<HTMLButtonElement>>;
|
|
55
55
|
|
|
56
|
+
type AccordionOrientation = "horizontal" | "vertical";
|
|
57
|
+
/**
|
|
58
|
+
* Render-prop or static node accepted by Trigger.children — lets the
|
|
59
|
+
* caller branch rendering on the section state.
|
|
60
|
+
*/
|
|
61
|
+
type SectionRenderable = ReactNode | ((state: SectionRenderState) => ReactNode);
|
|
62
|
+
interface SectionRenderState {
|
|
63
|
+
/** Section's id */
|
|
64
|
+
id: string;
|
|
65
|
+
/** True when the section is currently open */
|
|
66
|
+
open: boolean;
|
|
67
|
+
/** Direction the panel is laid out in */
|
|
68
|
+
orientation: AccordionOrientation;
|
|
69
|
+
/** Toggle this section open/closed */
|
|
70
|
+
toggle: () => void;
|
|
71
|
+
}
|
|
72
|
+
interface AccordionPanelProps {
|
|
73
|
+
/** Layout direction. Horizontal for menus/toolbars, vertical for sidebars/panels. */
|
|
74
|
+
orientation?: AccordionOrientation;
|
|
75
|
+
/** Controlled list of open section ids */
|
|
76
|
+
value?: string[];
|
|
77
|
+
/** Default open section ids (uncontrolled) */
|
|
78
|
+
defaultValue?: string[];
|
|
79
|
+
/** Fires whenever the open set changes */
|
|
80
|
+
onValueChange?: (open: string[]) => void;
|
|
81
|
+
/** Optional class on the root container */
|
|
82
|
+
className?: string;
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}
|
|
85
|
+
interface AccordionPanelSectionProps {
|
|
86
|
+
/** Stable id used for open-state tracking */
|
|
87
|
+
id: string;
|
|
88
|
+
/**
|
|
89
|
+
* Pinned sections never collapse. Useful for an "anchor" item like a
|
|
90
|
+
* Home button at the start of a menu.
|
|
91
|
+
*/
|
|
92
|
+
pinned?: boolean;
|
|
93
|
+
/** Class on the section's outer container */
|
|
94
|
+
className?: string;
|
|
95
|
+
/** Class applied only when the section is open */
|
|
96
|
+
openClassName?: string;
|
|
97
|
+
/** Class applied only when the section is collapsed */
|
|
98
|
+
closedClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Children. Compose with `<AccordionPanel.Trigger>` and
|
|
101
|
+
* `<AccordionPanel.Content>` — Trigger always renders, Content only
|
|
102
|
+
* renders when the section is open.
|
|
103
|
+
*/
|
|
104
|
+
children: ReactNode;
|
|
105
|
+
}
|
|
106
|
+
interface AccordionPanelTriggerProps {
|
|
107
|
+
/**
|
|
108
|
+
* Custom render. Receives section state — `{ open, toggle, ... }`. If
|
|
109
|
+
* omitted, the default chevron-divider is rendered.
|
|
110
|
+
*/
|
|
111
|
+
children?: SectionRenderable;
|
|
112
|
+
/** Class on the trigger element */
|
|
113
|
+
className?: string;
|
|
114
|
+
/** Aria label override (default: "Toggle section") */
|
|
115
|
+
"aria-label"?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* One collapsible section inside an AccordionPanel.
|
|
120
|
+
*
|
|
121
|
+
* Compose with `<AccordionPanel.Trigger>` and `<AccordionPanel.Content>`
|
|
122
|
+
* children — Content renders only when open, Trigger always renders and
|
|
123
|
+
* adapts its look by state. Children that are not Trigger/Content are
|
|
124
|
+
* rendered as-is, regardless of state, so static decorations stay put.
|
|
125
|
+
*
|
|
126
|
+
* Pinned sections never collapse and don't need a Trigger.
|
|
127
|
+
*/
|
|
128
|
+
declare function AccordionPanelSection({ id, pinned, className, openClassName, closedClassName, children, }: AccordionPanelSectionProps): react_jsx_runtime.JSX.Element;
|
|
129
|
+
declare namespace AccordionPanelSection {
|
|
130
|
+
var displayName: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Trigger for an AccordionPanel.Section.
|
|
135
|
+
*
|
|
136
|
+
* Has two visual roles, picked automatically from section state:
|
|
137
|
+
*
|
|
138
|
+
* - When the section is OPEN: renders as a thin divider on the section's
|
|
139
|
+
* trailing edge. Hovering reveals an inset chevron pointing toward the
|
|
140
|
+
* section so the user knows clicking will collapse it.
|
|
141
|
+
*
|
|
142
|
+
* - When the section is CLOSED: renders as a standalone chevron button
|
|
143
|
+
* in place of the section content. Clicking re-expands the section.
|
|
144
|
+
*
|
|
145
|
+
* Supply `children` (node or render-prop) to fully replace the default
|
|
146
|
+
* rendering. The render-prop receives `{ open, toggle, orientation, id }`.
|
|
147
|
+
*/
|
|
148
|
+
declare function AccordionPanelTrigger({ children, className, "aria-label": ariaLabel, }: AccordionPanelTriggerProps): react_jsx_runtime.JSX.Element;
|
|
149
|
+
declare namespace AccordionPanelTrigger {
|
|
150
|
+
var displayName: string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface AccordionPanelContentProps {
|
|
154
|
+
children: ReactNode;
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Wrapper for the open-state content of a Section. Renders its children
|
|
159
|
+
* only when the parent Section is open; returns `null` otherwise.
|
|
160
|
+
*
|
|
161
|
+
* Use this so siblings of `<AccordionPanel.Trigger>` inside a section can
|
|
162
|
+
* cleanly toggle in/out of the DOM. Layout style flows through the
|
|
163
|
+
* `className` prop (defaults to a flex row/column matching orientation).
|
|
164
|
+
*/
|
|
165
|
+
declare function AccordionPanelContent({ children, className, }: AccordionPanelContentProps): react_jsx_runtime.JSX.Element | null;
|
|
166
|
+
declare namespace AccordionPanelContent {
|
|
167
|
+
var displayName: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Horizontal or vertical accordion of collapsible sections.
|
|
172
|
+
*
|
|
173
|
+
* Use the compound parts:
|
|
174
|
+
* <AccordionPanel orientation="horizontal" defaultValue={["wishlist"]}>
|
|
175
|
+
* <AccordionPanel.Section id="home" pinned>
|
|
176
|
+
* <Action icon="home" />
|
|
177
|
+
* </AccordionPanel.Section>
|
|
178
|
+
* <AccordionPanel.Section id="wishlist">
|
|
179
|
+
* <Action icon="list">Wishlist</Action>
|
|
180
|
+
* </AccordionPanel.Section>
|
|
181
|
+
* </AccordionPanel>
|
|
182
|
+
*
|
|
183
|
+
* Each non-pinned section renders a trigger (default chevron-divider) that
|
|
184
|
+
* collapses/expands. Pass a custom `trigger` prop on a Section, or use the
|
|
185
|
+
* exported `AccordionPanel.Trigger` directly to compose your own.
|
|
186
|
+
*/
|
|
187
|
+
declare function AccordionPanelRoot({ orientation, value: controlledValue, defaultValue, onValueChange, className, children, }: AccordionPanelProps): react_jsx_runtime.JSX.Element;
|
|
188
|
+
declare namespace AccordionPanelRoot {
|
|
189
|
+
var displayName: string;
|
|
190
|
+
}
|
|
191
|
+
type AccordionPanelType = typeof AccordionPanelRoot & {
|
|
192
|
+
Section: typeof AccordionPanelSection;
|
|
193
|
+
Trigger: typeof AccordionPanelTrigger;
|
|
194
|
+
Content: typeof AccordionPanelContent;
|
|
195
|
+
};
|
|
196
|
+
declare const AccordionPanel: AccordionPanelType;
|
|
197
|
+
|
|
198
|
+
interface AccordionPanelContextValue {
|
|
199
|
+
orientation: AccordionOrientation;
|
|
200
|
+
isOpen: (id: string) => boolean;
|
|
201
|
+
toggle: (id: string) => void;
|
|
202
|
+
open: (id: string) => void;
|
|
203
|
+
close: (id: string) => void;
|
|
204
|
+
/** Ordered list of all section ids registered in this panel */
|
|
205
|
+
sectionIds: string[];
|
|
206
|
+
registerSection: (id: string) => () => void;
|
|
207
|
+
}
|
|
208
|
+
declare function useAccordionPanel(): AccordionPanelContextValue;
|
|
209
|
+
interface AccordionSectionContextValue {
|
|
210
|
+
id: string;
|
|
211
|
+
open: boolean;
|
|
212
|
+
pinned: boolean;
|
|
213
|
+
orientation: AccordionOrientation;
|
|
214
|
+
toggle: () => void;
|
|
215
|
+
}
|
|
216
|
+
declare function useAccordionSection(): AccordionSectionContextValue;
|
|
217
|
+
|
|
56
218
|
interface FieldProps {
|
|
57
219
|
label?: string;
|
|
58
220
|
description?: string;
|
|
@@ -2322,4 +2484,4 @@ declare function useAnimation({ open, enterClass, exitClass, }: UseAnimationOpti
|
|
|
2322
2484
|
|
|
2323
2485
|
declare function useId(prefix?: string): string;
|
|
2324
2486
|
|
|
2325
|
-
export { Accordion, type AccordionContentProps, type AccordionContextValue, type AccordionItemProps, type AccordionProps, type AccordionTriggerProps, Action, type ActionColor, type ActionProps, type AffixPosition, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Brand, type BrandProps, Breadcrumbs, type BreadcrumbsItemProps, type BreadcrumbsProps, Calendar, type CalendarMode, type CalendarProps, Callout, type CalloutProps, Canvas, type CanvasContextValue, type CanvasControlsProps, type CanvasEdgeProps, type CanvasMinimapProps, type CanvasNodeProps, type CanvasProps, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, Carousel, type CarouselContextValue, type CarouselControlsProps, type CarouselPanelsProps, type CarouselProps, type CarouselSlideProps, type CarouselStepsProps, type CarouselVariant, Chart, type ChartAreaProps, type ChartBarData, type ChartBarProps, type ChartCommonProps, type ChartDonutData, type ChartDonutProps, type ChartHorizontalBarProps, type ChartLineProps, type ChartPieData, type ChartPieProps, type ChartSeries, type ChartSparklineProps, type ChartStackedBarProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type Color, ColorPicker, type ColorPickerProps, Command, type CommandContextValue, type CommandEmptyProps, type CommandGroupProps, type CommandInputProps, type CommandItemProps, type CommandListProps, type CommandProps, Composer, type ComposerProps, ContentRenderer, type ContentRendererProps, ContextMenu, type ContextMenuContentProps, type ContextMenuContextValue, type ContextMenuItemProps, type ContextMenuProps, type ContextMenuSeparatorProps, type ContextMenuTriggerProps, DatePicker, type DatePickerProps, type DateRange, Diagram, type DiagramContextValue, type DiagramEntityData, type DiagramEntityProps, type DiagramFieldData, type DiagramFieldProps, type DiagramProps, type DiagramRelationData, type DiagramRelationProps, type DiagramSchema, type DiagramToolbarProps, type DiagramType, type DropPosition, Dropdown, type DropdownContextValue, type DropdownItemProps, type DropdownItemsProps, type DropdownProps, type DropdownSeparatorProps, type DropdownTriggerProps, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, type EdgeAnchor, Editor, type EditorAction, type EditorContentProps, type EditorContextValue, type EditorProps, type EditorToolbarProps, Emoji, type EmojiCategory, type EmojiCategoryKey, type EmojiEntry, type EmojiFlatEntry, type EmojiProps, EmojiSelect, type EmojiSelectProps, type ExportFormat, Field, type FieldProps, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, Heading, type HeadingProps, Icon, type IconProps, type IconSet, Input, type InputAffixProps, type InputBaseProps, type InputOption, type InputOptionGroup, type InputProps, Kanban, type KanbanCardProps, type KanbanColumnProps, type KanbanContextValue, type KanbanProps, Menu, type MenuContextValue, type MenuGroupProps, type MenuItemProps, type MenuOrientation, type MenuProps, type MenuSubmenuProps, MobileMenu, type MobileMenuBottomBarProps, type MobileMenuContextValue, type MobileMenuFlyoutProps, type MobileMenuItemProps, type MobileMenuSide, type MobileMenuVariant, Modal, type ModalBodyProps, type ModalContextValue, type ModalFooterProps, type ModalHeaderProps, type ModalProps, MultiSwitch, type MultiSwitchProps, Navbar, type NavbarBrandProps, type NavbarContextValue, type NavbarItemProps, type NavbarItemsProps, type NavbarProps, type NavbarToggleProps, type NodeRect, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Pillbox, type PillboxProps, type Placement, Popover, type PopoverContentProps, type PopoverContextValue, type PopoverProps, type PopoverTriggerProps, Portal, type PortalProps, Profile, type ProfileProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RelationType, type RenderExtension, type RenderExtensionProps, SKIN_TONES, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarCollapseMode, type SidebarContextValue, type SidebarGroupProps, type SidebarItemProps, type SidebarProps, type SidebarSubmenuProps, type SidebarToggleProps, type Size, Skeleton, type SkeletonProps, type SkinTone, Slider, type SliderProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableHeadProps, type TablePaginationProps, type TableProps, type TableRowProps, type TableRowTrayProps, type TableSearchProps, type TableTrayProps, Tabs, type TabsContextValue, type TabsListProps, type TabsPanelProps, type TabsPanelsProps, type TabsProps, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Timeline, type TimelineBlockProps, type TimelineEvent, type TimelineItemProps, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toast, type ToastContextValue, type ToastData, type ToastPosition, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, TreeNav, type TreeNavContextValue, type TreeNavProps, type TreeNodeData, type TreeNodeProps, type Variant, type ViewportState, applyTone, cn, configureIcons, find, hasSkinTones, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, useAccordion, useAnimation, useCanvas, useCarousel, useCommand, useContextMenu, useControllableState, useDiagram, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|
|
2487
|
+
export { Accordion, type AccordionContentProps, type AccordionContextValue, type AccordionItemProps, type AccordionOrientation, AccordionPanel, AccordionPanelContent, type AccordionPanelContentProps, type AccordionPanelProps, AccordionPanelSection, type AccordionPanelSectionProps, AccordionPanelTrigger, type AccordionPanelTriggerProps, type AccordionProps, type AccordionTriggerProps, Action, type ActionColor, type ActionProps, type AffixPosition, Autocomplete, type AutocompleteOption, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Brand, type BrandProps, Breadcrumbs, type BreadcrumbsItemProps, type BreadcrumbsProps, Calendar, type CalendarMode, type CalendarProps, Callout, type CalloutProps, Canvas, type CanvasContextValue, type CanvasControlsProps, type CanvasEdgeProps, type CanvasMinimapProps, type CanvasNodeProps, type CanvasProps, Card, type CardBodyProps, type CardFooterProps, type CardHeaderProps, type CardProps, Carousel, type CarouselContextValue, type CarouselControlsProps, type CarouselPanelsProps, type CarouselProps, type CarouselSlideProps, type CarouselStepsProps, type CarouselVariant, Chart, type ChartAreaProps, type ChartBarData, type ChartBarProps, type ChartCommonProps, type ChartDonutData, type ChartDonutProps, type ChartHorizontalBarProps, type ChartLineProps, type ChartPieData, type ChartPieProps, type ChartSeries, type ChartSparklineProps, type ChartStackedBarProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type Color, ColorPicker, type ColorPickerProps, Command, type CommandContextValue, type CommandEmptyProps, type CommandGroupProps, type CommandInputProps, type CommandItemProps, type CommandListProps, type CommandProps, Composer, type ComposerProps, ContentRenderer, type ContentRendererProps, ContextMenu, type ContextMenuContentProps, type ContextMenuContextValue, type ContextMenuItemProps, type ContextMenuProps, type ContextMenuSeparatorProps, type ContextMenuTriggerProps, DatePicker, type DatePickerProps, type DateRange, Diagram, type DiagramContextValue, type DiagramEntityData, type DiagramEntityProps, type DiagramFieldData, type DiagramFieldProps, type DiagramProps, type DiagramRelationData, type DiagramRelationProps, type DiagramSchema, type DiagramToolbarProps, type DiagramType, type DropPosition, Dropdown, type DropdownContextValue, type DropdownItemProps, type DropdownItemsProps, type DropdownProps, type DropdownSeparatorProps, type DropdownTriggerProps, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, type EdgeAnchor, Editor, type EditorAction, type EditorContentProps, type EditorContextValue, type EditorProps, type EditorToolbarProps, Emoji, type EmojiCategory, type EmojiCategoryKey, type EmojiEntry, type EmojiFlatEntry, type EmojiProps, EmojiSelect, type EmojiSelectProps, type ExportFormat, Field, type FieldProps, FileUpload, type FileUploadContextValue, type FileUploadDropzoneProps, type FileUploadListProps, type FileUploadProps, Heading, type HeadingProps, Icon, type IconProps, type IconSet, Input, type InputAffixProps, type InputBaseProps, type InputOption, type InputOptionGroup, type InputProps, Kanban, type KanbanCardProps, type KanbanColumnProps, type KanbanContextValue, type KanbanProps, Menu, type MenuContextValue, type MenuGroupProps, type MenuItemProps, type MenuOrientation, type MenuProps, type MenuSubmenuProps, MobileMenu, type MobileMenuBottomBarProps, type MobileMenuContextValue, type MobileMenuFlyoutProps, type MobileMenuItemProps, type MobileMenuSide, type MobileMenuVariant, Modal, type ModalBodyProps, type ModalContextValue, type ModalFooterProps, type ModalHeaderProps, type ModalProps, MultiSwitch, type MultiSwitchProps, Navbar, type NavbarBrandProps, type NavbarContextValue, type NavbarItemProps, type NavbarItemsProps, type NavbarProps, type NavbarToggleProps, type NodeRect, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Pillbox, type PillboxProps, type Placement, Popover, type PopoverContentProps, type PopoverContextValue, type PopoverProps, type PopoverTriggerProps, Portal, type PortalProps, Profile, type ProfileProps, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RelationType, type RenderExtension, type RenderExtensionProps, SKIN_TONES, type SectionRenderState, type SectionRenderable, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarCollapseMode, type SidebarContextValue, type SidebarGroupProps, type SidebarItemProps, type SidebarProps, type SidebarSubmenuProps, type SidebarToggleProps, type Size, Skeleton, type SkeletonProps, type SkinTone, Slider, type SliderProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableHeadProps, type TablePaginationProps, type TableProps, type TableRowProps, type TableRowTrayProps, type TableSearchProps, type TableTrayProps, Tabs, type TabsContextValue, type TabsListProps, type TabsPanelProps, type TabsPanelsProps, type TabsProps, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Timeline, type TimelineBlockProps, type TimelineEvent, type TimelineItemProps, type TimelineOrientation, type TimelineProps, type TimelineVariant, Toast, type ToastContextValue, type ToastData, type ToastPosition, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipProps, TreeNav, type TreeNavContextValue, type TreeNavProps, type TreeNodeData, type TreeNodeProps, type Variant, type ViewportState, applyTone, cn, configureIcons, find, hasSkinTones, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, useAccordion, useAccordionPanel, useAccordionSection, useAnimation, useCanvas, useCarousel, useCommand, useContextMenu, useControllableState, useDiagram, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|