@peasant-labs/fairtrade 0.0.20 → 0.0.21
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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionGroupDisclosure - the one collapsed count control for a session list.
|
|
3
|
+
*
|
|
4
|
+
* The label names the group's membership and its count ("orphan sessions 2"),
|
|
5
|
+
* a chevron leads the control, and a trailing `show`/`hide` states what the
|
|
6
|
+
* press will do. The control is a real `<button>` with `aria-expanded` and
|
|
7
|
+
* `aria-controls`, so the row it reveals is named, not inferred.
|
|
8
|
+
*
|
|
9
|
+
* Expansion state stays with the caller: a group is an aside, and a viewer who
|
|
10
|
+
* opened it once has not asked for it to be open on every future visit. The
|
|
11
|
+
* revealed content renders only while expanded, so a folded row cannot be
|
|
12
|
+
* mistaken for a visible one and holds no page height.
|
|
13
|
+
*
|
|
14
|
+
* @param {object} props
|
|
15
|
+
* @param {import('react').ReactNode} props.label - the control's text while OPEN
|
|
16
|
+
* @param {import('react').ReactNode} props.collapsedLabel - the control's text
|
|
17
|
+
* while CLOSED; the caller writes it, because the sibling groups do not agree
|
|
18
|
+
* on a leading mark
|
|
19
|
+
* @param {boolean} props.expanded
|
|
20
|
+
* @param {() => void} props.onToggle
|
|
21
|
+
* @param {string} props.rowsID - the `id` of the element this control reveals;
|
|
22
|
+
* the caller owns that element
|
|
23
|
+
* @param {boolean} [props.bare] - drop the outer border when the group sits
|
|
24
|
+
* inside an already-bordered panel
|
|
25
|
+
* @param {boolean} [props.indent] - indent one step, so a group nested inside a
|
|
26
|
+
* list reads as belonging to it rather than as another list row
|
|
27
|
+
* @param {string} [props.testID] - base for the wrapper and control test ids:
|
|
28
|
+
* `<base>`, `<base>-toggle`, and `<base>-label`
|
|
29
|
+
* @param {import('react').ReactNode} [props.children] - revealed only while
|
|
30
|
+
* expanded
|
|
31
|
+
*/
|
|
32
|
+
export default function SessionGroupDisclosure({ label, collapsedLabel, expanded, onToggle, rowsID, bare, indent, testID, children, }: {
|
|
33
|
+
label: import("react").ReactNode;
|
|
34
|
+
collapsedLabel: import("react").ReactNode;
|
|
35
|
+
expanded: boolean;
|
|
36
|
+
onToggle: () => void;
|
|
37
|
+
rowsID: string;
|
|
38
|
+
bare?: boolean;
|
|
39
|
+
indent?: boolean;
|
|
40
|
+
testID?: string;
|
|
41
|
+
children?: import("react").ReactNode;
|
|
42
|
+
}): import("react").JSX.Element;
|
|
@@ -9,6 +9,7 @@ export { default as ChartBar } from "./ChartBar.jsx";
|
|
|
9
9
|
export { default as ChartLine } from "./ChartLine.jsx";
|
|
10
10
|
export { default as Sparkline } from "./Sparkline.jsx";
|
|
11
11
|
export { default as Accordion } from "./Accordion.jsx";
|
|
12
|
+
export { default as SessionGroupDisclosure } from "./SessionGroupDisclosure.jsx";
|
|
12
13
|
export { default as Dialog } from "./Dialog.jsx";
|
|
13
14
|
export { default as CommandPalette } from "./CommandPalette.jsx";
|
|
14
15
|
export { default as CommitGraph } from "./CommitGraph.jsx";
|