@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,113 +1,113 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import w, { useMemo as K } from "react";
|
|
3
3
|
import * as d from "@radix-ui/react-popover";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as f } from "../button/button.js";
|
|
5
5
|
import { useTableFilterContext as L } from "./table-filter.context.js";
|
|
6
6
|
import _ from "./filters/text.js";
|
|
7
7
|
import M from "./filters/boolean.js";
|
|
8
8
|
import U from "./filters/number/number.js";
|
|
9
|
-
import q from "
|
|
10
|
-
import E from "
|
|
11
|
-
import {
|
|
12
|
-
import { FilterConfirmationDialog as H } from "./close-filter-confirm/filter-confirmation-dialog.js";
|
|
9
|
+
import { CheckboxFilter as q } from "../checkbox-filter/index.js";
|
|
10
|
+
import { getFilterCount as E } from "./selected-filters-display/selected-filters-display.utils.js";
|
|
11
|
+
import { FilterConfirmationDialog as G } from "./close-filter-confirm/filter-confirmation-dialog.js";
|
|
13
12
|
import { hasUnsavedFilterChangesForColumn as A } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { NumberBadge as H } from "../number-badge/number-badge.js";
|
|
14
|
+
const le = ({ filterName: n }) => {
|
|
15
|
+
const [T, a] = w.useState(!1), [C, s] = w.useState(!1), {
|
|
16
|
+
getFilterForColumn: g,
|
|
17
17
|
hasAppliedFilterForColumn: O,
|
|
18
|
-
updateColumnFilter:
|
|
18
|
+
updateColumnFilter: b,
|
|
19
19
|
applyFilters: c,
|
|
20
20
|
resetToAppliedFilters: P,
|
|
21
21
|
filterSchema: j,
|
|
22
22
|
filterComponents: m = {},
|
|
23
23
|
tempFilters: v,
|
|
24
24
|
filter: p
|
|
25
|
-
} = L(), N = (
|
|
26
|
-
!
|
|
25
|
+
} = L(), N = (t) => {
|
|
26
|
+
!t && C ? A(n, v, p.value) ? a(!0) : s(!1) : s(t);
|
|
27
27
|
}, $ = () => {
|
|
28
28
|
c(), a(!1), s(!1);
|
|
29
|
-
},
|
|
29
|
+
}, B = () => {
|
|
30
30
|
P(), a(!1), s(!1);
|
|
31
|
-
},
|
|
31
|
+
}, D = () => {
|
|
32
32
|
a(!1);
|
|
33
|
-
}, x = A(n, v, p.value),
|
|
34
|
-
() =>
|
|
35
|
-
[n,
|
|
33
|
+
}, x = A(n, v, p.value), o = j.find((t) => t.filterKey === n), r = K(
|
|
34
|
+
() => g(n),
|
|
35
|
+
[n, g]
|
|
36
36
|
);
|
|
37
|
-
if (!
|
|
37
|
+
if (!o)
|
|
38
38
|
return console.warn(`Column "${n}" not found in schema`), null;
|
|
39
|
-
const
|
|
39
|
+
const R = {
|
|
40
40
|
boolean: M,
|
|
41
41
|
string: _,
|
|
42
42
|
number: U,
|
|
43
43
|
checkbox: q
|
|
44
|
-
},
|
|
45
|
-
label:
|
|
46
|
-
value:
|
|
44
|
+
}, F = o.type && (m == null ? void 0 : m[o.type]) || R[o.type ?? "string"], u = O(n), y = p.loading || !1, k = o.options ? Object.entries(o.options).map(([t, i]) => ({
|
|
45
|
+
label: t,
|
|
46
|
+
value: t,
|
|
47
47
|
total: i
|
|
48
|
-
})) : void 0,
|
|
49
|
-
const
|
|
50
|
-
c(
|
|
48
|
+
})) : void 0, h = r ? E(r, k) : void 0, S = r != null && r.value ? Array.isArray(r.value) ? r.value.length : 1 : 0, z = () => {
|
|
49
|
+
const t = b(n, "", "");
|
|
50
|
+
c(t), s(!1);
|
|
51
51
|
}, I = () => {
|
|
52
52
|
c(), s(!1);
|
|
53
53
|
};
|
|
54
|
-
return
|
|
54
|
+
return F ? /* @__PURE__ */ l(d.Root, { open: C, onOpenChange: N, children: [
|
|
55
55
|
/* @__PURE__ */ e(d.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
56
|
-
|
|
56
|
+
f,
|
|
57
57
|
{
|
|
58
|
-
variant:
|
|
59
|
-
shade:
|
|
58
|
+
variant: u ? "colored-stroke" : "stroke",
|
|
59
|
+
shade: u ? "brand" : "neutral",
|
|
60
60
|
size: "small",
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
children: /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
|
|
62
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-1", children: [
|
|
63
|
+
o.helperText && /* @__PURE__ */ l("span", { className: "leading-normal-regular-xs text-neutral-muted", children: [
|
|
64
|
+
o.helperText,
|
|
65
65
|
": "
|
|
66
66
|
] }),
|
|
67
|
-
|
|
67
|
+
o.title
|
|
68
68
|
] }),
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
u && /* @__PURE__ */ e(H, { number: h || 0, textColor: "brand" }),
|
|
70
|
+
y && /* @__PURE__ */ e("div", { className: "w-4 h-4 border-2 border-text-brand-secondary rounded-full animate-spin flex-shrink-0" })
|
|
71
71
|
] })
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
74
|
-
/* @__PURE__ */ e(d.Portal, { children: /* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ e(d.Portal, { children: /* @__PURE__ */ l(
|
|
75
75
|
d.Content,
|
|
76
76
|
{
|
|
77
77
|
className: "w-80 bg-surface-neutral-default border border-stroke-solid-light rounded-2xl overflow-hidden shadow-lg",
|
|
78
78
|
sideOffset: 8,
|
|
79
79
|
align: "start",
|
|
80
80
|
children: [
|
|
81
|
-
|
|
81
|
+
y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-3", children: [
|
|
82
82
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
|
|
83
83
|
/* @__PURE__ */ e("span", { className: "text-text-neutral-muted text-sm", children: "Loading options..." })
|
|
84
84
|
] }) }) : /* @__PURE__ */ e(
|
|
85
|
-
|
|
85
|
+
F,
|
|
86
86
|
{
|
|
87
|
-
value:
|
|
88
|
-
onChange: ({ condition:
|
|
89
|
-
filterOptions:
|
|
87
|
+
value: r,
|
|
88
|
+
onChange: ({ condition: t, value: i }) => b(n, t, i),
|
|
89
|
+
filterOptions: k
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
(x || !!
|
|
93
|
-
/* @__PURE__ */ e(
|
|
94
|
-
x && /* @__PURE__ */ e(
|
|
92
|
+
(x || !!S) && /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
|
|
93
|
+
/* @__PURE__ */ e(f, { onClick: z, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
|
|
94
|
+
x && /* @__PURE__ */ e(f, { onClick: I, variant: "filled", shade: "neutral", size: "small", children: `Apply${h !== void 0 ? ` ${h}` : ""}` })
|
|
95
95
|
] })
|
|
96
96
|
]
|
|
97
97
|
}
|
|
98
98
|
) }),
|
|
99
99
|
T && /* @__PURE__ */ e(
|
|
100
|
-
|
|
100
|
+
G,
|
|
101
101
|
{
|
|
102
|
-
onClose:
|
|
103
|
-
onRevertChanges:
|
|
102
|
+
onClose: D,
|
|
103
|
+
onRevertChanges: B,
|
|
104
104
|
onApplyChanges: $
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
] }) : (console.warn(
|
|
108
|
-
`No filter component found for column "${
|
|
108
|
+
`No filter component found for column "${o.filterKey}" with type "${o.type}". Provide a custom filter component or use supported types: "string", "number", "boolean", "checkbox".`
|
|
109
109
|
), null);
|
|
110
110
|
};
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
le as TableFilterColumnButton
|
|
113
113
|
};
|
|
@@ -127,11 +127,11 @@
|
|
|
127
127
|
--alpha-two-900: rgba(255, 255, 255, 0.9);
|
|
128
128
|
|
|
129
129
|
--shadow-custom:
|
|
130
|
-
0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px
|
|
130
|
+
0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 1px var(--color-neutral-150);
|
|
131
131
|
--shadow-default:
|
|
132
|
-
0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px
|
|
132
|
+
0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px 1px var(--color-neutral-150);
|
|
133
133
|
|
|
134
|
-
--shadow-button-disabled: 0px 0px 0px
|
|
134
|
+
--shadow-button-disabled: 0px 0px 0px 1px var(--neutral-100), 0px 1px 2px 0px transparent;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
.dark {
|
|
@@ -259,11 +259,11 @@
|
|
|
259
259
|
--alpha-two-900: rgba(0, 0, 0, 0.9);
|
|
260
260
|
|
|
261
261
|
--shadow-custom:
|
|
262
|
-
0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px
|
|
262
|
+
0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 1px var(--color-neutral-150);
|
|
263
263
|
--shadow-default:
|
|
264
|
-
0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px
|
|
264
|
+
0px 1px 2px 0px var(--color-alpha-one-50), 0px 0px 0px 1px var(--color-neutral-150);
|
|
265
265
|
|
|
266
|
-
--shadow-button-disabled: 0px 0px 0px
|
|
266
|
+
--shadow-button-disabled: 0px 0px 0px 1px var(--neutral-100), 0px 1px 2px 0px transparent;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
/* Tailwind v4 Theme Integration */
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
font-family: inherit;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
/*@import './config-deprecated.css';*/
|
|
25
25
|
/* @import './colors/defaults.css'; */
|
|
26
|
+
|
|
26
27
|
@import './colors/semantic/index.css';
|
|
27
28
|
@import './typography/index.css';
|
|
28
29
|
@import './shadows.css';
|