@peasant-labs/fairtrade 0.0.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.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -0
  3. package/dist/lib/README.md +13 -0
  4. package/dist/lib/base.css +48 -0
  5. package/dist/lib/components.css +2 -0
  6. package/dist/lib/fonts.css +28 -0
  7. package/dist/lib/tokens.css +184 -0
  8. package/dist/lib/tokens.json +768 -0
  9. package/dist/lib/types/Accordion.d.ts +47 -0
  10. package/dist/lib/types/Accordion.stories.d.ts +91 -0
  11. package/dist/lib/types/Avatar.d.ts +94 -0
  12. package/dist/lib/types/Avatar.stories.d.ts +160 -0
  13. package/dist/lib/types/BrandMark.d.ts +25 -0
  14. package/dist/lib/types/BrandMark.stories.d.ts +75 -0
  15. package/dist/lib/types/Breadcrumb.d.ts +66 -0
  16. package/dist/lib/types/Breadcrumb.stories.d.ts +91 -0
  17. package/dist/lib/types/Button.d.ts +86 -0
  18. package/dist/lib/types/Button.stories.d.ts +129 -0
  19. package/dist/lib/types/Card.d.ts +145 -0
  20. package/dist/lib/types/Card.stories.d.ts +70 -0
  21. package/dist/lib/types/Chart.stories.d.ts +55 -0
  22. package/dist/lib/types/ChartBar.d.ts +51 -0
  23. package/dist/lib/types/ChartLine.d.ts +54 -0
  24. package/dist/lib/types/Checkbox.d.ts +132 -0
  25. package/dist/lib/types/Checkbox.stories.d.ts +75 -0
  26. package/dist/lib/types/Chip.d.ts +85 -0
  27. package/dist/lib/types/Chip.stories.d.ts +190 -0
  28. package/dist/lib/types/CliOnboard.d.ts +68 -0
  29. package/dist/lib/types/CliOnboard.stories.d.ts +24 -0
  30. package/dist/lib/types/CommandPalette.d.ts +6 -0
  31. package/dist/lib/types/CommandPalette.stories.d.ts +94 -0
  32. package/dist/lib/types/CommitGraph.d.ts +71 -0
  33. package/dist/lib/types/CommitGraph.stories.d.ts +17 -0
  34. package/dist/lib/types/ConnectionState.d.ts +82 -0
  35. package/dist/lib/types/ConnectionState.stories.d.ts +117 -0
  36. package/dist/lib/types/ConsentDialog.d.ts +97 -0
  37. package/dist/lib/types/ConsentDialog.stories.d.ts +61 -0
  38. package/dist/lib/types/DataTable.d.ts +116 -0
  39. package/dist/lib/types/DataTable.stories.d.ts +240 -0
  40. package/dist/lib/types/DateRange.d.ts +242 -0
  41. package/dist/lib/types/DateRange.stories.d.ts +272 -0
  42. package/dist/lib/types/Dialog.d.ts +9 -0
  43. package/dist/lib/types/Dialog.stories.d.ts +121 -0
  44. package/dist/lib/types/DiffView.d.ts +39 -0
  45. package/dist/lib/types/DiffView.stories.d.ts +118 -0
  46. package/dist/lib/types/EmptyState.d.ts +28 -0
  47. package/dist/lib/types/EmptyState.stories.d.ts +130 -0
  48. package/dist/lib/types/EvidenceCaption.d.ts +39 -0
  49. package/dist/lib/types/EvidenceCaption.stories.d.ts +43 -0
  50. package/dist/lib/types/Explainer.d.ts +82 -0
  51. package/dist/lib/types/Explainer.stories.d.ts +22 -0
  52. package/dist/lib/types/FacetRail.d.ts +13 -0
  53. package/dist/lib/types/FacetRail.stories.d.ts +28 -0
  54. package/dist/lib/types/Feedback.d.ts +222 -0
  55. package/dist/lib/types/Feedback.stories.d.ts +81 -0
  56. package/dist/lib/types/GroupedMultiSelect.d.ts +67 -0
  57. package/dist/lib/types/GroupedMultiSelect.stories.d.ts +59 -0
  58. package/dist/lib/types/Input.d.ts +158 -0
  59. package/dist/lib/types/Input.stories.d.ts +181 -0
  60. package/dist/lib/types/Intensity.d.ts +55 -0
  61. package/dist/lib/types/Intensity.stories.d.ts +108 -0
  62. package/dist/lib/types/MapCanvas.d.ts +89 -0
  63. package/dist/lib/types/MapCanvas.stories.d.ts +174 -0
  64. package/dist/lib/types/Menu.d.ts +62 -0
  65. package/dist/lib/types/Menu.stories.d.ts +173 -0
  66. package/dist/lib/types/ModerationQueue.d.ts +135 -0
  67. package/dist/lib/types/ModerationQueue.stories.d.ts +34 -0
  68. package/dist/lib/types/Pager.d.ts +47 -0
  69. package/dist/lib/types/Pager.stories.d.ts +100 -0
  70. package/dist/lib/types/Pagination.d.ts +50 -0
  71. package/dist/lib/types/Pagination.stories.d.ts +193 -0
  72. package/dist/lib/types/PolicySelect.d.ts +80 -0
  73. package/dist/lib/types/PolicySelect.stories.d.ts +130 -0
  74. package/dist/lib/types/ProviderIcon.d.ts +83 -0
  75. package/dist/lib/types/ProviderIcon.stories.d.ts +44 -0
  76. package/dist/lib/types/RailShell.d.ts +199 -0
  77. package/dist/lib/types/RailShell.stories.d.ts +32 -0
  78. package/dist/lib/types/Redaction.d.ts +53 -0
  79. package/dist/lib/types/Redaction.stories.d.ts +120 -0
  80. package/dist/lib/types/RoleRoster.d.ts +97 -0
  81. package/dist/lib/types/RoleRoster.stories.d.ts +23 -0
  82. package/dist/lib/types/SignIn.d.ts +78 -0
  83. package/dist/lib/types/SignIn.stories.d.ts +57 -0
  84. package/dist/lib/types/Sparkline.d.ts +19 -0
  85. package/dist/lib/types/StatTiles.d.ts +115 -0
  86. package/dist/lib/types/StatTiles.stories.d.ts +31 -0
  87. package/dist/lib/types/StepWizard.d.ts +92 -0
  88. package/dist/lib/types/StepWizard.stories.d.ts +18 -0
  89. package/dist/lib/types/StepsWaterfall.d.ts +67 -0
  90. package/dist/lib/types/StepsWaterfall.stories.d.ts +94 -0
  91. package/dist/lib/types/Switch.d.ts +63 -0
  92. package/dist/lib/types/Switch.stories.d.ts +134 -0
  93. package/dist/lib/types/Tabs.d.ts +48 -0
  94. package/dist/lib/types/Tabs.stories.d.ts +75 -0
  95. package/dist/lib/types/TimeStrip.d.ts +12 -0
  96. package/dist/lib/types/TimeStrip.stories.d.ts +30 -0
  97. package/dist/lib/types/Timeline.d.ts +192 -0
  98. package/dist/lib/types/Timeline.stories.d.ts +974 -0
  99. package/dist/lib/types/ToastHost.d.ts +70 -0
  100. package/dist/lib/types/ToastHost.stories.d.ts +115 -0
  101. package/dist/lib/types/ToolRenderers.d.ts +24 -0
  102. package/dist/lib/types/ToolRenderers.stories.d.ts +138 -0
  103. package/dist/lib/types/Tooltip.d.ts +80 -0
  104. package/dist/lib/types/Tooltip.stories.d.ts +116 -0
  105. package/dist/lib/types/Tour.d.ts +37 -0
  106. package/dist/lib/types/Tour.stories.d.ts +39 -0
  107. package/dist/lib/types/TranscriptMarkers.d.ts +50 -0
  108. package/dist/lib/types/TranscriptMarkers.stories.d.ts +48 -0
  109. package/dist/lib/types/Treemap.d.ts +77 -0
  110. package/dist/lib/types/Treemap.stories.d.ts +101 -0
  111. package/dist/lib/types/VisibilityControl.d.ts +54 -0
  112. package/dist/lib/types/VisibilityControl.stories.d.ts +126 -0
  113. package/dist/lib/types/chart-shared.d.ts +63 -0
  114. package/dist/lib/types/index.d.ts +53 -0
  115. package/dist/lib/types/story-frame.d.ts +12 -0
  116. package/dist/lib/ui.js +8707 -0
  117. package/package.json +67 -0
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @typedef {Object} MapNode
3
+ * @property {string} id stable key (repo-relative path)
4
+ * @property {string} label display label (leaf of a path is shown)
5
+ * @property {'folder'|'file'} kind folder vs file — distinguished by ICON
6
+ * @property {number} [loc=0] lines of code — node WIDTH ∝ loc
7
+ * @property {number} [coverage=0] 0..4 monochrome coverage ramp (the FILL)
8
+ * @property {string} [parent] parent id (forms the tree)
9
+ * @property {number} [violations=0] violation count — a clay badge
10
+ */
11
+ /**
12
+ * @typedef {Object} MapEdge
13
+ * @property {string} from
14
+ * @property {string} to
15
+ * @property {'structure'|'activity'} [kind='structure'] solid vs dashed
16
+ * @property {number} [weight=1] stroke WIDTH ∝ weight (never hue)
17
+ */
18
+ /**
19
+ * MapCanvas — an interactive code-structure map. Pan (drag), zoom (square controls /
20
+ * +/- keys, never wheel), semantic zoom (overview / folders / files) with edge
21
+ * ancestor-lifting, a minimap, and a node search combobox. Square metric-encoded
22
+ * nodes (width ∝ LOC, monochrome coverage fill, folder/file icon, amber selection +
23
+ * marker, clay violation badge) and square orthogonal edges (solid structure /
24
+ * dashed activity, width ∝ weight). Full roving-focus keyboard nav with an aria-live
25
+ * region. Pure: no data fetching, deterministic layout.
26
+ *
27
+ * @param {Object} props
28
+ * @param {{nodes: MapNode[], edges?: MapEdge[]}} [props.data] the graph
29
+ * @param {'overview'|'folders'|'files'} [props.grain='folders'] initial semantic zoom
30
+ * @param {string} [props.selectedId] initial selection
31
+ * @param {(id:string|null, node:MapNode|null)=>void} [props.onSelect] selection cb
32
+ * @param {number} [props.height=520] canvas height (px)
33
+ * @param {string} [props.ariaLabel='code map'] application label
34
+ * @param {string} [props.className] extra container class
35
+ */
36
+ export default function MapCanvas({ data, grain: initialGrain, selectedId: initialSelected, onSelect, height, ariaLabel, className, }: {
37
+ data?: {
38
+ nodes: MapNode[];
39
+ edges?: MapEdge[];
40
+ };
41
+ grain?: "overview" | "folders" | "files";
42
+ selectedId?: string;
43
+ onSelect?: (id: string | null, node: MapNode | null) => void;
44
+ height?: number;
45
+ ariaLabel?: string;
46
+ className?: string;
47
+ }): any;
48
+ export type MapNode = {
49
+ /**
50
+ * stable key (repo-relative path)
51
+ */
52
+ id: string;
53
+ /**
54
+ * display label (leaf of a path is shown)
55
+ */
56
+ label: string;
57
+ /**
58
+ * folder vs file — distinguished by ICON
59
+ */
60
+ kind: "folder" | "file";
61
+ /**
62
+ * lines of code — node WIDTH ∝ loc
63
+ */
64
+ loc?: number;
65
+ /**
66
+ * 0..4 monochrome coverage ramp (the FILL)
67
+ */
68
+ coverage?: number;
69
+ /**
70
+ * parent id (forms the tree)
71
+ */
72
+ parent?: string;
73
+ /**
74
+ * violation count — a clay badge
75
+ */
76
+ violations?: number;
77
+ };
78
+ export type MapEdge = {
79
+ from: string;
80
+ to: string;
81
+ /**
82
+ * solid vs dashed
83
+ */
84
+ kind?: "structure" | "activity";
85
+ /**
86
+ * stroke WIDTH ∝ weight (never hue)
87
+ */
88
+ weight?: number;
89
+ };
@@ -0,0 +1,174 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { MapCanvas as component };
4
+ export namespace parameters {
5
+ let layout: string;
6
+ namespace docs {
7
+ namespace description {
8
+ let component: string;
9
+ }
10
+ }
11
+ }
12
+ export let decorators: Function[];
13
+ export namespace argTypes {
14
+ namespace grain {
15
+ namespace control {
16
+ let type: string;
17
+ }
18
+ let options: string[];
19
+ }
20
+ namespace height {
21
+ export namespace control_1 {
22
+ let type_1: string;
23
+ export { type_1 as type };
24
+ export let min: number;
25
+ export let max: number;
26
+ export let step: number;
27
+ }
28
+ export { control_1 as control };
29
+ }
30
+ namespace onSelect {
31
+ let action: string;
32
+ }
33
+ namespace data {
34
+ let control_2: boolean;
35
+ export { control_2 as control };
36
+ }
37
+ namespace selectedId {
38
+ let control_3: boolean;
39
+ export { control_3 as control };
40
+ }
41
+ namespace ariaLabel {
42
+ let control_4: string;
43
+ export { control_4 as control };
44
+ }
45
+ }
46
+ }
47
+ export default _default;
48
+ export namespace Default {
49
+ namespace args {
50
+ export namespace data_1 {
51
+ export { NODES as nodes };
52
+ export { EDGES as edges };
53
+ }
54
+ export { data_1 as data };
55
+ let grain_1: string;
56
+ export { grain_1 as grain };
57
+ let height_1: number;
58
+ export { height_1 as height };
59
+ let onSelect_1: import("storybook/test").Mock<(...args: any[]) => any>;
60
+ export { onSelect_1 as onSelect };
61
+ let ariaLabel_1: string;
62
+ export { ariaLabel_1 as ariaLabel };
63
+ }
64
+ function play({ args, canvasElement }: {
65
+ args: any;
66
+ canvasElement: any;
67
+ }): Promise<void>;
68
+ }
69
+ export namespace Overview {
70
+ export namespace args_1 {
71
+ let grain_2: string;
72
+ export { grain_2 as grain };
73
+ let ariaLabel_2: string;
74
+ export { ariaLabel_2 as ariaLabel };
75
+ }
76
+ export { args_1 as args };
77
+ export function play_1({ canvasElement }: {
78
+ canvasElement: any;
79
+ }): Promise<void>;
80
+ export { play_1 as play };
81
+ }
82
+ export namespace Violations {
83
+ export namespace args_2 {
84
+ export namespace data_2 {
85
+ export { VIOLATION_NODES as nodes };
86
+ export { EDGES as edges };
87
+ }
88
+ export { data_2 as data };
89
+ let grain_3: string;
90
+ export { grain_3 as grain };
91
+ let ariaLabel_3: string;
92
+ export { ariaLabel_3 as ariaLabel };
93
+ }
94
+ export { args_2 as args };
95
+ export function play_2({ canvasElement }: {
96
+ canvasElement: any;
97
+ }): Promise<void>;
98
+ export { play_2 as play };
99
+ }
100
+ export namespace Light {
101
+ export namespace args_3 { }
102
+ export { args_3 as args };
103
+ export namespace globals {
104
+ let theme: string;
105
+ namespace backgrounds {
106
+ let value: string;
107
+ }
108
+ }
109
+ }
110
+ import MapCanvas from './MapCanvas.jsx';
111
+ declare const NODES: ({
112
+ id: string;
113
+ label: string;
114
+ kind: string;
115
+ loc?: undefined;
116
+ coverage?: undefined;
117
+ parent?: undefined;
118
+ violations?: undefined;
119
+ } | {
120
+ id: string;
121
+ label: string;
122
+ kind: string;
123
+ loc: number;
124
+ coverage: number;
125
+ parent: string;
126
+ violations?: undefined;
127
+ } | {
128
+ id: string;
129
+ label: string;
130
+ kind: string;
131
+ loc: number;
132
+ coverage: number;
133
+ parent: string;
134
+ violations: number;
135
+ })[];
136
+ declare const EDGES: {
137
+ from: string;
138
+ to: string;
139
+ kind: string;
140
+ weight: number;
141
+ }[];
142
+ declare const VIOLATION_NODES: ({
143
+ id: string;
144
+ label: string;
145
+ kind: string;
146
+ loc?: undefined;
147
+ coverage?: undefined;
148
+ parent?: undefined;
149
+ violations?: undefined;
150
+ } | {
151
+ id: string;
152
+ label: string;
153
+ kind: string;
154
+ loc: number;
155
+ coverage: number;
156
+ parent: string;
157
+ violations?: undefined;
158
+ } | {
159
+ id: string;
160
+ label: string;
161
+ kind: string;
162
+ loc: number;
163
+ coverage: number;
164
+ parent: string;
165
+ violations: number;
166
+ } | {
167
+ violations: number;
168
+ id: string;
169
+ label: string;
170
+ kind: string;
171
+ loc?: undefined;
172
+ coverage?: undefined;
173
+ parent?: undefined;
174
+ })[];
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @typedef {Object} MenuItem
3
+ * @property {string} label row label (passed-through children case preserved)
4
+ * @property {React.ComponentType<any>} [icon] leading lucide icon component (e.g. icon={Copy})
5
+ * @property {string} [brand] leading provider mark (e.g. brand="claude-code"); takes precedence over icon
6
+ * @property {string} [kbd] right-aligned shortcut hint (e.g. "⌘D")
7
+ * @property {boolean} [danger] destructive (.menu-danger) variant - clay, keeps icon + label
8
+ * @property {boolean} [disabled] aria-disabled row, skipped by arrow keys, not selectable
9
+ * @property {boolean} [separator] a role="separator" .menu-sep hairline row, skipped by keyboard nav
10
+ * @property {() => void} [onSelect] invoked when the row is chosen (click or Enter/Space)
11
+ */
12
+ /**
13
+ * Menu - a dropdown menu controlled by a single trigger button.
14
+ *
15
+ * @param {Object} props
16
+ * @param {React.ReactNode} props.label trigger label (lowercase chrome by default)
17
+ * @param {MenuItem[]} [props.items=[]] menu rows
18
+ * @param {'start'|'end'} [props.align='start'] which edge of the trigger the popout aligns to
19
+ * @param {React.ReactNode} [props.caption] optional .menu-cap caption rendered inside the popout before the list
20
+ * @param {boolean} [props.defaultOpen=false] render with the popout already open (specimen / screenshot state)
21
+ */
22
+ export default function Menu({ label, items, align, caption, defaultOpen }: {
23
+ label: React.ReactNode;
24
+ items?: MenuItem[];
25
+ align?: "start" | "end";
26
+ caption?: React.ReactNode;
27
+ defaultOpen?: boolean;
28
+ }): any;
29
+ export type MenuItem = {
30
+ /**
31
+ * row label (passed-through children case preserved)
32
+ */
33
+ label: string;
34
+ /**
35
+ * leading lucide icon component (e.g. icon={Copy})
36
+ */
37
+ icon?: React.ComponentType<any>;
38
+ /**
39
+ * leading provider mark (e.g. brand="claude-code"); takes precedence over icon
40
+ */
41
+ brand?: string;
42
+ /**
43
+ * right-aligned shortcut hint (e.g. "⌘D")
44
+ */
45
+ kbd?: string;
46
+ /**
47
+ * destructive (.menu-danger) variant - clay, keeps icon + label
48
+ */
49
+ danger?: boolean;
50
+ /**
51
+ * aria-disabled row, skipped by arrow keys, not selectable
52
+ */
53
+ disabled?: boolean;
54
+ /**
55
+ * a role="separator" .menu-sep hairline row, skipped by keyboard nav
56
+ */
57
+ separator?: boolean;
58
+ /**
59
+ * invoked when the row is chosen (click or Enter/Space)
60
+ */
61
+ onSelect?: () => void;
62
+ };
@@ -0,0 +1,173 @@
1
+ export default meta;
2
+ export const Playground: {};
3
+ export namespace Aligned {
4
+ namespace args {
5
+ let align: string;
6
+ let label: string;
7
+ }
8
+ }
9
+ export namespace Providers {
10
+ export namespace args_1 {
11
+ let label_1: string;
12
+ export { label_1 as label };
13
+ export let items: ({
14
+ label: string;
15
+ brand: string;
16
+ kbd: string;
17
+ disabled?: undefined;
18
+ } | {
19
+ label: string;
20
+ brand: string;
21
+ kbd: string;
22
+ disabled: boolean;
23
+ })[];
24
+ }
25
+ export { args_1 as args };
26
+ }
27
+ export namespace WithDangerItem {
28
+ export namespace args_2 {
29
+ let label_2: string;
30
+ export { label_2 as label };
31
+ let items_1: ({
32
+ label: string;
33
+ icon: react.ForwardRefExoticComponent<any>;
34
+ disabled?: undefined;
35
+ danger?: undefined;
36
+ kbd?: undefined;
37
+ } | {
38
+ label: string;
39
+ icon: react.ForwardRefExoticComponent<any>;
40
+ disabled: boolean;
41
+ danger?: undefined;
42
+ kbd?: undefined;
43
+ } | {
44
+ label: string;
45
+ icon: react.ForwardRefExoticComponent<any>;
46
+ danger: boolean;
47
+ kbd: string;
48
+ disabled?: undefined;
49
+ })[];
50
+ export { items_1 as items };
51
+ }
52
+ export { args_2 as args };
53
+ }
54
+ export namespace Empty {
55
+ export namespace args_3 {
56
+ let label_3: string;
57
+ export { label_3 as label };
58
+ let items_2: any[];
59
+ export { items_2 as items };
60
+ }
61
+ export { args_3 as args };
62
+ }
63
+ export namespace WithCaptionAndSeparator {
64
+ export namespace args_4 {
65
+ let label_4: string;
66
+ export { label_4 as label };
67
+ export let caption: string;
68
+ let items_3: ({
69
+ label: string;
70
+ icon: react.ForwardRefExoticComponent<any>;
71
+ kbd: string;
72
+ disabled?: undefined;
73
+ separator?: undefined;
74
+ danger?: undefined;
75
+ } | {
76
+ label: string;
77
+ icon: react.ForwardRefExoticComponent<any>;
78
+ kbd: string;
79
+ disabled: boolean;
80
+ separator?: undefined;
81
+ danger?: undefined;
82
+ } | {
83
+ separator: boolean;
84
+ label?: undefined;
85
+ icon?: undefined;
86
+ kbd?: undefined;
87
+ disabled?: undefined;
88
+ danger?: undefined;
89
+ } | {
90
+ label: string;
91
+ icon: react.ForwardRefExoticComponent<any>;
92
+ kbd: string;
93
+ danger: boolean;
94
+ disabled?: undefined;
95
+ separator?: undefined;
96
+ })[];
97
+ export { items_3 as items };
98
+ }
99
+ export { args_4 as args };
100
+ }
101
+ export namespace OpensAndSelects {
102
+ export namespace args_5 {
103
+ let defaultOpen: boolean;
104
+ }
105
+ export { args_5 as args };
106
+ export function play({ canvasElement }: {
107
+ canvasElement: any;
108
+ }): Promise<void>;
109
+ }
110
+ declare namespace meta {
111
+ export let title: string;
112
+ export { Menu as component };
113
+ export let tags: string[];
114
+ export let decorators: Function[];
115
+ export namespace argTypes {
116
+ export namespace label_5 {
117
+ let control: string;
118
+ }
119
+ export { label_5 as label };
120
+ export namespace align_1 {
121
+ let control_1: string;
122
+ export { control_1 as control };
123
+ export let options: string[];
124
+ }
125
+ export { align_1 as align };
126
+ export namespace defaultOpen_1 {
127
+ let control_2: string;
128
+ export { control_2 as control };
129
+ }
130
+ export { defaultOpen_1 as defaultOpen };
131
+ export namespace items_4 {
132
+ let control_3: boolean;
133
+ export { control_3 as control };
134
+ }
135
+ export { items_4 as items };
136
+ }
137
+ export namespace args_6 {
138
+ let label_6: string;
139
+ export { label_6 as label };
140
+ let align_2: string;
141
+ export { align_2 as align };
142
+ let defaultOpen_2: boolean;
143
+ export { defaultOpen_2 as defaultOpen };
144
+ let items_5: ({
145
+ label: string;
146
+ icon: react.ForwardRefExoticComponent<any>;
147
+ kbd: string;
148
+ disabled?: undefined;
149
+ danger?: undefined;
150
+ } | {
151
+ label: string;
152
+ icon: react.ForwardRefExoticComponent<any>;
153
+ kbd?: undefined;
154
+ disabled?: undefined;
155
+ danger?: undefined;
156
+ } | {
157
+ label: string;
158
+ icon: react.ForwardRefExoticComponent<any>;
159
+ disabled: boolean;
160
+ kbd?: undefined;
161
+ danger?: undefined;
162
+ } | {
163
+ label: string;
164
+ icon: react.ForwardRefExoticComponent<any>;
165
+ danger: boolean;
166
+ kbd: string;
167
+ disabled?: undefined;
168
+ })[];
169
+ export { items_5 as items };
170
+ }
171
+ export { args_6 as args };
172
+ }
173
+ import Menu from './Menu.jsx';
@@ -0,0 +1,135 @@
1
+ /**
2
+ * ApprovalBar — a sticky top bar for reviewing a single pending item. Once acted on it collapses
3
+ * to a one-line resolved acknowledgement (icon + word) rather than disappearing outright.
4
+ * @typedef {Object} ApprovalBarProps
5
+ * @property {React.ReactNode} subject the thing under review, e.g. "pending share to {collective}";
6
+ * the collective/title inside is USER CONTENT (case preserved).
7
+ * @property {() => void} [onApprove] called when approve is clicked (after the optimistic resolve).
8
+ * @property {() => void} [onReject] called when reject is clicked (after the optimistic resolve).
9
+ * @property {string} [approveLabel='approve'] lowercase label for the approve action.
10
+ * @property {string} [rejectLabel='reject'] lowercase label for the reject action.
11
+ * @property {string} [className] extra classes appended to the .mod-bar root.
12
+ */
13
+ /**
14
+ * @param {ApprovalBarProps} props
15
+ */
16
+ export function ApprovalBar({ subject, onApprove, onReject, approveLabel, rejectLabel, className, }: ApprovalBarProps): any;
17
+ /**
18
+ * ModerationQueue — a panel listing pending items (member requests OR shares). Each row shows who +
19
+ * detail + relative time, with approve/reject buttons. Acting on a row resolves it OPTIMISTICALLY in
20
+ * place: the buttons swap for an approved/rejected pill (olive/clay + icon) and the row is struck +
21
+ * dimmed, never removed — so the reviewer keeps an audit trail of what they just decided. When no
22
+ * items remain pending an empty state is shown.
23
+ * @typedef {Object} QueueItem
24
+ * @property {string} id stable key.
25
+ * @property {'member'|'share'} [kind] picks the leading icon (user-plus / inbox). defaults to share.
26
+ * @property {React.ReactNode} who the actor — a handle/name. USER CONTENT (case preserved).
27
+ * @property {React.ReactNode} [detail] the secondary line (org, title, …). USER CONTENT.
28
+ * @property {React.ReactNode} [when] relative time, e.g. "2h ago". rendered tabular + lowercased.
29
+ *
30
+ * @typedef {Object} ModerationQueueProps
31
+ * @property {React.ReactNode} [title='pending review'] the panel header label (lowercase chrome).
32
+ * @property {QueueItem[]} [items=[]] the pending items.
33
+ * @property {(item: QueueItem) => void} [onApprove] called with the item when approved.
34
+ * @property {(item: QueueItem) => void} [onReject] called with the item when rejected.
35
+ * @property {React.ReactNode} [emptyLabel='nothing pending'] message for the empty state.
36
+ * @property {string} [className] extra classes appended to the .mod-queue root.
37
+ */
38
+ /**
39
+ * @param {ModerationQueueProps} props
40
+ */
41
+ export function ModerationQueue({ title, items, onApprove, onReject, emptyLabel, className, }: ModerationQueueProps): any;
42
+ export default ModerationQueue;
43
+ /**
44
+ * ApprovalBar — a sticky top bar for reviewing a single pending item. Once acted on it collapses
45
+ * to a one-line resolved acknowledgement (icon + word) rather than disappearing outright.
46
+ */
47
+ export type ApprovalBarProps = {
48
+ /**
49
+ * the thing under review, e.g. "pending share to {collective}";
50
+ * the collective/title inside is USER CONTENT (case preserved).
51
+ */
52
+ subject: React.ReactNode;
53
+ /**
54
+ * called when approve is clicked (after the optimistic resolve).
55
+ */
56
+ onApprove?: () => void;
57
+ /**
58
+ * called when reject is clicked (after the optimistic resolve).
59
+ */
60
+ onReject?: () => void;
61
+ /**
62
+ * lowercase label for the approve action.
63
+ */
64
+ approveLabel?: string;
65
+ /**
66
+ * lowercase label for the reject action.
67
+ */
68
+ rejectLabel?: string;
69
+ /**
70
+ * extra classes appended to the .mod-bar root.
71
+ */
72
+ className?: string;
73
+ };
74
+ /**
75
+ * ModerationQueue — a panel listing pending items (member requests OR shares). Each row shows who +
76
+ * detail + relative time, with approve/reject buttons. Acting on a row resolves it OPTIMISTICALLY in
77
+ * place: the buttons swap for an approved/rejected pill (olive/clay + icon) and the row is struck +
78
+ * dimmed, never removed — so the reviewer keeps an audit trail of what they just decided. When no
79
+ * items remain pending an empty state is shown.
80
+ */
81
+ export type QueueItem = {
82
+ /**
83
+ * stable key.
84
+ */
85
+ id: string;
86
+ /**
87
+ * picks the leading icon (user-plus / inbox). defaults to share.
88
+ */
89
+ kind?: "member" | "share";
90
+ /**
91
+ * the actor — a handle/name. USER CONTENT (case preserved).
92
+ */
93
+ who: React.ReactNode;
94
+ /**
95
+ * the secondary line (org, title, …). USER CONTENT.
96
+ */
97
+ detail?: React.ReactNode;
98
+ /**
99
+ * relative time, e.g. "2h ago". rendered tabular + lowercased.
100
+ */
101
+ when?: React.ReactNode;
102
+ };
103
+ /**
104
+ * ModerationQueue — a panel listing pending items (member requests OR shares). Each row shows who +
105
+ * detail + relative time, with approve/reject buttons. Acting on a row resolves it OPTIMISTICALLY in
106
+ * place: the buttons swap for an approved/rejected pill (olive/clay + icon) and the row is struck +
107
+ * dimmed, never removed — so the reviewer keeps an audit trail of what they just decided. When no
108
+ * items remain pending an empty state is shown.
109
+ */
110
+ export type ModerationQueueProps = {
111
+ /**
112
+ * the panel header label (lowercase chrome).
113
+ */
114
+ title?: React.ReactNode;
115
+ /**
116
+ * the pending items.
117
+ */
118
+ items?: QueueItem[];
119
+ /**
120
+ * called with the item when approved.
121
+ */
122
+ onApprove?: (item: QueueItem) => void;
123
+ /**
124
+ * called with the item when rejected.
125
+ */
126
+ onReject?: (item: QueueItem) => void;
127
+ /**
128
+ * message for the empty state.
129
+ */
130
+ emptyLabel?: React.ReactNode;
131
+ /**
132
+ * extra classes appended to the .mod-queue root.
133
+ */
134
+ className?: string;
135
+ };
@@ -0,0 +1,34 @@
1
+ export default meta;
2
+ export namespace MemberRequests {
3
+ function render(): any;
4
+ function play({ canvasElement }: {
5
+ canvasElement: any;
6
+ }): Promise<void>;
7
+ }
8
+ export namespace PendingShares {
9
+ export function render_1(): any;
10
+ export { render_1 as render };
11
+ }
12
+ export namespace ApprovalBarSticky {
13
+ export let decorators: Function[];
14
+ export function render_2(): any;
15
+ export { render_2 as render };
16
+ export function play_1({ canvasElement }: {
17
+ canvasElement: any;
18
+ }): Promise<void>;
19
+ export { play_1 as play };
20
+ }
21
+ export namespace Empty {
22
+ export function render_3(): any;
23
+ export { render_3 as render };
24
+ }
25
+ declare namespace meta {
26
+ export let title: string;
27
+ export { ModerationQueue as component };
28
+ let decorators_1: Function[];
29
+ export { decorators_1 as decorators };
30
+ export namespace parameters {
31
+ let layout: string;
32
+ }
33
+ }
34
+ import { ModerationQueue } from './ModerationQueue.jsx';