@ztwoint/z-ui 0.1.129 → 0.1.131
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/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +30 -12
- package/dist/components/checkbox-filter/checkbox-filter-popover-field.d.ts +8 -0
- package/dist/components/checkbox-filter/checkbox-filter-popover-field.hook.d.ts +11 -0
- package/dist/components/checkbox-filter/checkbox-filter-popover-field.hook.js +23 -0
- package/dist/components/checkbox-filter/checkbox-filter-popover-field.js +44 -0
- package/dist/components/checkbox-filter/checkbox-filter.d.ts +2 -0
- package/dist/components/checkbox-filter/checkbox-filter.hook.d.ts +11 -0
- package/dist/components/checkbox-filter/checkbox-filter.hook.js +31 -0
- package/dist/components/checkbox-filter/checkbox-filter.js +64 -0
- package/dist/components/checkbox-filter/checkbox-filter.type.d.ts +2 -0
- package/dist/components/checkbox-filter/index.d.ts +7 -0
- package/dist/components/checkbox-filter/index.js +7 -0
- package/dist/components/column-reorder/column-reorder.js +14 -14
- package/dist/components/dropdown/z2-dropdown.js +3 -3
- package/dist/components/input/input.js +1 -1
- package/dist/components/number-badge/index.d.ts +2 -0
- package/dist/components/number-badge/number-badge.d.ts +10 -0
- package/dist/components/number-badge/number-badge.js +27 -0
- package/dist/components/primitives/popover-compact/index.d.ts +2 -0
- package/dist/components/primitives/popover-compact/popover-compact.d.ts +12 -0
- package/dist/components/primitives/popover-compact/popover-compact.js +30 -0
- package/dist/components/primitives/table-card/table-card.js +5 -4
- package/dist/components/tab/tab.js +57 -27
- package/dist/components/table/components/cell/avatar-cell.js +5 -4
- package/dist/components/table/components/cell/description-cell.js +3 -3
- package/dist/components/table/components/cell/label-cell.js +9 -9
- package/dist/components/table/components/cell/link-cell.js +17 -17
- package/dist/components/table/components/cell/number-cell.js +17 -17
- package/dist/components/table/table-provider.js +2 -1
- package/dist/components/table/table.const.d.ts +1 -1
- package/dist/components/table/table.const.js +1 -1
- package/dist/components/table-filter/filters/index.d.ts +0 -1
- package/dist/components/table-filter/table-filter-button.js +56 -55
- package/dist/components/table-filter/table-filter-column-button.js +51 -51
- package/dist/css/config/colors/semantic/base.css +6 -6
- package/dist/css/config/config.css +2 -1
- package/dist/css/config/other-variables.css +1 -1
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +319 -315
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/checkbox-filter/checkbox-filter-popover-field.d.ts +8 -0
- package/dist/types/components/checkbox-filter/checkbox-filter-popover-field.hook.d.ts +11 -0
- package/dist/types/components/checkbox-filter/checkbox-filter.d.ts +2 -0
- package/dist/types/components/checkbox-filter/checkbox-filter.hook.d.ts +11 -0
- package/dist/types/components/checkbox-filter/checkbox-filter.type.d.ts +2 -0
- package/dist/types/components/checkbox-filter/index.d.ts +7 -0
- package/dist/types/components/number-badge/index.d.ts +2 -0
- package/dist/types/components/number-badge/number-badge.d.ts +10 -0
- package/dist/types/components/primitives/popover-compact/index.d.ts +2 -0
- package/dist/types/components/primitives/popover-compact/popover-compact.d.ts +12 -0
- package/dist/types/components/table/table.const.d.ts +1 -1
- package/dist/types/components/table-filter/filters/index.d.ts +0 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/table-filter/filters/checkbox.js +0 -70
- package/dist/css/config/colors/backgrounds.css +0 -32
- package/dist/css/config/colors/components/avatar.css +0 -53
- package/dist/css/config/colors/components/badge.css +0 -137
- package/dist/css/config/colors/components/checkbox.css +0 -7
- package/dist/css/config/colors/components/featured-icon.css +0 -80
- package/dist/css/config/colors/components/progress-bar.css +0 -7
- package/dist/css/config/colors/components/radio-button.css +0 -7
- package/dist/css/config/colors/components/scroll-overlay.css +0 -17
- package/dist/css/config/colors/components/tab.css +0 -59
- package/dist/css/config/colors/components/toggle-switch.css +0 -3
- package/dist/css/config/colors/components/toggle.css +0 -25
- package/dist/css/config/colors/icons.css +0 -81
- package/dist/css/config/colors/overlay.css +0 -3
- package/dist/css/config/colors/shape.css +0 -163
- package/dist/css/config/colors/stroke.css +0 -79
- package/dist/css/config/colors/surfaces.css +0 -199
- package/dist/css/config/colors/text.css +0 -160
- package/dist/css/config/config-deprecated.css +0 -39
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "@radix-ui/react-tabs";
|
|
3
|
+
import { cn as r } from "../../lib/utils.js";
|
|
4
|
+
function m({ className: a, ...t }) {
|
|
5
5
|
return /* @__PURE__ */ e(
|
|
6
|
-
|
|
6
|
+
s.Root,
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "tabs",
|
|
9
|
-
className:
|
|
9
|
+
className: r(a),
|
|
10
10
|
orientation: "horizontal",
|
|
11
11
|
...t
|
|
12
12
|
}
|
|
@@ -14,67 +14,97 @@ function o({ className: a, ...t }) {
|
|
|
14
14
|
}
|
|
15
15
|
function c({ className: a, ...t }) {
|
|
16
16
|
return /* @__PURE__ */ e(
|
|
17
|
-
|
|
17
|
+
s.List,
|
|
18
18
|
{
|
|
19
19
|
"data-slot": "tabs-list",
|
|
20
|
-
className:
|
|
20
|
+
className: r(
|
|
21
21
|
"inline-flex items-center bg-transparent relative",
|
|
22
22
|
"w-full h-11",
|
|
23
23
|
"max-lg:w-full max-lg:max-w-[full] max-lg:overflow-x-auto max-lg:overflow-y-hidden",
|
|
24
24
|
"max-sm:w-full max-sm:px-2",
|
|
25
|
-
// 'after:absolute after:bottom-0 after:left-0 after:w-full after:h-0.5 after:bg-neutral-150',
|
|
26
25
|
a
|
|
27
26
|
),
|
|
28
27
|
...t
|
|
29
28
|
}
|
|
30
29
|
);
|
|
31
30
|
}
|
|
32
|
-
function
|
|
31
|
+
function f({
|
|
33
32
|
className: a,
|
|
34
33
|
icon: t,
|
|
35
|
-
label:
|
|
36
|
-
...
|
|
34
|
+
label: n,
|
|
35
|
+
...i
|
|
37
36
|
}) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
37
|
+
return /* @__PURE__ */ o(
|
|
38
|
+
s.Trigger,
|
|
40
39
|
{
|
|
41
40
|
"data-slot": "tabs-trigger",
|
|
42
|
-
className:
|
|
41
|
+
className: r(
|
|
42
|
+
// Base positioning and layout
|
|
43
43
|
"flex h-11 p-2.5 justify-center items-center gap-1 relative cursor-pointer",
|
|
44
44
|
"max-lg:min-w-fit max-lg:flex-shrink-0",
|
|
45
45
|
"max-sm:px-1.5 max-sm:py-2 max-sm:gap-0.5",
|
|
46
46
|
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
47
47
|
"group",
|
|
48
|
+
// Underline pseudo-element using Tailwind's after: utilities
|
|
49
|
+
'after:content-[""] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2',
|
|
50
|
+
"after:w-[calc(100%-24px)] after:border-b after:border-stroke-solid-attention",
|
|
51
|
+
"after:opacity-0 after:transition-opacity after:duration-200 after:ease-linear after:z-10",
|
|
52
|
+
// Active state - show underline
|
|
53
|
+
"data-[state=active]:after:opacity-100",
|
|
48
54
|
a
|
|
49
55
|
),
|
|
50
|
-
...
|
|
56
|
+
...i,
|
|
51
57
|
children: [
|
|
52
|
-
t && /* @__PURE__ */ e(
|
|
53
|
-
|
|
58
|
+
t && /* @__PURE__ */ e(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: r(
|
|
62
|
+
"w-[14px] h-[14px] flex-shrink-0 flex items-center justify-center transition-colors duration-200",
|
|
63
|
+
// Icon colors based on state
|
|
64
|
+
"text-text-neutral-secondary",
|
|
65
|
+
// Default inactive color
|
|
66
|
+
"group-data-[state=active]:text-text-neutral-primary",
|
|
67
|
+
// Active color
|
|
68
|
+
"group-hover:text-text-neutral-primary",
|
|
69
|
+
// Hover color
|
|
70
|
+
// Force icon size
|
|
71
|
+
"[&>*]:!w-[14px] [&>*]:!h-[14px]"
|
|
72
|
+
),
|
|
73
|
+
children: t
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
n && /* @__PURE__ */ e("div", { className: "flex px-0.5 justify-center items-center gap-1.5 max-sm:px-0.25 max-sm:gap-1", children: /* @__PURE__ */ e(
|
|
54
77
|
"div",
|
|
55
78
|
{
|
|
56
|
-
className:
|
|
57
|
-
"text-center font-[450] transition-colors duration-200
|
|
79
|
+
className: r(
|
|
80
|
+
"text-center font-[450] transition-colors duration-200",
|
|
58
81
|
"text-sm leading-none tracking-[-0.2px]",
|
|
59
82
|
"max-lg:text-[13px]",
|
|
60
|
-
"max-sm:text-xs"
|
|
83
|
+
"max-sm:text-xs",
|
|
84
|
+
// Label colors based on state
|
|
85
|
+
"text-text-neutral-secondary",
|
|
86
|
+
// Default inactive color
|
|
87
|
+
"group-data-[state=active]:text-text-neutral-primary",
|
|
88
|
+
// Active color
|
|
89
|
+
"group-hover:text-text-neutral-primary"
|
|
90
|
+
// Hover color
|
|
61
91
|
),
|
|
62
|
-
children:
|
|
92
|
+
children: n
|
|
63
93
|
}
|
|
64
94
|
) })
|
|
65
95
|
]
|
|
66
96
|
}
|
|
67
97
|
);
|
|
68
98
|
}
|
|
69
|
-
function
|
|
99
|
+
function p({
|
|
70
100
|
className: a,
|
|
71
101
|
...t
|
|
72
102
|
}) {
|
|
73
|
-
return /* @__PURE__ */ e(
|
|
103
|
+
return /* @__PURE__ */ e(s.Content, { "data-slot": "tabs-content", className: r(a), ...t });
|
|
74
104
|
}
|
|
75
105
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
106
|
+
m as Z2Tabs,
|
|
107
|
+
p as Z2TabsContent,
|
|
78
108
|
c as Z2TabsList,
|
|
79
|
-
|
|
109
|
+
f as Z2TabsTrigger
|
|
80
110
|
};
|
|
@@ -17,6 +17,7 @@ import "../../../collapsible-side-nav-bar/popover/popover.js";
|
|
|
17
17
|
import "react-country-flag";
|
|
18
18
|
import "classnames";
|
|
19
19
|
import "@radix-ui/react-checkbox";
|
|
20
|
+
import "../../../checkbox-filter/index.js";
|
|
20
21
|
import "@radix-ui/react-dialog";
|
|
21
22
|
import "../../../dropdown/z2-dropdown.js";
|
|
22
23
|
import "@radix-ui/react-dropdown-menu";
|
|
@@ -25,6 +26,7 @@ import "../../../input/input.js";
|
|
|
25
26
|
import "../../../nav-header/nav-header.js";
|
|
26
27
|
import "../../../nav-header/nav-item/nav-item.js";
|
|
27
28
|
import "@radix-ui/react-select";
|
|
29
|
+
import "@radix-ui/react-popover";
|
|
28
30
|
import "../../../stepper/stepper.js";
|
|
29
31
|
import "../../../stepper-item/stepper-item.js";
|
|
30
32
|
import "@radix-ui/react-tabs";
|
|
@@ -41,7 +43,6 @@ import "../../../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledg
|
|
|
41
43
|
import "@radix-ui/react-slot";
|
|
42
44
|
import "../../../radio/z2-radio.js";
|
|
43
45
|
import "../../../segmented-control/item.js";
|
|
44
|
-
import "@radix-ui/react-popover";
|
|
45
46
|
import "../../../primitives/popconfirm/popconfirm.js";
|
|
46
47
|
import "../../../dynamic-table/z2-table.js";
|
|
47
48
|
import "../../../dynamic-table/z2-table-context.js";
|
|
@@ -55,7 +56,7 @@ import "../../../z2map/components/map-pin-content.js";
|
|
|
55
56
|
import "../../../z2map/components/map-controls.js";
|
|
56
57
|
import "../../../z2map/components/map-zoom-control.js";
|
|
57
58
|
import "../../../z2map/components/map-style-control.js";
|
|
58
|
-
const
|
|
59
|
+
const ut = ({
|
|
59
60
|
avatar: m,
|
|
60
61
|
value: a,
|
|
61
62
|
rightIcon: o,
|
|
@@ -66,7 +67,7 @@ const ft = ({
|
|
|
66
67
|
"div",
|
|
67
68
|
{
|
|
68
69
|
className: r(
|
|
69
|
-
"flex flex-col gap-2.5 items-center
|
|
70
|
+
"flex flex-col gap-2.5 items-center h-full min-w-full leading-none-medium-sm p-3",
|
|
70
71
|
s
|
|
71
72
|
),
|
|
72
73
|
children: [
|
|
@@ -93,5 +94,5 @@ const ft = ({
|
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
96
|
export {
|
|
96
|
-
|
|
97
|
+
ut as AvatarCell
|
|
97
98
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as l } from "../../../../lib/utils.js";
|
|
3
|
-
const
|
|
3
|
+
const o = ({ value: e, className: t }) => /* @__PURE__ */ r(
|
|
4
4
|
"div",
|
|
5
5
|
{
|
|
6
6
|
className: l(
|
|
7
|
-
"text-text-neutral-secondary p-3 w-full h-full items-center flex
|
|
7
|
+
"text-text-neutral-secondary p-3 w-full h-full items-center flex",
|
|
8
8
|
"leading-[24px] text-[14px]",
|
|
9
9
|
t
|
|
10
10
|
),
|
|
@@ -12,5 +12,5 @@ const i = ({ value: e, className: t }) => /* @__PURE__ */ r(
|
|
|
12
12
|
}
|
|
13
13
|
);
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
o as DescriptionCell
|
|
16
16
|
};
|
|
@@ -2,19 +2,19 @@ import { jsxs as e, jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as a } from "../../../../lib/utils.js";
|
|
4
4
|
const u = ({
|
|
5
|
-
value:
|
|
5
|
+
value: r,
|
|
6
6
|
leftIcon: n,
|
|
7
|
-
rightIcon:
|
|
7
|
+
rightIcon: m,
|
|
8
8
|
className: c,
|
|
9
|
-
helperText:
|
|
9
|
+
helperText: t,
|
|
10
10
|
description: s
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const i = "min-h-max min-w-max";
|
|
13
13
|
return /* @__PURE__ */ e(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
className: a(
|
|
17
|
-
"flex flex-row gap-2.5 items-center
|
|
17
|
+
"flex flex-row gap-2.5 items-center h-full min-w-full leading-none-medium-sm p-3",
|
|
18
18
|
s && "flex-col",
|
|
19
19
|
c
|
|
20
20
|
),
|
|
@@ -27,12 +27,12 @@ const u = ({
|
|
|
27
27
|
),
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
30
|
-
n && /* @__PURE__ */ l("span", { className: a(
|
|
31
|
-
|
|
30
|
+
n && /* @__PURE__ */ l("span", { className: a(i), children: n }),
|
|
31
|
+
r
|
|
32
32
|
] }),
|
|
33
33
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2.5", children: [
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
t && /* @__PURE__ */ l("span", { className: "text-text-neutral-secondary", children: t }),
|
|
35
|
+
m && /* @__PURE__ */ l("span", { className: a(i), children: m })
|
|
36
36
|
] })
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as e } from "../../../../lib/utils.js";
|
|
4
|
-
const
|
|
5
|
-
value:
|
|
6
|
-
href:
|
|
4
|
+
const d = ({
|
|
5
|
+
value: a,
|
|
6
|
+
href: i,
|
|
7
7
|
target: t = "_self",
|
|
8
8
|
leftIcon: n,
|
|
9
|
-
rightIcon:
|
|
10
|
-
className:
|
|
11
|
-
LinkComponent:
|
|
9
|
+
rightIcon: s,
|
|
10
|
+
className: c,
|
|
11
|
+
LinkComponent: o = "a"
|
|
12
12
|
}) => {
|
|
13
13
|
const l = "min-h-max min-w-max";
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
o,
|
|
16
16
|
{
|
|
17
|
-
href:
|
|
17
|
+
href: i,
|
|
18
18
|
target: t,
|
|
19
19
|
rel: "noopener noreferrer",
|
|
20
20
|
className: e(
|
|
21
|
-
"text-text-brand-secondary p-3 leading-none-medium-sm flex flex-row justify-between
|
|
22
|
-
|
|
21
|
+
"text-text-brand-secondary p-3 leading-none-medium-sm flex flex-row justify-between gap-2.5 min-w-full min-h-full items-center",
|
|
22
|
+
c
|
|
23
23
|
),
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
n && /* @__PURE__ */
|
|
27
|
-
|
|
25
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
26
|
+
n && /* @__PURE__ */ m("span", { className: e(l), children: n }),
|
|
27
|
+
a
|
|
28
28
|
] }),
|
|
29
|
-
|
|
29
|
+
s && /* @__PURE__ */ m("span", { className: e(l), children: s })
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
d as LinkCell
|
|
36
36
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
value:
|
|
6
|
-
leftIcon:
|
|
3
|
+
import { cn as s } from "../../../../lib/utils.js";
|
|
4
|
+
const x = ({
|
|
5
|
+
value: t,
|
|
6
|
+
leftIcon: a,
|
|
7
7
|
rightIcon: n,
|
|
8
|
-
className:
|
|
8
|
+
className: r,
|
|
9
9
|
helperText: i
|
|
10
10
|
}) => {
|
|
11
11
|
const m = "min-h-max min-w-max";
|
|
12
12
|
return /* @__PURE__ */ e(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
|
-
className:
|
|
16
|
-
"flex gap-2.5 items-center
|
|
17
|
-
|
|
15
|
+
className: s(
|
|
16
|
+
"flex gap-2.5 items-center h-full min-w-full leading-none-medium-sm p-3",
|
|
17
|
+
r
|
|
18
18
|
),
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ l(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
22
|
+
className: s(
|
|
23
23
|
"text-text-neutral-primary flex justify-between gap-2.5 min-w-full items-center"
|
|
24
24
|
),
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2.5 h-full", children: [
|
|
27
|
+
a && /* @__PURE__ */ e("span", { className: s(m), children: a }),
|
|
28
28
|
i && /* @__PURE__ */ e("span", { className: "text-text-neutral-secondary", children: i })
|
|
29
29
|
] }),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
n && /* @__PURE__ */ e("span", { className:
|
|
30
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2.5", children: [
|
|
31
|
+
t,
|
|
32
|
+
n && /* @__PURE__ */ e("span", { className: s(m), children: n })
|
|
33
33
|
] })
|
|
34
34
|
]
|
|
35
35
|
}
|
|
@@ -38,5 +38,5 @@ const u = ({
|
|
|
38
38
|
);
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
x as NumberCell
|
|
42
42
|
};
|
|
@@ -24,6 +24,7 @@ import "../collapsible-side-nav-bar/popover/popover.js";
|
|
|
24
24
|
import "react-country-flag";
|
|
25
25
|
import "classnames";
|
|
26
26
|
import "@radix-ui/react-checkbox";
|
|
27
|
+
import "../checkbox-filter/index.js";
|
|
27
28
|
import "@radix-ui/react-dialog";
|
|
28
29
|
import "../dropdown/z2-dropdown.js";
|
|
29
30
|
import "@radix-ui/react-dropdown-menu";
|
|
@@ -32,6 +33,7 @@ import "../input/input.js";
|
|
|
32
33
|
import "../nav-header/nav-header.js";
|
|
33
34
|
import "../nav-header/nav-item/nav-item.js";
|
|
34
35
|
import "@radix-ui/react-select";
|
|
36
|
+
import "@radix-ui/react-popover";
|
|
35
37
|
import "../stepper/stepper.js";
|
|
36
38
|
import "../stepper-item/stepper-item.js";
|
|
37
39
|
import "@radix-ui/react-tabs";
|
|
@@ -46,7 +48,6 @@ import "../../node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dis
|
|
|
46
48
|
import "@radix-ui/react-slot";
|
|
47
49
|
import "../radio/z2-radio.js";
|
|
48
50
|
import "../segmented-control/item.js";
|
|
49
|
-
import "@radix-ui/react-popover";
|
|
50
51
|
import "../primitives/popconfirm/popconfirm.js";
|
|
51
52
|
import "../dynamic-table/z2-table.js";
|
|
52
53
|
import "../dynamic-table/z2-table-context.js";
|
|
@@ -24,7 +24,7 @@ export declare const TABLE_CSS_CLASSES: {
|
|
|
24
24
|
readonly headerCellContent: "flex items-center justify-between";
|
|
25
25
|
readonly sortIcon: "ml-2 w-4 h-4 text-gray-400";
|
|
26
26
|
readonly sortIconActive: "ml-2 w-4 h-4 text-gray-600";
|
|
27
|
-
readonly row: " transition-colors duration-200 text-text-neutral-primary";
|
|
27
|
+
readonly row: " transition-colors duration-200 text-text-neutral-primary hover:bg-background-neutral-light";
|
|
28
28
|
readonly emptyState: "px-4 py-8 text-center text-gray-500";
|
|
29
29
|
readonly dataErrorState: "px-4 py-8 text-center text-text-danger-primary";
|
|
30
30
|
readonly loading: "px-4 py-8 text-center text-gray-500";
|
|
@@ -23,7 +23,7 @@ const t = "No data available", e = {
|
|
|
23
23
|
headerCellContent: "flex items-center justify-between",
|
|
24
24
|
sortIcon: "ml-2 w-4 h-4 text-gray-400",
|
|
25
25
|
sortIconActive: "ml-2 w-4 h-4 text-gray-600",
|
|
26
|
-
row: " transition-colors duration-200 text-text-neutral-primary",
|
|
26
|
+
row: " transition-colors duration-200 text-text-neutral-primary hover:bg-background-neutral-light",
|
|
27
27
|
emptyState: "px-4 py-8 text-center text-gray-500",
|
|
28
28
|
dataErrorState: "px-4 py-8 text-center text-text-danger-primary",
|
|
29
29
|
loading: "px-4 py-8 text-center text-gray-500"
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as b from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as p from "@radix-ui/react-popover";
|
|
4
4
|
import { Button as y } from "../button/button.js";
|
|
5
5
|
import { useTableFilterContext as q } from "./table-filter.context.js";
|
|
6
6
|
import E from "./filters/text.js";
|
|
7
7
|
import G from "./filters/boolean.js";
|
|
8
8
|
import J from "./filters/number/number.js";
|
|
9
|
-
import M from "
|
|
9
|
+
import { CheckboxFilter as M } from "../checkbox-filter/index.js";
|
|
10
10
|
import Q from "../assets/icons/circle-check-filled.js";
|
|
11
11
|
import { SelectedFiltersDisplay as W } from "./selected-filters-display/selected-filters-display.js";
|
|
12
12
|
import { FilterConfirmationDialog as X } from "./close-filter-confirm/filter-confirmation-dialog.js";
|
|
13
13
|
import { hasUnsavedFilterChanges as S } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { NumberBadge as Y } from "../number-badge/number-badge.js";
|
|
15
|
+
const de = () => {
|
|
16
|
+
var w, A;
|
|
17
|
+
const [K, c] = b.useState(!1), n = b.useRef(null), [C, d] = b.useState(!1), {
|
|
18
|
+
selectedColumn: o,
|
|
18
19
|
setSelectedColumn: O,
|
|
19
20
|
getFilterForColumn: P,
|
|
20
21
|
hasFilterForColumn: T,
|
|
21
22
|
updateColumnFilter: D,
|
|
22
23
|
clearAllFilters: R,
|
|
23
|
-
resetToAppliedFilters:
|
|
24
|
-
applyFilters:
|
|
25
|
-
hasActiveFilters:
|
|
24
|
+
resetToAppliedFilters: B,
|
|
25
|
+
applyFilters: $,
|
|
26
|
+
hasActiveFilters: f,
|
|
26
27
|
tempFilters: u,
|
|
27
|
-
filterSchema:
|
|
28
|
-
filter:
|
|
28
|
+
filterSchema: m,
|
|
29
|
+
filter: h,
|
|
29
30
|
filterComponents: x = {}
|
|
30
|
-
} = q(),
|
|
31
|
-
!e && C ? S(u,
|
|
31
|
+
} = q(), z = (e) => {
|
|
32
|
+
!e && C ? S(u, h.value) ? c(!0) : d(!1) : d(e);
|
|
32
33
|
}, N = () => {
|
|
33
|
-
|
|
34
|
+
$(), c(!1), d(!1);
|
|
34
35
|
}, L = () => {
|
|
35
|
-
|
|
36
|
+
B(), c(!1), d(!1);
|
|
36
37
|
}, I = () => {
|
|
37
|
-
|
|
38
|
-
}, F = S(u,
|
|
39
|
-
if (!
|
|
40
|
-
const e =
|
|
38
|
+
c(!1);
|
|
39
|
+
}, F = S(u, h.value), r = P(o || ""), V = () => {
|
|
40
|
+
if (!o) return null;
|
|
41
|
+
const e = m.find((a) => a.filterKey === o), s = {
|
|
41
42
|
boolean: G,
|
|
42
43
|
string: E,
|
|
43
44
|
number: J,
|
|
@@ -48,66 +49,66 @@ const ie = () => {
|
|
|
48
49
|
`No filter component found for column "${e == null ? void 0 : e.filterKey}" with type "${e == null ? void 0 : e.type}". Provide a custom filter component or use supported types: "string", "number", "boolean", "checkbox".`
|
|
49
50
|
), null;
|
|
50
51
|
const U = {
|
|
51
|
-
condition: (
|
|
52
|
-
value: (
|
|
52
|
+
condition: (r == null ? void 0 : r.condition) || "",
|
|
53
|
+
value: (r == null ? void 0 : r.value) || ""
|
|
53
54
|
};
|
|
54
55
|
return /* @__PURE__ */ t("div", { className: "flex-1 h-full", children: /* @__PURE__ */ t("div", { className: "mb-4 h-full", children: /* @__PURE__ */ t(
|
|
55
56
|
j,
|
|
56
57
|
{
|
|
57
58
|
value: U,
|
|
58
|
-
onChange: ({ condition:
|
|
59
|
-
filterOptions: e != null && e.options ? Object.entries(e.options).map(([
|
|
60
|
-
label:
|
|
61
|
-
value:
|
|
59
|
+
onChange: ({ condition: a, value: v }) => D(o, a, v),
|
|
60
|
+
filterOptions: e != null && e.options ? Object.entries(e.options).map(([a, v]) => ({
|
|
61
|
+
label: a,
|
|
62
|
+
value: a,
|
|
62
63
|
total: v
|
|
63
64
|
})) : void 0
|
|
64
65
|
},
|
|
65
|
-
|
|
66
|
+
o
|
|
66
67
|
) }) });
|
|
67
|
-
}, H =
|
|
68
|
-
|
|
69
|
-
const g =
|
|
68
|
+
}, H = h.loading || !1;
|
|
69
|
+
r && (Array.isArray(r.value) && r.value.length > 0 || (r == null ? void 0 : r.value) !== "") && (n.current = r);
|
|
70
|
+
const g = m.find(
|
|
70
71
|
(e) => {
|
|
71
72
|
var s;
|
|
72
73
|
return e.filterKey == ((s = n.current) == null ? void 0 : s.field);
|
|
73
74
|
}
|
|
74
|
-
),
|
|
75
|
+
), k = Array.isArray((w = n.current) == null ? void 0 : w.value) ? (A = n.current) == null ? void 0 : A.value.map(
|
|
75
76
|
(e) => {
|
|
76
77
|
var s;
|
|
77
78
|
return ((s = g == null ? void 0 : g.options) == null ? void 0 : s[e]) || 1;
|
|
78
79
|
}
|
|
79
|
-
) : [],
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */ t(
|
|
80
|
+
) : [], i = k.reduce((e, s) => e + s, 0);
|
|
81
|
+
return /* @__PURE__ */ l(p.Root, { open: C, onOpenChange: z, children: [
|
|
82
|
+
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ l(
|
|
82
83
|
y,
|
|
83
84
|
{
|
|
84
|
-
variant:
|
|
85
|
-
shade:
|
|
85
|
+
variant: f ? "colored-stroke" : "stroke",
|
|
86
|
+
shade: f ? "brand" : "neutral",
|
|
86
87
|
size: "small",
|
|
87
88
|
children: [
|
|
88
89
|
"Filters ",
|
|
89
|
-
|
|
90
|
+
f && /* @__PURE__ */ t(Y, { number: i, textColor: "brand" })
|
|
90
91
|
]
|
|
91
92
|
}
|
|
92
93
|
) }),
|
|
93
|
-
/* @__PURE__ */ t(
|
|
94
|
-
|
|
94
|
+
/* @__PURE__ */ t(p.Portal, { children: /* @__PURE__ */ l(
|
|
95
|
+
p.Content,
|
|
95
96
|
{
|
|
96
97
|
className: "w-[512px] bg-surface-neutral-default border border-stroke-solid-light rounded-2xl overflow-hidden shadow-lg",
|
|
97
98
|
sideOffset: 8,
|
|
98
99
|
align: "start",
|
|
99
100
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ l("div", { className: "flex h-[422px]", style: { maxHeight: "calc(100vh - 8rem)" }, children: [
|
|
102
|
+
/* @__PURE__ */ l("div", { className: "w-48 border-r border-stroke-solid-light p-2 flex flex-col gap-1.5 overflow-y-auto", children: [
|
|
102
103
|
/* @__PURE__ */ t("div", { className: "p-2 pb-1", children: /* @__PURE__ */ t("h3", { className: "leading-none-medium-sm text-text-neutral-secondary", children: "Filters" }) }),
|
|
103
|
-
|
|
104
|
+
m.map((e) => /* @__PURE__ */ l(
|
|
104
105
|
"button",
|
|
105
106
|
{
|
|
106
107
|
onClick: () => O(e.filterKey),
|
|
107
|
-
className: `w-full text-left p-2 text-sm flex items-center justify-between hover:bg-surface-neutral-hover transition-colors rounded-lg ${
|
|
108
|
+
className: `w-full text-left p-2 text-sm flex items-center justify-between hover:bg-surface-neutral-hover transition-colors rounded-lg ${o === e.filterKey ? "bg-surface-neutral-focused text-text-brand-primary" : "text-text-neutral-primary"}`,
|
|
108
109
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
e.helperText && /* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-1", children: [
|
|
111
|
+
e.helperText && /* @__PURE__ */ l("span", { className: "leading-normal-regular-xs text-neutral-muted", children: [
|
|
111
112
|
e.helperText,
|
|
112
113
|
": "
|
|
113
114
|
] }),
|
|
@@ -119,24 +120,24 @@ const ie = () => {
|
|
|
119
120
|
e.filterKey
|
|
120
121
|
))
|
|
121
122
|
] }),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
124
|
-
H && /* @__PURE__ */ t("div", { className: "flex items-center justify-center p-8 absolute top-0 left-0 right-0 bottom-0 bg-background-neutral-default/80", children: /* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ l("div", { className: "flex-1 flex flex-col relative", children: [
|
|
124
|
+
o ? V() : /* @__PURE__ */ t("div", { className: "flex-1 flex items-center justify-center text-text-neutral-muted", children: "Select a column to configure its filter" }),
|
|
125
|
+
H && /* @__PURE__ */ t("div", { className: "flex items-center justify-center p-8 absolute top-0 left-0 right-0 bottom-0 bg-background-neutral-default/80", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-3", children: [
|
|
125
126
|
/* @__PURE__ */ t("div", { className: "w-8 h-8 border-2 border-stroke-solid-medium border-t-transparent rounded-full animate-spin" }),
|
|
126
127
|
/* @__PURE__ */ t("span", { className: "text-text-body-primary text-sm", children: "Loading options..." })
|
|
127
128
|
] }) })
|
|
128
129
|
] })
|
|
129
130
|
] }),
|
|
130
|
-
(!!
|
|
131
|
-
|
|
131
|
+
(!!i || F) && /* @__PURE__ */ l("div", { className: "flex justify-between items-end p-4 border-t border-stroke-solid-medium min-h-[73px]", children: [
|
|
132
|
+
k.length > 0 ? /* @__PURE__ */ t(
|
|
132
133
|
W,
|
|
133
134
|
{
|
|
134
135
|
tempFilters: u,
|
|
135
|
-
filterSchema:
|
|
136
|
-
totalCount:
|
|
136
|
+
filterSchema: m,
|
|
137
|
+
totalCount: i
|
|
137
138
|
}
|
|
138
139
|
) : /* @__PURE__ */ t("div", { className: "w-full" }),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2", children: [
|
|
140
141
|
/* @__PURE__ */ t(
|
|
141
142
|
y,
|
|
142
143
|
{
|
|
@@ -158,7 +159,7 @@ const ie = () => {
|
|
|
158
159
|
size: "small",
|
|
159
160
|
className: "min-w-20",
|
|
160
161
|
disabled: !F,
|
|
161
|
-
children: `Apply ${
|
|
162
|
+
children: `Apply ${i ? i.toLocaleString() : ""}`
|
|
162
163
|
}
|
|
163
164
|
)
|
|
164
165
|
] })
|
|
@@ -177,5 +178,5 @@ const ie = () => {
|
|
|
177
178
|
] });
|
|
178
179
|
};
|
|
179
180
|
export {
|
|
180
|
-
|
|
181
|
+
de as TableFilterButton
|
|
181
182
|
};
|