@julien-wiegandt/open-ui 0.1.58 → 0.1.60
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/components/popover/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/open-ui.js +7 -5
- package/dist/open-ui.umd.cjs +31 -31
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type PopoverStyleProps = {
|
|
|
8
8
|
visible?: boolean;
|
|
9
9
|
zIndex?: number;
|
|
10
10
|
placement?: "left" | "right" | "top" | "bottom";
|
|
11
|
+
gap?: number;
|
|
11
12
|
bgcolor?: string;
|
|
12
13
|
arrowcolor?: string;
|
|
13
14
|
radius?: Radius;
|
|
@@ -20,6 +21,7 @@ export declare const Popover: React.ForwardRefExoticComponent<{
|
|
|
20
21
|
visible?: boolean;
|
|
21
22
|
zIndex?: number;
|
|
22
23
|
placement?: "left" | "right" | "top" | "bottom";
|
|
24
|
+
gap?: number;
|
|
23
25
|
bgcolor?: string;
|
|
24
26
|
arrowcolor?: string;
|
|
25
27
|
radius?: Radius;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './components/text';
|
|
|
14
14
|
export * from './components/textarea';
|
|
15
15
|
export * from './components/title';
|
|
16
16
|
export * from './components/toast';
|
|
17
|
+
export * from './components/utils/get-color-based-on-background';
|
|
17
18
|
export * from './context/toast';
|
|
18
19
|
export * from './hooks';
|
|
19
20
|
export * from './theme/constants';
|
package/dist/open-ui.js
CHANGED
|
@@ -4729,11 +4729,11 @@ const Ld = gt(be)`
|
|
|
4729
4729
|
...e
|
|
4730
4730
|
}), [e]);
|
|
4731
4731
|
Ie(() => {
|
|
4732
|
-
if (o?.current) {
|
|
4732
|
+
if (o?.current && e.visible) {
|
|
4733
4733
|
const { clientHeight: x, clientWidth: v } = o.current;
|
|
4734
4734
|
u({ height: x, width: v });
|
|
4735
4735
|
}
|
|
4736
|
-
}, [o?.current]), Ie(() => {
|
|
4736
|
+
}, [o?.current, e.visible]), Ie(() => {
|
|
4737
4737
|
if (i?.current && e.visible) {
|
|
4738
4738
|
const { clientHeight: x, clientWidth: v } = i.current;
|
|
4739
4739
|
a({ height: x, width: v });
|
|
@@ -4742,7 +4742,7 @@ const Ld = gt(be)`
|
|
|
4742
4742
|
const x = () => {
|
|
4743
4743
|
if (!e.visible || !o.current || !i.current || s.height === 0 || c.height === 0)
|
|
4744
4744
|
return;
|
|
4745
|
-
const v = o.current.getBoundingClientRect(), k = window.scrollY, P = window.scrollX, { height: _, width: b } = s, { height: w, width: T } = c, E = 8, z = 8, I =
|
|
4745
|
+
const v = o.current.getBoundingClientRect(), k = window.scrollY, P = window.scrollX, { height: _, width: b } = s, { height: w, width: T } = c, E = e.gap ?? 8, z = 8, I = E - z / 2;
|
|
4746
4746
|
let L = { top: 0, left: 0 }, O = { top: 0, left: 0 };
|
|
4747
4747
|
const H = v.left + P + T / 2, V = v.top + k + w / 2;
|
|
4748
4748
|
switch (g.placement) {
|
|
@@ -4790,7 +4790,7 @@ const Ld = gt(be)`
|
|
|
4790
4790
|
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
4791
4791
|
};
|
|
4792
4792
|
}, [e.visible, g.placement, s, c]), Ie(() => {
|
|
4793
|
-
e.visible || (a({ height: 0, width: 0 }), d({ top: 0, left: 0 }), l({ top: 0, left: 0 }));
|
|
4793
|
+
e.visible || (a({ height: 0, width: 0 }), u({ height: 0, width: 0 }), d({ top: 0, left: 0 }), l({ top: 0, left: 0 }));
|
|
4794
4794
|
}, [e.visible]);
|
|
4795
4795
|
const p = (x) => {
|
|
4796
4796
|
if (o.current = x, Ds(n)) {
|
|
@@ -4811,7 +4811,8 @@ const Ld = gt(be)`
|
|
|
4811
4811
|
top: `${f.top}px`,
|
|
4812
4812
|
left: `${f.left}px`,
|
|
4813
4813
|
zIndex: g.zIndex,
|
|
4814
|
-
opacity: `${e.visible && s.height !== 0 && s.width !== 0 ? 1 : 0}
|
|
4814
|
+
opacity: `${e.visible && s.height !== 0 && s.width !== 0 ? 1 : 0}`,
|
|
4815
|
+
transition: "opacity 0.25s ease"
|
|
4815
4816
|
},
|
|
4816
4817
|
children: e.content
|
|
4817
4818
|
}
|
|
@@ -6286,6 +6287,7 @@ export {
|
|
|
6286
6287
|
hh as ToastProvider,
|
|
6287
6288
|
ao as breakpoints,
|
|
6288
6289
|
Eh as createTheme,
|
|
6290
|
+
yc as getColorBasedOnBackground,
|
|
6289
6291
|
Ht as radiusMap,
|
|
6290
6292
|
Un as useResponsive,
|
|
6291
6293
|
Ph as useTheme,
|