···15157. Run `pnpm hip install --all` in the apps/docs dir
16168. Generate and .mdx page with example in apps/docs
17171818-## Rules
1818+## Rules for Components
19192020- Prefer using packages/hip-ui/src/components/flex and packages/hip-ui/src/components/grid over css for things layout related
2121- Use icon from lucide-react
2222- Prefer re-using existing component rather than redefining them
2323+- For composite components use the size prop only on the root element. otherwise use css to stylex for different sizes
···11+---
22+title: Disclosure
33+description: A collapsible section of content composed of a heading that expands and collapses a panel.
44+---
55+66+import { PropDocs } from '../../lib/PropDocs'
77+import { Example } from '../../lib/Example'
88+import { Basic } from '../../examples/disclosure/basic'
99+import { Expanded } from '../../examples/disclosure/expanded'
1010+import { Disabled } from '../../examples/disclosure/disabled'
1111+import { Sizes } from '../../examples/disclosure/sizes'
1212+1313+<Example src={Basic} />
1414+1515+## Installation
1616+1717+Run the following command to add the disclosure component to your project.
1818+1919+```bash
2020+pnpm hip install disclosure
2121+```
2222+2323+## Props
2424+2525+This component is built using the [React Aria Disclosure](https://react-spectrum.adobe.com/react-aria/Disclosure.html).
2626+2727+<PropDocs components={["Disclosure", "DisclosureTitle", "DisclosurePanel"]} />
2828+2929+## Features
3030+3131+### Expanded
3232+3333+Disclosure can be expanded by default using the `defaultExpanded` prop.
3434+3535+<Example src={Expanded} />
3636+3737+### Disabled State
3838+3939+Disclosure can be disabled to prevent interaction.
4040+4141+<Example src={Disabled} />
4242+4343+4444+### Sizes
4545+4646+Disclosure supports three different sizes: small, medium, and large.
4747+4848+<Example src={Sizes} />
4949+5050+## Related Components
5151+5252+- [Accordion](/docs/components/accordion) - For multiple collapsible sections
5353+- [Dialog](/docs/components/dialog) - For modal content
5454+- [Popover](/docs/components/popover) - For overlay content
5555+
+25
apps/docs/src/examples/disclosure/basic.tsx
···11+import * as stylex from "@stylexjs/stylex";
22+33+import {
44+ Disclosure,
55+ DisclosurePanel,
66+ DisclosureTitle,
77+} from "@/components/disclosure";
88+99+const styles = stylex.create({
1010+ root: {
1111+ width: "100%",
1212+ },
1313+});
1414+1515+export function Basic() {
1616+ return (
1717+ <Disclosure style={styles.root}>
1818+ <DisclosureTitle>System Requirements</DisclosureTitle>
1919+ <DisclosurePanel>
2020+ Details about system requirements here. Minimum system requirements
2121+ include Windows 10 or macOS 10.15 or later.
2222+ </DisclosurePanel>
2323+ </Disclosure>
2424+ );
2525+}
+14
apps/docs/src/examples/disclosure/disabled.tsx
···11+import { Disclosure, DisclosurePanel, DisclosureTitle } from "@/components/disclosure";
22+33+export function Disabled() {
44+ return (
55+ <Disclosure>
66+ <DisclosureTitle isDisabled>System Requirements</DisclosureTitle>
77+ <DisclosurePanel>
88+ Details about system requirements here.
99+ Minimum system requirements include Windows 10 or macOS 10.15 or later.
1010+ </DisclosurePanel>
1111+ </Disclosure>
1212+ );
1313+}
1414+
+14
apps/docs/src/examples/disclosure/expanded.tsx
···11+import { Disclosure, DisclosurePanel, DisclosureTitle } from "@/components/disclosure";
22+33+export function Expanded() {
44+ return (
55+ <Disclosure defaultExpanded>
66+ <DisclosureTitle>System Requirements</DisclosureTitle>
77+ <DisclosurePanel>
88+ Details about system requirements here.
99+ Minimum system requirements include Windows 10 or macOS 10.15 or later.
1010+ </DisclosurePanel>
1111+ </Disclosure>
1212+ );
1313+}
1414+