@cfx-dev/ui-components 5.0.5 → 5.0.7
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/TableResponsiveText.css +1 -1
- package/dist/assets/css/Text.css +1 -1
- package/dist/components/BurgerMenu/BurgerMenu.d.ts +6 -1
- package/dist/components/BurgerMenu/BurgerMenu.js +49 -34
- package/dist/components/TableResponsiveText/TableResponsiveText.d.ts +1 -0
- package/dist/components/TableResponsiveText/TableResponsiveText.js +26 -17
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__TableResponsiveText__root__0e257{position:relative;min-width:
|
|
1
|
+
.cfxui__TableResponsiveText__root__0e257{position:relative;display:flex;align-items:center;width:100%;min-width:var(--min-width)}.cfxui__TableResponsiveText__root__0e257 .cfxui__TableResponsiveText__text__78e87{position:absolute;left:0;right:0;z-index:1;overflow-x:clip}
|
package/dist/assets/css/Text.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__Text__root__2fe11{--trim-line-height: calc(var(--font-size-current) * var(--line-height-current));--trim-extra-height: calc(var(--trim-line-height) - 1cap);--trim-size: calc((var(--trim-extra-height) / 2) * -1)}.cfxui__Text__root__2fe11{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__Text__root__2fe11:before{content:"";margin-bottom:calc(var(--trim-size) - .015cap);display:table}.cfxui__Text__root__2fe11:after{content:"";margin-top:calc(var(--trim-size) + .025cap);display:table}.cfxui__Text__root__2fe11.cfxui__Text__verticalTrimDisabled__34631:before,.cfxui__Text__root__2fe11.cfxui__Text__verticalTrimDisabled__34631:after{display:none;margin:0}.cfxui__Text__root__2fe11.cfxui__Text__centered__4d7bd{text-align:center}.cfxui__Text__root__2fe11.cfxui__Text__underlined__5860e{text-decoration:underline}.cfxui__Text__root__2fe11.cfxui__Text__strikethrough__e3ee3{text-decoration:line-through}.cfxui__Text__root__2fe11.cfxui__Text__truncated__417f4{width:100%;
|
|
1
|
+
.cfxui__Text__root__2fe11{--trim-line-height: calc(var(--font-size-current) * var(--line-height-current));--trim-extra-height: calc(var(--trim-line-height) - 1cap);--trim-size: calc((var(--trim-extra-height) / 2) * -1)}.cfxui__Text__root__2fe11{transition:all .25s ease,outline-offset 0s,outline 0s}.cfxui__Text__root__2fe11:before{content:"";margin-bottom:calc(var(--trim-size) - .015cap);display:table}.cfxui__Text__root__2fe11:after{content:"";margin-top:calc(var(--trim-size) + .025cap);display:table}.cfxui__Text__root__2fe11.cfxui__Text__verticalTrimDisabled__34631:before,.cfxui__Text__root__2fe11.cfxui__Text__verticalTrimDisabled__34631:after{display:none;margin:0}.cfxui__Text__root__2fe11.cfxui__Text__centered__4d7bd{text-align:center}.cfxui__Text__root__2fe11.cfxui__Text__underlined__5860e{text-decoration:underline}.cfxui__Text__root__2fe11.cfxui__Text__strikethrough__e3ee3{text-decoration:line-through}.cfxui__Text__root__2fe11.cfxui__Text__truncated__417f4{width:100%;white-space:nowrap;overflow-x:clip;display:inline-block;mask:linear-gradient(90deg,rgba(var(--color-red),1),rgba(var(--color-red),1) calc(100% - 2ch),transparent)}.cfxui__Text__root__2fe11.cfxui__Text__typographic__d8155{overflow-wrap:break-word}.cfxui__Text__root__2fe11.cfxui__Text__typographic__d8155 li{margin-left:calc(var(--quant) * 4)}.cfxui__Text__root__2fe11:not(.cfxui__Text__typographic__d8155) a{color:inherit;text-decoration:none}.cfxui__Text__root__2fe11.cfxui__Text__block__cb1b6{max-width:100%}
|
|
@@ -4,6 +4,7 @@ export interface BurgerMenuItem {
|
|
|
4
4
|
label: string;
|
|
5
5
|
highlighted?: boolean;
|
|
6
6
|
id: string;
|
|
7
|
+
openByDefault?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
submenu?: BurgerMenuItem[];
|
|
9
10
|
}
|
|
@@ -12,5 +13,9 @@ export interface BurgerMenuProps {
|
|
|
12
13
|
onItemClick: (item: string) => void;
|
|
13
14
|
isOpen: boolean;
|
|
14
15
|
className?: string;
|
|
16
|
+
menuClassName?: string;
|
|
17
|
+
subItemContainerClassName?: string;
|
|
18
|
+
itemInteractiveClassName?: string;
|
|
19
|
+
itemClassName?: string;
|
|
15
20
|
}
|
|
16
|
-
export declare function BurgerMenu({ items, onItemClick, isOpen, className, }: BurgerMenuProps): React.ReactElement;
|
|
21
|
+
export declare function BurgerMenu({ items, onItemClick, isOpen, className, menuClassName, subItemContainerClassName, itemInteractiveClassName, itemClassName, }: BurgerMenuProps): React.ReactElement;
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useCallback as b } from "react";
|
|
3
3
|
import r from "../Flex/Flex.js";
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Interactive as
|
|
7
|
-
import { Text as
|
|
4
|
+
import { clsx as u } from "../../utils/clsx.js";
|
|
5
|
+
import { Icon as N } from "../Icon/Icon.js";
|
|
6
|
+
import { Interactive as f } from "../Interactive/Interactive.js";
|
|
7
|
+
import { Text as S } from "../Text/Text.js";
|
|
8
8
|
import "../../utils/ui/ui.js";
|
|
9
|
-
import { s as
|
|
10
|
-
function
|
|
11
|
-
items:
|
|
12
|
-
onItemClick:
|
|
13
|
-
isOpen:
|
|
14
|
-
className:
|
|
9
|
+
import { s as i } from "../../BurgerMenu.module-CyY93Y4u.js";
|
|
10
|
+
function P({
|
|
11
|
+
items: a,
|
|
12
|
+
onItemClick: c,
|
|
13
|
+
isOpen: g,
|
|
14
|
+
className: y,
|
|
15
|
+
menuClassName: C,
|
|
16
|
+
subItemContainerClassName: k,
|
|
17
|
+
itemInteractiveClassName: s,
|
|
18
|
+
itemClassName: t
|
|
15
19
|
}) {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const [d, w] = x(() => {
|
|
21
|
+
const e = {};
|
|
22
|
+
return a.forEach((n) => {
|
|
23
|
+
n.openByDefault && (e[n.id] = !0);
|
|
24
|
+
}), e;
|
|
25
|
+
}), l = b((e) => {
|
|
26
|
+
c(e);
|
|
27
|
+
}, [c]), m = b((e) => {
|
|
28
|
+
w((n) => ({
|
|
20
29
|
...n,
|
|
21
30
|
[e]: !n[e]
|
|
22
31
|
}));
|
|
@@ -24,24 +33,25 @@ function K({
|
|
|
24
33
|
return /* @__PURE__ */ o(
|
|
25
34
|
r,
|
|
26
35
|
{
|
|
27
|
-
className:
|
|
36
|
+
className: u(i.burgerMenuContentContainer, y),
|
|
28
37
|
direction: "column",
|
|
29
|
-
children:
|
|
38
|
+
children: g && /* @__PURE__ */ o(r, { direction: "column", className: u(i.menu, C), children: a.map((e) => /* @__PURE__ */ p("div", { children: [
|
|
30
39
|
/* @__PURE__ */ o(
|
|
31
|
-
|
|
40
|
+
f,
|
|
32
41
|
{
|
|
33
42
|
showPointer: !0,
|
|
34
43
|
"aria-label": "Toggle item",
|
|
35
44
|
role: "button",
|
|
36
45
|
onClick: () => {
|
|
37
|
-
e.submenu ?
|
|
46
|
+
e.submenu ? m(e.id) : l(e.id);
|
|
38
47
|
},
|
|
39
48
|
onKeyDown: (n) => {
|
|
40
|
-
(n.key === "Enter" || n.key === " ") && (e.submenu ?
|
|
49
|
+
(n.key === "Enter" || n.key === " ") && (e.submenu ? m(e.id) : l(e.id));
|
|
41
50
|
},
|
|
42
|
-
|
|
51
|
+
className: s,
|
|
52
|
+
children: /* @__PURE__ */ p(r, { p: 2, justifyContent: "space-between", className: t, children: [
|
|
43
53
|
/* @__PURE__ */ o(
|
|
44
|
-
|
|
54
|
+
S,
|
|
45
55
|
{
|
|
46
56
|
size: "xsmall",
|
|
47
57
|
weight: e.highlighted ? "bold" : "regular",
|
|
@@ -49,9 +59,9 @@ function K({
|
|
|
49
59
|
}
|
|
50
60
|
),
|
|
51
61
|
e.submenu && /* @__PURE__ */ o(
|
|
52
|
-
|
|
62
|
+
N,
|
|
53
63
|
{
|
|
54
|
-
name:
|
|
64
|
+
name: d[e.id] ? "UpChevron" : "DownChevron"
|
|
55
65
|
}
|
|
56
66
|
)
|
|
57
67
|
] })
|
|
@@ -60,21 +70,26 @@ function K({
|
|
|
60
70
|
e.submenu && /* @__PURE__ */ o(
|
|
61
71
|
r,
|
|
62
72
|
{
|
|
63
|
-
className:
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
className: u(
|
|
74
|
+
i.subItemContainer,
|
|
75
|
+
k,
|
|
76
|
+
{
|
|
77
|
+
[i.subItemContainerOpen]: d[e.id]
|
|
78
|
+
}
|
|
79
|
+
),
|
|
66
80
|
direction: "column",
|
|
67
81
|
children: e.submenu.map((n) => /* @__PURE__ */ o(
|
|
68
|
-
|
|
82
|
+
f,
|
|
69
83
|
{
|
|
70
84
|
showPointer: !0,
|
|
71
85
|
"aria-label": "Toggle sub item",
|
|
72
86
|
role: "button",
|
|
73
|
-
onClick: () =>
|
|
74
|
-
onKeyDown: (
|
|
75
|
-
(
|
|
87
|
+
onClick: () => l(n.id),
|
|
88
|
+
onKeyDown: (h) => {
|
|
89
|
+
(h.key === "Enter" || h.key === " ") && l(n.id);
|
|
76
90
|
},
|
|
77
|
-
|
|
91
|
+
className: s,
|
|
92
|
+
children: /* @__PURE__ */ o(r, { p: 2, className: t, children: n.label })
|
|
78
93
|
},
|
|
79
94
|
n.id
|
|
80
95
|
))
|
|
@@ -85,5 +100,5 @@ function K({
|
|
|
85
100
|
);
|
|
86
101
|
}
|
|
87
102
|
export {
|
|
88
|
-
|
|
103
|
+
P as BurgerMenu
|
|
89
104
|
};
|
|
@@ -4,6 +4,7 @@ import { TextProps } from '../Text';
|
|
|
4
4
|
export interface TableResponsiveTextProps extends TextProps {
|
|
5
5
|
title?: string;
|
|
6
6
|
rootClassName?: string;
|
|
7
|
+
minWidth?: string | number;
|
|
7
8
|
}
|
|
8
9
|
declare function TableResponsiveText(props: TableResponsiveTextProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
declare const _default: React.MemoExoticComponent<typeof TableResponsiveText>;
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Text as c } from "../Text/Text.js";
|
|
6
|
-
import "../../utils/ui/ui.js";
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { Text as m } from "../Text/Text.js";
|
|
4
|
+
import { ui as c } from "../../utils/ui/ui.js";
|
|
7
5
|
import { Title as a } from "../Title/Title.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { clsx as x } from "../../utils/clsx.js";
|
|
7
|
+
const _ = "cfxui__TableResponsiveText__root__0e257", f = "cfxui__TableResponsiveText__text__78e87", i = {
|
|
8
|
+
root: _,
|
|
9
|
+
text: f
|
|
11
10
|
};
|
|
12
|
-
function
|
|
11
|
+
function p(o) {
|
|
13
12
|
const {
|
|
14
|
-
title:
|
|
15
|
-
children:
|
|
16
|
-
rootClassName:
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
title: n,
|
|
14
|
+
children: r,
|
|
15
|
+
rootClassName: s,
|
|
16
|
+
minWidth: t = 15
|
|
17
|
+
} = o;
|
|
18
|
+
return /* @__PURE__ */ e(a, { title: n ?? r, fixedOn: "top", children: /* @__PURE__ */ e(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: x(i.root, s),
|
|
22
|
+
style: {
|
|
23
|
+
"--min-width": typeof t == "number" ? c.q(t) : t
|
|
24
|
+
},
|
|
25
|
+
children: /* @__PURE__ */ e(m, { truncated: !0, ...o, className: i.text })
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
19
28
|
}
|
|
20
|
-
const
|
|
29
|
+
const y = l.memo(p);
|
|
21
30
|
export {
|
|
22
|
-
|
|
31
|
+
y as default
|
|
23
32
|
};
|