@stackone/malachite 0.39.0 → 0.40.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/COMPONENTS.md +1 -1
- package/dist/index.d.ts +19 -2
- package/dist/index.js +1421 -1404
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -20,7 +20,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
20
20
|
## Lists, rows & navigation
|
|
21
21
|
|
|
22
22
|
- **`ButtonList`** — Vertical list of pill-style button/link rows with built-in hover/focus/active states. _Key props:_ `buttons[]` (`key`, `children`, `onClick`, `href`), `compact`.
|
|
23
|
-
- **`Accordion`** — Expand/collapse section with a clickable header (arrow + title + trailing slot). Controlled or uncontrolled. _Key props:_ `title`, `trailing`, `isExpanded`/`defaultExpanded`, `onToggle`.
|
|
23
|
+
- **`Accordion`** — Expand/collapse section with a clickable header (disclosure arrow + title/header + trailing slot). Use `header` for rich content and `trailing` for an interactive control (e.g. a Checkbox) — trailing sits outside the toggle button, so a selectable+expandable row is just an Accordion. Controlled or uncontrolled. _Key props:_ `title` or `header`, `trailing`, `disabled`, `isExpanded`/`defaultExpanded`, `onToggle`.
|
|
24
24
|
- **`DefinitionRow`** — Row showing an icon, label, optional tag and description — for definition/detail lists. _Key props:_ `icon`, `label`, `tag`, `description`.
|
|
25
25
|
- **`PreviewTree`** — Nested, indented tree for previewing hierarchical structure.
|
|
26
26
|
- **`PreviewTreeRow`** — A single labelled row within a PreviewTree. _Key props:_ `label`.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,16 +10,33 @@ import { UseFormReturn } from 'react-hook-form';
|
|
|
10
10
|
|
|
11
11
|
export declare const Accordion: default_2.FC<AccordionProps>;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
title: string;
|
|
13
|
+
declare interface AccordionBaseProps {
|
|
15
14
|
className?: string;
|
|
16
15
|
children?: default_2.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Content pinned to the right of the header, OUTSIDE the toggle button — so it may
|
|
18
|
+
* be interactive (e.g. a Checkbox) without nesting a button inside a button.
|
|
19
|
+
*/
|
|
17
20
|
trailing?: default_2.ReactNode;
|
|
18
21
|
defaultExpanded?: boolean;
|
|
19
22
|
isExpanded?: boolean;
|
|
20
23
|
onToggle?: (expanded: boolean) => void;
|
|
24
|
+
/** Disables the toggle (and its hover). Trailing controls manage their own state. */
|
|
25
|
+
disabled?: boolean;
|
|
21
26
|
}
|
|
22
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Requires at least one of `title` (simple text header) or `header` (rich ReactNode
|
|
30
|
+
* content for the toggle area, e.g. avatar + badges) so the toggle is never empty.
|
|
31
|
+
*/
|
|
32
|
+
export declare type AccordionProps = AccordionBaseProps & ({
|
|
33
|
+
title: string;
|
|
34
|
+
header?: default_2.ReactNode;
|
|
35
|
+
} | {
|
|
36
|
+
title?: string;
|
|
37
|
+
header: default_2.ReactNode;
|
|
38
|
+
});
|
|
39
|
+
|
|
23
40
|
/**
|
|
24
41
|
* ActionMenu is a kebab-style overflow action menu. The trigger renders a
|
|
25
42
|
* three-dot icon button; on click, a popover appears with the given items.
|