@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 +17 -16
- package/package.json +1 -1
- package/types/components/drawer/drawer.d.ts +5 -1
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,
|
|
13255
|
-
const
|
|
13256
|
-
open:
|
|
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
|
-
|
|
13258
|
+
n && r && r();
|
|
13259
13259
|
}
|
|
13260
|
-
}),
|
|
13261
|
-
enabled:
|
|
13262
|
-
}),
|
|
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
|
-
|
|
13265
|
-
}, [
|
|
13264
|
+
l && o && l();
|
|
13265
|
+
}, [o]), s.useMemo(
|
|
13266
13266
|
() => ({
|
|
13267
|
-
open:
|
|
13268
|
-
onOpen:
|
|
13269
|
-
onClose:
|
|
13270
|
-
|
|
13271
|
-
...
|
|
13267
|
+
open: o,
|
|
13268
|
+
onOpen: l,
|
|
13269
|
+
onClose: r,
|
|
13270
|
+
isClosable: t,
|
|
13271
|
+
...m,
|
|
13272
|
+
...a
|
|
13272
13273
|
}),
|
|
13273
|
-
[
|
|
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,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>>;
|