@sellgar/kit 0.0.136 → 0.0.137

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/dist/index.js CHANGED
@@ -13251,26 +13251,27 @@ const bm = s.createContext(null), _m = () => {
13251
13251
  overlay: JE,
13252
13252
  close: e1
13253
13253
  };
13254
- function t1({ initialOpen: e = !1, open: t, onOpen: n, onClose: i } = {}) {
13255
- const l = t ?? e, r = zl({
13256
- open: l,
13254
+ function t1({ initialOpen: e = !1, isClosable: t = !0, isOverlayClosable: n = !1, open: i, onOpen: l, onClose: r } = {}) {
13255
+ const o = i ?? e, a = zl({
13256
+ open: o,
13257
13257
  onOpenChange: () => {
13258
- i && i();
13258
+ n && r && r();
13259
13259
  }
13260
- }), o = r.context, a = oo(o, {
13261
- enabled: t === null
13262
- }), c = Pl(o, { outsidePressEvent: "mousedown" }), u = Al(o), d = Il([a, c, u]);
13260
+ }), c = a.context, u = oo(c, {
13261
+ enabled: i === null
13262
+ }), d = Pl(c, { outsidePressEvent: "mousedown" }), f = Al(c), m = Il([u, d, f]);
13263
13263
  return s.useEffect(() => {
13264
- n && l && n();
13265
- }, [l]), s.useMemo(
13264
+ l && o && l();
13265
+ }, [o]), s.useMemo(
13266
13266
  () => ({
13267
- open: l,
13268
- onOpen: n,
13269
- onClose: i,
13270
- ...d,
13271
- ...r
13267
+ open: o,
13268
+ onOpen: l,
13269
+ onClose: r,
13270
+ isClosable: t,
13271
+ ...m,
13272
+ ...a
13272
13273
  }),
13273
- [l, n, i, d, r]
13274
+ [o, l, r, m, a]
13274
13275
  );
13275
13276
  }
13276
13277
  const xm = s.createContext(null), Em = () => {
@@ -13292,7 +13293,7 @@ const xm = s.createContext(null), Em = () => {
13292
13293
  l(!1), i && i();
13293
13294
  };
13294
13295
  return /* @__PURE__ */ s.createElement("div", { className: lc.close, ...t, ref: n, onClick: r }, /* @__PURE__ */ s.createElement(Fe, { icon: "close-line" }));
13295
- }), Y1 = (e) => /* @__PURE__ */ s.createElement(n1, { open: e.open, onOpen: e.onOpen, onClose: e.onClose }, /* @__PURE__ */ s.createElement(i1, { className: lc.wrapper }, /* @__PURE__ */ s.createElement(l1, null), e.children));
13296
+ }), Y1 = (e) => /* @__PURE__ */ s.createElement(n1, { open: e.open, onOpen: e.onOpen, onClose: e.onClose }, /* @__PURE__ */ s.createElement(i1, { className: lc.wrapper }, e.isClosable && /* @__PURE__ */ s.createElement(l1, null), e.children));
13296
13297
  export {
13297
13298
  v1 as Accordion,
13298
13299
  ym as Animate,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sellgar/kit",
3
3
  "type": "module",
4
- "version": "0.0.136",
4
+ "version": "0.0.137",
5
5
  "description": "Sellgar kit",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,11 +1,13 @@
1
1
  import { default as React } from 'react';
2
2
  interface IProps {
3
+ isClosable?: boolean;
4
+ isOverlayClosable?: boolean;
3
5
  open?: boolean;
4
6
  initialOpen?: boolean;
5
7
  onOpen?(): void;
6
8
  onClose?(): void;
7
9
  }
8
- export declare function useDrawer({ initialOpen, open: controlledOpen, onOpen, onClose }?: IProps): {
10
+ export declare function useDrawer({ initialOpen, isClosable, isOverlayClosable, open: controlledOpen, onOpen, onClose }?: IProps): {
9
11
  placement: import('@floating-ui/utils').Placement;
10
12
  strategy: import('@floating-ui/utils').Strategy;
11
13
  middlewareData: import('@floating-ui/core').MiddlewareData;
@@ -51,6 +53,7 @@ export declare function useDrawer({ initialOpen, open: controlledOpen, onOpen, o
51
53
  open: boolean;
52
54
  onOpen: (() => void) | undefined;
53
55
  onClose: (() => void) | undefined;
56
+ isClosable: boolean;
54
57
  };
55
58
  export declare const useDrawerContext: () => {
56
59
  placement: import('@floating-ui/utils').Placement;
@@ -98,6 +101,7 @@ export declare const useDrawerContext: () => {
98
101
  open: boolean;
99
102
  onOpen: (() => void) | undefined;
100
103
  onClose: (() => void) | undefined;
104
+ isClosable: boolean;
101
105
  };
102
106
  export declare const Dialog: React.FC<React.PropsWithChildren<IProps>>;
103
107
  export declare const DialogContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;