@ztwoint/z-ui 0.1.27 → 0.1.29
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/assets/icons/chevron-left.d.ts +7 -0
- package/dist/components/assets/icons/chevron-left.js +20 -0
- package/dist/components/assets/icons/chevron-right.js +30 -0
- package/dist/components/assets/icons/double-chevron-left.d.ts +7 -0
- package/dist/components/assets/icons/double-chevron-left.js +24 -0
- package/dist/components/assets/icons/double-chevron-right.d.ts +7 -0
- package/dist/components/assets/icons/double-chevron-right.js +24 -0
- package/dist/components/assets/icons/info-icon.js +16 -0
- package/dist/components/assets/icons/magnifier-icon.js +16 -0
- package/dist/components/assets/icons/sub-nav-indicator.d.ts +3 -2
- package/dist/components/assets/icons/sub-nav-indicator.js +26 -41
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +45 -30
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-content.js +16 -16
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-footer.js +1 -1
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-group.js +24 -16
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +60 -54
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-item.js +61 -62
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-provider.js +23 -23
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.d.ts +1 -1
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.js +14 -14
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dropdown-menu/z2-dropdown-menu.js +255 -0
- package/dist/components/nav-header/nav-header.js +7 -7
- package/dist/components/table/components/cell/boolean-cell.d.ts +7 -0
- package/dist/components/table/components/cell/boolean-cell.js +7 -0
- package/dist/components/table/components/cell/index.d.ts +3 -0
- package/dist/components/table/components/cell/number-cell.d.ts +7 -0
- package/dist/components/table/components/cell/number-cell.js +5 -0
- package/dist/components/table/components/cell/text-cell.d.ts +7 -0
- package/dist/components/table/components/cell/text-cell.js +5 -0
- package/dist/components/table/components/index.d.ts +11 -0
- package/dist/components/table/components/pagination/components/index.d.ts +3 -0
- package/dist/components/table/components/pagination/components/pagination-info.d.ts +4 -0
- package/dist/components/table/components/pagination/components/pagination-info.js +27 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.d.ts +4 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts +6 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.js +24 -0
- package/dist/components/table/components/pagination/components/pagination-quick-jumper.js +35 -0
- package/dist/components/table/components/pagination/index.d.ts +6 -0
- package/dist/components/table/components/pagination/pagination.const.d.ts +26 -0
- package/dist/components/table/components/pagination/pagination.const.js +22 -0
- package/dist/components/table/components/pagination/pagination.d.ts +4 -0
- package/dist/components/table/components/pagination/pagination.hook.d.ts +5 -0
- package/dist/components/table/components/pagination/pagination.hook.js +22 -0
- package/dist/components/table/components/pagination/pagination.js +112 -0
- package/dist/components/table/components/pagination/pagination.type.d.ts +33 -0
- package/dist/components/table/components/pagination/pagination.utils.d.ts +7 -0
- package/dist/components/table/components/pagination/pagination.utils.js +35 -0
- package/dist/components/table/components/table-cell.d.ts +15 -0
- package/dist/components/table/components/table-cell.js +45 -0
- package/dist/components/table/components/table-empty-state.d.ts +7 -0
- package/dist/components/table/components/table-empty-state.js +6 -0
- package/dist/components/table/components/table-filter/filters/boolean.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/boolean.js +31 -0
- package/dist/components/table/components/table-filter/filters/index.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/number.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/number.js +28 -0
- package/dist/components/table/components/table-filter/filters/text.d.ts +3 -0
- package/dist/components/table/components/table-filter/filters/text.js +28 -0
- package/dist/components/table/components/table-filter/index.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.d.ts +9 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +15 -0
- package/dist/components/table/components/table-filter/table-filter.hook.js +34 -0
- package/dist/components/table/components/table-filter/table-filter.js +105 -0
- package/dist/components/table/components/table-filter/table-filter.type.d.ts +18 -0
- package/dist/components/table/components/table-footer-content.d.ts +7 -0
- package/dist/components/table/components/table-footer-content.js +9 -0
- package/dist/components/table/components/table-footer.d.ts +7 -0
- package/dist/components/table/components/table-footer.js +6 -0
- package/dist/components/table/components/table-header/index.d.ts +2 -0
- package/dist/components/table/components/table-header/table-header.d.ts +9 -0
- package/dist/components/table/components/table-header/table-header.js +27 -0
- package/dist/components/table/components/table-header/table-header.utils.d.ts +5 -0
- package/dist/components/table/components/table-header/table-header.utils.js +15 -0
- package/dist/components/table/components/table-header/table-sort-icon.d.ts +8 -0
- package/dist/components/table/components/table-header/table-sort-icon.js +13 -0
- package/dist/components/table/components/table-header-content.d.ts +7 -0
- package/dist/components/table/components/table-header-content.js +9 -0
- package/dist/components/table/components/table-header-wrapper.d.ts +7 -0
- package/dist/components/table/components/table-header-wrapper.js +9 -0
- package/dist/components/table/components/table-loading-state.d.ts +7 -0
- package/dist/components/table/components/table-loading-state.js +9 -0
- package/dist/components/table/components/table-row.d.ts +11 -0
- package/dist/components/table/components/table-row.js +23 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/table-provider.d.ts +26 -0
- package/dist/components/table/table-provider.js +45 -0
- package/dist/components/table/table.const.d.ts +24 -0
- package/dist/components/table/table.const.js +27 -0
- package/dist/components/table/table.context.d.ts +7 -0
- package/dist/components/table/table.context.js +11 -0
- package/dist/components/table/table.d.ts +4 -0
- package/dist/components/table/table.js +39 -0
- package/dist/components/table/table.type.d.ts +63 -0
- package/dist/components/table/table.utils.d.ts +3 -0
- package/dist/components/table/table.utils.js +5 -0
- package/dist/css/config/colors/components/select.css +1 -1
- package/dist/css/config/colors/defaults.css +378 -137
- package/dist/css/config/colors/semantic-colors.css +356 -0
- package/dist/css/config/components/button.css +152 -0
- package/dist/css/config/components/index.css +1 -0
- package/dist/css/config/config-deprecated.css +41 -0
- package/dist/css/config/config.css +4 -18
- package/dist/css/config/typography/2xl.css +7 -0
- package/dist/css/config/typography/3xl.css +7 -0
- package/dist/css/config/typography/4xl.css +7 -0
- package/dist/css/config/typography/base.css +7 -0
- package/dist/css/config/typography/lg.css +7 -0
- package/dist/css/config/typography/sm.css +7 -0
- package/dist/css/config/typography/xl.css +7 -0
- package/dist/css/config/typography/xs.css +7 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/devComponents/navigation/index.d.ts +1 -0
- package/dist/devComponents/navigation/navigation.d.ts +1 -0
- package/dist/index.d.ts +41 -8
- package/dist/index.js +176 -102
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/theme.hook.d.ts +8 -0
- package/dist/lib/theme.hook.js +50 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +26 -0
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +26 -0
- package/dist/routes/default.d.ts +2 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/table.d.ts +2 -0
- package/dist/sample/text-cell.d.ts +3 -0
- package/dist/types/components/assets/icons/chevron-left.d.ts +7 -0
- package/dist/types/components/assets/icons/double-chevron-left.d.ts +7 -0
- package/dist/types/components/assets/icons/double-chevron-right.d.ts +7 -0
- package/dist/types/components/assets/icons/sub-nav-indicator.d.ts +3 -2
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar.d.ts +1 -1
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +3 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/text-cell.d.ts +7 -0
- package/dist/types/components/table/components/index.d.ts +11 -0
- package/dist/types/components/table/components/pagination/components/index.d.ts +3 -0
- package/dist/types/components/table/components/pagination/components/pagination-info.d.ts +4 -0
- package/dist/types/components/table/components/pagination/components/pagination-quick-jumper.d.ts +4 -0
- package/dist/types/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts +6 -0
- package/dist/types/components/table/components/pagination/index.d.ts +6 -0
- package/dist/types/components/table/components/pagination/pagination.const.d.ts +26 -0
- package/dist/types/components/table/components/pagination/pagination.d.ts +4 -0
- package/dist/types/components/table/components/pagination/pagination.hook.d.ts +5 -0
- package/dist/types/components/table/components/pagination/pagination.type.d.ts +33 -0
- package/dist/types/components/table/components/pagination/pagination.utils.d.ts +7 -0
- package/dist/types/components/table/components/table-cell.d.ts +15 -0
- package/dist/types/components/table/components/table-empty-state.d.ts +7 -0
- package/dist/types/components/table/components/table-filter/filters/boolean.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/index.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/number.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/filters/text.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/index.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/table-filter.d.ts +9 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +15 -0
- package/dist/types/components/table/components/table-filter/table-filter.type.d.ts +18 -0
- package/dist/types/components/table/components/table-footer-content.d.ts +7 -0
- package/dist/types/components/table/components/table-footer.d.ts +7 -0
- package/dist/types/components/table/components/table-header/index.d.ts +2 -0
- package/dist/types/components/table/components/table-header/table-header.d.ts +10 -0
- package/dist/types/components/table/components/table-header/table-header.utils.d.ts +5 -0
- package/dist/types/components/table/components/table-header/table-sort-icon.d.ts +8 -0
- package/dist/types/components/table/components/table-header-content.d.ts +7 -0
- package/dist/types/components/table/components/table-header-wrapper.d.ts +7 -0
- package/dist/types/components/table/components/table-loading-state.d.ts +7 -0
- package/dist/types/components/table/components/table-row.d.ts +11 -0
- package/dist/types/components/table/index.d.ts +9 -0
- package/dist/types/components/table/table-provider.d.ts +26 -0
- package/dist/types/components/table/table.const.d.ts +24 -0
- package/dist/types/components/table/table.context.d.ts +7 -0
- package/dist/types/components/table/table.d.ts +4 -0
- package/dist/types/components/table/table.type.d.ts +63 -0
- package/dist/types/components/table/table.utils.d.ts +3 -0
- package/dist/types/devComponents/navigation/index.d.ts +1 -0
- package/dist/types/devComponents/navigation/navigation.d.ts +1 -0
- package/dist/types/index.d.ts +41 -8
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/theme.hook.d.ts +8 -0
- package/dist/types/routes/default.d.ts +2 -0
- package/dist/types/routes/index.d.ts +2 -0
- package/dist/types/routes/table.d.ts +2 -0
- package/dist/types/sample/text-cell.d.ts +3 -0
- package/package.json +3 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
import { CheckIcon as i, CircleIcon as u, ChevronRightIcon as l } from "lucide-react";
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
function b({ ...e }) {
|
|
6
|
+
return /* @__PURE__ */ t(o.Root, { "data-slot": "dropdown-menu", ...e });
|
|
7
|
+
}
|
|
8
|
+
function m({
|
|
9
|
+
...e
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ t(o.Portal, { "data-slot": "dropdown-menu-portal", ...e });
|
|
12
|
+
}
|
|
13
|
+
function f({
|
|
14
|
+
...e
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ t(o.Trigger, { "data-slot": "dropdown-menu-trigger", ...e });
|
|
17
|
+
}
|
|
18
|
+
function x({
|
|
19
|
+
className: e,
|
|
20
|
+
sideOffset: a = 8,
|
|
21
|
+
...r
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
|
|
24
|
+
o.Content,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "dropdown-menu-content",
|
|
27
|
+
sideOffset: a,
|
|
28
|
+
className: n(
|
|
29
|
+
"bg-white dark:bg-gray-950 text-gray-900 dark:text-gray-100 border border-gray-200 dark:border-gray-800",
|
|
30
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
31
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
32
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
33
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
34
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
35
|
+
"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[12rem]",
|
|
36
|
+
"origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",
|
|
37
|
+
"rounded-xl p-2 shadow-2xl shadow-black/10 dark:shadow-black/30",
|
|
38
|
+
"backdrop-blur-xl bg-white/95 dark:bg-gray-950/95",
|
|
39
|
+
e
|
|
40
|
+
),
|
|
41
|
+
...r
|
|
42
|
+
}
|
|
43
|
+
) });
|
|
44
|
+
}
|
|
45
|
+
function w({ ...e }) {
|
|
46
|
+
return /* @__PURE__ */ t(o.Group, { "data-slot": "dropdown-menu-group", ...e });
|
|
47
|
+
}
|
|
48
|
+
function k({
|
|
49
|
+
className: e,
|
|
50
|
+
inset: a,
|
|
51
|
+
variant: r = "default",
|
|
52
|
+
...d
|
|
53
|
+
}) {
|
|
54
|
+
return /* @__PURE__ */ t(
|
|
55
|
+
o.Item,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "dropdown-menu-item",
|
|
58
|
+
"data-inset": a,
|
|
59
|
+
"data-variant": r,
|
|
60
|
+
className: n(
|
|
61
|
+
"relative flex cursor-default items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
62
|
+
"outline-none select-none transition-all duration-150",
|
|
63
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
64
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
65
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
66
|
+
"data-[variant=destructive]:text-red-600 dark:data-[variant=destructive]:text-red-400",
|
|
67
|
+
"data-[variant=destructive]:hover:bg-red-50 dark:data-[variant=destructive]:hover:bg-red-950/20",
|
|
68
|
+
"data-[variant=destructive]:focus:bg-red-50 dark:data-[variant=destructive]:focus:bg-red-950/30",
|
|
69
|
+
"data-[inset]:pl-10",
|
|
70
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
71
|
+
"[&_svg:not([class*='text-'])]:text-gray-500 dark:[&_svg:not([class*='text-'])]:text-gray-400",
|
|
72
|
+
e
|
|
73
|
+
),
|
|
74
|
+
...d
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function h({
|
|
79
|
+
className: e,
|
|
80
|
+
children: a,
|
|
81
|
+
checked: r,
|
|
82
|
+
...d
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ s(
|
|
85
|
+
o.CheckboxItem,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
88
|
+
className: n(
|
|
89
|
+
"relative flex cursor-default items-center gap-3 rounded-lg py-2.5 pr-3 pl-10 text-sm font-medium",
|
|
90
|
+
"outline-none select-none transition-all duration-150",
|
|
91
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
92
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
93
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
94
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
95
|
+
e
|
|
96
|
+
),
|
|
97
|
+
checked: r,
|
|
98
|
+
...d,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-3 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, { className: "size-3.5 text-blue-600 dark:text-blue-400" }) }) }),
|
|
101
|
+
a
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function v({
|
|
107
|
+
...e
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ t(o.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...e });
|
|
110
|
+
}
|
|
111
|
+
function y({
|
|
112
|
+
className: e,
|
|
113
|
+
children: a,
|
|
114
|
+
...r
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ s(
|
|
117
|
+
o.RadioItem,
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
120
|
+
className: n(
|
|
121
|
+
"relative flex cursor-default items-center gap-3 rounded-lg py-2.5 pr-3 pl-10 text-sm font-medium",
|
|
122
|
+
"outline-none select-none transition-all duration-150",
|
|
123
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
124
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
125
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
126
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
127
|
+
e
|
|
128
|
+
),
|
|
129
|
+
...r,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-3 flex size-4 items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(u, { className: "size-2 fill-blue-600 dark:fill-blue-400 text-blue-600 dark:text-blue-400" }) }) }),
|
|
132
|
+
a
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function D({
|
|
138
|
+
className: e,
|
|
139
|
+
inset: a,
|
|
140
|
+
...r
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ t(
|
|
143
|
+
o.Label,
|
|
144
|
+
{
|
|
145
|
+
"data-slot": "dropdown-menu-label",
|
|
146
|
+
"data-inset": a,
|
|
147
|
+
className: n(
|
|
148
|
+
"px-3 py-2 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400",
|
|
149
|
+
"data-[inset]:pl-10",
|
|
150
|
+
e
|
|
151
|
+
),
|
|
152
|
+
...r
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function M({
|
|
157
|
+
className: e,
|
|
158
|
+
...a
|
|
159
|
+
}) {
|
|
160
|
+
return /* @__PURE__ */ t(
|
|
161
|
+
o.Separator,
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "dropdown-menu-separator",
|
|
164
|
+
className: n("bg-gray-200 dark:bg-gray-800 my-2 h-px", e),
|
|
165
|
+
...a
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function z({ className: e, ...a }) {
|
|
170
|
+
return /* @__PURE__ */ t(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
174
|
+
className: n(
|
|
175
|
+
"ml-auto text-xs font-mono text-gray-400 dark:text-gray-500 tracking-wider",
|
|
176
|
+
"bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded",
|
|
177
|
+
e
|
|
178
|
+
),
|
|
179
|
+
...a
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function I({ ...e }) {
|
|
184
|
+
return /* @__PURE__ */ t(o.Sub, { "data-slot": "dropdown-menu-sub", ...e });
|
|
185
|
+
}
|
|
186
|
+
function Z({
|
|
187
|
+
className: e,
|
|
188
|
+
inset: a,
|
|
189
|
+
children: r,
|
|
190
|
+
...d
|
|
191
|
+
}) {
|
|
192
|
+
return /* @__PURE__ */ s(
|
|
193
|
+
o.SubTrigger,
|
|
194
|
+
{
|
|
195
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
196
|
+
"data-inset": a,
|
|
197
|
+
className: n(
|
|
198
|
+
"flex cursor-default items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium",
|
|
199
|
+
"outline-none select-none transition-all duration-150",
|
|
200
|
+
"hover:bg-gray-50 dark:hover:bg-gray-900/50",
|
|
201
|
+
"focus:bg-blue-50 dark:focus:bg-blue-950/30 focus:text-blue-700 dark:focus:text-blue-300",
|
|
202
|
+
"data-[state=open]:bg-blue-50 dark:data-[state=open]:bg-blue-950/30",
|
|
203
|
+
"data-[state=open]:text-blue-700 dark:data-[state=open]:text-blue-300",
|
|
204
|
+
"data-[inset]:pl-10",
|
|
205
|
+
e
|
|
206
|
+
),
|
|
207
|
+
...d,
|
|
208
|
+
children: [
|
|
209
|
+
r,
|
|
210
|
+
/* @__PURE__ */ t(l, { className: "ml-auto size-4 text-gray-400 dark:text-gray-500" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
function N({
|
|
216
|
+
className: e,
|
|
217
|
+
...a
|
|
218
|
+
}) {
|
|
219
|
+
return /* @__PURE__ */ t(
|
|
220
|
+
o.SubContent,
|
|
221
|
+
{
|
|
222
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
223
|
+
className: n(
|
|
224
|
+
"bg-white dark:bg-gray-950 text-gray-900 dark:text-gray-100 border border-gray-200 dark:border-gray-800",
|
|
225
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
226
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
227
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
228
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
229
|
+
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
230
|
+
"z-50 min-w-[10rem] origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
231
|
+
"overflow-hidden rounded-xl p-2 shadow-2xl shadow-black/10 dark:shadow-black/30",
|
|
232
|
+
"backdrop-blur-xl bg-white/95 dark:bg-gray-950/95",
|
|
233
|
+
e
|
|
234
|
+
),
|
|
235
|
+
...a
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
export {
|
|
240
|
+
b as Z2DropdownMenu,
|
|
241
|
+
h as Z2DropdownMenuCheckboxItem,
|
|
242
|
+
x as Z2DropdownMenuContent,
|
|
243
|
+
w as Z2DropdownMenuGroup,
|
|
244
|
+
k as Z2DropdownMenuItem,
|
|
245
|
+
D as Z2DropdownMenuLabel,
|
|
246
|
+
m as Z2DropdownMenuPortal,
|
|
247
|
+
v as Z2DropdownMenuRadioGroup,
|
|
248
|
+
y as Z2DropdownMenuRadioItem,
|
|
249
|
+
M as Z2DropdownMenuSeparator,
|
|
250
|
+
z as Z2DropdownMenuShortcut,
|
|
251
|
+
I as Z2DropdownMenuSub,
|
|
252
|
+
N as Z2DropdownMenuSubContent,
|
|
253
|
+
Z as Z2DropdownMenuSubTrigger,
|
|
254
|
+
f as Z2DropdownMenuTrigger
|
|
255
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as d } from "react";
|
|
3
3
|
import n from "../assets/icons/z2-icon.js";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
import { NavItem as c } from "./nav-item/nav-item.js";
|
|
6
|
-
const N = d({}), i = ({ className: a, children: r, ...
|
|
6
|
+
const N = d({}), i = ({ className: a, children: r, ...s }) => /* @__PURE__ */ e(N.Provider, { value: {}, children: /* @__PURE__ */ l(
|
|
7
7
|
"header",
|
|
8
8
|
{
|
|
9
|
-
className:
|
|
10
|
-
"flex items-center h-
|
|
9
|
+
className: t(
|
|
10
|
+
"flex items-center h-12 p-3",
|
|
11
11
|
"gap-6",
|
|
12
12
|
// space between icon/separator/list
|
|
13
13
|
"bg-[#001534]",
|
|
14
14
|
a
|
|
15
15
|
),
|
|
16
|
-
...
|
|
16
|
+
...s,
|
|
17
17
|
children: [
|
|
18
18
|
/* @__PURE__ */ e("div", { className: "flex items-center flex-shrink-0", children: /* @__PURE__ */ e(n, { className: "shrink-0" }) }),
|
|
19
19
|
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-white/20", "aria-hidden": "true" }),
|
|
@@ -22,12 +22,12 @@ const N = d({}), i = ({ className: a, children: r, ...t }) => /* @__PURE__ */ e(
|
|
|
22
22
|
}
|
|
23
23
|
) });
|
|
24
24
|
i.displayName = "NavHeader.Root";
|
|
25
|
-
const m = ({ className: a, children: r, ...
|
|
25
|
+
const m = ({ className: a, children: r, ...s }) => /* @__PURE__ */ e("nav", { className: t("flex flex-row gap-2 ml-0", a), ...s, children: r });
|
|
26
26
|
m.displayName = "NavHeader.List";
|
|
27
27
|
const o = ({
|
|
28
28
|
className: a,
|
|
29
29
|
...r
|
|
30
|
-
}) => /* @__PURE__ */ e("div", { className:
|
|
30
|
+
}) => /* @__PURE__ */ e("div", { className: "list-none", children: /* @__PURE__ */ e(c, { ...r, className: t(a) }) });
|
|
31
31
|
o.displayName = "NavHeader.Item";
|
|
32
32
|
const H = {
|
|
33
33
|
Root: i,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../../node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js";
|
|
3
|
+
import t from "../../../../node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js";
|
|
4
|
+
const l = ({ value: r }) => r == null ? null : r ? /* @__PURE__ */ e(o, { className: "text-green-500 w-4 h-4" }) : /* @__PURE__ */ e(t, { className: "text-red-500 w-4 h-4" });
|
|
5
|
+
export {
|
|
6
|
+
l as BooleanCell
|
|
7
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { TableCell } from './table-cell';
|
|
2
|
+
export { TableHeader, TableSortIcon } from './table-header';
|
|
3
|
+
export { TableRow } from './table-row';
|
|
4
|
+
export { TableEmptyState } from './table-empty-state';
|
|
5
|
+
export { TableLoadingState } from './table-loading-state';
|
|
6
|
+
export { Pagination as TablePagination } from './pagination';
|
|
7
|
+
export { TableHeaderWrapper } from './table-header-wrapper';
|
|
8
|
+
export { TableHeaderContent } from './table-header-content';
|
|
9
|
+
export { TableFooter } from './table-footer';
|
|
10
|
+
export { TableFooterContent } from './table-footer-content';
|
|
11
|
+
export * from './cell';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { calculateItemRange as s } from "../pagination.utils.js";
|
|
3
|
+
import { PAGINATION_LABELS as r, PAGINATION_CSS_CLASSES as c } from "../pagination.const.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
showTotal: o,
|
|
6
|
+
totalItems: n,
|
|
7
|
+
currentPage: i,
|
|
8
|
+
itemsPerPage: a
|
|
9
|
+
}) => {
|
|
10
|
+
if (!o || !n) return null;
|
|
11
|
+
const { start: e, end: f } = s(i, a, n);
|
|
12
|
+
return /* @__PURE__ */ t("div", { className: c.info, children: [
|
|
13
|
+
r.showing,
|
|
14
|
+
" ",
|
|
15
|
+
e,
|
|
16
|
+
"-",
|
|
17
|
+
f,
|
|
18
|
+
" ",
|
|
19
|
+
r.of,
|
|
20
|
+
" ",
|
|
21
|
+
n
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
l as PaginationInfo,
|
|
26
|
+
l as default
|
|
27
|
+
};
|
package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const usePaginationQuickJumper: (currentPage: number, totalPage: number, onPageChange: (page: number) => void) => {
|
|
2
|
+
inputValue: string;
|
|
3
|
+
handleInputChange: (value: string) => void;
|
|
4
|
+
handleInputSubmit: () => void;
|
|
5
|
+
handleKeyPress: (event: React.KeyboardEvent) => void;
|
|
6
|
+
};
|
package/dist/components/table/components/pagination/components/pagination-quick-jumper.hook.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState as m, useCallback as s } from "react";
|
|
2
|
+
import { isValidPageNumber as c } from "../pagination.utils.js";
|
|
3
|
+
const l = (i, u, r) => {
|
|
4
|
+
const [e, o] = m(""), p = s((t) => {
|
|
5
|
+
(t === "" || /^\d+$/.test(t)) && o(t);
|
|
6
|
+
}, []), n = s(() => {
|
|
7
|
+
const t = parseInt(e, 10);
|
|
8
|
+
c(t, u) && t !== i && r(t), o("");
|
|
9
|
+
}, [e, u, i, r]), a = s(
|
|
10
|
+
(t) => {
|
|
11
|
+
t.key === "Enter" && n();
|
|
12
|
+
},
|
|
13
|
+
[n]
|
|
14
|
+
);
|
|
15
|
+
return {
|
|
16
|
+
inputValue: e,
|
|
17
|
+
handleInputChange: p,
|
|
18
|
+
handleInputSubmit: n,
|
|
19
|
+
handleKeyPress: a
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
l as usePaginationQuickJumper
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as a, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { PAGINATION_CSS_CLASSES as n, PAGINATION_LABELS as t } from "../pagination.const.js";
|
|
3
|
+
import { usePaginationQuickJumper as c } from "./pagination-quick-jumper.hook.js";
|
|
4
|
+
const P = ({
|
|
5
|
+
disabled: o,
|
|
6
|
+
currentPage: e,
|
|
7
|
+
totalPage: r,
|
|
8
|
+
onChange: i
|
|
9
|
+
}) => {
|
|
10
|
+
const { inputValue: u, handleInputChange: l, handleInputSubmit: s, handleKeyPress: p } = c(e, r, i);
|
|
11
|
+
return /* @__PURE__ */ a("div", { className: n.jumper, children: [
|
|
12
|
+
/* @__PURE__ */ a("span", { children: [
|
|
13
|
+
t.goToPage,
|
|
14
|
+
":"
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ g(
|
|
17
|
+
"input",
|
|
18
|
+
{
|
|
19
|
+
type: "text",
|
|
20
|
+
className: n.input,
|
|
21
|
+
value: u,
|
|
22
|
+
onChange: (m) => l(m.target.value),
|
|
23
|
+
onKeyPress: p,
|
|
24
|
+
onBlur: s,
|
|
25
|
+
disabled: o,
|
|
26
|
+
placeholder: e.toString(),
|
|
27
|
+
"aria-label": t.goToPage
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
P as PaginationQuickJumper,
|
|
34
|
+
P as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Pagination, default } from './pagination';
|
|
2
|
+
export type { PaginationProps, PaginationInfoProps, PaginationQuickJumperProps, } from './pagination.type';
|
|
3
|
+
export { usePagination } from './pagination.hook';
|
|
4
|
+
export { usePaginationQuickJumper } from './components/pagination-quick-jumper.hook';
|
|
5
|
+
export { calculateVisiblePages, calculateItemRange, isValidPageNumber } from './pagination.utils';
|
|
6
|
+
export { PAGINATION_DEFAULTS, PAGINATION_CSS_CLASSES, PAGINATION_LABELS } from './pagination.const';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const PAGINATION_DEFAULTS: {
|
|
2
|
+
readonly MAX_VISIBLE_PAGES: 6;
|
|
3
|
+
readonly ITEMS_PER_PAGE: 10;
|
|
4
|
+
};
|
|
5
|
+
export declare const PAGINATION_CSS_CLASSES: {
|
|
6
|
+
readonly container: "flex items-center justify-between gap-4 p-4";
|
|
7
|
+
readonly navigation: "flex items-center gap-2";
|
|
8
|
+
readonly button: "flex items-center justify-center w-8 h-8 text-sm rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors";
|
|
9
|
+
readonly buttonActive: "bg-blue-600 text-white border-blue-600 hover:bg-blue-700";
|
|
10
|
+
readonly buttonIcon: "flex items-center justify-center w-8 h-8 text-sm rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors";
|
|
11
|
+
readonly ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400";
|
|
12
|
+
readonly info: "text-sm text-text-neutral-secondary";
|
|
13
|
+
readonly jumper: "flex items-center gap-2 text-sm text-text-neutral-primary";
|
|
14
|
+
readonly input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
|
|
15
|
+
};
|
|
16
|
+
export declare const PAGINATION_LABELS: {
|
|
17
|
+
readonly previous: "Previous page";
|
|
18
|
+
readonly next: "Next page";
|
|
19
|
+
readonly first: "First page";
|
|
20
|
+
readonly last: "Last page";
|
|
21
|
+
readonly goToPage: "Go to page";
|
|
22
|
+
readonly page: "Page";
|
|
23
|
+
readonly of: "out of";
|
|
24
|
+
readonly showing: "Viewing";
|
|
25
|
+
readonly to: "to";
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
MAX_VISIBLE_PAGES: 6
|
|
3
|
+
}, t = {
|
|
4
|
+
ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400",
|
|
5
|
+
info: "text-sm text-text-neutral-secondary",
|
|
6
|
+
jumper: "flex items-center gap-2 text-sm text-text-neutral-primary",
|
|
7
|
+
input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
8
|
+
}, r = {
|
|
9
|
+
previous: "Previous page",
|
|
10
|
+
next: "Next page",
|
|
11
|
+
first: "First page",
|
|
12
|
+
last: "Last page",
|
|
13
|
+
goToPage: "Go to page",
|
|
14
|
+
page: "Page",
|
|
15
|
+
of: "out of",
|
|
16
|
+
showing: "Viewing"
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
t as PAGINATION_CSS_CLASSES,
|
|
20
|
+
e as PAGINATION_DEFAULTS,
|
|
21
|
+
r as PAGINATION_LABELS
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMemo as i, useCallback as o } from "react";
|
|
2
|
+
import { calculateVisiblePages as l, isValidPageNumber as P } from "./pagination.utils.js";
|
|
3
|
+
const u = (a) => {
|
|
4
|
+
const n = i(
|
|
5
|
+
() => l(a),
|
|
6
|
+
[a.currentPage, a.totalPage, a.maxVisiblePages]
|
|
7
|
+
), e = o(
|
|
8
|
+
(t) => P(t, a.totalPage),
|
|
9
|
+
[a.totalPage]
|
|
10
|
+
), g = o(
|
|
11
|
+
(t) => e(t),
|
|
12
|
+
[e]
|
|
13
|
+
);
|
|
14
|
+
return {
|
|
15
|
+
...n,
|
|
16
|
+
goToPage: g,
|
|
17
|
+
canGoToPage: e
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
u as usePagination
|
|
22
|
+
};
|