@ztwoint/z-ui 0.1.147 → 0.1.148

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.
Files changed (34) hide show
  1. package/dist/components/pdf-preview/components/pdf-error-state.d.ts +9 -0
  2. package/dist/components/pdf-preview/components/pdf-error-state.js +18 -0
  3. package/dist/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
  4. package/dist/components/pdf-preview/components/pdf-loading-state.js +34 -0
  5. package/dist/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
  6. package/dist/components/pdf-preview/components/pdf-toolbar.js +47 -0
  7. package/dist/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
  8. package/dist/components/pdf-preview/components/pdf-viewer.js +6 -0
  9. package/dist/components/pdf-preview/index.d.ts +3 -0
  10. package/dist/components/pdf-preview/pdf-preview.const.d.ts +29 -0
  11. package/dist/components/pdf-preview/pdf-preview.const.js +29 -0
  12. package/dist/components/pdf-preview/pdf-preview.d.ts +16 -0
  13. package/dist/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
  14. package/dist/components/pdf-preview/pdf-preview.hook.js +69 -0
  15. package/dist/components/pdf-preview/pdf-preview.js +77 -0
  16. package/dist/components/pdf-preview/pdf-preview.type.d.ts +81 -0
  17. package/dist/components/primitives/table-card/table-card.js +11 -10
  18. package/dist/components/table/components/cell/avatar-cell.js +3 -2
  19. package/dist/components/table/table-provider.js +1 -0
  20. package/dist/css/styles/tailwind.css +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +56 -54
  23. package/dist/sample-resume.pdf +0 -0
  24. package/dist/types/components/pdf-preview/components/pdf-error-state.d.ts +9 -0
  25. package/dist/types/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
  26. package/dist/types/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
  27. package/dist/types/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
  28. package/dist/types/components/pdf-preview/index.d.ts +3 -0
  29. package/dist/types/components/pdf-preview/pdf-preview.const.d.ts +29 -0
  30. package/dist/types/components/pdf-preview/pdf-preview.d.ts +16 -0
  31. package/dist/types/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
  32. package/dist/types/components/pdf-preview/pdf-preview.type.d.ts +81 -0
  33. package/dist/types/index.d.ts +1 -0
  34. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -36,5 +36,6 @@ export * from './components/primitives/chart-card';
36
36
  export * from './components/radio-card/radio-card';
37
37
  export * from './components/z2map';
38
38
  export * from './components/kpi-card';
39
+ export * from './components/pdf-preview';
39
40
  export * from './lib/theme.hook';
40
41
  export * from './lib/utils';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import { Alert as p, AlertDescription as n, AlertTitle as f } from "./components/alert/alert.js";
2
+ import { Alert as p, AlertDescription as f, AlertTitle as n } from "./components/alert/alert.js";
3
3
  import { AlertCirclesIcon as m } from "./components/alert/icons/circles-icon.js";
4
4
  import { Button as x, buttonVariants as i } from "./components/button/button.js";
5
5
  import { Z2SideNavBarProvider as Z } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
@@ -8,8 +8,8 @@ import { Z2SideNavBarHeader as S } from "./components/collapsible-side-nav-bar/s
8
8
  import { Z2SideNavBarContent as I } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
9
9
  import { Z2SideNavBarFooter as D } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
10
10
  import { Z2SideNavBarGroup as h } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
11
- import { Z2SideNavBarItem as v } from "./components/collapsible-side-nav-bar/side-nav-bar-item.js";
12
- import { Z2SideNavBarSeparator as M } from "./components/collapsible-side-nav-bar/side-nav-bar-separator.js";
11
+ import { Z2SideNavBarItem as B } from "./components/collapsible-side-nav-bar/side-nav-bar-item.js";
12
+ import { Z2SideNavBarSeparator as P } from "./components/collapsible-side-nav-bar/side-nav-bar-separator.js";
13
13
  import { useZ2SideNavBar as R } from "./components/collapsible-side-nav-bar/context.js";
14
14
  import { Z2Popover as E } from "./components/collapsible-side-nav-bar/popover/popover.js";
15
15
  import "react/jsx-runtime";
@@ -23,23 +23,23 @@ import { SIDEBAR_WIDTH as Q, SIDEBAR_WIDTH_COLLAPSED as j } from "./components/c
23
23
  import { CountryFlags as oo } from "./components/country-flags/country-flags.js";
24
24
  import { Z2Checkbox as ro } from "./components/checkbox/checkbox.js";
25
25
  import { CheckboxFilter as ao } from "./components/checkbox-filter/index.js";
26
- import { Z2Dialog as no, Z2DialogClose as fo, Z2DialogContent as lo, Z2DialogDescription as mo, Z2DialogFooter as xo, Z2DialogHeader as io, Z2DialogOverlay as uo, Z2DialogPortal as Zo, Z2DialogTitle as co, Z2DialogTrigger as so } from "./components/dialog/dialog.js";
27
- import { DropdownContext as bo, Z2Dropdown as So, Z2DropdownContent as To, Z2DropdownInput as Io, Z2DropdownItem as go, Z2DropdownSub as Do, Z2DropdownSubContent as wo, Z2DropdownSubItem as ho, Z2DropdownSubTrigger as Bo } from "./components/dropdown/z2-dropdown.js";
28
- import { Z2DropdownMenu as Lo, Z2DropdownMenuCheckboxItem as Mo, Z2DropdownMenuContent as Po, Z2DropdownMenuGroup as Ro, Z2DropdownMenuItem as Ao, Z2DropdownMenuLabel as Eo, Z2DropdownMenuPortal as yo, Z2DropdownMenuRadioGroup as ko, Z2DropdownMenuRadioItem as No, Z2DropdownMenuSeparator as Ho, Z2DropdownMenuShortcut as _o, Z2DropdownMenuSub as Fo, Z2DropdownMenuSubContent as Oo, Z2DropdownMenuSubTrigger as Go, Z2DropdownMenuTrigger as Vo } from "./components/dropdown-menu/z2-dropdown-menu.js";
26
+ import { Z2Dialog as fo, Z2DialogClose as no, Z2DialogContent as lo, Z2DialogDescription as mo, Z2DialogFooter as xo, Z2DialogHeader as io, Z2DialogOverlay as uo, Z2DialogPortal as Zo, Z2DialogTitle as co, Z2DialogTrigger as so } from "./components/dialog/dialog.js";
27
+ import { DropdownContext as bo, Z2Dropdown as So, Z2DropdownContent as To, Z2DropdownInput as Io, Z2DropdownItem as go, Z2DropdownSub as Do, Z2DropdownSubContent as wo, Z2DropdownSubItem as ho, Z2DropdownSubTrigger as vo } from "./components/dropdown/z2-dropdown.js";
28
+ import { Z2DropdownMenu as Lo, Z2DropdownMenuCheckboxItem as Po, Z2DropdownMenuContent as Mo, Z2DropdownMenuGroup as Ro, Z2DropdownMenuItem as Ao, Z2DropdownMenuLabel as Eo, Z2DropdownMenuPortal as yo, Z2DropdownMenuRadioGroup as ko, Z2DropdownMenuRadioItem as No, Z2DropdownMenuSeparator as Ho, Z2DropdownMenuShortcut as _o, Z2DropdownMenuSub as Fo, Z2DropdownMenuSubContent as Oo, Z2DropdownMenuSubTrigger as Go, Z2DropdownMenuTrigger as Vo } from "./components/dropdown-menu/z2-dropdown-menu.js";
29
29
  import { FileUploadArea as Uo } from "./components/file-upload-area/file-upload-area.js";
30
30
  import { DEFAULT_ACCEPT as qo } from "./components/file-upload-area/file-upload-area.const.js";
31
31
  import { Input as zo } from "./components/input/input.js";
32
32
  import { NavHeader as Ko } from "./components/nav-header/nav-header.js";
33
33
  import { NavItem as jo } from "./components/nav-header/nav-item/nav-item.js";
34
- import { Z2Select as oe, Z2SelectContent as ee, Z2SelectGroup as re, Z2SelectItem as te, Z2SelectLabel as ae, Z2SelectScrollDownButton as pe, Z2SelectScrollUpButton as ne, Z2SelectSeparator as fe, Z2SelectTrigger as le, Z2SelectValue as me } from "./components/select/z2-select.js";
34
+ import { Z2Select as oe, Z2SelectContent as ee, Z2SelectGroup as re, Z2SelectItem as te, Z2SelectLabel as ae, Z2SelectScrollDownButton as pe, Z2SelectScrollUpButton as fe, Z2SelectSeparator as ne, Z2SelectTrigger as le, Z2SelectValue as me } from "./components/select/z2-select.js";
35
35
  import { Z2SelectCompact as xe } from "./components/primitives/select-compact/select-compact.js";
36
36
  import { PopoverCompact as ue } from "./components/primitives/popover-compact/popover-compact.js";
37
37
  import { Z2Stepper as ce } from "./components/stepper/stepper.js";
38
38
  import { Z2StepperItem as Ce } from "./components/stepper-item/stepper-item.js";
39
39
  import { Z2Tabs as Se, Z2TabsContent as Te, Z2TabsList as Ie, Z2TabsTrigger as ge } from "./components/tab/tab.js";
40
40
  import { Table as we, TableProvider as he } from "./components/table/table-provider.js";
41
- import { TableBody as ve } from "./components/table/table.js";
42
- import { extractCellValue as Me } from "./components/table/table.utils.js";
41
+ import { TableBody as Be } from "./components/table/table.js";
42
+ import { extractCellValue as Pe } from "./components/table/table.utils.js";
43
43
  import { DEFAULT_EMPTY_MESSAGE as Re, TABLE_CSS_CLASSES as Ae } from "./components/table/table.const.js";
44
44
  import { TableContext as ye, useTableContext as ke } from "./components/table/table.context.js";
45
45
  import { TableCell as He } from "./components/table/components/table-cell.js";
@@ -54,7 +54,7 @@ import { default as $e } from "./components/assets/icons/chevron-down.js";
54
54
  import { TableRow as er } from "./components/table/components/table-row.js";
55
55
  import { TableMessageState as tr } from "./components/table/components/table-message-state.js";
56
56
  import { TableLoadingState as pr } from "./components/table/components/table-loading-state.js";
57
- import { Pagination as fr } from "./components/table/components/pagination/pagination.js";
57
+ import { Pagination as nr } from "./components/table/components/pagination/pagination.js";
58
58
  import { TableHeaderWrapper as mr } from "./components/table/components/table-header-wrapper.js";
59
59
  import { TableHeaderContent as xr } from "./components/table/components/table-header-content.js";
60
60
  import { TableFooter as ur } from "./components/table/components/table-footer.js";
@@ -65,8 +65,8 @@ import { PaginationQuickJumper as Ir } from "./components/table/components/pagin
65
65
  import "react";
66
66
  import { Z2Tooltip as Dr } from "./components/tooltip/tooltip.js";
67
67
  import { default as hr } from "./components/primitives/table-card/table-card.js";
68
- import { Badge as vr, badgeVariants as Lr } from "./components/badge/badge.js";
69
- import { Avatar as Pr, AvatarWithLabel as Rr } from "./components/avatar/avatar.js";
68
+ import { Badge as Br, badgeVariants as Lr } from "./components/badge/badge.js";
69
+ import { Avatar as Mr, AvatarWithLabel as Rr } from "./components/avatar/avatar.js";
70
70
  import { Z2TextPreset as Er } from "./components/text-preset/text-preset.js";
71
71
  import { ColumnReOrder as kr } from "./components/column-reorder/column-reorder.js";
72
72
  import { default as Hr } from "./components/tree-checkbox-select/TreeCheckboxSelect.js";
@@ -77,7 +77,7 @@ import { Check as $r } from "./components/assets/icons/check.js";
77
77
  import { default as et } from "./components/assets/icons/chevron-left.js";
78
78
  import { default as tt } from "./components/assets/icons/chevron-right.js";
79
79
  import { default as pt } from "./components/assets/icons/circle-check-filled.js";
80
- import { default as ft } from "./components/assets/icons/circle-check.js";
80
+ import { default as nt } from "./components/assets/icons/circle-check.js";
81
81
  import { default as mt } from "./components/assets/icons/dots.js";
82
82
  import { default as xt } from "./components/assets/icons/double-chevron-left.js";
83
83
  import { default as ut } from "./components/assets/icons/double-chevron-right.js";
@@ -87,8 +87,8 @@ import { InfoIcon as St } from "./components/assets/icons/info-icon.js";
87
87
  import { default as It } from "./components/assets/icons/left-arrow.js";
88
88
  import { default as Dt } from "./components/assets/icons/link.js";
89
89
  import { default as ht } from "./components/assets/icons/list-tree.js";
90
- import { default as vt } from "./components/assets/icons/media-record.js";
91
- import { Minus as Mt } from "./components/assets/icons/minus.js";
90
+ import { default as Bt } from "./components/assets/icons/media-record.js";
91
+ import { Minus as Pt } from "./components/assets/icons/minus.js";
92
92
  import { default as Rt } from "./components/assets/icons/octagon-warning-Copy.js";
93
93
  import { default as Et } from "./components/assets/icons/pin.js";
94
94
  import { default as kt } from "./components/assets/icons/sitemap.js";
@@ -104,7 +104,7 @@ import { default as $t } from "./components/assets/icons/vector_3.js";
104
104
  import { default as ea } from "./components/assets/icons/table-cols-2.js";
105
105
  import { default as ta } from "./components/assets/icons/triangle-warning.js";
106
106
  import { default as pa } from "./components/assets/icons/arrow-left.js";
107
- import { default as fa } from "./components/assets/icons/filter-icon.js";
107
+ import { default as na } from "./components/assets/icons/filter-icon.js";
108
108
  import { default as ma } from "./components/assets/icons/descending.js";
109
109
  import { default as xa } from "./components/assets/icons/chain.js";
110
110
  import { default as ua } from "./components/assets/icons/eraser.js";
@@ -112,45 +112,46 @@ import { default as ca } from "./components/assets/icons/left-square-bracket.js"
112
112
  import { default as Ca } from "./components/assets/icons/right-square-bracket.js";
113
113
  import { SegmentedControl as Sa } from "./components/segmented-control/controller.js";
114
114
  import { SegmentedControlItem as Ia } from "./components/segmented-control/item.js";
115
- import { Popover as Da, PopoverAnchor as wa, PopoverContent as ha, PopoverTrigger as Ba } from "./components/popover/popover.js";
115
+ import { Popover as Da, PopoverAnchor as wa, PopoverContent as ha, PopoverTrigger as va } from "./components/popover/popover.js";
116
116
  import { Popconfirm as La } from "./components/primitives/popconfirm/popconfirm.js";
117
- import { Z2Table as Pa, Z2TableBase as Ra, Z2TableBody as Aa, Z2TableBodyRow as Ea, Z2TableBodyRowCell as ya, Z2TableBodyRowExpandded as ka, Z2TableBodyRowSkeleton as Na, Z2TableBodyRowSkeletonCell as Ha, Z2TableEmpty as _a, Z2TableHead as Fa, Z2TableHeadRow as Oa, Z2TableHeadRowCell as Ga, Z2TableHeadRowCellResize as Va, Z2TableLoader as Wa, Z2TableRowSelect as Ua, Z2TableRowSelectAll as Xa, Z2TableRowSpacer as qa } from "./components/dynamic-table/z2-table.js";
117
+ import { Z2Table as Ma, Z2TableBase as Ra, Z2TableBody as Aa, Z2TableBodyRow as Ea, Z2TableBodyRowCell as ya, Z2TableBodyRowExpandded as ka, Z2TableBodyRowSkeleton as Na, Z2TableBodyRowSkeletonCell as Ha, Z2TableEmpty as _a, Z2TableHead as Fa, Z2TableHeadRow as Oa, Z2TableHeadRowCell as Ga, Z2TableHeadRowCellResize as Va, Z2TableLoader as Wa, Z2TableRowSelect as Ua, Z2TableRowSelectAll as Xa, Z2TableRowSpacer as qa } from "./components/dynamic-table/z2-table.js";
118
118
  import { Z2TableContainer as za, Z2TableProvider as Ja, Z2TableRoot as Ka, useZ2Table as Qa } from "./components/dynamic-table/z2-table-context.js";
119
119
  import { Z2TablePagination as $a } from "./components/dynamic-table/z2-table-pagination.js";
120
120
  import { Z2TableColumnHeader as ep } from "./components/dynamic-table/z2-column-header.js";
121
121
  import { Chart as tp } from "./components/chart/chart.js";
122
122
  import { ChartCard as pp } from "./components/primitives/chart-card/chart-card.js";
123
- import { EmptyState as fp, ErrorState as lp, LoadingState as mp } from "./components/primitives/chart-card/chart-card-states.js";
123
+ import { EmptyState as np, ErrorState as lp, LoadingState as mp } from "./components/primitives/chart-card/chart-card-states.js";
124
124
  import { COLOR_PALETTES as xp, UI_COLORS as ip, getThemePalette as up } from "./components/primitives/chart-card/config/colors.js";
125
125
  import { validateChartConfig as cp, validateChartData as sp } from "./components/primitives/chart-card/validators/config-validator.js";
126
126
  import { buildBarChartOptions as bp } from "./components/primitives/chart-card/builders/bar-chart-builder.js";
127
127
  import { buildLineChartOptions as Tp } from "./components/primitives/chart-card/builders/line-chart-builder.js";
128
128
  import { buildChartOptions as gp, isChartTypeSupported as Dp, registeredChartTypes as wp } from "./components/primitives/chart-card/builders/chart-builder-factory.js";
129
- import { Z2RadioCard as Bp } from "./components/radio-card/radio-card.js";
129
+ import { Z2RadioCard as vp } from "./components/radio-card/radio-card.js";
130
130
  import { default as Lp } from "./components/z2map/map.js";
131
- import { DEFAULT_MAP_CONFIG as Pp, MAP_VARIANTS as Rp, PIN_SIZES as Ap } from "./components/z2map/map.constants.js";
131
+ import { DEFAULT_MAP_CONFIG as Mp, MAP_VARIANTS as Rp, PIN_SIZES as Ap } from "./components/z2map/map.constants.js";
132
132
  import { MapPinComponent as yp } from "./components/z2map/components/map-pin.js";
133
133
  import { MapPinContent as Np } from "./components/z2map/components/map-pin-content.js";
134
134
  import { MapControls as _p } from "./components/z2map/components/map-controls.js";
135
135
  import { MapZoomControl as Op } from "./components/z2map/components/map-zoom-control.js";
136
136
  import { MapStyleControl as Vp } from "./components/z2map/components/map-style-control.js";
137
137
  import { KpiCard as Up, kpiCardVariants as Xp } from "./components/kpi-card/kpi-card.js";
138
- import { useTheme as Yp } from "./lib/theme.hook.js";
139
- import { cn as Jp } from "./lib/utils.js";
140
- import { Z2PopoverTrigger as Qp } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
141
- import { Z2PopoverContent as $p } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
138
+ import { PdfPreview as Yp } from "./components/pdf-preview/pdf-preview.js";
139
+ import { useTheme as Jp } from "./lib/theme.hook.js";
140
+ import { cn as Qp } from "./lib/utils.js";
141
+ import { Z2PopoverTrigger as $p } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
142
+ import { Z2PopoverContent as ef } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
142
143
  export {
143
144
  p as Alert,
144
145
  m as AlertCirclesIcon,
145
- n as AlertDescription,
146
- f as AlertTitle,
146
+ f as AlertDescription,
147
+ n as AlertTitle,
147
148
  Qr as ApartmentBuildingIcon,
148
149
  pa as ArrowLeftIcon,
149
150
  J as ArrowsThroughLineY,
150
- Pr as Avatar,
151
+ Mr as Avatar,
151
152
  Ye as AvatarCell,
152
153
  Rr as AvatarWithLabel,
153
- vr as Badge,
154
+ Br as Badge,
154
155
  Ge as BooleanCell,
155
156
  x as Button,
156
157
  xp as COLOR_PALETTES,
@@ -163,13 +164,13 @@ export {
163
164
  et as ChevronLeftIcon,
164
165
  tt as ChevronRightIcon,
165
166
  pt as CircleCheckFilledIcon,
166
- ft as CircleCheckIcon,
167
+ nt as CircleCheckIcon,
167
168
  _ as CirclesIcon,
168
169
  kr as ColumnReOrder,
169
170
  oo as CountryFlags,
170
171
  qo as DEFAULT_ACCEPT,
171
172
  Re as DEFAULT_EMPTY_MESSAGE,
172
- Pp as DEFAULT_MAP_CONFIG,
173
+ Mp as DEFAULT_MAP_CONFIG,
173
174
  O as DatabaseCopy,
174
175
  G as DatabaseCopyIcon,
175
176
  ma as DescendingSortingIcon,
@@ -179,11 +180,11 @@ export {
179
180
  ut as DoubleChevronRightIcon,
180
181
  ct as DragHandleIcon,
181
182
  bo as DropdownContext,
182
- fp as EmptyState,
183
+ np as EmptyState,
183
184
  ua as EraserIcon,
184
185
  lp as ErrorState,
185
186
  Uo as FileUploadArea,
186
- fa as FilterIcon,
187
+ na as FilterIcon,
187
188
  Ct as HomeIcon,
188
189
  St as InfoIcon,
189
190
  zo as Input,
@@ -202,8 +203,8 @@ export {
202
203
  Np as MapPinContent,
203
204
  Vp as MapStyleControl,
204
205
  Op as MapZoomControl,
205
- vt as MediaRecordIcon,
206
- Mt as MinusIcon,
206
+ Bt as MediaRecordIcon,
207
+ Pt as MinusIcon,
207
208
  Ko as NavHeader,
208
209
  jo as NavItem,
209
210
  Fe as NumberCell,
@@ -211,13 +212,14 @@ export {
211
212
  Ap as PIN_SIZES,
212
213
  Sr as PaginationInfo,
213
214
  Ir as PaginationQuickJumper,
215
+ Yp as PdfPreview,
214
216
  Et as PinIcon,
215
217
  La as Popconfirm,
216
218
  Da as Popover,
217
219
  wa as PopoverAnchor,
218
220
  ue as PopoverCompact,
219
221
  ha as PopoverContent,
220
- Ba as PopoverTrigger,
222
+ va as PopoverTrigger,
221
223
  Ca as RightSquareBracketIcon,
222
224
  Q as SIDEBAR_WIDTH,
223
225
  j as SIDEBAR_WIDTH_COLLAPSED,
@@ -231,7 +233,7 @@ export {
231
233
  N as SubNavIndicatorIcon,
232
234
  Ae as TABLE_CSS_CLASSES,
233
235
  we as Table,
234
- ve as TableBody,
236
+ Be as TableBody,
235
237
  hr as TableCard,
236
238
  He as TableCell,
237
239
  ea as TableCols2Icon,
@@ -243,7 +245,7 @@ export {
243
245
  mr as TableHeaderWrapper,
244
246
  pr as TableLoadingState,
245
247
  tr as TableMessageState,
246
- fr as TablePagination,
248
+ nr as TablePagination,
247
249
  he as TableProvider,
248
250
  er as TableRow,
249
251
  Hr as TreeCheckboxSelect,
@@ -265,8 +267,8 @@ export {
265
267
  Xr as Z2BreadcrumbSeparator,
266
268
  ro as Z2Checkbox,
267
269
  Qt as Z2DataIcon,
268
- no as Z2Dialog,
269
- fo as Z2DialogClose,
270
+ fo as Z2Dialog,
271
+ no as Z2DialogClose,
270
272
  lo as Z2DialogContent,
271
273
  mo as Z2DialogDescription,
272
274
  xo as Z2DialogFooter,
@@ -280,8 +282,8 @@ export {
280
282
  Io as Z2DropdownInput,
281
283
  go as Z2DropdownItem,
282
284
  Lo as Z2DropdownMenu,
283
- Mo as Z2DropdownMenuCheckboxItem,
284
- Po as Z2DropdownMenuContent,
285
+ Po as Z2DropdownMenuCheckboxItem,
286
+ Mo as Z2DropdownMenuContent,
285
287
  Ro as Z2DropdownMenuGroup,
286
288
  Ao as Z2DropdownMenuItem,
287
289
  Eo as Z2DropdownMenuLabel,
@@ -297,13 +299,13 @@ export {
297
299
  Do as Z2DropdownSub,
298
300
  wo as Z2DropdownSubContent,
299
301
  ho as Z2DropdownSubItem,
300
- Bo as Z2DropdownSubTrigger,
302
+ vo as Z2DropdownSubTrigger,
301
303
  Yt as Z2Icon,
302
304
  Lp as Z2Map,
303
305
  E as Z2Popover,
304
- $p as Z2PopoverContent,
305
- Qp as Z2PopoverTrigger,
306
- Bp as Z2RadioCard,
306
+ ef as Z2PopoverContent,
307
+ $p as Z2PopoverTrigger,
308
+ vp as Z2RadioCard,
307
309
  Yr as Z2RadioGroup,
308
310
  zr as Z2RadioGroupIndicator,
309
311
  Jr as Z2RadioGroupItem,
@@ -314,8 +316,8 @@ export {
314
316
  te as Z2SelectItem,
315
317
  ae as Z2SelectLabel,
316
318
  pe as Z2SelectScrollDownButton,
317
- ne as Z2SelectScrollUpButton,
318
- fe as Z2SelectSeparator,
319
+ fe as Z2SelectScrollUpButton,
320
+ ne as Z2SelectSeparator,
319
321
  le as Z2SelectTrigger,
320
322
  me as Z2SelectValue,
321
323
  s as Z2SideNavBar,
@@ -323,14 +325,14 @@ export {
323
325
  D as Z2SideNavBarFooter,
324
326
  h as Z2SideNavBarGroup,
325
327
  S as Z2SideNavBarHeader,
326
- v as Z2SideNavBarItem,
328
+ B as Z2SideNavBarItem,
327
329
  Z as Z2SideNavBarProvider,
328
- M as Z2SideNavBarSeparator,
330
+ P as Z2SideNavBarSeparator,
329
331
  C as Z2SidebarVariants,
330
332
  Jt as Z2SlashIcon,
331
333
  ce as Z2Stepper,
332
334
  Ce as Z2StepperItem,
333
- Pa as Z2Table,
335
+ Ma as Z2Table,
334
336
  Ra as Z2TableBase,
335
337
  Aa as Z2TableBody,
336
338
  Ea as Z2TableBodyRow,
@@ -363,14 +365,14 @@ export {
363
365
  gp as buildChartOptions,
364
366
  Tp as buildLineChartOptions,
365
367
  i as buttonVariants,
366
- Jp as cn,
367
- Me as extractCellValue,
368
+ Qp as cn,
369
+ Pe as extractCellValue,
368
370
  up as getThemePalette,
369
371
  Dp as isChartTypeSupported,
370
372
  Xp as kpiCardVariants,
371
373
  wp as registeredChartTypes,
372
374
  ke as useTableContext,
373
- Yp as useTheme,
375
+ Jp as useTheme,
374
376
  R as useZ2SideNavBar,
375
377
  Qa as useZ2Table,
376
378
  cp as validateChartConfig,
Binary file
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { PdfPreviewError } from '../pdf-preview.type';
3
+ interface PdfErrorStateProps {
4
+ error: PdfPreviewError;
5
+ onRetry: () => void;
6
+ }
7
+ /** Default error UI shown when PDF loading fails. Displays warning icon, error message, and a retry button. */
8
+ export declare const PdfErrorState: React.FC<PdfErrorStateProps>;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ /** Default loading spinner shown while the PDF source is being resolved/fetched. */
3
+ export declare const PdfLoadingState: React.FC;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ interface PdfToolbarProps {
3
+ title: string;
4
+ showDownload: boolean;
5
+ onDownload: () => void;
6
+ downloadDisabled?: boolean;
7
+ }
8
+ /**
9
+ * Toolbar displayed at the top of the PDF preview dialog.
10
+ * Contains:
11
+ * - DialogPrimitive.Title: serves as both the visible title and Radix's required accessible title
12
+ * - Download button (optional): triggers the parent's download handler
13
+ * - Close button: uses DialogPrimitive.Close to close the dialog via Radix
14
+ */
15
+ export declare const PdfToolbar: React.FC<PdfToolbarProps>;
16
+ export {};
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ interface PdfViewerProps {
3
+ url: string;
4
+ title: string;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Browser-native PDF renderer with a two-level fallback:
9
+ *
10
+ * 1. <object type="application/pdf"> — uses the browser's built-in PDF plugin
11
+ * (Chrome, Firefox, Edge all have mature viewers with zoom, search, print)
12
+ *
13
+ * 2. <iframe> — fallback rendered as <object>'s child if the plugin is unavailable
14
+ *
15
+ * Note: <iframe> does not support child fallback content (unlike <object>), so a
16
+ * download link inside <iframe> would be unreachable. If the browser can't render
17
+ * the PDF at all, the iframe will show a blank page or its own error.
18
+ *
19
+ * This approach adds zero JS bundle size since it relies entirely on browser capabilities.
20
+ */
21
+ export declare const PdfViewer: React.FC<PdfViewerProps>;
22
+ export {};
@@ -0,0 +1,3 @@
1
+ export { PdfPreview } from './pdf-preview';
2
+ export type { PdfPreviewProps, PdfPreviewError, PdfPreviewStatus } from './pdf-preview.type';
3
+ export type { PdfPreviewSize } from './pdf-preview.const';
@@ -0,0 +1,29 @@
1
+ /** Available dialog size options for the PDF preview modal. */
2
+ export declare const PDF_PREVIEW_SIZES: {
3
+ readonly SM: "sm";
4
+ readonly MD: "md";
5
+ readonly LG: "lg";
6
+ readonly XL: "xl";
7
+ readonly FULL: "full";
8
+ };
9
+ export type PdfPreviewSize = (typeof PDF_PREVIEW_SIZES)[keyof typeof PDF_PREVIEW_SIZES];
10
+ /** Default prop values used when the consumer doesn't provide them. */
11
+ export declare const PDF_PREVIEW_DEFAULTS: {
12
+ readonly size: PdfPreviewSize;
13
+ readonly showToolbar: true;
14
+ readonly showDownload: true;
15
+ };
16
+ /**
17
+ * CVA variants for the dialog content container.
18
+ * Each size sets a max width/height using min() to stay responsive,
19
+ * with a 2rem margin from viewport edges. 'full' takes up nearly the entire screen.
20
+ *
21
+ * Note: Z2DialogContent's base styles include `grid gap-4 max-w-[calc(100%-2rem)] sm:max-w-lg`
22
+ * which conflict with our layout. We override them here with:
23
+ * - `flex flex-col` → overrides `grid` (tailwind-merge handles display conflicts)
24
+ * - `max-w-none sm:max-w-none` → cancels the max-width caps so our w-[min(...)] sizing works
25
+ * - `gap-0` → removes the default gap between children
26
+ */
27
+ export declare const pdfDialogContentVariants: (props?: ({
28
+ size?: "sm" | "md" | "full" | "lg" | "xl" | null | undefined;
29
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { PdfPreviewProps } from './pdf-preview.type';
3
+ /**
4
+ * PdfPreview — A zero-dependency PDF preview dialog component.
5
+ *
6
+ * Uses the browser's built-in PDF renderer (<object> + <iframe> fallback)
7
+ * instead of pdf.js, resulting in zero additional bundle size.
8
+ *
9
+ * Supports:
10
+ * - Multiple source types: URL string, Blob, File, or async fetch function
11
+ * - Controlled & uncontrolled open state
12
+ * - Customizable loading/error states
13
+ * - `renderPdf` escape hatch for plugging in custom renderers (e.g. react-pdf)
14
+ */
15
+ declare const PdfPreview: React.FC<PdfPreviewProps>;
16
+ export { PdfPreview };
@@ -0,0 +1,12 @@
1
+ import { UsePdfPreviewProps, UsePdfPreviewReturn } from './pdf-preview.type';
2
+ /**
3
+ * Core hook that manages the entire PDF preview lifecycle:
4
+ * - Controlled/uncontrolled open state (like popconfirm.hook.ts pattern)
5
+ * - Lazy source resolution — async fetch only runs when dialog opens
6
+ * - Blob URL memory management — created on open, revoked on close/unmount
7
+ * - Status state machine: idle → loading → ready | error
8
+ * - Abort tracking to prevent stale state updates if dialog closes mid-fetch
9
+ */
10
+ export declare function usePdfPreview(props: UsePdfPreviewProps): UsePdfPreviewReturn & {
11
+ resolvedTitle: string;
12
+ };
@@ -0,0 +1,81 @@
1
+ import { ReactNode } from 'react';
2
+ import { PdfPreviewSize } from './pdf-preview.const';
3
+ /**
4
+ * Represents an error that occurred while loading or processing a PDF.
5
+ * Used by error callbacks and the error state UI.
6
+ */
7
+ export interface PdfPreviewError {
8
+ message: string;
9
+ cause?: unknown;
10
+ }
11
+ /**
12
+ * State machine for the PDF loading lifecycle:
13
+ * idle → loading → ready | error
14
+ * Resets back to 'idle' when the dialog closes.
15
+ */
16
+ export type PdfPreviewStatus = 'idle' | 'loading' | 'ready' | 'error';
17
+ /**
18
+ * Props for the PdfPreview component.
19
+ *
20
+ * Supports both controlled (open/onOpenChange) and uncontrolled usage.
21
+ * The `src` prop accepts multiple source types to handle different use cases:
22
+ * - Static URL string (e.g. "/files/report.pdf")
23
+ * - Blob or File object (e.g. from a file input)
24
+ * - Async function that returns any of the above (e.g. server-side fetch)
25
+ */
26
+ export interface PdfPreviewProps {
27
+ /** PDF source — URL string, Blob, File, or async function returning any of those.
28
+ * Async functions receive an AbortSignal so the fetch can be cancelled when the dialog closes. */
29
+ src: string | Blob | File | ((signal: AbortSignal) => Promise<string | Blob | File>);
30
+ /** Dialog title. Auto-detected from filename if not provided */
31
+ title?: string;
32
+ /** Dialog size variant */
33
+ size?: PdfPreviewSize;
34
+ /** Controlled open state */
35
+ open?: boolean;
36
+ /** Callback when open state changes */
37
+ onOpenChange?: (open: boolean) => void;
38
+ /** Disable the trigger */
39
+ disabled?: boolean;
40
+ /** Show the toolbar (default: true) */
41
+ showToolbar?: boolean;
42
+ /** Show the download button in the toolbar (default: true) */
43
+ showDownload?: boolean;
44
+ /** Filename used when downloading */
45
+ downloadFilename?: string;
46
+ /** Custom download handler */
47
+ onDownload?: () => void;
48
+ /** Custom loading content */
49
+ loadingContent?: ReactNode;
50
+ /** Custom error content or render function */
51
+ errorContent?: ReactNode | ((error: PdfPreviewError) => ReactNode);
52
+ /** Escape hatch: render your own PDF viewer given the resolved URL */
53
+ renderPdf?: (resolvedUrl: string) => ReactNode;
54
+ /** Additional class name for the dialog content */
55
+ className?: string;
56
+ /** Additional class name for the PDF viewer area */
57
+ viewerClassName?: string;
58
+ /** Called when an error occurs */
59
+ onError?: (error: PdfPreviewError) => void;
60
+ /** Called when the PDF loads successfully */
61
+ onLoad?: () => void;
62
+ /** Click trigger element (rendered via Radix asChild) */
63
+ children?: ReactNode;
64
+ }
65
+ /** Props passed to the usePdfPreview hook for managing dialog state and PDF source resolution. */
66
+ export interface UsePdfPreviewProps {
67
+ src: PdfPreviewProps['src'];
68
+ open?: boolean;
69
+ onOpenChange?: (open: boolean) => void;
70
+ onError?: (error: PdfPreviewError) => void;
71
+ onLoad?: () => void;
72
+ }
73
+ /** Return value of usePdfPreview — provides state and handlers to the main component. */
74
+ export interface UsePdfPreviewReturn {
75
+ open: boolean;
76
+ handleOpenChange: (open: boolean) => void;
77
+ status: PdfPreviewStatus;
78
+ resolvedUrl: string | null;
79
+ error: PdfPreviewError | null;
80
+ retry: () => void;
81
+ }
@@ -37,5 +37,6 @@ export * from './components/primitives/chart-card';
37
37
  export * from './components/radio-card/radio-card';
38
38
  export * from './components/z2map';
39
39
  export * from './components/kpi-card';
40
+ export * from './components/pdf-preview';
40
41
  export * from './lib/theme.hook';
41
42
  export * from './lib/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.147",
3
+ "version": "0.1.148",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",