@coinloger/dev-ui 0.1.0 → 0.1.3
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/cjs/components/Badge/Badge.cjs +1 -1
- package/dist/cjs/components/Button/Button.cjs +1 -1
- package/dist/cjs/components/Card/Card.cjs +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/Container/Container.cjs +1 -0
- package/dist/cjs/components/Flex/Flex.cjs +1 -0
- package/dist/cjs/components/Flex/FlexItem.cjs +1 -0
- package/dist/cjs/components/Input/Input.cjs +1 -1
- package/dist/cjs/components/Modal/Modal.cjs +1 -1
- package/dist/cjs/components/Radio/Radio.cjs +1 -1
- package/dist/cjs/components/Select/Select.cjs +1 -1
- package/dist/cjs/components/Switch/Switch.cjs +1 -1
- package/dist/cjs/components/Table/Table.cjs +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
- package/dist/cjs/components/Typography/Heading.cjs +1 -1
- package/dist/cjs/components/Typography/Text.cjs +1 -1
- package/dist/cjs/dev-ui.css +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme.cjs +1 -1
- package/dist/esm/components/Badge/Badge.js +14 -22
- package/dist/esm/components/Button/Button.js +12 -24
- package/dist/esm/components/Card/Card.js +10 -18
- package/dist/esm/components/Checkbox/Checkbox.js +17 -33
- package/dist/esm/components/Container/Container.d.ts +23 -0
- package/dist/esm/components/Container/Container.js +24 -0
- package/dist/esm/components/Flex/Flex.d.ts +64 -0
- package/dist/esm/components/Flex/Flex.js +39 -0
- package/dist/esm/components/Flex/FlexItem.d.ts +53 -0
- package/dist/esm/components/Flex/FlexItem.js +33 -0
- package/dist/esm/components/Input/Input.js +16 -46
- package/dist/esm/components/Modal/Modal.d.ts +0 -35
- package/dist/esm/components/Modal/Modal.js +60 -83
- package/dist/esm/components/Radio/Radio.js +16 -32
- package/dist/esm/components/Select/Select.d.ts +1 -17
- package/dist/esm/components/Select/Select.js +95 -93
- package/dist/esm/components/Switch/Switch.js +18 -34
- package/dist/esm/components/Table/Table.js +13 -22
- package/dist/esm/components/Tabs/Tabs.d.ts +0 -25
- package/dist/esm/components/Tabs/Tabs.js +45 -70
- package/dist/esm/components/Typography/Heading.js +15 -25
- package/dist/esm/components/Typography/Text.js +19 -32
- package/dist/esm/dev-ui.css +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +20 -16
- package/dist/esm/theme.d.ts +0 -5
- package/dist/esm/theme.js +11 -16
- package/package.json +15 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
export interface SelectOption {
|
|
3
3
|
value: string | number;
|
|
4
4
|
label: string;
|
|
@@ -57,20 +57,4 @@ export interface SelectProps {
|
|
|
57
57
|
export declare const Select: {
|
|
58
58
|
({ options, value, onChange, placeholder, label, error, helperText, disabled, fullWidth, size, className, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
59
59
|
displayName: string;
|
|
60
|
-
propTypes: {
|
|
61
|
-
options: PropTypes.Validator<(PropTypes.InferProps<{
|
|
62
|
-
value: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
63
|
-
label: PropTypes.Validator<string>;
|
|
64
|
-
}> | null | undefined)[]>;
|
|
65
|
-
value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
66
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
67
|
-
placeholder: PropTypes.Requireable<string>;
|
|
68
|
-
label: PropTypes.Requireable<string>;
|
|
69
|
-
error: PropTypes.Requireable<boolean>;
|
|
70
|
-
helperText: PropTypes.Requireable<string>;
|
|
71
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
72
|
-
fullWidth: PropTypes.Requireable<boolean>;
|
|
73
|
-
size: PropTypes.Requireable<string>;
|
|
74
|
-
className: PropTypes.Requireable<string>;
|
|
75
|
-
};
|
|
76
60
|
};
|
|
@@ -1,110 +1,112 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import * as e from "prop-types";
|
|
1
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useRef as C, useEffect as g } from "react";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
options:
|
|
8
|
-
value:
|
|
9
|
-
onChange:
|
|
10
|
-
placeholder:
|
|
11
|
-
label:
|
|
12
|
-
error:
|
|
13
|
-
helperText:
|
|
14
|
-
disabled:
|
|
15
|
-
fullWidth:
|
|
16
|
-
size:
|
|
17
|
-
className:
|
|
5
|
+
const O = ({
|
|
6
|
+
options: c,
|
|
7
|
+
value: a,
|
|
8
|
+
onChange: p,
|
|
9
|
+
placeholder: x = "Select an option",
|
|
10
|
+
label: f,
|
|
11
|
+
error: h,
|
|
12
|
+
helperText: v,
|
|
13
|
+
disabled: u,
|
|
14
|
+
fullWidth: w,
|
|
15
|
+
size: k = "md",
|
|
16
|
+
className: y
|
|
18
17
|
}) => {
|
|
19
|
-
const [t,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const [t, d] = N(!1), [L, b] = N("bottom"), i = C(null), m = c.find((e) => e.value === a), l = () => {
|
|
19
|
+
if (i.current) {
|
|
20
|
+
const e = i.current.getBoundingClientRect(), o = window.innerHeight - e.bottom, B = e.top;
|
|
21
|
+
o < 250 && B > o ? b("top") : b("bottom");
|
|
22
|
+
}
|
|
23
|
+
}, E = () => {
|
|
24
|
+
u || (t || l(), d(!t));
|
|
25
|
+
}, S = (e) => {
|
|
26
|
+
p && p(e), d(!1);
|
|
23
27
|
};
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
return g(() => (t && (window.addEventListener("resize", l), window.addEventListener("scroll", l, { capture: !0 })), () => {
|
|
29
|
+
window.removeEventListener("resize", l), window.removeEventListener("scroll", l, { capture: !0 });
|
|
30
|
+
}), [t]), g(() => {
|
|
31
|
+
const e = (o) => {
|
|
32
|
+
i.current && !i.current.contains(o.target) && d(!1);
|
|
27
33
|
};
|
|
28
|
-
return t && document.addEventListener("mousedown",
|
|
29
|
-
document.removeEventListener("mousedown",
|
|
34
|
+
return t && document.addEventListener("mousedown", e), () => {
|
|
35
|
+
document.removeEventListener("mousedown", e);
|
|
30
36
|
};
|
|
31
|
-
}, [t]), /* @__PURE__ */
|
|
37
|
+
}, [t]), /* @__PURE__ */ r(
|
|
32
38
|
"div",
|
|
33
39
|
{
|
|
34
|
-
className:
|
|
35
|
-
ref:
|
|
36
|
-
style: { width:
|
|
40
|
+
className: n("ui-select-wrapper", w && "ui-w-full", y),
|
|
41
|
+
ref: i,
|
|
42
|
+
style: { width: w ? "100%" : "auto" },
|
|
37
43
|
children: [
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
44
|
+
f && /* @__PURE__ */ s("label", { className: "ui-label", style: { marginBottom: "0.375rem", display: "block" }, children: f }),
|
|
45
|
+
/* @__PURE__ */ r("div", { className: "ui-select-input-container", children: [
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
type: "button",
|
|
50
|
+
className: n(
|
|
51
|
+
"ui-select-trigger",
|
|
52
|
+
`ui-select-${k}`,
|
|
53
|
+
h && "ui-select-error",
|
|
54
|
+
u && "ui-select-disabled",
|
|
55
|
+
t && "ui-select-open"
|
|
56
|
+
),
|
|
57
|
+
onClick: E,
|
|
58
|
+
disabled: u,
|
|
59
|
+
"aria-haspopup": "listbox",
|
|
60
|
+
"aria-expanded": t,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ s("span", { className: n(!m && "ui-select-placeholder"), children: m ? m.label : x }),
|
|
63
|
+
/* @__PURE__ */ s(
|
|
64
|
+
"svg",
|
|
65
|
+
{
|
|
66
|
+
className: "ui-select-icon",
|
|
67
|
+
fill: "none",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
viewBox: "0 0 24 24",
|
|
70
|
+
children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
t && /* @__PURE__ */ r(
|
|
77
|
+
"ul",
|
|
72
78
|
{
|
|
73
|
-
className:
|
|
74
|
-
"ui-select-
|
|
75
|
-
|
|
79
|
+
className: n(
|
|
80
|
+
"ui-select-menu",
|
|
81
|
+
L === "top" && "ui-select-menu-top"
|
|
76
82
|
),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
role: "listbox",
|
|
84
|
+
children: [
|
|
85
|
+
c.map((e) => /* @__PURE__ */ s(
|
|
86
|
+
"li",
|
|
87
|
+
{
|
|
88
|
+
className: n(
|
|
89
|
+
"ui-select-option",
|
|
90
|
+
e.value === a && "ui-select-selected"
|
|
91
|
+
),
|
|
92
|
+
onClick: () => S(e.value),
|
|
93
|
+
role: "option",
|
|
94
|
+
"aria-selected": e.value === a,
|
|
95
|
+
children: e.label
|
|
96
|
+
},
|
|
97
|
+
e.value
|
|
98
|
+
)),
|
|
99
|
+
c.length === 0 && /* @__PURE__ */ s("li", { className: "ui-select-option", style: { color: "var(--ui-text-muted)", cursor: "default" }, children: "No options" })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
85
103
|
] }),
|
|
86
|
-
|
|
104
|
+
v && /* @__PURE__ */ s("span", { className: n("ui-helper-text", h && "ui-helper-text-error"), style: { marginTop: "0.375rem", display: "block" }, children: v })
|
|
87
105
|
]
|
|
88
106
|
}
|
|
89
107
|
);
|
|
90
108
|
};
|
|
91
|
-
|
|
92
|
-
b.propTypes = {
|
|
93
|
-
options: e.arrayOf(e.shape({
|
|
94
|
-
value: e.oneOfType([e.string, e.number]).isRequired,
|
|
95
|
-
label: e.string.isRequired
|
|
96
|
-
})).isRequired,
|
|
97
|
-
value: e.oneOfType([e.string, e.number]),
|
|
98
|
-
onChange: e.func,
|
|
99
|
-
placeholder: e.string,
|
|
100
|
-
label: e.string,
|
|
101
|
-
error: e.bool,
|
|
102
|
-
helperText: e.string,
|
|
103
|
-
disabled: e.bool,
|
|
104
|
-
fullWidth: e.bool,
|
|
105
|
-
size: e.oneOf(["sm", "md", "lg", "xl"]),
|
|
106
|
-
className: e.string
|
|
107
|
-
};
|
|
109
|
+
O.displayName = "Select";
|
|
108
110
|
export {
|
|
109
|
-
|
|
111
|
+
O as Select
|
|
110
112
|
};
|
|
@@ -1,53 +1,37 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import * as e from "prop-types";
|
|
1
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { clsx as o } from "clsx";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
({ className:
|
|
5
|
+
const p = l(
|
|
6
|
+
({ className: c, label: s, error: u, disabled: t, size: r = "md", variant: a = "primary", ...e }, h) => /* @__PURE__ */ m(
|
|
8
7
|
"label",
|
|
9
8
|
{
|
|
10
|
-
className:
|
|
9
|
+
className: o(
|
|
11
10
|
"ui-switch-label",
|
|
12
|
-
`ui-switch-${
|
|
13
|
-
`ui-switch-${
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
`ui-switch-${r}`,
|
|
12
|
+
`ui-switch-${a}`,
|
|
13
|
+
t && "ui-switch-disabled",
|
|
14
|
+
c
|
|
16
15
|
),
|
|
17
16
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ i(
|
|
19
18
|
"input",
|
|
20
19
|
{
|
|
21
20
|
type: "checkbox",
|
|
22
21
|
className: "ui-switch-input",
|
|
23
|
-
disabled:
|
|
24
|
-
ref:
|
|
22
|
+
disabled: t,
|
|
23
|
+
ref: h,
|
|
25
24
|
role: "switch",
|
|
26
|
-
...
|
|
25
|
+
...e
|
|
27
26
|
}
|
|
28
27
|
),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
28
|
+
/* @__PURE__ */ i("span", { className: "ui-switch-track", children: /* @__PURE__ */ i("span", { className: "ui-switch-thumb" }) }),
|
|
29
|
+
s && /* @__PURE__ */ i("span", { className: "ui-switch-text", children: s })
|
|
31
30
|
]
|
|
32
31
|
}
|
|
33
32
|
)
|
|
34
33
|
);
|
|
35
|
-
|
|
36
|
-
a.propTypes = {
|
|
37
|
-
label: e.node,
|
|
38
|
-
error: e.bool,
|
|
39
|
-
size: e.oneOf(["sm", "md", "lg", "xl"]),
|
|
40
|
-
variant: e.oneOf(["primary", "success", "warning", "danger"]),
|
|
41
|
-
checked: e.bool,
|
|
42
|
-
defaultChecked: e.bool,
|
|
43
|
-
onChange: e.func,
|
|
44
|
-
name: e.string,
|
|
45
|
-
value: e.oneOfType([e.string, e.number]),
|
|
46
|
-
disabled: e.bool,
|
|
47
|
-
required: e.bool,
|
|
48
|
-
id: e.string,
|
|
49
|
-
className: e.string
|
|
50
|
-
};
|
|
34
|
+
p.displayName = "Switch";
|
|
51
35
|
export {
|
|
52
|
-
|
|
36
|
+
p as Switch
|
|
53
37
|
};
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import * as e from "prop-types";
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
4
3
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
-
({ className:
|
|
7
|
-
const
|
|
4
|
+
const u = d(
|
|
5
|
+
({ className: a, bordered: r = !0, striped: t, hover: i, size: l = "md", children: s, ...o }, m) => {
|
|
6
|
+
const b = [
|
|
8
7
|
"ui-table",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
r && "ui-table-bordered",
|
|
9
|
+
t && "ui-table-striped",
|
|
10
|
+
i && "ui-table-hover",
|
|
11
|
+
l === "sm" && "ui-table-sm",
|
|
12
|
+
a
|
|
14
13
|
].filter(Boolean).join(" ");
|
|
15
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ e("div", { className: "ui-table-responsive", children: /* @__PURE__ */ e("table", { ref: m, className: b, ...o, children: s }) });
|
|
16
15
|
}
|
|
17
16
|
);
|
|
18
|
-
|
|
19
|
-
r.propTypes = {
|
|
20
|
-
bordered: e.bool,
|
|
21
|
-
striped: e.bool,
|
|
22
|
-
hover: e.bool,
|
|
23
|
-
size: e.oneOf(["sm", "md"]),
|
|
24
|
-
children: e.node,
|
|
25
|
-
className: e.string
|
|
26
|
-
};
|
|
17
|
+
u.displayName = "Table";
|
|
27
18
|
export {
|
|
28
|
-
|
|
19
|
+
u as Table
|
|
29
20
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode, MouseEventHandler } from 'react';
|
|
2
2
|
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
4
3
|
/**
|
|
5
4
|
* Tabs Root properties.
|
|
6
5
|
*/
|
|
@@ -40,41 +39,17 @@ export interface TabsContentProps {
|
|
|
40
39
|
export declare const Tabs: {
|
|
41
40
|
({ defaultValue, value, onValueChange, children, className }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
42
41
|
displayName: string;
|
|
43
|
-
propTypes: {
|
|
44
|
-
defaultValue: PropTypes.Requireable<string>;
|
|
45
|
-
value: PropTypes.Requireable<string>;
|
|
46
|
-
onValueChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
48
|
-
className: PropTypes.Requireable<string>;
|
|
49
|
-
};
|
|
50
42
|
} & {
|
|
51
43
|
List: {
|
|
52
44
|
({ className, children, variant, ...props }: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
53
45
|
displayName: string;
|
|
54
|
-
propTypes: {
|
|
55
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
56
|
-
variant: PropTypes.Requireable<string>;
|
|
57
|
-
className: PropTypes.Requireable<string>;
|
|
58
|
-
};
|
|
59
46
|
};
|
|
60
47
|
Trigger: {
|
|
61
48
|
({ value, className, children, onClick, ...props }: TabsTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
62
49
|
displayName: string;
|
|
63
|
-
propTypes: {
|
|
64
|
-
value: PropTypes.Validator<string>;
|
|
65
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
66
|
-
className: PropTypes.Requireable<string>;
|
|
67
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
69
|
-
};
|
|
70
50
|
};
|
|
71
51
|
Content: {
|
|
72
52
|
({ value, className, children, ...props }: TabsContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
73
53
|
displayName: string;
|
|
74
|
-
propTypes: {
|
|
75
|
-
value: PropTypes.Validator<string>;
|
|
76
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
77
|
-
className: PropTypes.Requireable<string>;
|
|
78
|
-
};
|
|
79
54
|
};
|
|
80
55
|
};
|
|
@@ -1,92 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import * as t from "prop-types";
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, useState as $, useId as N, useContext as m } from "react";
|
|
3
|
+
import { clsx as b } from "clsx";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
const [
|
|
8
|
-
|
|
5
|
+
const u = x(null), C = ({ defaultValue: t, value: s, onValueChange: a, children: o, className: n }) => {
|
|
6
|
+
const [e, i] = $(t || ""), r = s !== void 0, l = r ? s : e, d = N(), g = (T) => {
|
|
7
|
+
r || i(T), a?.(T);
|
|
9
8
|
};
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
},
|
|
9
|
+
return /* @__PURE__ */ c(u.Provider, { value: { value: l, onChange: g, baseId: d }, children: /* @__PURE__ */ c("div", { className: b("ui-tabs", n), children: o }) });
|
|
10
|
+
}, I = ({ className: t, children: s, variant: a = "line", ...o }) => /* @__PURE__ */ c(
|
|
12
11
|
"div",
|
|
13
12
|
{
|
|
14
13
|
role: "tablist",
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
17
|
-
children:
|
|
14
|
+
className: b("ui-tabs-list", `ui-tabs-list-${a}`, t),
|
|
15
|
+
...o,
|
|
16
|
+
children: s
|
|
18
17
|
}
|
|
19
|
-
),
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
const
|
|
23
|
-
|
|
18
|
+
), p = ({ value: t, className: s, children: a, onClick: o, ...n }) => {
|
|
19
|
+
const e = m(u);
|
|
20
|
+
if (!e) throw new Error("TabsTrigger must be used within Tabs");
|
|
21
|
+
const i = e.value === t, r = `${e.baseId}-trigger-${t}`, l = `${e.baseId}-content-${t}`, d = (g) => {
|
|
22
|
+
e.onChange(t), o?.(g);
|
|
24
23
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ c(
|
|
26
25
|
"button",
|
|
27
26
|
{
|
|
28
27
|
type: "button",
|
|
29
28
|
role: "tab",
|
|
30
|
-
"aria-selected":
|
|
31
|
-
"aria-controls":
|
|
32
|
-
id:
|
|
33
|
-
tabIndex:
|
|
34
|
-
"data-state":
|
|
35
|
-
className:
|
|
36
|
-
onClick:
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
29
|
+
"aria-selected": i,
|
|
30
|
+
"aria-controls": l,
|
|
31
|
+
id: r,
|
|
32
|
+
tabIndex: i ? 0 : -1,
|
|
33
|
+
"data-state": i ? "active" : "inactive",
|
|
34
|
+
className: b("ui-tabs-trigger", s),
|
|
35
|
+
onClick: d,
|
|
36
|
+
...n,
|
|
37
|
+
children: a
|
|
39
38
|
}
|
|
40
39
|
);
|
|
41
|
-
},
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
return
|
|
40
|
+
}, h = ({ value: t, className: s, children: a, ...o }) => {
|
|
41
|
+
const n = m(u);
|
|
42
|
+
if (!n) throw new Error("TabsContent must be used within Tabs");
|
|
43
|
+
const e = n.value === t, i = `${n.baseId}-trigger-${t}`, r = `${n.baseId}-content-${t}`;
|
|
44
|
+
return e ? /* @__PURE__ */ c(
|
|
46
45
|
"div",
|
|
47
46
|
{
|
|
48
47
|
role: "tabpanel",
|
|
49
|
-
id:
|
|
50
|
-
"aria-labelledby":
|
|
48
|
+
id: r,
|
|
49
|
+
"aria-labelledby": i,
|
|
51
50
|
tabIndex: 0,
|
|
52
|
-
className:
|
|
53
|
-
...
|
|
54
|
-
children:
|
|
51
|
+
className: b("ui-tabs-content", s),
|
|
52
|
+
...o,
|
|
53
|
+
children: a
|
|
55
54
|
}
|
|
56
55
|
) : null;
|
|
57
|
-
},
|
|
58
|
-
List:
|
|
59
|
-
Trigger:
|
|
60
|
-
Content:
|
|
56
|
+
}, L = Object.assign(C, {
|
|
57
|
+
List: I,
|
|
58
|
+
Trigger: p,
|
|
59
|
+
Content: h
|
|
61
60
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
m.propTypes = {
|
|
67
|
-
defaultValue: t.string,
|
|
68
|
-
value: t.string,
|
|
69
|
-
onValueChange: t.func,
|
|
70
|
-
children: t.node,
|
|
71
|
-
className: t.string
|
|
72
|
-
};
|
|
73
|
-
T.propTypes = {
|
|
74
|
-
children: t.node,
|
|
75
|
-
variant: t.oneOf(["line", "pills"]),
|
|
76
|
-
className: t.string
|
|
77
|
-
};
|
|
78
|
-
h.propTypes = {
|
|
79
|
-
value: t.string.isRequired,
|
|
80
|
-
children: t.node,
|
|
81
|
-
className: t.string,
|
|
82
|
-
onClick: t.func,
|
|
83
|
-
disabled: t.bool
|
|
84
|
-
};
|
|
85
|
-
C.propTypes = {
|
|
86
|
-
value: t.string.isRequired,
|
|
87
|
-
children: t.node,
|
|
88
|
-
className: t.string
|
|
89
|
-
};
|
|
61
|
+
C.displayName = "Tabs";
|
|
62
|
+
I.displayName = "TabsList";
|
|
63
|
+
p.displayName = "TabsTrigger";
|
|
64
|
+
h.displayName = "TabsContent";
|
|
90
65
|
export {
|
|
91
|
-
|
|
66
|
+
L as Tabs
|
|
92
67
|
};
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import * as e from "prop-types";
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { clsx as s } from "clsx";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
({ className:
|
|
8
|
-
const c = `h${o}`,
|
|
9
|
-
return /* @__PURE__ */
|
|
5
|
+
const f = d(
|
|
6
|
+
({ className: i, children: r, level: o = 1, truncate: m, lines: t, style: a, ...e }, n) => {
|
|
7
|
+
const c = `h${o}`, p = t ? { ...a, "--ui-line-clamp": t } : a;
|
|
8
|
+
return /* @__PURE__ */ u(
|
|
10
9
|
c,
|
|
11
10
|
{
|
|
12
|
-
ref:
|
|
13
|
-
className:
|
|
11
|
+
ref: n,
|
|
12
|
+
className: s(
|
|
14
13
|
"ui-heading",
|
|
15
14
|
`ui-heading-h${o}`,
|
|
16
15
|
m && "ui-text-truncate",
|
|
17
16
|
t && "ui-text-clamp",
|
|
18
|
-
|
|
17
|
+
i
|
|
19
18
|
),
|
|
20
|
-
style:
|
|
21
|
-
...
|
|
22
|
-
children:
|
|
19
|
+
style: p,
|
|
20
|
+
...e,
|
|
21
|
+
children: r
|
|
23
22
|
}
|
|
24
23
|
);
|
|
25
24
|
}
|
|
26
25
|
);
|
|
27
|
-
|
|
28
|
-
i.propTypes = {
|
|
29
|
-
level: e.oneOf([1, 2, 3, 4, 5, 6]),
|
|
30
|
-
truncate: e.bool,
|
|
31
|
-
lines: e.number,
|
|
32
|
-
children: e.node,
|
|
33
|
-
className: e.string,
|
|
34
|
-
style: e.object,
|
|
35
|
-
id: e.string
|
|
36
|
-
};
|
|
26
|
+
f.displayName = "Heading";
|
|
37
27
|
export {
|
|
38
|
-
|
|
28
|
+
f as Heading
|
|
39
29
|
};
|