@ztwoint/z-ui 0.1.46 → 0.1.49
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/alert/alert.const.d.ts +0 -3
- package/dist/components/alert/alert.const.js +16 -31
- package/dist/components/alert/alert.js +32 -44
- package/dist/components/assets/icons/check.d.ts +8 -0
- package/dist/components/assets/icons/check.js +17 -0
- package/dist/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/components/assets/icons/x-mark.js +17 -0
- package/dist/components/button/button.d.ts +3 -3
- package/dist/components/button/button.js +58 -58
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +17 -17
- package/dist/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/components/nav-header/nav-item/nav-item.js +29 -28
- package/dist/components/select/z2-select.js +131 -78
- package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/components/table/components/cell/avatar-cell.js +74 -0
- package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/components/table/components/cell/boolean-cell.js +5 -5
- package/dist/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/components/table/components/cell/description-cell.js +16 -0
- package/dist/components/table/components/cell/index.d.ts +10 -1
- package/dist/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/components/table/components/cell/label-cell.js +47 -0
- package/dist/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/components/table/components/cell/link-cell.js +35 -0
- package/dist/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/components/table/components/cell/number-cell.js +40 -3
- package/dist/components/table/components/index.d.ts +1 -1
- package/dist/components/table/components/table-cell.d.ts +1 -1
- package/dist/components/table/components/table-cell.js +41 -32
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.js +33 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.js +20 -0
- package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +16 -16
- package/dist/components/table/components/table-filter/table-filter-button.js +88 -57
- package/dist/components/table/components/table-filter/table-filter-column-button.js +81 -51
- package/dist/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.js +17 -14
- package/dist/components/table/components/table-footer.js +6 -6
- package/dist/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/components/table/components/table-header/table-header.js +27 -33
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table-provider.js +37 -8
- package/dist/components/table/table.const.d.ts +15 -9
- package/dist/components/table/table.const.js +15 -9
- package/dist/components/table/table.js +39 -34
- package/dist/components/table/table.type.d.ts +36 -5
- package/dist/components/table/table.utils.d.ts +1 -1
- package/dist/components/table/table.utils.js +5 -3
- package/dist/components/table-card/table-card.js +116 -89
- package/dist/components/tooltip/tooltip.js +24 -22
- package/dist/css/config/colors/backgrounds.css +8 -8
- package/dist/css/config/colors/components/avatar.css +12 -12
- package/dist/css/config/colors/components/badge.css +42 -42
- package/dist/css/config/colors/components/checkbox.css +2 -2
- package/dist/css/config/colors/components/featured-icon.css +18 -18
- package/dist/css/config/colors/components/progress-bar.css +2 -2
- package/dist/css/config/colors/components/radio-button.css +2 -2
- package/dist/css/config/colors/components/scroll-overlay.css +4 -4
- package/dist/css/config/colors/components/tab.css +7 -7
- package/dist/css/config/colors/components/toggle-switch.css +1 -1
- package/dist/css/config/colors/components/toggle.css +6 -6
- package/dist/css/config/colors/icons.css +20 -20
- package/dist/css/config/colors/overlay.css +1 -1
- package/dist/css/config/colors/semantic/alert.css +44 -0
- package/dist/css/config/colors/semantic/background.css +51 -0
- package/dist/css/config/colors/semantic/base.css +395 -0
- package/dist/css/config/colors/semantic/button.css +131 -0
- package/dist/css/config/colors/semantic/drop-shadow.css +30 -0
- package/dist/css/config/colors/semantic/dropdown.css +12 -0
- package/dist/css/config/colors/semantic/index.css +16 -0
- package/dist/css/config/colors/semantic/input.css +56 -0
- package/dist/css/config/colors/semantic/overlay.css +13 -0
- package/dist/css/config/colors/semantic/stroke.css +90 -0
- package/dist/css/config/colors/semantic/surface.css +135 -0
- package/dist/css/config/colors/semantic/text.css +113 -0
- package/dist/css/config/colors/semantic/tooltip.css +12 -0
- package/dist/css/config/colors/shape.css +40 -40
- package/dist/css/config/colors/stroke.css +19 -19
- package/dist/css/config/colors/surfaces.css +47 -47
- package/dist/css/config/colors/text.css +37 -37
- package/dist/css/config/components/index.css +0 -2
- package/dist/css/config/config-deprecated.css +3 -5
- package/dist/css/config/config.css +5 -3
- package/dist/css/config/other-variables.css +9 -0
- package/dist/css/config/shadows.css +15 -0
- package/dist/css/config/typography/2xl.css +7 -14
- package/dist/css/config/typography/3xl.css +7 -14
- package/dist/css/config/typography/4xl.css +7 -14
- package/dist/css/config/typography/base.css +7 -14
- package/dist/css/config/typography/lg.css +7 -14
- package/dist/css/config/typography/sm.css +7 -14
- package/dist/css/config/typography/xl.css +7 -14
- package/dist/css/config/typography/xs.css +7 -14
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.js +62 -64
- package/dist/types/components/alert/alert.const.d.ts +0 -3
- package/dist/types/components/assets/icons/check.d.ts +8 -0
- package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/types/components/button/button.d.ts +3 -3
- package/dist/types/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +10 -1
- package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/types/components/table/components/index.d.ts +1 -1
- package/dist/types/components/table/components/table-cell.d.ts +1 -1
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/table.const.d.ts +15 -9
- package/dist/types/components/table/table.type.d.ts +36 -5
- package/dist/types/components/table/table.utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/table/components/cell/text-cell.d.ts +0 -7
- package/dist/components/table/components/cell/text-cell.js +0 -5
- package/dist/css/config/colors/components/alert.css +0 -84
- package/dist/css/config/colors/components/button.css +0 -93
- package/dist/css/config/colors/components/select.css +0 -128
- package/dist/css/config/colors/components/text-button.css +0 -67
- package/dist/css/config/colors/defaults.css +0 -393
- package/dist/css/config/colors/semantic-colors.css +0 -353
- package/dist/css/config/components/button.css +0 -160
- package/dist/css/config/components/input.css +0 -56
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
- package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
- /package/dist/css/config/typography/{typography.css → index.css} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Alert as p, AlertDescription as n, AlertTitle as m } from "./components
|
|
|
3
3
|
import { AlertCirclesIcon as f } from "./components/alert/icons/circles-icon.js";
|
|
4
4
|
import { Button as i, buttonVariants as Z } from "./components/button/button.js";
|
|
5
5
|
import { Z2SideNavBarProvider as S } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
6
|
-
import { Z2SideNavBar as D, Z2SidebarVariants as
|
|
7
|
-
import { Z2SideNavBarHeader as
|
|
6
|
+
import { Z2SideNavBar as D, Z2SidebarVariants as b } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
|
|
7
|
+
import { Z2SideNavBarHeader as g } from "./components/collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
8
8
|
import { Z2SideNavBarContent as w } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
9
9
|
import { Z2SideNavBarFooter as s } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
10
10
|
import { Z2SideNavBarGroup as v } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
@@ -21,8 +21,8 @@ import { default as J } from "./components/assets/icons/sidebar-left-show-copy.j
|
|
|
21
21
|
import { SIDEBAR_WIDTH as Y, SIDEBAR_WIDTH_COLLAPSED as j } from "./components/collapsible-side-nav-bar/constants.js";
|
|
22
22
|
import { CountryFlags as z } from "./components/country-flags/country-flags.js";
|
|
23
23
|
import { Z2Dialog as X, Z2DialogClose as $, Z2DialogContent as oo, Z2DialogDescription as ro, Z2DialogFooter as eo, Z2DialogHeader as to, Z2DialogOverlay as ao, Z2DialogPortal as po, Z2DialogTitle as no, Z2DialogTrigger as mo } from "./components/dialog/dialog.js";
|
|
24
|
-
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as So, Z2DropdownSub as uo, Z2DropdownSubContent as Do, Z2DropdownSubItem as
|
|
25
|
-
import { Z2DropdownMenu as
|
|
24
|
+
import { DropdownContext as fo, Z2Dropdown as xo, Z2DropdownContent as io, Z2DropdownInput as Zo, Z2DropdownItem as So, Z2DropdownSub as uo, Z2DropdownSubContent as Do, Z2DropdownSubItem as bo, Z2DropdownSubTrigger as To } from "./components/dropdown/z2-dropdown.js";
|
|
25
|
+
import { Z2DropdownMenu as Co, Z2DropdownMenuCheckboxItem as wo, Z2DropdownMenuContent as co, Z2DropdownMenuGroup as so, Z2DropdownMenuItem as Io, Z2DropdownMenuLabel as vo, Z2DropdownMenuPortal as Bo, Z2DropdownMenuRadioGroup as Mo, Z2DropdownMenuRadioItem as Ao, Z2DropdownMenuSeparator as Po, Z2DropdownMenuShortcut as Lo, Z2DropdownMenuSub as No, Z2DropdownMenuSubContent as Eo, Z2DropdownMenuSubTrigger as Fo, Z2DropdownMenuTrigger as Ho } from "./components/dropdown-menu/z2-dropdown-menu.js";
|
|
26
26
|
import { FileUploadArea as yo } from "./components/file-upload-area/file-upload-area.js";
|
|
27
27
|
import { DEFAULT_ACCEPT as Go } from "./components/file-upload-area/file-upload-area.const.js";
|
|
28
28
|
import { Input as Uo } from "./components/input/input.js";
|
|
@@ -34,83 +34,81 @@ import { Z2StepperItem as pr } from "./components/stepper-item/stepper-item.js";
|
|
|
34
34
|
import { Z2Tabs as mr, Z2TabsContent as lr, Z2TabsList as fr, Z2TabsTrigger as xr } from "./components/tab/tab.js";
|
|
35
35
|
import { Table as Zr, TableProvider as dr } from "./components/table/table-provider.js";
|
|
36
36
|
import { TableBody as ur } from "./components/table/table.js";
|
|
37
|
-
import { extractCellValue as
|
|
38
|
-
import { DEFAULT_EMPTY_MESSAGE as
|
|
37
|
+
import { extractCellValue as br } from "./components/table/table.utils.js";
|
|
38
|
+
import { DEFAULT_EMPTY_MESSAGE as gr, TABLE_CSS_CLASSES as Cr } from "./components/table/table.const.js";
|
|
39
39
|
import { TableContext as cr, useTableContext as sr } from "./components/table/table.context.js";
|
|
40
40
|
import { TableCell as vr } from "./components/table/components/table-cell.js";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { BooleanCell as Nr } from "./components/table/components/cell/boolean-cell.js";
|
|
44
|
-
import { TableHeader as Fr } from "./components/table/components/table-header/table-header.js";
|
|
41
|
+
import { NumberCell as Mr } from "./components/table/components/cell/number-cell.js";
|
|
42
|
+
import { BooleanCell as Pr } from "./components/table/components/cell/boolean-cell.js";
|
|
45
43
|
import "react/jsx-runtime";
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
44
|
+
import { useTheme as Nr } from "./lib/theme.hook.js";
|
|
45
|
+
import { cn as Fr } from "./lib/utils.js";
|
|
46
|
+
import { Z2Tooltip as _r } from "./components/tooltip/tooltip.js";
|
|
47
|
+
import { default as hr } from "./components/table-card/table-card.js";
|
|
48
|
+
import { Badge as Rr, badgeVariants as Ur } from "./components/badge/badge.js";
|
|
49
|
+
import { Avatar as Wr, AvatarWithLabel as kr } from "./components/avatar/avatar.js";
|
|
50
|
+
import { InfoIcon as Jr } from "./components/assets/icons/info-icon.js";
|
|
51
|
+
import { MagnifierIcon as Yr } from "./components/assets/icons/magnifier-icon.js";
|
|
52
|
+
import { TableHeader as qr } from "./components/table/components/table-header/table-header.js";
|
|
53
|
+
import { TableRow as Kr } from "./components/table/components/table-row.js";
|
|
54
|
+
import { TableEmptyState as $r } from "./components/table/components/table-empty-state.js";
|
|
55
|
+
import { TableLoadingState as re } from "./components/table/components/table-loading-state.js";
|
|
56
|
+
import { Pagination as te } from "./components/table/components/pagination/pagination.js";
|
|
57
|
+
import { TableHeaderWrapper as pe } from "./components/table/components/table-header-wrapper.js";
|
|
58
|
+
import { TableHeaderContent as me } from "./components/table/components/table-header-content.js";
|
|
59
|
+
import { TableFooter as fe } from "./components/table/components/table-footer.js";
|
|
60
|
+
import { TableFooterContent as ie } from "./components/table/components/table-footer-content.js";
|
|
61
|
+
import { PaginationInfo as de } from "./components/table/components/pagination/components/pagination-info.js";
|
|
62
|
+
import { PaginationQuickJumper as ue } from "./components/table/components/pagination/components/pagination-quick-jumper.js";
|
|
57
63
|
import "react";
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import { Badge as me, badgeVariants as le } from "./components/badge/badge.js";
|
|
61
|
-
import { Avatar as xe, AvatarWithLabel as ie } from "./components/avatar/avatar.js";
|
|
62
|
-
import { InfoIcon as de } from "./components/assets/icons/info-icon.js";
|
|
63
|
-
import { useTheme as ue } from "./lib/theme.hook.js";
|
|
64
|
-
import { cn as Te } from "./lib/utils.js";
|
|
65
|
-
import { Z2PopoverTrigger as Ce } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
66
|
-
import { Z2PopoverContent as we } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
64
|
+
import { Z2PopoverTrigger as be } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
65
|
+
import { Z2PopoverContent as ge } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
67
66
|
export {
|
|
68
67
|
p as Alert,
|
|
69
68
|
f as AlertCirclesIcon,
|
|
70
69
|
n as AlertDescription,
|
|
71
70
|
m as AlertTitle,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
Wr as Avatar,
|
|
72
|
+
kr as AvatarWithLabel,
|
|
73
|
+
Rr as Badge,
|
|
74
|
+
Pr as BooleanCell,
|
|
76
75
|
i as Button,
|
|
77
76
|
_ as ChevronUpIcon,
|
|
78
77
|
R as CirclesIcon,
|
|
79
78
|
z as CountryFlags,
|
|
80
79
|
Go as DEFAULT_ACCEPT,
|
|
81
|
-
|
|
80
|
+
gr as DEFAULT_EMPTY_MESSAGE,
|
|
82
81
|
V as DatabaseCopy,
|
|
83
82
|
fo as DropdownContext,
|
|
84
83
|
yo as FileUploadArea,
|
|
85
|
-
|
|
84
|
+
Jr as InfoIcon,
|
|
86
85
|
Uo as Input,
|
|
87
|
-
|
|
86
|
+
Yr as MagnifierIcon,
|
|
88
87
|
Wo as NavHeader,
|
|
89
88
|
Oo as NavItem,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
Mr as NumberCell,
|
|
90
|
+
de as PaginationInfo,
|
|
91
|
+
ue as PaginationQuickJumper,
|
|
93
92
|
Y as SIDEBAR_WIDTH,
|
|
94
93
|
j as SIDEBAR_WIDTH_COLLAPSED,
|
|
95
94
|
J as SidebarLeftShowCopy,
|
|
96
95
|
h as SubNavIndicator,
|
|
97
|
-
|
|
96
|
+
Cr as TABLE_CSS_CLASSES,
|
|
98
97
|
Zr as Table,
|
|
99
98
|
ur as TableBody,
|
|
100
|
-
|
|
99
|
+
hr as TableCard,
|
|
101
100
|
vr as TableCell,
|
|
102
101
|
cr as TableContext,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
$r as TableEmptyState,
|
|
103
|
+
fe as TableFooter,
|
|
104
|
+
ie as TableFooterContent,
|
|
105
|
+
qr as TableHeader,
|
|
106
|
+
me as TableHeaderContent,
|
|
107
|
+
pe as TableHeaderWrapper,
|
|
108
|
+
re as TableLoadingState,
|
|
109
|
+
te as TablePagination,
|
|
111
110
|
dr as TableProvider,
|
|
112
|
-
|
|
113
|
-
Mr as TextCell,
|
|
111
|
+
Kr as TableRow,
|
|
114
112
|
k as WindowLeftCopy,
|
|
115
113
|
X as Z2Dialog,
|
|
116
114
|
$ as Z2DialogClose,
|
|
@@ -126,7 +124,7 @@ export {
|
|
|
126
124
|
io as Z2DropdownContent,
|
|
127
125
|
Zo as Z2DropdownInput,
|
|
128
126
|
So as Z2DropdownItem,
|
|
129
|
-
|
|
127
|
+
Co as Z2DropdownMenu,
|
|
130
128
|
wo as Z2DropdownMenuCheckboxItem,
|
|
131
129
|
co as Z2DropdownMenuContent,
|
|
132
130
|
so as Z2DropdownMenuGroup,
|
|
@@ -143,11 +141,11 @@ export {
|
|
|
143
141
|
Ho as Z2DropdownMenuTrigger,
|
|
144
142
|
uo as Z2DropdownSub,
|
|
145
143
|
Do as Z2DropdownSubContent,
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
bo as Z2DropdownSubItem,
|
|
145
|
+
To as Z2DropdownSubTrigger,
|
|
148
146
|
F as Z2Popover,
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
ge as Z2PopoverContent,
|
|
148
|
+
be as Z2PopoverTrigger,
|
|
151
149
|
Qo as Z2Select,
|
|
152
150
|
Yo as Z2SelectContent,
|
|
153
151
|
jo as Z2SelectGroup,
|
|
@@ -162,23 +160,23 @@ export {
|
|
|
162
160
|
w as Z2SideNavBarContent,
|
|
163
161
|
s as Z2SideNavBarFooter,
|
|
164
162
|
v as Z2SideNavBarGroup,
|
|
165
|
-
|
|
163
|
+
g as Z2SideNavBarHeader,
|
|
166
164
|
M as Z2SideNavBarItem,
|
|
167
165
|
S as Z2SideNavBarProvider,
|
|
168
166
|
P as Z2SideNavBarSeparator,
|
|
169
|
-
|
|
167
|
+
b as Z2SidebarVariants,
|
|
170
168
|
tr as Z2Stepper,
|
|
171
169
|
pr as Z2StepperItem,
|
|
172
170
|
mr as Z2Tabs,
|
|
173
171
|
lr as Z2TabsContent,
|
|
174
172
|
fr as Z2TabsList,
|
|
175
173
|
xr as Z2TabsTrigger,
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
_r as Z2Tooltip,
|
|
175
|
+
Ur as badgeVariants,
|
|
178
176
|
Z as buttonVariants,
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
Fr as cn,
|
|
178
|
+
br as extractCellValue,
|
|
181
179
|
sr as useTableContext,
|
|
182
|
-
|
|
180
|
+
Nr as useTheme,
|
|
183
181
|
N as useZ2SideNavBar
|
|
184
182
|
};
|
|
@@ -4,6 +4,3 @@ export declare const alertVariants: (props?: ({
|
|
|
4
4
|
export declare const iconVariants: (props?: ({
|
|
5
5
|
variant?: "success" | "warning" | "danger" | "accent" | "neutral" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
-
export declare const buttonVariants: (props?: ({
|
|
8
|
-
appearance?: "stroke" | "ghost" | null | undefined;
|
|
9
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function Check({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Check;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function XMark({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default XMark;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "stroke" | "
|
|
5
|
-
shade?: "danger" | "neutral" | "brand" |
|
|
6
|
-
size?: "small" | "large" | null | undefined;
|
|
4
|
+
variant?: "stroke" | "filled" | "ghost" | null | undefined;
|
|
5
|
+
shade?: "danger" | "neutral" | "brand" | null | undefined;
|
|
6
|
+
size?: "small" | "large" | "medium" | null | undefined;
|
|
7
7
|
iconOnly?: boolean | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
9
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'iconOnly'> {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface NavItemProps extends ButtonProps {
|
|
2
|
+
export interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
3
|
isActive?: boolean;
|
|
4
|
+
leftIcon?: React.ReactNode;
|
|
5
|
+
rightIcon?: React.ReactNode;
|
|
6
|
+
label?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { RootProps, LabelProps } from '../../../avatar/avatar';
|
|
3
|
+
import { CellValue } from '../../table.type';
|
|
4
|
+
export interface AvatarCellProps {
|
|
5
|
+
avatar: {
|
|
6
|
+
label: LabelProps['label'];
|
|
7
|
+
color: RootProps['color'];
|
|
8
|
+
};
|
|
9
|
+
value: CellValue;
|
|
10
|
+
rightIcon?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const AvatarCell: FC<AvatarCellProps>;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
export { TextCell } from './text-cell';
|
|
2
1
|
export { NumberCell } from './number-cell';
|
|
3
2
|
export { BooleanCell } from './boolean-cell';
|
|
3
|
+
export { LinkCell } from './link-cell';
|
|
4
|
+
export { DescriptionCell } from './description-cell';
|
|
5
|
+
export { AvatarCell } from './avatar-cell';
|
|
6
|
+
export { LabelCell } from './label-cell';
|
|
7
|
+
export type { NumberCellProps } from './number-cell';
|
|
8
|
+
export type { BooleanCellProps } from './boolean-cell';
|
|
9
|
+
export type { LinkCellProps } from './link-cell';
|
|
10
|
+
export type { AvatarCellProps } from './avatar-cell';
|
|
11
|
+
export type { LabelCellProps } from './label-cell';
|
|
12
|
+
export type { DescriptionCellProps } from './description-cell';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CellValue } from '../../table.type';
|
|
2
|
+
export interface LabelCellProps {
|
|
3
|
+
value: CellValue;
|
|
4
|
+
rightIcon?: React.ReactNode;
|
|
5
|
+
leftIcon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LabelCell: React.FC<LabelCellProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CellValue } from '../../table.type';
|
|
2
|
+
export interface LinkCellProps {
|
|
3
|
+
value: CellValue;
|
|
4
|
+
href: string;
|
|
5
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
6
|
+
rightIcon?: React.ReactNode;
|
|
7
|
+
leftIcon?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LinkCell: React.FC<LinkCellProps>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { CellValue } from '../../table.type';
|
|
3
|
-
interface NumberCellProps {
|
|
2
|
+
export interface NumberCellProps {
|
|
4
3
|
value: CellValue;
|
|
4
|
+
rightIcon?: React.ReactNode;
|
|
5
|
+
leftIcon?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
helperText?: string;
|
|
5
8
|
}
|
|
6
9
|
export declare const NumberCell: React.FC<NumberCellProps>;
|
|
7
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { TableCell } from './table-cell';
|
|
2
|
-
export {
|
|
2
|
+
export { NumberCell, BooleanCell, AvatarCell, DescriptionCell, LabelCell, LinkCell } from './cell';
|
|
3
3
|
export { TableHeader } from './table-header';
|
|
4
4
|
export { TableRow } from './table-row';
|
|
5
5
|
export { TableEmptyState } from './table-empty-state';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CellValue, CellType, CellRenderer, TableProps } from '../table.type';
|
|
3
3
|
interface TableCellProps {
|
|
4
|
-
value: CellValue
|
|
4
|
+
value: CellValue | Record<string, unknown>;
|
|
5
5
|
cellType: CellType;
|
|
6
6
|
cellRenderer?: CellRenderer;
|
|
7
7
|
customCells?: Record<string, CellRenderer>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface FilterConfirmationDialogProps {
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onKeepChanges: () => void;
|
|
5
|
+
onRevertChanges: () => void;
|
|
6
|
+
onApplyChanges: () => void;
|
|
7
|
+
hasUnsavedChanges: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const FilterConfirmationDialog: React.FC<FilterConfirmationDialogProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterRule } from '../../../table.type';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two filter arrays to determine if they are different
|
|
4
|
+
*/
|
|
5
|
+
export declare const areFiltersEqual: (filters1: FilterRule[], filters2: FilterRule[]) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if there are unsaved changes by comparing temporary filters with applied filters
|
|
8
|
+
*/
|
|
9
|
+
export declare const hasUnsavedFilterChanges: (tempFilters: FilterRule[], appliedFilters: FilterRule[]) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if there are unsaved changes for a specific column filter
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasUnsavedFilterChangesForColumn: (columnName: string, tempFilters: FilterRule[], appliedFilters: FilterRule[]) => boolean;
|
|
@@ -9,6 +9,7 @@ export interface TableFilterContextValue {
|
|
|
9
9
|
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
|
+
resetToAppliedFilters: () => void;
|
|
12
13
|
applyFilters: () => void;
|
|
13
14
|
hasActiveFilters: boolean;
|
|
14
15
|
filterableFields: TableSchema;
|
|
@@ -9,6 +9,7 @@ declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
|
|
|
9
9
|
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
|
+
resetToAppliedFilters: () => void;
|
|
12
13
|
applyFilters: () => void;
|
|
13
14
|
hasActiveFilters: boolean;
|
|
14
15
|
tempFilters: FilterRule[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
export declare const basicHeaderUsageCode = "import { Table, TableHeader } from '@/components/table';\n\nconst schema = [\n {\n key: 'id',\n title: 'ID',\n cellType: 'number',\n sortable: true,\n },\n {\n key: 'name',\n title: 'Name',\n cellType: '
|
|
2
|
+
export declare const basicHeaderUsageCode = "import { Table, TableHeader } from '@/components/table';\n\nconst schema = [\n {\n key: 'id',\n title: 'ID',\n cellType: 'number',\n sortable: true,\n },\n {\n key: 'name',\n title: 'Name',\n cellType: 'label',\n sortable: true,\n },\n];\n\nconst data = [\n { id: 1, name: 'John Doe' },\n { id: 2, name: 'Jane Smith' },\n];\n\nfunction MyTable() {\n return (\n <Table dataSource={data} schema={schema}>\n <table className=\"w-full\">\n <TableHeader \n schema={schema}\n cell={{ hasBorder: true }}\n />\n {/* Table body goes here */}\n </table>\n </Table>\n );\n}";
|
|
3
3
|
export declare const BasicHeader: StoryObj;
|
|
@@ -4,5 +4,5 @@ export type { TableProps, TableSchema, TableSchemaColumn, CellType, CellValue, C
|
|
|
4
4
|
export { extractCellValue } from './table.utils';
|
|
5
5
|
export { DEFAULT_EMPTY_MESSAGE, TABLE_CSS_CLASSES } from './table.const';
|
|
6
6
|
export { TableContext, useTableContext } from './table.context';
|
|
7
|
-
export { TableCell, TableHeader, TableRow, TableEmptyState, TableLoadingState, TablePagination,
|
|
7
|
+
export { TableCell, TableHeader, TableRow, TableEmptyState, TableLoadingState, TablePagination, NumberCell, BooleanCell, TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent, } from './components';
|
|
8
8
|
export { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
export declare const DEFAULT_EMPTY_MESSAGE = "No data available";
|
|
2
2
|
export declare const TABLE_CSS_CLASSES: {
|
|
3
3
|
readonly table: "w-full";
|
|
4
|
-
readonly
|
|
4
|
+
readonly bordered: {
|
|
5
|
+
readonly true: "[&_td:first-child]:border-l-1 [&_th:first-child]:border-l-1 ";
|
|
6
|
+
readonly false: "";
|
|
7
|
+
};
|
|
8
|
+
readonly header: "bg-background-neutral-medium text-text-neutral-secondary table-fixed";
|
|
5
9
|
readonly cell: {
|
|
6
|
-
readonly default: "
|
|
7
|
-
readonly cellHeight: {
|
|
8
|
-
readonly small: "p-3";
|
|
9
|
-
readonly large: "p-4";
|
|
10
|
-
};
|
|
10
|
+
readonly default: "p-0 align-middle relative h-4 ";
|
|
11
11
|
readonly hasBorder: {
|
|
12
|
-
readonly true: "border border-stroke-solid-light";
|
|
12
|
+
readonly true: "border-r border-b border-stroke-solid-light ";
|
|
13
13
|
readonly false: "border-b border-stroke-solid-light";
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
readonly headerCell:
|
|
16
|
+
readonly headerCell: {
|
|
17
|
+
readonly default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider border-stroke-solid-light";
|
|
18
|
+
readonly hasBorder: {
|
|
19
|
+
readonly true: " [box-shadow:inset_-1px_0_0_0_var(--color-stroke-solid-light),_inset_0_-1px_0_0_var(--color-stroke-solid-light)] border-stroke-solid-light dark:shadow-none dark:border-0";
|
|
20
|
+
readonly false: "border-stroke-solid-light ";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
17
23
|
readonly sortableHeaderCell: "p-3 text-left text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors duration-200";
|
|
18
24
|
readonly headerCellContent: "flex items-center justify-between";
|
|
19
25
|
readonly sortIcon: "ml-2 w-4 h-4 text-gray-400";
|
|
20
26
|
readonly sortIconActive: "ml-2 w-4 h-4 text-gray-600";
|
|
21
|
-
readonly row: "
|
|
27
|
+
readonly row: " transition-colors duration-200 text-text-neutral-primary";
|
|
22
28
|
readonly emptyState: "px-4 py-8 text-center text-gray-500";
|
|
23
29
|
readonly loading: "px-4 py-8 text-center text-gray-500";
|
|
24
30
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FilterComponentType } from './components/table-filter/table-filter.type';
|
|
3
|
-
export type CellType = '
|
|
3
|
+
export type CellType = 'number' | 'boolean' | 'checkbox' | 'link' | 'avatar' | 'label' | 'description' | 'text';
|
|
4
4
|
export type CellValue = string | number | boolean | null | undefined;
|
|
5
5
|
export type CellRendererProps = {
|
|
6
6
|
value: CellValue;
|
|
@@ -46,22 +46,52 @@ export type TableSort = {
|
|
|
46
46
|
sortedColumns: SortColumn[];
|
|
47
47
|
onSort: (field: string, direction: SortDirection) => void;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
import type { NumberCellProps } from './components/cell/number-cell';
|
|
50
|
+
import type { BooleanCellProps } from './components/cell/boolean-cell';
|
|
51
|
+
import type { LinkCellProps } from './components/cell/link-cell';
|
|
52
|
+
import type { AvatarCellProps } from './components/cell/avatar-cell';
|
|
53
|
+
import type { LabelCellProps } from './components/cell/label-cell';
|
|
54
|
+
import type { DescriptionCellProps } from './components/cell/description-cell';
|
|
55
|
+
type CellPropsByType = {
|
|
56
|
+
number: Omit<NumberCellProps, 'value'>;
|
|
57
|
+
boolean: Omit<BooleanCellProps, 'value'>;
|
|
58
|
+
checkbox: Omit<BooleanCellProps, 'value'>;
|
|
59
|
+
link: Omit<LinkCellProps, 'value' | 'href'> & {
|
|
60
|
+
href: string;
|
|
61
|
+
};
|
|
62
|
+
avatar: Omit<AvatarCellProps, 'value'>;
|
|
63
|
+
label: Omit<LabelCellProps, 'value'>;
|
|
64
|
+
description: Omit<DescriptionCellProps, 'value'>;
|
|
65
|
+
};
|
|
66
|
+
type ColumnBase<T extends CellType> = {
|
|
50
67
|
key: string;
|
|
51
|
-
valueGetter?: (record: Record<string, any>) => string | number | boolean | null | undefined;
|
|
52
68
|
title: string;
|
|
53
|
-
cellType:
|
|
69
|
+
cellType: T;
|
|
54
70
|
cellRenderer?: CellRenderer;
|
|
55
71
|
filterable?: boolean;
|
|
56
72
|
hideable?: boolean;
|
|
57
73
|
sortable?: boolean;
|
|
58
74
|
filterOptions?: FilterOption[];
|
|
59
75
|
};
|
|
76
|
+
export type TableSchemaColumn = (ColumnBase<'number'> & {
|
|
77
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['number'];
|
|
78
|
+
}) | (ColumnBase<'boolean'> & {
|
|
79
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['boolean'];
|
|
80
|
+
}) | (ColumnBase<'checkbox'> & {
|
|
81
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['checkbox'];
|
|
82
|
+
}) | (ColumnBase<'link'> & {
|
|
83
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['link'];
|
|
84
|
+
}) | (ColumnBase<'avatar'> & {
|
|
85
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['avatar'];
|
|
86
|
+
}) | (ColumnBase<'label'> & {
|
|
87
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['label'];
|
|
88
|
+
}) | (ColumnBase<'description'> & {
|
|
89
|
+
valueGetter?: (record: Record<string, unknown>) => CellValue | CellPropsByType['description'];
|
|
90
|
+
});
|
|
60
91
|
export type TableSchema = TableSchemaColumn[];
|
|
61
92
|
export type TableProps = {
|
|
62
93
|
cell?: {
|
|
63
94
|
hasBorder?: boolean;
|
|
64
|
-
cellHeight?: 'small' | 'large';
|
|
65
95
|
};
|
|
66
96
|
dataSource: Record<string, unknown>[];
|
|
67
97
|
schema: TableSchema;
|
|
@@ -73,3 +103,4 @@ export type TableProps = {
|
|
|
73
103
|
sort?: TableSort;
|
|
74
104
|
customCells?: Record<string, CellRenderer>;
|
|
75
105
|
};
|
|
106
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CellValue, TableSchemaColumn } from './table.type';
|
|
2
|
-
export declare const extractCellValue: (record: Record<string, unknown>, column: TableSchemaColumn) => CellValue
|
|
2
|
+
export declare const extractCellValue: (record: Record<string, unknown>, column: TableSchemaColumn) => CellValue | Record<string, unknown>;
|
package/package.json
CHANGED