@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.
@@ -1 +1 @@
1
- .cfxui__TableResponsiveText__root__0e257{position:relative;min-width:calc(var(--quant) * 15);z-index:-1}.cfxui__TableResponsiveText__root__0e257 .cfxui__TableResponsiveText__text__78e87{position:absolute;left:0;right:0;overflow:hidden}
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}
@@ -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%;line-height:1.1;white-space:nowrap;overflow:hidden;mask:linear-gradient(90deg,red,red 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%}
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 c } from "react/jsx-runtime";
2
- import { useState as C, useCallback as d } from "react";
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 m } from "../../utils/clsx.js";
5
- import { Icon as k } from "../Icon/Icon.js";
6
- import { Interactive as h } from "../Interactive/Interactive.js";
7
- import { Text as w } from "../Text/Text.js";
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 l } from "../../BurgerMenu.module-CyY93Y4u.js";
10
- function K({
11
- items: b,
12
- onItemClick: u,
13
- isOpen: p,
14
- className: f
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 [t, g] = C({}), i = d((e) => {
17
- u(e);
18
- }, [u]), s = d((e) => {
19
- g((n) => ({
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: m(l.burgerMenuContentContainer, f),
36
+ className: u(i.burgerMenuContentContainer, y),
28
37
  direction: "column",
29
- children: p && /* @__PURE__ */ o(r, { direction: "column", className: l.menu, children: b.map((e) => /* @__PURE__ */ c("div", { 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
- h,
40
+ f,
32
41
  {
33
42
  showPointer: !0,
34
43
  "aria-label": "Toggle item",
35
44
  role: "button",
36
45
  onClick: () => {
37
- e.submenu ? s(e.id) : i(e.id);
46
+ e.submenu ? m(e.id) : l(e.id);
38
47
  },
39
48
  onKeyDown: (n) => {
40
- (n.key === "Enter" || n.key === " ") && (e.submenu ? s(e.id) : i(e.id));
49
+ (n.key === "Enter" || n.key === " ") && (e.submenu ? m(e.id) : l(e.id));
41
50
  },
42
- children: /* @__PURE__ */ c(r, { p: 2, justifyContent: "space-between", children: [
51
+ className: s,
52
+ children: /* @__PURE__ */ p(r, { p: 2, justifyContent: "space-between", className: t, children: [
43
53
  /* @__PURE__ */ o(
44
- w,
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
- k,
62
+ N,
53
63
  {
54
- name: t[e.id] ? "UpChevron" : "DownChevron"
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: m(l.subItemContainer, {
64
- [l.subItemContainerOpen]: t[e.id]
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
- h,
82
+ f,
69
83
  {
70
84
  showPointer: !0,
71
85
  "aria-label": "Toggle sub item",
72
86
  role: "button",
73
- onClick: () => i(n.id),
74
- onKeyDown: (a) => {
75
- (a.key === "Enter" || a.key === " ") && i(n.id);
87
+ onClick: () => l(n.id),
88
+ onKeyDown: (h) => {
89
+ (h.key === "Enter" || h.key === " ") && l(n.id);
76
90
  },
77
- children: /* @__PURE__ */ o(r, { p: 2, children: n.label })
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
- K as BurgerMenu
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 t } from "react/jsx-runtime";
2
- import n from "react";
3
- import l from "../Flex/Flex.js";
4
- import { clsx as m } from "../../utils/clsx.js";
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
- const x = "cfxui__TableResponsiveText__root__0e257", _ = "cfxui__TableResponsiveText__text__78e87", o = {
9
- root: x,
10
- text: _
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 f(e) {
11
+ function p(o) {
13
12
  const {
14
- title: r,
15
- children: s,
16
- rootClassName: i
17
- } = e;
18
- return /* @__PURE__ */ t(a, { title: r ?? s, children: /* @__PURE__ */ t(l, { gap: "medium", centered: !0, className: m(o.root, i), children: /* @__PURE__ */ t(c, { truncated: !0, ...e, className: o.text }) }) });
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 C = n.memo(f);
29
+ const y = l.memo(p);
21
30
  export {
22
- C as default
31
+ y as default
23
32
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "5.0.5",
4
+ "version": "5.0.7",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",