@cfx-dev/ui-components 4.5.3 → 4.5.5
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/Modal.css +1 -1
- package/dist/components/Button/LinkButton.js +30 -24
- package/dist/components/ClipboardButton/ClipboardButton.js +4 -4
- package/dist/components/Flyout/Flyout.js +4 -4
- package/dist/components/Modal/Modal.d.ts +36 -2
- package/dist/components/Modal/Modal.js +129 -63
- package/dist/components/Modal/ModalShowcase.js +24 -16
- package/dist/components/Tabular/Tabular.d.ts +12 -11
- package/dist/components/Tabular/Tabular.js +62 -59
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.cfxui__Modal__root__53283{flex-shrink:0;position:relative;display:flex;flex-direction:column;max-width:calc((var(--width) - var(--offset-safezone) * 2) * 1);min-width:calc(var(--quant) * 37.5);max-height:calc((var(--height) - var(--offset-safezone) * 2) * 1);padding:calc(var(--quant) * 6) calc(var(--quant) * 3.75) calc(var(--quant) * 3.75) calc(var(--quant) * 3.75);background-color:var(--color-modal-background);border-radius:var(--border-radius-small);overflow:hidden auto;animation-name:cfxui__Modal__modal-appearance__60dd7;animation-duration:.2s}@media (min-width: 1024px){.cfxui__Modal__root__53283{min-width:calc(var(--quant) * 75)}}@media (min-width: 1920px){.cfxui__Modal__root__53283{min-width:calc(var(--quant) * 87.5);padding:calc(var(--quant) * 6) calc(var(--quant) * 5) calc(var(--quant) * 5) calc(var(--quant) * 5)}}.cfxui__Modal__root__53283 .cfxui__Modal__close__2df9b{position:absolute;top:calc(var(--quant) * 1.5);right:calc(var(--quant) * 2);z-index:1}.cfxui__Modal__root__53283 .cfxui__Modal__header__bec76{display:flex;flex-direction:column;gap:calc(var(--quant) * 2.5);padding-bottom:calc(var(--quant) * 3)}@media (min-width: 1920px){.cfxui__Modal__root__53283 .cfxui__Modal__header__bec76{padding-bottom:calc(var(--quant) * 4)}}.cfxui__Modal__root__53283 .
|
|
1
|
+
.cfxui__Modal__root__53283{flex-shrink:0;position:relative;display:flex;flex-direction:column;max-width:calc((var(--width) - var(--offset-safezone) * 2) * 1);min-width:calc(var(--quant) * 37.5);max-height:calc((var(--height) - var(--offset-safezone) * 2) * 1);padding:calc(var(--quant) * 6) calc(var(--quant) * 3.75) calc(var(--quant) * 3.75) calc(var(--quant) * 3.75);background-color:var(--color-modal-background);border-radius:var(--border-radius-small);overflow:hidden auto;animation-name:cfxui__Modal__modal-appearance__60dd7;animation-duration:.2s}.cfxui__Modal__root__53283.cfxui__Modal__colored__649d1{border-top:calc(var(--quant) * 1.25) solid var(--modal-color);background:linear-gradient(180deg,var(--modal-color-bg) 0%,rgba(var(--color-bg),.2) 44.05%),linear-gradient(0deg,var(--color-modal-background),var(--color-modal-background))}@media (min-width: 1024px){.cfxui__Modal__root__53283{min-width:calc(var(--quant) * 75)}}@media (min-width: 1920px){.cfxui__Modal__root__53283{min-width:calc(var(--quant) * 87.5);padding:calc(var(--quant) * 6) calc(var(--quant) * 5) calc(var(--quant) * 5) calc(var(--quant) * 5)}}.cfxui__Modal__root__53283 .cfxui__Modal__close__2df9b{position:absolute;top:calc(var(--quant) * 1.5);right:calc(var(--quant) * 2);z-index:1}.cfxui__Modal__root__53283 .cfxui__Modal__header__bec76{display:flex;flex-direction:column;gap:calc(var(--quant) * 2.5);padding-bottom:calc(var(--quant) * 3)}@media (min-width: 1920px){.cfxui__Modal__root__53283 .cfxui__Modal__header__bec76{padding-bottom:calc(var(--quant) * 4)}}.cfxui__Modal__root__53283 .cfxui__Modal__footer__bb2fc{padding-top:calc(var(--quant) * 2.5)}@media (min-width: 1920px){.cfxui__Modal__root__53283 .cfxui__Modal__footer__bb2fc{padding-top:calc(var(--quant) * 3.75)}}@keyframes cfxui__Modal__modal-appearance__60dd7{0%{opacity:0;transform:scale(.75)}to{opacity:1;transform:scale(1)}}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
function M(t) {
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { isExternalUrl as b } from "../../utils/links.js";
|
|
4
|
+
import { getButtonClassName as h, ButtonContent as B } from "./Button.js";
|
|
5
|
+
function M(e) {
|
|
7
6
|
const {
|
|
8
|
-
to:
|
|
9
|
-
title:
|
|
10
|
-
tabIndex:
|
|
11
|
-
target:
|
|
12
|
-
onClick:
|
|
13
|
-
isHrefProp:
|
|
14
|
-
Component:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
to: t,
|
|
8
|
+
title: f = "",
|
|
9
|
+
tabIndex: m,
|
|
10
|
+
target: u = "",
|
|
11
|
+
onClick: n,
|
|
12
|
+
isHrefProp: a = !1,
|
|
13
|
+
Component: c,
|
|
14
|
+
disabled: l = !1,
|
|
15
|
+
ref: C
|
|
16
|
+
} = e, d = o.useMemo(() => h(e), [e]), r = b(t), k = r ? "a" : c || "a", p = o.useMemo(() => r || a ? { href: t } : { to: t }, [t, r, a]), x = o.useCallback((i) => {
|
|
17
|
+
if (l) {
|
|
18
|
+
i.preventDefault();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
n && n(i);
|
|
22
|
+
}, [l, n]);
|
|
23
|
+
return /* @__PURE__ */ s(
|
|
24
|
+
k,
|
|
19
25
|
{
|
|
20
|
-
ref:
|
|
21
|
-
className:
|
|
22
|
-
tabIndex:
|
|
23
|
-
title:
|
|
24
|
-
target:
|
|
26
|
+
ref: C,
|
|
27
|
+
className: d,
|
|
28
|
+
tabIndex: m,
|
|
29
|
+
title: f,
|
|
30
|
+
target: u,
|
|
25
31
|
rel: "noopener noreferrer",
|
|
26
|
-
onClickCapture:
|
|
32
|
+
onClickCapture: x,
|
|
27
33
|
...p,
|
|
28
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ s(B, { ...e })
|
|
29
35
|
}
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -2,9 +2,9 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import c from "react";
|
|
3
3
|
import C from "../Button/Button.js";
|
|
4
4
|
import { clsx as _ } from "../../utils/clsx.js";
|
|
5
|
-
import { noop as f } from "../../utils/functional.js";
|
|
6
5
|
import "../../utils/links.js";
|
|
7
|
-
import { Title as
|
|
6
|
+
import { Title as f } from "../Title/Title.js";
|
|
7
|
+
import { noop as u } from "../../utils/functional.js";
|
|
8
8
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
9
9
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
10
10
|
import "../../index-Cl_RnsqN.js";
|
|
@@ -19,7 +19,7 @@ function h(o) {
|
|
|
19
19
|
copiedTitle: T,
|
|
20
20
|
textToCopy: j,
|
|
21
21
|
fixedOn: n,
|
|
22
|
-
onClick: t =
|
|
22
|
+
onClick: t = u,
|
|
23
23
|
...p
|
|
24
24
|
} = o, {
|
|
25
25
|
copied: l,
|
|
@@ -29,7 +29,7 @@ function h(o) {
|
|
|
29
29
|
t(s), i();
|
|
30
30
|
}, [i, t]), a = _(e.root, { [e.copied]: l });
|
|
31
31
|
return /* @__PURE__ */ r(
|
|
32
|
-
|
|
32
|
+
f,
|
|
33
33
|
{
|
|
34
34
|
title: m,
|
|
35
35
|
fixedOn: n,
|
|
@@ -3,9 +3,9 @@ import d from "react";
|
|
|
3
3
|
import { F as f } from "../../Combination-N-vN9BB-.js";
|
|
4
4
|
import p from "../Button/Button.js";
|
|
5
5
|
import { clsx as l } from "../../utils/clsx.js";
|
|
6
|
-
import { noop as h } from "../../utils/functional.js";
|
|
7
6
|
import "../../utils/links.js";
|
|
8
|
-
import { Interactive as
|
|
7
|
+
import { Interactive as h } from "../Interactive/Interactive.js";
|
|
8
|
+
import { noop as y } from "../../utils/functional.js";
|
|
9
9
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
10
10
|
import { useKeyboardClose as F } from "../../utils/hooks/useKeyboardClose.js";
|
|
11
11
|
import { useOutlet as x } from "../../utils/hooks/useOutlet.js";
|
|
@@ -28,7 +28,7 @@ function I(c) {
|
|
|
28
28
|
const {
|
|
29
29
|
disabled: t = !1,
|
|
30
30
|
size: s = "normal",
|
|
31
|
-
onClose: r =
|
|
31
|
+
onClose: r = y,
|
|
32
32
|
children: a,
|
|
33
33
|
holderClassName: n
|
|
34
34
|
} = c, m = x(E);
|
|
@@ -42,7 +42,7 @@ function I(c) {
|
|
|
42
42
|
[o.active]: !t
|
|
43
43
|
});
|
|
44
44
|
return /* @__PURE__ */ e(m, { children: /* @__PURE__ */ i("div", { className: u, children: [
|
|
45
|
-
/* @__PURE__ */ e(
|
|
45
|
+
/* @__PURE__ */ e(h, { showPointer: !1, className: o.backdrop, onClick: r }),
|
|
46
46
|
/* @__PURE__ */ e("div", { className: o.mask, children: /* @__PURE__ */ e("div", { className: l(o.holder, n), children: /* @__PURE__ */ e(f, { disabled: !!t, className: o.content, children: a }) }) })
|
|
47
47
|
] }) });
|
|
48
48
|
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ButtonBarProps } from '../Button';
|
|
3
|
+
import { IconBigName } from '../Icons';
|
|
4
|
+
import { ColorType } from '../../utils/ui';
|
|
3
5
|
|
|
6
|
+
export declare enum ModalThemeEnum {
|
|
7
|
+
default = "default",
|
|
8
|
+
danger = "danger",
|
|
9
|
+
success = "success",
|
|
10
|
+
warning = "warning"
|
|
11
|
+
}
|
|
12
|
+
export type ModalThemeType = keyof typeof ModalThemeEnum;
|
|
13
|
+
export declare const MODAL_THEME_TO_COLOR_MAP: Record<ModalThemeType, ColorType | undefined>;
|
|
4
14
|
export interface ModalProps {
|
|
5
15
|
children: React.ReactNode;
|
|
6
16
|
onClose?: () => void;
|
|
17
|
+
color?: ColorType;
|
|
18
|
+
theme?: ModalThemeType;
|
|
7
19
|
className?: string;
|
|
8
20
|
overlayClassName?: string;
|
|
9
21
|
backdropClassName?: string;
|
|
@@ -18,8 +30,30 @@ export declare namespace Modal {
|
|
|
18
30
|
var Header: (props: ModalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
31
|
var Footer: (props: ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
32
|
}
|
|
21
|
-
export interface
|
|
33
|
+
export interface ModalHeaderIconProps {
|
|
34
|
+
theme?: ModalThemeType;
|
|
35
|
+
iconName?: IconBigName;
|
|
36
|
+
iconColor?: ColorType;
|
|
37
|
+
}
|
|
38
|
+
type ModalHeaderIconType = {
|
|
39
|
+
theme: ModalThemeType;
|
|
40
|
+
iconName?: never;
|
|
41
|
+
iconColor?: never;
|
|
42
|
+
icon?: never;
|
|
43
|
+
} | {
|
|
44
|
+
theme?: never;
|
|
45
|
+
iconName: IconBigName;
|
|
46
|
+
iconColor?: ColorType;
|
|
47
|
+
icon?: never;
|
|
48
|
+
} | {
|
|
49
|
+
theme?: never;
|
|
50
|
+
iconName?: never;
|
|
51
|
+
iconColor?: never;
|
|
52
|
+
icon?: React.ReactNode;
|
|
53
|
+
};
|
|
54
|
+
export type ModalHeaderProps = ModalHeaderIconType & {
|
|
22
55
|
title: string;
|
|
23
56
|
description?: React.ReactNode;
|
|
24
|
-
}
|
|
57
|
+
};
|
|
25
58
|
export type ModalFooterProps = ButtonBarProps;
|
|
59
|
+
export {};
|
|
@@ -1,60 +1,81 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import B from "react";
|
|
3
3
|
import "../Button/Button.js";
|
|
4
|
-
import { ButtonBar as
|
|
4
|
+
import { ButtonBar as M } from "../Button/ButtonBar.js";
|
|
5
5
|
import "../../utils/links.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
10
|
-
import {
|
|
6
|
+
import g from "../Flex/Flex.js";
|
|
7
|
+
import { clsx as i } from "../../utils/clsx.js";
|
|
8
|
+
import { IconBig as w } from "../IconBig/IconBig.js";
|
|
9
|
+
import O from "../IconButton/IconButton.js";
|
|
10
|
+
import { Overlay as u } from "../Overlay/Overlay.js";
|
|
11
|
+
import { Text as b } from "../Text/Text.js";
|
|
12
|
+
import { ui as C } from "../../utils/ui/ui.js";
|
|
13
|
+
import { ColorEnum as z } from "../../utils/ui/ui.types.js";
|
|
11
14
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
12
|
-
import { useKeyboardClose as
|
|
15
|
+
import { useKeyboardClose as F } from "../../utils/hooks/useKeyboardClose.js";
|
|
13
16
|
import "../../index-Cl_RnsqN.js";
|
|
14
|
-
const
|
|
15
|
-
root:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const H = "cfxui__Modal__root__53283", I = "cfxui__Modal__colored__649d1", L = "cfxui__Modal__close__2df9b", T = "cfxui__Modal__header__bec76", j = "cfxui__Modal__footer__bb2fc", l = {
|
|
18
|
+
root: H,
|
|
19
|
+
colored: I,
|
|
20
|
+
close: L,
|
|
21
|
+
header: T,
|
|
22
|
+
footer: j
|
|
19
23
|
};
|
|
20
|
-
|
|
24
|
+
var A = /* @__PURE__ */ ((o) => (o.default = "default", o.danger = "danger", o.success = "success", o.warning = "warning", o))(A || {});
|
|
25
|
+
const h = {
|
|
26
|
+
default: void 0,
|
|
27
|
+
danger: "red",
|
|
28
|
+
success: "green",
|
|
29
|
+
warning: "yellow"
|
|
30
|
+
};
|
|
31
|
+
function N(o) {
|
|
21
32
|
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
33
|
+
theme: r = "default",
|
|
34
|
+
color: c,
|
|
35
|
+
onClose: e,
|
|
36
|
+
children: t,
|
|
37
|
+
className: s,
|
|
38
|
+
overlayClassName: m,
|
|
39
|
+
backdropClassName: f,
|
|
40
|
+
contentClassName: y,
|
|
41
|
+
ariaDescribedby: v,
|
|
42
|
+
ariaLabelledby: x,
|
|
43
|
+
disableBackdropClose: _ = !1,
|
|
44
|
+
disableFocusLock: k = !1
|
|
45
|
+
} = o, p = B.useCallback(() => {
|
|
46
|
+
_ || !e || e();
|
|
47
|
+
}, [e, _]);
|
|
48
|
+
F(p);
|
|
49
|
+
const n = c || h[r];
|
|
50
|
+
return /* @__PURE__ */ d(u, { className: i(l.overlay, m), children: [
|
|
36
51
|
/* @__PURE__ */ a(
|
|
37
|
-
|
|
52
|
+
u.Backdrop,
|
|
38
53
|
{
|
|
39
|
-
onClick:
|
|
40
|
-
className:
|
|
54
|
+
onClick: p,
|
|
55
|
+
className: i(l.backdrop, f)
|
|
41
56
|
}
|
|
42
57
|
),
|
|
43
58
|
/* @__PURE__ */ a(
|
|
44
|
-
|
|
59
|
+
u.Content,
|
|
45
60
|
{
|
|
46
|
-
className:
|
|
47
|
-
disableFocusLock:
|
|
48
|
-
children: /* @__PURE__ */
|
|
61
|
+
className: y,
|
|
62
|
+
disableFocusLock: k,
|
|
63
|
+
children: /* @__PURE__ */ d(
|
|
49
64
|
"div",
|
|
50
65
|
{
|
|
51
66
|
role: "dialog",
|
|
52
|
-
"aria-describedby":
|
|
53
|
-
"aria-labelledby":
|
|
54
|
-
className:
|
|
67
|
+
"aria-describedby": v,
|
|
68
|
+
"aria-labelledby": x,
|
|
69
|
+
className: i(l.root, s, {
|
|
70
|
+
[l.colored]: !!n
|
|
71
|
+
}),
|
|
72
|
+
style: {
|
|
73
|
+
"--modal-color": n ? C.color(n) : void 0,
|
|
74
|
+
"--modal-color-bg": n ? C.color(n, void 0, 0.2) : void 0
|
|
75
|
+
},
|
|
55
76
|
children: [
|
|
56
|
-
!!
|
|
57
|
-
|
|
77
|
+
!!e && /* @__PURE__ */ a(O, { areaSize: "large", className: l.close, name: "Close", onClick: e }),
|
|
78
|
+
t
|
|
58
79
|
]
|
|
59
80
|
}
|
|
60
81
|
)
|
|
@@ -62,37 +83,82 @@ function _(c) {
|
|
|
62
83
|
)
|
|
63
84
|
] });
|
|
64
85
|
}
|
|
65
|
-
|
|
86
|
+
function D(o) {
|
|
87
|
+
switch (o) {
|
|
88
|
+
case "danger":
|
|
89
|
+
return "Warni";
|
|
90
|
+
case "success":
|
|
91
|
+
return "Confirm";
|
|
92
|
+
default:
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function P(o) {
|
|
66
97
|
const {
|
|
67
|
-
|
|
68
|
-
|
|
98
|
+
theme: r = "default",
|
|
99
|
+
iconName: c,
|
|
100
|
+
iconColor: e
|
|
69
101
|
} = o;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
if (!c && !r)
|
|
103
|
+
return null;
|
|
104
|
+
const t = c || D(r), s = e || h[r] || z.primary;
|
|
105
|
+
return t ? /* @__PURE__ */ a(g, { centered: !0, children: /* @__PURE__ */ a(
|
|
106
|
+
w,
|
|
107
|
+
{
|
|
108
|
+
name: t,
|
|
109
|
+
color: s,
|
|
110
|
+
size: "normal"
|
|
111
|
+
}
|
|
112
|
+
) }) : null;
|
|
113
|
+
}
|
|
114
|
+
N.Header = function(r) {
|
|
115
|
+
const {
|
|
116
|
+
title: c,
|
|
117
|
+
description: e,
|
|
118
|
+
theme: t = "default",
|
|
119
|
+
icon: s,
|
|
120
|
+
iconName: m,
|
|
121
|
+
iconColor: f
|
|
122
|
+
} = r;
|
|
123
|
+
return /* @__PURE__ */ d(g, { vertical: !0, gap: "large", children: [
|
|
124
|
+
s || /* @__PURE__ */ a(
|
|
125
|
+
P,
|
|
73
126
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
127
|
+
theme: t,
|
|
128
|
+
iconName: m,
|
|
129
|
+
iconColor: f
|
|
77
130
|
}
|
|
78
131
|
),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
132
|
+
/* @__PURE__ */ d("div", { className: l.header, children: [
|
|
133
|
+
/* @__PURE__ */ a(
|
|
134
|
+
b,
|
|
135
|
+
{
|
|
136
|
+
weight: "bold",
|
|
137
|
+
size: "large",
|
|
138
|
+
children: c
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
e && /* @__PURE__ */ a(
|
|
142
|
+
b,
|
|
143
|
+
{
|
|
144
|
+
size: "small",
|
|
145
|
+
color: "secondary",
|
|
146
|
+
typographic: !0,
|
|
147
|
+
children: e
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] })
|
|
87
151
|
] });
|
|
88
152
|
};
|
|
89
|
-
|
|
153
|
+
N.Footer = function(r) {
|
|
90
154
|
const {
|
|
91
|
-
className:
|
|
155
|
+
className: c,
|
|
92
156
|
...e
|
|
93
|
-
} =
|
|
94
|
-
return /* @__PURE__ */ a(
|
|
157
|
+
} = r;
|
|
158
|
+
return /* @__PURE__ */ a(M, { ...e, className: i(l.footer, c) });
|
|
95
159
|
};
|
|
96
160
|
export {
|
|
97
|
-
|
|
161
|
+
h as MODAL_THEME_TO_COLOR_MAP,
|
|
162
|
+
N as Modal,
|
|
163
|
+
A as ModalThemeEnum
|
|
98
164
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import r from "react";
|
|
3
3
|
import n from "../Box/Box.js";
|
|
4
4
|
import "../../utils/ui/ui.js";
|
|
5
|
-
import
|
|
5
|
+
import i from "../Button/Button.js";
|
|
6
6
|
import "../../utils/links.js";
|
|
7
|
-
import
|
|
7
|
+
import c from "../Input/Input.js";
|
|
8
8
|
import "../../utils/hooks/useGlobalKeyboardEvent.js";
|
|
9
9
|
import "../../utils/hooks/useKeyboardClose.js";
|
|
10
10
|
import "../../index-Cl_RnsqN.js";
|
|
11
|
-
import { LOREM_IPSUM as
|
|
12
|
-
import { Modal as
|
|
11
|
+
import { LOREM_IPSUM as p } from "../../utils/loremipsum.js";
|
|
12
|
+
import { Modal as l } from "./Modal.js";
|
|
13
13
|
function s() {
|
|
14
|
-
const [
|
|
14
|
+
const [a, d] = r.useState(!1), t = r.useCallback(() => d((m) => !m), []);
|
|
15
15
|
return /* @__PURE__ */ e(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
@@ -22,16 +22,24 @@ function s() {
|
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ o("div", { id: "backdrop" }),
|
|
24
24
|
/* @__PURE__ */ o("div", { id: "overlay-outlet" }),
|
|
25
|
-
/* @__PURE__ */ o(
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */ o(
|
|
28
|
-
|
|
25
|
+
/* @__PURE__ */ o(i, { theme: "primary", onClick: t, text: "Toggle Modal" }),
|
|
26
|
+
a && /* @__PURE__ */ e(l, { onClose: t, children: [
|
|
27
|
+
/* @__PURE__ */ o(
|
|
28
|
+
l.Header,
|
|
29
|
+
{
|
|
30
|
+
iconName: "Subscriptions",
|
|
31
|
+
iconColor: "accent",
|
|
32
|
+
title: "Modal Title",
|
|
33
|
+
description: "Modal Description"
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ o(n, { mb: 4, children: /* @__PURE__ */ o(c, { theme: "onlight", placeholder: "Input", fullWidth: !0 }) }),
|
|
29
37
|
"Modal content:",
|
|
30
38
|
" ",
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */ e(
|
|
39
|
+
p,
|
|
40
|
+
/* @__PURE__ */ e(l.Footer, { children: [
|
|
33
41
|
/* @__PURE__ */ o(
|
|
34
|
-
|
|
42
|
+
i,
|
|
35
43
|
{
|
|
36
44
|
fullWidth: !0,
|
|
37
45
|
theme: "secondary",
|
|
@@ -40,7 +48,7 @@ function s() {
|
|
|
40
48
|
}
|
|
41
49
|
),
|
|
42
50
|
/* @__PURE__ */ o(
|
|
43
|
-
|
|
51
|
+
i,
|
|
44
52
|
{
|
|
45
53
|
fullWidth: !0,
|
|
46
54
|
theme: "primary",
|
|
@@ -54,7 +62,7 @@ function s() {
|
|
|
54
62
|
}
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
|
-
const
|
|
65
|
+
const w = r.memo(s);
|
|
58
66
|
export {
|
|
59
|
-
|
|
67
|
+
w as default
|
|
60
68
|
};
|
|
@@ -12,11 +12,23 @@ export interface TabularItem {
|
|
|
12
12
|
ariaControls?: string;
|
|
13
13
|
hasNotification?: boolean;
|
|
14
14
|
}
|
|
15
|
+
export interface TabularItemComponentProps {
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
type: HTMLButtonElement['type'];
|
|
18
|
+
role: HTMLButtonElement['role'];
|
|
19
|
+
className?: string;
|
|
20
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
21
|
+
'aria-label'?: string;
|
|
22
|
+
'aria-controls'?: string;
|
|
23
|
+
'data-text'?: React.ReactNode;
|
|
24
|
+
'aria-selected'?: boolean;
|
|
25
|
+
}
|
|
15
26
|
export interface TabularProps {
|
|
16
27
|
items: TabularItem[];
|
|
17
28
|
activeItem?: string;
|
|
18
29
|
onActivate?: (id: string) => void;
|
|
19
30
|
itemClassName?: string;
|
|
31
|
+
ItemComponent?: React.ElementType<TabularItemComponentProps>;
|
|
20
32
|
className?: string;
|
|
21
33
|
ariaLabel?: string;
|
|
22
34
|
tabIndex?: number;
|
|
@@ -32,17 +44,6 @@ export declare namespace Tabular {
|
|
|
32
44
|
export interface TabularRootProps extends React.PropsWithChildren, Pick<TabularProps, 'className' | 'ariaLabel' | 'tabIndex' | 'theme' | 'role' | 'size'> {
|
|
33
45
|
style?: React.CSSProperties;
|
|
34
46
|
}
|
|
35
|
-
export interface TabularItemComponentProps {
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
type: HTMLButtonElement['type'];
|
|
38
|
-
role: HTMLButtonElement['role'];
|
|
39
|
-
className?: string;
|
|
40
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
41
|
-
'aria-label'?: string;
|
|
42
|
-
'aria-controls'?: string;
|
|
43
|
-
'data-text'?: React.ReactNode;
|
|
44
|
-
'aria-selected'?: boolean;
|
|
45
|
-
}
|
|
46
47
|
export interface TabularItemProps extends TabularItem {
|
|
47
48
|
active: boolean;
|
|
48
49
|
onClick: (id: string) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as b, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import x, { createElement as p } from "react";
|
|
3
3
|
import { Dot as C } from "../Dot/Dot.js";
|
|
4
|
-
import { clsx as
|
|
4
|
+
import { clsx as d } from "../../utils/clsx.js";
|
|
5
5
|
import { ui as v } from "../../utils/ui/ui.js";
|
|
6
|
-
const k = "cfxui__Tabular__reset__b1dbc", R = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", y = "cfxui__Tabular__active__1ae95", j = "cfxui__Tabular__hasNotification__c372f", A = "cfxui__Tabular__content__3a95a",
|
|
6
|
+
const k = "cfxui__Tabular__reset__b1dbc", R = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", y = "cfxui__Tabular__active__1ae95", j = "cfxui__Tabular__hasNotification__c372f", A = "cfxui__Tabular__content__3a95a", a = {
|
|
7
7
|
reset: k,
|
|
8
8
|
"tabular-size-initial-large": "cfxui__Tabular__tabular-size-initial-large__9451f",
|
|
9
9
|
item: R,
|
|
@@ -27,98 +27,101 @@ const k = "cfxui__Tabular__reset__b1dbc", R = "cfxui__Tabular__item__98cc3", I =
|
|
|
27
27
|
hasNotification: j,
|
|
28
28
|
content: A
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function n(f) {
|
|
31
31
|
const {
|
|
32
32
|
items: s,
|
|
33
|
-
activeItem:
|
|
34
|
-
onActivate:
|
|
35
|
-
itemClassName:
|
|
33
|
+
activeItem: i,
|
|
34
|
+
onActivate: e,
|
|
35
|
+
itemClassName: _,
|
|
36
36
|
size: u = "medium",
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
e
|
|
42
|
-
|
|
37
|
+
className: c,
|
|
38
|
+
ItemComponent: m,
|
|
39
|
+
...r
|
|
40
|
+
} = f, l = x.useCallback((t) => {
|
|
41
|
+
e && e(t);
|
|
42
|
+
}, [e]), o = d(
|
|
43
|
+
a.root,
|
|
44
|
+
c
|
|
43
45
|
);
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
|
|
46
|
+
return /* @__PURE__ */ b(n.Root, { ...r, className: o, children: s.map((t) => /* @__PURE__ */ p(
|
|
47
|
+
n.Item,
|
|
46
48
|
{
|
|
47
|
-
...
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
...t,
|
|
50
|
+
Component: m,
|
|
51
|
+
className: _,
|
|
52
|
+
key: t.id,
|
|
53
|
+
active: t.id === i,
|
|
54
|
+
onClick: l,
|
|
52
55
|
size: u
|
|
53
56
|
}
|
|
54
57
|
)) });
|
|
55
58
|
}
|
|
56
|
-
|
|
59
|
+
n.Root = function(s) {
|
|
57
60
|
const {
|
|
58
|
-
children:
|
|
59
|
-
className:
|
|
60
|
-
ariaLabel:
|
|
61
|
+
children: i,
|
|
62
|
+
className: e,
|
|
63
|
+
ariaLabel: _,
|
|
61
64
|
tabIndex: u,
|
|
62
|
-
theme:
|
|
63
|
-
role:
|
|
65
|
+
theme: c = "dark",
|
|
66
|
+
role: m = "tablist",
|
|
64
67
|
style: r
|
|
65
|
-
} = s,
|
|
66
|
-
return /* @__PURE__ */
|
|
68
|
+
} = s, l = d(a.root, a[`theme-${c}`], e);
|
|
69
|
+
return /* @__PURE__ */ b(
|
|
67
70
|
"div",
|
|
68
71
|
{
|
|
69
|
-
role:
|
|
70
|
-
"aria-label":
|
|
72
|
+
role: m,
|
|
73
|
+
"aria-label": _,
|
|
71
74
|
tabIndex: u,
|
|
72
|
-
className:
|
|
75
|
+
className: l,
|
|
73
76
|
style: r,
|
|
74
|
-
children:
|
|
77
|
+
children: i
|
|
75
78
|
}
|
|
76
79
|
);
|
|
77
80
|
};
|
|
78
|
-
|
|
81
|
+
n.Item = function(s) {
|
|
79
82
|
const {
|
|
80
|
-
id:
|
|
81
|
-
label:
|
|
82
|
-
onClick:
|
|
83
|
+
id: i,
|
|
84
|
+
label: e,
|
|
85
|
+
onClick: _,
|
|
83
86
|
ariaLabel: u,
|
|
84
|
-
ariaControls:
|
|
85
|
-
className:
|
|
87
|
+
ariaControls: c,
|
|
88
|
+
className: m,
|
|
86
89
|
active: r = !1,
|
|
87
|
-
disabled:
|
|
88
|
-
hasNotification:
|
|
89
|
-
size:
|
|
90
|
+
disabled: l = !1,
|
|
91
|
+
hasNotification: o = !1,
|
|
92
|
+
size: t,
|
|
90
93
|
Component: z
|
|
91
|
-
} = s, g =
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
v.getResponsiveFlatClassnames("tabular-size",
|
|
94
|
+
} = s, g = x.useCallback(() => {
|
|
95
|
+
l || _(i);
|
|
96
|
+
}, [l, _, i]), T = d(
|
|
97
|
+
a.reset,
|
|
98
|
+
a.item,
|
|
99
|
+
m,
|
|
100
|
+
v.getResponsiveFlatClassnames("tabular-size", t).map((h) => a[h]),
|
|
98
101
|
{
|
|
99
|
-
[
|
|
100
|
-
[
|
|
102
|
+
[a.active]: r,
|
|
103
|
+
[a.hasNotification]: o
|
|
101
104
|
}
|
|
102
105
|
);
|
|
103
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ b(
|
|
104
107
|
z || "button",
|
|
105
108
|
{
|
|
106
|
-
disabled:
|
|
109
|
+
disabled: l,
|
|
107
110
|
type: "button",
|
|
108
111
|
role: "tab",
|
|
109
112
|
className: T,
|
|
110
113
|
onClick: g,
|
|
111
114
|
"aria-label": u,
|
|
112
|
-
"aria-controls":
|
|
113
|
-
"data-text":
|
|
115
|
+
"aria-controls": c,
|
|
116
|
+
"data-text": e,
|
|
114
117
|
"aria-selected": r,
|
|
115
|
-
children: /* @__PURE__ */ N("span", { className:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
children: /* @__PURE__ */ N("span", { className: a.content, children: [
|
|
119
|
+
e,
|
|
120
|
+
o && /* @__PURE__ */ b(C, { color: "green", className: a.notification })
|
|
118
121
|
] })
|
|
119
122
|
}
|
|
120
123
|
);
|
|
121
124
|
};
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
n as Tabular
|
|
124
127
|
};
|