@edux-design/buttons 0.0.2 → 0.0.4

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,6 +3,29 @@ import { MenuButtonContext } from "../util/MenuButtonContext";
3
3
  import { cx } from "@edux-design/utils";
4
4
  import { Chevron } from "@edux-design/icons";
5
5
 
6
+ /**
7
+ * Props for the MenuButton component.
8
+ *
9
+ * @typedef {Object} MenuButtonProps
10
+ * @property {React.ReactNode} [children] - Content to display inside the button (usually label or icon).
11
+ * @property {"small"|"medium"} [size="medium"] - Size variant controlling button height.
12
+ */
13
+
14
+ /**
15
+ * MenuButton component.
16
+ *
17
+ * Provides a styled menu trigger button with optional sizing.
18
+ * It uses a `MenuButtonContext` provider to share internal state
19
+ * with child menu items.
20
+ *
21
+ * @component
22
+ * @type {React.FC<MenuButtonProps>}
23
+ *
24
+ * @example
25
+ * ```jsx
26
+ * <MenuButton size="small">Options</MenuButton>
27
+ * ```
28
+ */
6
29
  export function MenuButton({ children, size }) {
7
30
  const SPLIT_BUTTON_STYLES = cx(
8
31
  "w-[36px] border-l-[1px] border-l-black flex flex-row justify-center items-center",
@@ -11,9 +34,10 @@ export function MenuButton({ children, size }) {
11
34
  "h-[40px] py-2": size === "medium" || size === undefined,
12
35
  }
13
36
  );
37
+
14
38
  return (
15
39
  <MenuButtonContext.Provider value>
16
- <div>{children}</div>
40
+ <div className={SPLIT_BUTTON_STYLES}>{children}</div>
17
41
  <Chevron />
18
42
  </MenuButtonContext.Provider>
19
43
  );
package/src/index.js CHANGED
@@ -1,2 +1,5 @@
1
+ export { IconButton } from "./elements/IconButton";
1
2
  export { Button } from "./elements/Button";
2
3
  export { MenuButton } from "./elements/MenuButton";
4
+ export { ButtonGroup } from "./elements/ButtonGroup";
5
+ export { ButtonGroupItem } from "./elements/ButtonGroupItem";
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+
2
+ {
3
+
4
+ "compilerOptions": {
5
+ "allowJs": true,
6
+ "checkJs": false,
7
+ "declaration": true,
8
+ "emitDeclarationOnly": true,
9
+ "jsx": "react-jsx",
10
+ "outDir": "dist"
11
+ }
12
+ }