Skip to content

Commit

Permalink
docs(Accordion): add description to all props and enable live edit
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharzil committed Jan 21, 2025
1 parent 1bb3fbe commit 32e5cb3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ export interface AccordionProps extends VibeComponentProps {
* Array of initial expanded indexes
*/
defaultIndex?: Array<number>;
/**
* A classname to be added to the accordion container
*/
className?: string;
/**
* An id to be added the accordion container.
*/
id?: string;
}

const Accordion: VibeComponent<AccordionProps, unknown> & object = forwardRef(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Accordion from "../Accordion";
import AccordionItem from "../../AccordionItem/AccordionItem";
import { Canvas, Meta } from "@storybook/blocks";
import { Meta } from "@storybook/blocks";
import {
BREADCRUBMS,
EXPAND_COLLAPSE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export default {
export const Overview = {
render: accordionTemplate.bind({}),
name: "Overview",
args: {}
args: {},
parameters: {
docs: {
liveEdit: {
isEnabled: false
}
}
}
};

export const MultiActive = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,53 @@ import { VibeComponentProps, ElementContent } from "../../../types";

export interface AccordionItemProps extends VibeComponentProps {
/**
* Header title
* Header title for the accordion item.
*/
title?: ElementContent;
/**
* The value of the expandable section
*/
children?: ElementContent;
/**
* The expand icon font size
* The font size of the expand/collapse icon.
*/
iconSize?: number | string;
/**
* On click callback
* Custom callback triggered when the item is clicked.
*/
onClick?: () => void;
/** @ignore */
open?: boolean;
/** @ignore */
onClickAccordionCallback?: () => void;
/**
* Determines whether the item's border is hidden.
*/
hideBorder?: boolean;
/**
* Custom class name to add to the header of the expandable
*/
headerClassName?: string;
/**
* Custom class name to add to the content of the expandable
*/
contentClassName?: string;
/**
* Custom class name to add to the ExpandCollapse component
*/
expandCollapseComponentClassName?: string;
/**
* Determines whether click events are captured.
*/
captureOnClick?: boolean;
/**
* A classname to be added to the accordion item container
*/
className?: string;
/**
* An id to be added the accordion item container.
*/
id?: string;
}

const AccordionItem: React.FC<AccordionItemProps> = forwardRef(
Expand Down

0 comments on commit 32e5cb3

Please sign in to comment.