@cfx-dev/ui-components 4.2.9 → 4.2.11
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/BurgerMenu.module-CyY93Y4u.js +11 -0
- package/dist/assets/css/BurgerMenu.css +1 -1
- package/dist/components/BurgerMenu/BurgerMenu.d.ts +7 -6
- package/dist/components/BurgerMenu/BurgerMenu.js +70 -119
- package/dist/components/BurgerMenu/BurgerMenuButton.d.ts +8 -0
- package/dist/components/BurgerMenu/BurgerMenuButton.js +54 -0
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +24 -18
- package/dist/components/BurgerMenu/index.d.ts +3 -0
- package/dist/components/BurgerMenu/index.js +4 -2
- package/dist/components/DropdownSelect/DropdownSelect.js +802 -1040
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Slider/Slider.js +294 -374
- package/dist/index-AweK2ufS.js +171 -0
- package/dist/{index-DBus3GoO.js → index-Bz27DCHt.js} +2 -2
- package/dist/main.d.ts +4 -1
- package/dist/main.js +136 -134
- package/package.json +1 -1
- package/dist/index-CjTSD6zB.js +0 -161
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const e = "cfxui__BurgerMenu__burgerButton__cc9ab", n = "cfxui__BurgerMenu__burgerMenuContentContainer__2fb6f", r = "cfxui__BurgerMenu__burgerLine__886ad", u = "cfxui__BurgerMenu__burgerLineOpen__af602", _ = "cfxui__BurgerMenu__subItemContainer__0d64a", t = "cfxui__BurgerMenu__subItemContainerOpen__5491d", o = {
|
|
2
|
+
burgerButton: e,
|
|
3
|
+
burgerMenuContentContainer: n,
|
|
4
|
+
burgerLine: r,
|
|
5
|
+
burgerLineOpen: u,
|
|
6
|
+
subItemContainer: _,
|
|
7
|
+
subItemContainerOpen: t
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
o as s
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__BurgerMenu__burgerButton__cc9ab{width:calc(var(--quant) * 3.25);height:calc(var(--quant) * 3.25);cursor:pointer}.
|
|
1
|
+
.cfxui__BurgerMenu__burgerButton__cc9ab{width:calc(var(--quant) * 3.25);height:calc(var(--quant) * 3.25);cursor:pointer}.cfxui__BurgerMenu__burgerMenuContentContainer__2fb6f{background:rgba(var(--color-bg-light),1)}.cfxui__BurgerMenu__burgerLine__886ad,.cfxui__BurgerMenu__burgerLineOpen__af602{width:100%;height:calc(var(--quant) * .3);background-color:rgba(var(--color-primary),1);border-radius:var(--border-radius-xsmall)}.cfxui__BurgerMenu__burgerLine__886ad,.cfxui__BurgerMenu__burgerLineOpen__af602{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(1){transform:rotate(45deg) translate(5px,5px)}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(1){transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(2){opacity:0}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(2){transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(3){transform:rotate(-45deg) translate(7px,-7px)}.cfxui__BurgerMenu__burgerLineOpen__af602:nth-child(3){transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__BurgerMenu__subItemContainer__0d64a{background-color:rgba(var(--color-secondary),.25);max-height:0;overflow:hidden}.cfxui__BurgerMenu__subItemContainer__0d64a{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__BurgerMenu__subItemContainerOpen__5491d{max-height:var(--height)}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
export interface BurgerMenuItem {
|
|
4
4
|
label: string;
|
|
5
5
|
highlighted?: boolean;
|
|
6
6
|
id: string;
|
|
7
7
|
className?: string;
|
|
8
|
-
submenu?:
|
|
8
|
+
submenu?: BurgerMenuItem[];
|
|
9
9
|
}
|
|
10
|
-
interface BurgerMenuProps {
|
|
11
|
-
items:
|
|
10
|
+
export interface BurgerMenuProps {
|
|
11
|
+
items: BurgerMenuItem[];
|
|
12
12
|
onItemClick: (item: string) => void;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
className?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare function BurgerMenu({ items, onItemClick, }: BurgerMenuProps): React.ReactElement;
|
|
15
|
-
export {};
|
|
16
|
+
export declare function BurgerMenu({ items, onItemClick, isOpen, className, }: BurgerMenuProps): React.ReactElement;
|
|
@@ -1,135 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Interactive as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { Text as
|
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useCallback as d } from "react";
|
|
3
|
+
import { Icon as k } from "../Icon/Icon.js";
|
|
4
|
+
import { Interactive as m } from "../Interactive/Interactive.js";
|
|
5
|
+
import { Flex as r } from "../Layout/Flex/Flex.js";
|
|
6
|
+
import { Text as w } from "../Text/Text.js";
|
|
7
7
|
import "../ui.js";
|
|
8
|
-
import { clsx as
|
|
9
|
-
|
|
10
|
-
burgerButton: y,
|
|
11
|
-
burgerContainerOpen: L,
|
|
12
|
-
burgerLine: B,
|
|
13
|
-
burgerLineOpen: k,
|
|
14
|
-
subItemContainer: w,
|
|
15
|
-
subItemContainerOpen: I
|
|
16
|
-
};
|
|
8
|
+
import { clsx as h } from "../../utils/clsx.js";
|
|
9
|
+
import { s as l } from "../../BurgerMenu.module-CyY93Y4u.js";
|
|
17
10
|
function K({
|
|
18
|
-
items:
|
|
19
|
-
onItemClick:
|
|
11
|
+
items: b,
|
|
12
|
+
onItemClick: t,
|
|
13
|
+
isOpen: p,
|
|
14
|
+
className: f
|
|
20
15
|
}) {
|
|
21
|
-
const [
|
|
22
|
-
|
|
23
|
-
}, []), s =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...o,
|
|
28
|
-
[e]: !o[e]
|
|
16
|
+
const [u, g] = C({}), i = d((e) => {
|
|
17
|
+
t(e);
|
|
18
|
+
}, [t]), s = d((e) => {
|
|
19
|
+
g((n) => ({
|
|
20
|
+
...n,
|
|
21
|
+
[e]: !n[e]
|
|
29
22
|
}));
|
|
30
23
|
}, []);
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
24
|
+
return /* @__PURE__ */ o(
|
|
25
|
+
r,
|
|
33
26
|
{
|
|
34
|
-
className:
|
|
27
|
+
className: h(l.burgerMenuContentContainer, f),
|
|
35
28
|
direction: "column",
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
29
|
+
children: p && /* @__PURE__ */ o(r, { direction: "column", className: l.menu, children: b.map((e) => /* @__PURE__ */ c("div", { children: [
|
|
30
|
+
/* @__PURE__ */ o(
|
|
31
|
+
m,
|
|
39
32
|
{
|
|
40
33
|
showPointer: !0,
|
|
41
|
-
"aria-label": "Toggle
|
|
34
|
+
"aria-label": "Toggle item",
|
|
42
35
|
role: "button",
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
45
|
-
(e.key === "Enter" || e.key === " ") && p();
|
|
36
|
+
onClick: () => {
|
|
37
|
+
e.submenu ? s(e.id) : i(e.id);
|
|
46
38
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children: [
|
|
54
|
-
/* @__PURE__ */ n(
|
|
55
|
-
"span",
|
|
56
|
-
{
|
|
57
|
-
className: t(i ? r.burgerLineOpen : r.burgerLine)
|
|
58
|
-
}
|
|
59
|
-
),
|
|
60
|
-
/* @__PURE__ */ n(
|
|
61
|
-
"span",
|
|
62
|
-
{
|
|
63
|
-
className: t(i ? r.burgerLineOpen : r.burgerLine)
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ n(
|
|
67
|
-
"span",
|
|
68
|
-
{
|
|
69
|
-
className: t(i ? r.burgerLineOpen : r.burgerLine)
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
) }),
|
|
77
|
-
i && /* @__PURE__ */ n(u, { direction: "column", className: r.menu, children: h.map((e) => /* @__PURE__ */ a("div", { children: [
|
|
78
|
-
/* @__PURE__ */ n(
|
|
79
|
-
c,
|
|
80
|
-
{
|
|
81
|
-
showPointer: !0,
|
|
82
|
-
"aria-label": "Toggle item",
|
|
83
|
-
role: "button",
|
|
84
|
-
onClick: () => {
|
|
85
|
-
e.submenu ? _(e.id) : s(e.id);
|
|
86
|
-
},
|
|
87
|
-
onKeyDown: (o) => {
|
|
88
|
-
(o.key === "Enter" || o.key === " ") && (e.submenu ? _(e.id) : s(e.id));
|
|
89
|
-
},
|
|
90
|
-
children: /* @__PURE__ */ a(u, { p: 2, justifyContent: "space-between", children: [
|
|
91
|
-
/* @__PURE__ */ n(
|
|
92
|
-
x,
|
|
93
|
-
{
|
|
94
|
-
size: "xsmall",
|
|
95
|
-
weight: e.highlighted ? "bold" : "normal",
|
|
96
|
-
children: e.label
|
|
97
|
-
}
|
|
98
|
-
),
|
|
99
|
-
e.submenu && /* @__PURE__ */ n(
|
|
100
|
-
O,
|
|
101
|
-
{
|
|
102
|
-
name: d[e.id] ? "UpChevron" : "DownChevron"
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
] })
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
e.submenu && /* @__PURE__ */ n(
|
|
109
|
-
u,
|
|
110
|
-
{
|
|
111
|
-
className: t(r.subItemContainer, {
|
|
112
|
-
[r.subItemContainerOpen]: d[e.id]
|
|
113
|
-
}),
|
|
114
|
-
direction: "column",
|
|
115
|
-
children: e.submenu.map((o) => /* @__PURE__ */ n(
|
|
116
|
-
c,
|
|
39
|
+
onKeyDown: (n) => {
|
|
40
|
+
(n.key === "Enter" || n.key === " ") && (e.submenu ? s(e.id) : i(e.id));
|
|
41
|
+
},
|
|
42
|
+
children: /* @__PURE__ */ c(r, { p: 2, justifyContent: "space-between", children: [
|
|
43
|
+
/* @__PURE__ */ o(
|
|
44
|
+
w,
|
|
117
45
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
46
|
+
size: "xsmall",
|
|
47
|
+
weight: e.highlighted ? "bold" : "normal",
|
|
48
|
+
children: e.label
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
e.submenu && /* @__PURE__ */ o(
|
|
52
|
+
k,
|
|
53
|
+
{
|
|
54
|
+
name: u[e.id] ? "UpChevron" : "DownChevron"
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] })
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
e.submenu && /* @__PURE__ */ o(
|
|
61
|
+
r,
|
|
62
|
+
{
|
|
63
|
+
className: h(l.subItemContainer, {
|
|
64
|
+
[l.subItemContainerOpen]: u[e.id]
|
|
65
|
+
}),
|
|
66
|
+
direction: "column",
|
|
67
|
+
children: e.submenu.map((n) => /* @__PURE__ */ o(
|
|
68
|
+
m,
|
|
69
|
+
{
|
|
70
|
+
showPointer: !0,
|
|
71
|
+
"aria-label": "Toggle sub item",
|
|
72
|
+
role: "button",
|
|
73
|
+
onClick: () => i(n.id),
|
|
74
|
+
onKeyDown: (a) => {
|
|
75
|
+
(a.key === "Enter" || a.key === " ") && i(n.id);
|
|
126
76
|
},
|
|
127
|
-
o.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
77
|
+
children: /* @__PURE__ */ o(r, { p: 2, children: n.label })
|
|
78
|
+
},
|
|
79
|
+
n.id
|
|
80
|
+
))
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }, e.id)) })
|
|
133
84
|
}
|
|
134
85
|
);
|
|
135
86
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BurgerMenuButtonProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function BurgerMenuButton({ isOpen, onToggle, className, }: BurgerMenuButtonProps): React.ReactElement;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Interactive as m } from "../Interactive/Interactive.js";
|
|
3
|
+
import { Flex as u } from "../Layout/Flex/Flex.js";
|
|
4
|
+
import { clsx as o } from "../../utils/clsx.js";
|
|
5
|
+
import { s as r } from "../../BurgerMenu.module-CyY93Y4u.js";
|
|
6
|
+
function g({
|
|
7
|
+
isOpen: n,
|
|
8
|
+
onToggle: t,
|
|
9
|
+
className: a
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ e(u, { className: a, children: /* @__PURE__ */ e(
|
|
12
|
+
m,
|
|
13
|
+
{
|
|
14
|
+
showPointer: !0,
|
|
15
|
+
"aria-label": "Toggle menu",
|
|
16
|
+
role: "button",
|
|
17
|
+
onClick: t,
|
|
18
|
+
onKeyDown: (i) => {
|
|
19
|
+
(i.key === "Enter" || i.key === " ") && t();
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ s(
|
|
22
|
+
u,
|
|
23
|
+
{
|
|
24
|
+
justifyContent: "space-around",
|
|
25
|
+
direction: "column",
|
|
26
|
+
className: r.burgerButton,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ e(
|
|
29
|
+
"span",
|
|
30
|
+
{
|
|
31
|
+
className: o(n ? r.burgerLineOpen : r.burgerLine)
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
className: o(n ? r.burgerLineOpen : r.burgerLine)
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
className: o(n ? r.burgerLineOpen : r.burgerLine)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
g as BurgerMenuButton
|
|
54
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Flex as
|
|
4
|
-
import { Text as
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import a, { useState as s, useCallback as u } from "react";
|
|
3
|
+
import { Flex as t } from "../Layout/Flex/Flex.js";
|
|
4
|
+
import { Text as m } from "../Text/Text.js";
|
|
5
5
|
import "../ui.js";
|
|
6
|
-
import { BurgerMenu as
|
|
7
|
-
|
|
6
|
+
import { BurgerMenu as c } from "./BurgerMenu.js";
|
|
7
|
+
import { BurgerMenuButton as g } from "./BurgerMenuButton.js";
|
|
8
|
+
const d = [
|
|
8
9
|
{
|
|
9
10
|
id: "1",
|
|
10
11
|
label: "Account",
|
|
@@ -32,22 +33,27 @@ const a = [
|
|
|
32
33
|
id: "4",
|
|
33
34
|
label: "Settings"
|
|
34
35
|
}
|
|
35
|
-
],
|
|
36
|
-
console.log(`Item clicked: ${
|
|
36
|
+
], p = (e) => {
|
|
37
|
+
console.log(`Item clicked: ${e}`);
|
|
37
38
|
};
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
function h() {
|
|
40
|
+
const [e, l] = s(!1), o = u(() => {
|
|
41
|
+
l((n) => !n);
|
|
42
|
+
}, []);
|
|
43
|
+
return /* @__PURE__ */ r(t, { gap: "large", vertical: !0, pb: 20, children: /* @__PURE__ */ i(t, { gap: "normal", vertical: !0, children: [
|
|
44
|
+
/* @__PURE__ */ r(m, { children: "Burger Menu" }),
|
|
45
|
+
/* @__PURE__ */ r(g, { isOpen: e, onToggle: o }),
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
c,
|
|
43
48
|
{
|
|
44
|
-
items:
|
|
45
|
-
onItemClick:
|
|
49
|
+
items: d,
|
|
50
|
+
onItemClick: p,
|
|
51
|
+
isOpen: e
|
|
46
52
|
}
|
|
47
|
-
)
|
|
53
|
+
)
|
|
48
54
|
] }) });
|
|
49
55
|
}
|
|
50
|
-
const
|
|
56
|
+
const I = a.memo(h);
|
|
51
57
|
export {
|
|
52
|
-
|
|
58
|
+
I as default
|
|
53
59
|
};
|