@cfx-dev/ui-components 4.5.17 → 4.5.18
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/assets/css/Flyout.css +1 -1
- package/dist/assets/css/Popover.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Flyout/Flyout.d.ts +7 -3
- package/dist/components/Flyout/Flyout.js +61 -48
- package/dist/components/Flyout/FlyoutShowcase.d.ts +5 -0
- package/dist/components/Flyout/FlyoutShowcase.js +28 -0
- package/dist/components/Flyout/index.d.ts +1 -1
- package/dist/components/Flyout/index.js +5 -3
- package/dist/main.d.ts +1 -1
- package/dist/main.js +176 -174
- package/dist/styles-scss/_ui.scss +1 -0
- package/dist/styles-scss/global.scss +2 -0
- package/dist/styles-scss/tokens.scss +26 -21
- package/package.json +1 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export declare const FLYOUT_OUTLET_ID = "flyout-outlet";
|
|
4
|
+
export declare const FLYOUT_ROOT_ID = "cfxui-root";
|
|
5
|
+
export declare const FLYOUT_ROOT_SHRINK_CLASSNAME = "shrink";
|
|
4
6
|
export type FlyoutSize = 'normal' | 'small' | 'xsmall' | 'xxsmall';
|
|
5
|
-
export type FlyoutTheme = 'default' | '
|
|
6
|
-
export interface FlyoutProps {
|
|
7
|
+
export type FlyoutTheme = 'default' | 'legacy';
|
|
8
|
+
export interface FlyoutProps extends React.PropsWithChildren {
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
theme?: FlyoutTheme;
|
|
9
11
|
size?: FlyoutSize;
|
|
10
12
|
onClose?(): void;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
13
|
holderClassName?: string;
|
|
14
|
+
rootClassName?: string;
|
|
15
|
+
maskClassName?: string;
|
|
13
16
|
}
|
|
14
17
|
export declare function Flyout(props: FlyoutProps): import("react/jsx-runtime").JSX.Element;
|
|
15
18
|
export declare namespace Flyout {
|
|
@@ -19,4 +22,5 @@ export interface FlyoutHeaderProps {
|
|
|
19
22
|
onClose?(): void;
|
|
20
23
|
children: React.ReactNode;
|
|
21
24
|
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
className?: string;
|
|
22
26
|
}
|
|
@@ -1,66 +1,79 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { F as
|
|
4
|
-
import
|
|
5
|
-
import { clsx as
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { F as x } from "../../Combination-N-vN9BB-.js";
|
|
4
|
+
import F from "../Button/Button.js";
|
|
5
|
+
import { clsx as s } from "../../utils/clsx.js";
|
|
6
6
|
import "../../utils/links.js";
|
|
7
|
-
import { Interactive as
|
|
8
|
-
import { noop as
|
|
7
|
+
import { Interactive as k } from "../Interactive/Interactive.js";
|
|
8
|
+
import { noop as b } from "../../utils/functional.js";
|
|
9
9
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
10
|
-
import { useKeyboardClose as
|
|
11
|
-
import { useOutlet as
|
|
12
|
-
const
|
|
13
|
-
root:
|
|
14
|
-
backdrop:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
import { useKeyboardClose as N } from "../../utils/hooks/useKeyboardClose.js";
|
|
11
|
+
import { useOutlet as C } from "../../utils/hooks/useOutlet.js";
|
|
12
|
+
const v = "cfxui__Flyout__root__eba04", z = "cfxui__Flyout__backdrop__57f9e", O = "cfxui__Flyout__holder__d80b5", L = "cfxui__Flyout__content__04e42", T = "cfxui__Flyout__header__40009", I = "cfxui__Flyout__title__b235a", E = "cfxui__Flyout__active__14a29", U = "cfxui__Flyout__mask__72713", e = {
|
|
13
|
+
root: v,
|
|
14
|
+
backdrop: z,
|
|
15
|
+
holder: O,
|
|
16
|
+
content: L,
|
|
17
|
+
header: T,
|
|
18
|
+
title: I,
|
|
19
|
+
active: E,
|
|
20
|
+
"backdrop-appearance": "cfxui__Flyout__backdrop-appearance__d9564",
|
|
21
|
+
mask: U,
|
|
22
|
+
"holder-appearance-btu": "cfxui__Flyout__holder-appearance-btu__84100",
|
|
23
|
+
"holder-appearance-rtl": "cfxui__Flyout__holder-appearance-rtl__3ccf2",
|
|
24
|
+
"theme-legacy": "cfxui__Flyout__theme-legacy__a3452",
|
|
18
25
|
"size-normal": "cfxui__Flyout__size-normal__e1165",
|
|
19
26
|
"size-small": "cfxui__Flyout__size-small__038a5",
|
|
20
27
|
"size-xsmall": "cfxui__Flyout__size-xsmall__839e8",
|
|
21
28
|
"size-xxsmall": "cfxui__Flyout__size-xxsmall__33712",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"holder-appearance": "cfxui__Flyout__holder-appearance__e818c",
|
|
26
|
-
header: O,
|
|
27
|
-
title: E
|
|
28
|
-
}, I = "flyout-outlet";
|
|
29
|
-
function T(c) {
|
|
29
|
+
"backdrop-appearance-rtl": "cfxui__Flyout__backdrop-appearance-rtl__9f651"
|
|
30
|
+
}, g = "flyout-outlet", H = "cfxui-root", n = "shrink";
|
|
31
|
+
function S(i) {
|
|
30
32
|
const {
|
|
31
33
|
disabled: t = !1,
|
|
32
|
-
size:
|
|
33
|
-
theme:
|
|
34
|
-
onClose:
|
|
35
|
-
children:
|
|
36
|
-
holderClassName:
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
size: a = "normal",
|
|
35
|
+
theme: c = "default",
|
|
36
|
+
onClose: l = b,
|
|
37
|
+
children: r,
|
|
38
|
+
holderClassName: u,
|
|
39
|
+
rootClassName: d,
|
|
40
|
+
maskClassName: f
|
|
41
|
+
} = i, p = C(g);
|
|
42
|
+
y.useEffect(() => {
|
|
39
43
|
if (t)
|
|
40
44
|
return;
|
|
41
|
-
const _ = document.getElementById(
|
|
42
|
-
return _ == null || _.classList.add(
|
|
43
|
-
}, [t]),
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const _ = document.getElementById(H);
|
|
46
|
+
return _ == null || _.classList.add(n), () => _ == null ? void 0 : _.classList.remove(n);
|
|
47
|
+
}, [t]), N(l);
|
|
48
|
+
const h = s(
|
|
49
|
+
e.root,
|
|
50
|
+
e[`size-${a}`],
|
|
51
|
+
e[`theme-${c}`],
|
|
52
|
+
{
|
|
53
|
+
[e.active]: !t
|
|
54
|
+
},
|
|
55
|
+
d
|
|
56
|
+
);
|
|
57
|
+
return /* @__PURE__ */ o(p, { children: /* @__PURE__ */ m("div", { className: h, children: [
|
|
58
|
+
/* @__PURE__ */ o(k, { showPointer: !1, className: e.backdrop, onClick: l }),
|
|
59
|
+
/* @__PURE__ */ o("div", { className: s(e.mask, f), children: /* @__PURE__ */ o("div", { className: s(e.holder, u), children: /* @__PURE__ */ o(x, { disabled: t, className: e.content, children: r }) }) })
|
|
50
60
|
] }) });
|
|
51
61
|
}
|
|
52
|
-
|
|
62
|
+
S.Header = function(t) {
|
|
53
63
|
const {
|
|
54
|
-
onClose:
|
|
55
|
-
children:
|
|
56
|
-
ref:
|
|
64
|
+
onClose: a,
|
|
65
|
+
children: c,
|
|
66
|
+
ref: l,
|
|
67
|
+
className: r
|
|
57
68
|
} = t;
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ o("div", { className: e.title, children:
|
|
60
|
-
!!
|
|
69
|
+
return /* @__PURE__ */ m("div", { ref: l, className: s(e.header, r), children: [
|
|
70
|
+
/* @__PURE__ */ o("div", { className: e.title, children: c }),
|
|
71
|
+
!!a && /* @__PURE__ */ o(F, { icon: "Close", onClick: a })
|
|
61
72
|
] });
|
|
62
73
|
};
|
|
63
74
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
g as FLYOUT_OUTLET_ID,
|
|
76
|
+
H as FLYOUT_ROOT_ID,
|
|
77
|
+
n as FLYOUT_ROOT_SHRINK_CLASSNAME,
|
|
78
|
+
S as Flyout
|
|
66
79
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { Flyout as l } from "./Flyout.js";
|
|
4
|
+
function i() {
|
|
5
|
+
const [e, t] = n.useState(!0);
|
|
6
|
+
return /* @__PURE__ */ o(s, { children: [
|
|
7
|
+
/* @__PURE__ */ o("button", { type: "button", onClick: () => t(!e), children: [
|
|
8
|
+
e ? "Open" : "Close",
|
|
9
|
+
" ",
|
|
10
|
+
"Flyout"
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ o(
|
|
13
|
+
l,
|
|
14
|
+
{
|
|
15
|
+
disabled: e,
|
|
16
|
+
onClose: () => t(!0),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ r(l.Header, { onClose: () => t(!0), children: /* @__PURE__ */ r("h1", { children: "Header" }) }),
|
|
19
|
+
/* @__PURE__ */ r("p", { children: "This is a flyout" })
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
const d = n.memo(i);
|
|
26
|
+
export {
|
|
27
|
+
d as default
|
|
28
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { FLYOUT_OUTLET_ID,
|
|
1
|
+
export { Flyout, FLYOUT_OUTLET_ID, FLYOUT_ROOT_ID, FLYOUT_ROOT_SHRINK_CLASSNAME, } from './Flyout';
|
|
2
2
|
export type { FlyoutProps, FlyoutSize, FlyoutTheme, } from './Flyout';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { FLYOUT_OUTLET_ID as
|
|
1
|
+
import { FLYOUT_OUTLET_ID as _, FLYOUT_ROOT_ID as L, FLYOUT_ROOT_SHRINK_CLASSNAME as F, Flyout as U } from "./Flyout.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
_ as FLYOUT_OUTLET_ID,
|
|
4
|
+
L as FLYOUT_ROOT_ID,
|
|
5
|
+
F as FLYOUT_ROOT_SHRINK_CLASSNAME,
|
|
6
|
+
U as Flyout
|
|
5
7
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export { Decorate } from './components/Decorate';
|
|
|
47
47
|
export type { DecorateProps } from './components/Decorate';
|
|
48
48
|
export { Dot } from './components/Dot';
|
|
49
49
|
export type { DotProps, DotSize } from './components/Dot';
|
|
50
|
-
export { Flyout, FLYOUT_OUTLET_ID } from './components/Flyout';
|
|
50
|
+
export { Flyout, FLYOUT_OUTLET_ID, FLYOUT_ROOT_ID, FLYOUT_ROOT_SHRINK_CLASSNAME, } from './components/Flyout';
|
|
51
51
|
export type { FlyoutSize, FlyoutProps } from './components/Flyout';
|
|
52
52
|
export { Logos } from './components/Logos';
|
|
53
53
|
export type { LogoNames } from './components/Logos';
|