@bigbinary/neeto-molecules 1.6.13 → 1.6.15

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.
@@ -3,41 +3,85 @@ type Element = {
3
3
  value: string;
4
4
  icon: React.ReactNode;
5
5
  };
6
-
7
6
  type ElementSection = {
8
7
  title: string;
9
8
  elements: Element[];
10
9
  key: string;
11
10
  isCreatable: (element: Element) => boolean;
12
11
  };
13
-
14
12
  type SelectedElement = {
15
13
  id: string;
16
14
  kind: string;
17
15
  position: number;
18
16
  label: string;
19
17
  icon: React.ReactNode;
18
+ isPending: boolean;
20
19
  };
21
-
22
20
  type dragResult = {
23
21
  index: number;
24
22
  };
25
-
26
23
  type SelectedElementAction = {
27
24
  label: string;
28
25
  key: string;
29
26
  onClick: (element: Element) => void;
30
27
  isVisible?: boolean;
31
28
  };
32
-
33
- export const ElementsPanel: React.FC<{
29
+ export
30
+ /**
31
+ *
32
+ * @example
33
+ *
34
+ * import React from "react";
35
+ * import Container from "@bigbinary/neeto-molecules/Container";
36
+ * import {
37
+ * ElementsPanel,
38
+ * PropertiesPanel,
39
+ * } from "@bigbinary/neeto-molecules/Builder";
40
+ *
41
+ * const Component = () => (
42
+ * <Container isHeaderFixed>
43
+ * <div className="flex h-full w-full justify-between">
44
+ * <ElementsPanel
45
+ * elementSections={sections}
46
+ * {...{
47
+ * handleAddElement,
48
+ * isElementVisible,
49
+ * selectedElements,
50
+ * fixedFirstElement,
51
+ * fixedLastElement,
52
+ * }}
53
+ * selectedElementActions={[
54
+ * {
55
+ * label: "Duplicate",
56
+ * key: "duplicate",
57
+ * onClick: element => alert("Clicked", JSON.stringify(element)),
58
+ * },
59
+ * {
60
+ * label: "Delete",
61
+ * key: "delete",
62
+ * onClick: element => alert("Clicked", JSON.stringify(element)),
63
+ * },
64
+ * ]}
65
+ * />
66
+ * <PropertiesPanel>
67
+ * <PropertiesPanel.EmptyProperty />
68
+ * </PropertiesPanel>
69
+ * </div>
70
+ * </Container>
71
+ * );
72
+ * @endexample
73
+ */
74
+ const ElementsPanel: React.FC<{
34
75
  elementSections: ElementSection[];
35
76
  selectedElements: SelectedElement[];
36
77
  handleAddElement: (element: Element) => void;
37
78
  isElementVisible: (element: Element) => boolean;
38
79
  fixedFirstElement?: SelectedElement;
39
80
  fixedLastElement?: SelectedElement;
40
- handleDragEnd?: ({ source: dragResult, destination: dragResult }) => void;
81
+ handleDragEnd?: ({
82
+ source: dragResult,
83
+ destination: dragResult
84
+ }) => void;
41
85
  isDragDisabled?: boolean;
42
86
  handleSelectElement: (index: number) => void;
43
87
  selectedElementIndex: number;
@@ -49,7 +93,6 @@ export const ElementsPanel: React.FC<{
49
93
  isAddingNewElement?: boolean;
50
94
  returnElementOnSelect?: boolean;
51
95
  }>;
52
-
53
96
  export const PropertiesPanel: React.FC<{
54
97
  children: React.ReactNode;
55
- }>;
98
+ }>;
@@ -35,5 +35,6 @@ const HelpPopover: React.FC<{
35
35
  helpLinkProps?: ButtonProps;
36
36
  popoverProps?: PopoverProps;
37
37
  size?: "default" | "large";
38
+ className?: string;
38
39
  }>;
39
40
  export default HelpPopover;