@trackunit/react-drawer 1.24.1 → 1.24.2

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/index.cjs.js CHANGED
@@ -319,10 +319,11 @@ const getIconName = (open, position) => {
319
319
  * @param {boolean} props.open - Indicates if the button is in "open" state
320
320
  * @param {DrawerPosition} props.position - The position of the button relative to its container
321
321
  * @param props.ref - Ref forwarded to the root DOM element
322
+ * @param props.style - Inline styles applied to the root DOM element
322
323
  */
323
- const DrawerToggle = ({ open, position, onClick = NOOP, ref }) => {
324
+ const DrawerToggle = ({ open, position, onClick = NOOP, ref, style }) => {
324
325
  const name = getIconName(open, position);
325
- return (jsxRuntime.jsx("div", { className: cvaToggleContainer({ position }), ref: ref, children: jsxRuntime.jsx("button", { className: cvaDrawerToggle({ position }), "data-testid": "toggle-button", onClick: onClick, children: jsxRuntime.jsx(reactComponents.Icon, { name: name }) }) }));
326
+ return (jsxRuntime.jsx("div", { className: cvaToggleContainer({ position }), ref: ref, style: style, children: jsxRuntime.jsx("button", { className: cvaDrawerToggle({ position }), "data-testid": "toggle-button", onClick: onClick, children: jsxRuntime.jsx(reactComponents.Icon, { name: name }) }) }));
326
327
  };
327
328
  const cvaDrawerToggle = cssClassVarianceUtilities.cvaMerge([
328
329
  "flex",
package/index.esm.js CHANGED
@@ -317,10 +317,11 @@ const getIconName = (open, position) => {
317
317
  * @param {boolean} props.open - Indicates if the button is in "open" state
318
318
  * @param {DrawerPosition} props.position - The position of the button relative to its container
319
319
  * @param props.ref - Ref forwarded to the root DOM element
320
+ * @param props.style - Inline styles applied to the root DOM element
320
321
  */
321
- const DrawerToggle = ({ open, position, onClick = NOOP, ref }) => {
322
+ const DrawerToggle = ({ open, position, onClick = NOOP, ref, style }) => {
322
323
  const name = getIconName(open, position);
323
- return (jsx("div", { className: cvaToggleContainer({ position }), ref: ref, children: jsx("button", { className: cvaDrawerToggle({ position }), "data-testid": "toggle-button", onClick: onClick, children: jsx(Icon, { name: name }) }) }));
324
+ return (jsx("div", { className: cvaToggleContainer({ position }), ref: ref, style: style, children: jsx("button", { className: cvaDrawerToggle({ position }), "data-testid": "toggle-button", onClick: onClick, children: jsx(Icon, { name: name }) }) }));
324
325
  };
325
326
  const cvaDrawerToggle = cvaMerge([
326
327
  "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-drawer",
3
- "version": "1.24.1",
3
+ "version": "1.24.2",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -1,7 +1,7 @@
1
- import { Refable } from "@trackunit/react-components";
1
+ import { Refable, type Styleable } from "@trackunit/react-components";
2
2
  import { MouseEvent } from "react";
3
3
  import { type DrawerPosition } from "../../types";
4
- interface DrawerToggleProps extends Refable<HTMLDivElement> {
4
+ interface DrawerToggleProps extends Refable<HTMLDivElement>, Styleable {
5
5
  open: boolean;
6
6
  onClick?: (event: MouseEvent) => void;
7
7
  position: DrawerPosition;
@@ -17,6 +17,7 @@ interface DrawerToggleProps extends Refable<HTMLDivElement> {
17
17
  * @param {boolean} props.open - Indicates if the button is in "open" state
18
18
  * @param {DrawerPosition} props.position - The position of the button relative to its container
19
19
  * @param props.ref - Ref forwarded to the root DOM element
20
+ * @param props.style - Inline styles applied to the root DOM element
20
21
  */
21
- export declare const DrawerToggle: ({ open, position, onClick, ref }: DrawerToggleProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const DrawerToggle: ({ open, position, onClick, ref, style }: DrawerToggleProps) => import("react/jsx-runtime").JSX.Element;
22
23
  export {};