@gaulatti/bleecker 0.1.29 → 0.1.31
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/area-chart.d.ts +13 -0
- package/dist/components/area-chart.js +9 -0
- package/dist/components/bar-chart.d.ts +13 -0
- package/dist/components/bar-chart.js +6 -0
- package/dist/components/button.d.ts +3 -1
- package/dist/components/button.js +6 -2
- package/dist/components/chart-theme.d.ts +46 -0
- package/dist/components/chart-theme.js +56 -0
- package/dist/components/chart.js +3 -10
- package/dist/components/dashboard-grid.d.ts +13 -0
- package/dist/components/dashboard-grid.js +8 -0
- package/dist/components/dashboard-section.d.ts +10 -0
- package/dist/components/dashboard-section.js +5 -0
- package/dist/components/data-list.d.ts +13 -0
- package/dist/components/data-list.js +5 -0
- package/dist/components/data-table-column-toggle.d.ts +7 -0
- package/dist/components/data-table-column-toggle.js +27 -0
- package/dist/components/data-table-filters.d.ts +22 -0
- package/dist/components/data-table-filters.js +11 -0
- package/dist/components/data-table-pagination.d.ts +7 -0
- package/dist/components/data-table-pagination.js +11 -0
- package/dist/components/data-table-toolbar.d.ts +11 -0
- package/dist/components/data-table-toolbar.js +9 -0
- package/dist/components/date-range-picker.d.ts +15 -0
- package/dist/components/date-range-picker.js +17 -0
- package/dist/components/donut-chart.d.ts +9 -0
- package/dist/components/donut-chart.js +5 -0
- package/dist/components/dropdown-menu.d.ts +27 -0
- package/dist/components/dropdown-menu.js +32 -0
- package/dist/components/error-state.d.ts +10 -0
- package/dist/components/error-state.js +7 -0
- package/dist/components/filter-chip.d.ts +13 -0
- package/dist/components/filter-chip.js +11 -0
- package/dist/components/funnel-chart.d.ts +12 -0
- package/dist/components/funnel-chart.js +10 -0
- package/dist/components/line-chart.d.ts +12 -0
- package/dist/components/line-chart.js +6 -0
- package/dist/components/loading-overlay.d.ts +8 -0
- package/dist/components/loading-overlay.js +9 -0
- package/dist/components/metric.d.ts +13 -0
- package/dist/components/metric.js +21 -0
- package/dist/components/notification-badge.d.ts +15 -0
- package/dist/components/notification-badge.js +9 -0
- package/dist/components/page-header.d.ts +11 -0
- package/dist/components/page-header.js +8 -0
- package/dist/components/pie-chart.d.ts +14 -0
- package/dist/components/pie-chart.js +6 -0
- package/dist/components/progress-stack.d.ts +14 -0
- package/dist/components/progress-stack.js +9 -0
- package/dist/components/radar-chart.d.ts +15 -0
- package/dist/components/radar-chart.js +9 -0
- package/dist/components/radial-bar-chart.d.ts +15 -0
- package/dist/components/radial-bar-chart.js +10 -0
- package/dist/components/sankey-chart.d.ts +29 -0
- package/dist/components/sankey-chart.js +26 -0
- package/dist/components/scatter-chart.d.ts +19 -0
- package/dist/components/scatter-chart.js +6 -0
- package/dist/components/search-input.d.ts +6 -0
- package/dist/components/search-input.js +9 -0
- package/dist/components/select.js +2 -2
- package/dist/components/sidebar.d.ts +28 -0
- package/dist/components/sidebar.js +26 -0
- package/dist/components/skeleton.d.ts +18 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/sortable-table-header.d.ts +14 -0
- package/dist/components/sortable-table-header.js +11 -0
- package/dist/components/sparkline.d.ts +9 -0
- package/dist/components/sparkline.js +7 -0
- package/dist/components/stat-card.d.ts +19 -0
- package/dist/components/stat-card.js +19 -0
- package/dist/components/stepper.d.ts +16 -0
- package/dist/components/stepper.js +33 -0
- package/dist/components/sunburst-chart.d.ts +14 -0
- package/dist/components/sunburst-chart.js +35 -0
- package/dist/components/table.js +28 -2
- package/dist/components/timeline.d.ts +15 -0
- package/dist/components/timeline.js +15 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +38 -0
- package/dist/layout/admin-shell.d.ts +10 -0
- package/dist/layout/admin-shell.js +5 -0
- package/dist/styles.css +1 -1
- package/dist/utils/format.d.ts +15 -0
- package/dist/utils/format.js +63 -0
- package/dist/utils/hooks.d.ts +22 -0
- package/dist/utils/hooks.js +58 -0
- package/package.json +5 -3
- package/src/styles/global.css +153 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ResponsiveContainer, SunburstChart as RechartsSunburstChart } from 'recharts';
|
|
4
|
+
import { cn } from '../utils/cn.js';
|
|
5
|
+
import { chartTheme } from './chart-theme.js';
|
|
6
|
+
function sumValues(node, dataKey) {
|
|
7
|
+
if (node.children && node.children.length > 0) {
|
|
8
|
+
return node.children.reduce((sum, child) => sum + sumValues(child, dataKey), 0);
|
|
9
|
+
}
|
|
10
|
+
const record = node;
|
|
11
|
+
return typeof record[dataKey] === 'number' ? record[dataKey] : 0;
|
|
12
|
+
}
|
|
13
|
+
function applyPalette(node, index = 0, depth = 0) {
|
|
14
|
+
const color = node.fill ?? chartTheme.palette[index % chartTheme.palette.length];
|
|
15
|
+
const next = {
|
|
16
|
+
...node,
|
|
17
|
+
fill: color
|
|
18
|
+
};
|
|
19
|
+
if (next.children) {
|
|
20
|
+
next.children = next.children.map((child, i) => applyPalette(child, i, depth + 1));
|
|
21
|
+
}
|
|
22
|
+
return next;
|
|
23
|
+
}
|
|
24
|
+
export function SunburstChart({ data, height = 350, dataKey = 'value', nameKey = 'name', className }) {
|
|
25
|
+
const themedData = React.useMemo(() => {
|
|
26
|
+
const withColors = applyPalette(data);
|
|
27
|
+
const total = sumValues(withColors, dataKey);
|
|
28
|
+
const rootRecord = withColors;
|
|
29
|
+
if (total > 0 && typeof rootRecord[dataKey] !== 'number') {
|
|
30
|
+
return { ...withColors, [dataKey]: total };
|
|
31
|
+
}
|
|
32
|
+
return withColors;
|
|
33
|
+
}, [data, dataKey]);
|
|
34
|
+
return (_jsx("div", { className: cn('w-full', className), style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsx(RechartsSunburstChart, { data: themedData, dataKey: dataKey, nameKey: nameKey }) }) }));
|
|
35
|
+
}
|
package/dist/components/table.js
CHANGED
|
@@ -26,8 +26,34 @@ export const TableFooter = React.forwardRef(function TableFooter({ className, ..
|
|
|
26
26
|
return _jsx("tfoot", { ref: ref, className: cn('border-t border-sand/10 bg-sand/5 font-medium dark:border-sand/20 dark:bg-sand/10', className), ...props });
|
|
27
27
|
});
|
|
28
28
|
// ─── TableRow ─────────────────────────────────────────────────────────────────
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
let hoveredRow = null;
|
|
30
|
+
export const TableRow = React.forwardRef(function TableRow({ className, onMouseEnter, onMouseLeave, ...props }, ref) {
|
|
31
|
+
const rowRef = React.useRef(null);
|
|
32
|
+
const mergedRef = React.useCallback((el) => {
|
|
33
|
+
rowRef.current = el;
|
|
34
|
+
if (typeof ref === 'function')
|
|
35
|
+
ref(el);
|
|
36
|
+
else if (ref)
|
|
37
|
+
ref.current = el;
|
|
38
|
+
}, [ref]);
|
|
39
|
+
const handleMouseEnter = React.useCallback((e) => {
|
|
40
|
+
onMouseEnter?.(e);
|
|
41
|
+
const el = rowRef.current;
|
|
42
|
+
if (!el)
|
|
43
|
+
return;
|
|
44
|
+
const prev = hoveredRow;
|
|
45
|
+
hoveredRow = el;
|
|
46
|
+
if (prev && prev !== el) {
|
|
47
|
+
el.style.transition = 'none';
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
el.style.transition = '';
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, [onMouseEnter]);
|
|
53
|
+
const handleMouseLeave = React.useCallback((e) => {
|
|
54
|
+
onMouseLeave?.(e);
|
|
55
|
+
}, [onMouseLeave]);
|
|
56
|
+
return (_jsx("tr", { ref: mergedRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, className: cn('border-b border-sand/10 data-[selected=true]:bg-sea/5 dark:border-sand/20 dark:data-[selected=true]:bg-accent-blue/10', 'hover:bg-black/[0.04] dark:hover:bg-white/[0.05]', 'transition-colors duration-150', className), ...props }));
|
|
31
57
|
});
|
|
32
58
|
// ─── TableHead (<th>) ─────────────────────────────────────────────────────────
|
|
33
59
|
export const TableHead = React.forwardRef(function TableHead({ className, ...props }, ref) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type TimelineStatus = 'completed' | 'active' | 'pending' | 'error';
|
|
3
|
+
export interface TimelineItem {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
status?: TimelineStatus;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface TimelineProps {
|
|
12
|
+
items: TimelineItem[];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Timeline({ items, className }: TimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils/cn.js';
|
|
3
|
+
const statusClasses = {
|
|
4
|
+
completed: 'bg-sea text-white ring-sea dark:bg-accent-blue dark:ring-accent-blue',
|
|
5
|
+
active: 'bg-desert text-white ring-desert dark:bg-accent-gold dark:ring-accent-gold',
|
|
6
|
+
pending: 'bg-sand/20 text-text-secondary ring-sand/40 dark:bg-sand/20 dark:text-text-secondary',
|
|
7
|
+
error: 'bg-terracotta text-white ring-terracotta'
|
|
8
|
+
};
|
|
9
|
+
export function Timeline({ items, className }) {
|
|
10
|
+
return (_jsx("div", { className: cn('relative space-y-0', className), children: items.map((item, index) => {
|
|
11
|
+
const status = item.status ?? (index === 0 ? 'active' : 'pending');
|
|
12
|
+
const isLast = index === items.length - 1;
|
|
13
|
+
return (_jsxs("div", { className: 'relative flex gap-4 pb-6 last:pb-0', children: [!isLast && (_jsx("div", { className: 'absolute left-[17px] top-8 h-full w-px bg-sand/20 dark:bg-sand/20' })), _jsx("div", { className: cn('relative z-10 flex h-9 w-9 shrink-0 items-center justify-center rounded-full ring-2 ring-offset-2 ring-offset-background dark:ring-offset-background', statusClasses[status]), children: item.icon ?? _jsx("span", { className: 'text-xs font-bold', children: index + 1 }) }), _jsxs("div", { className: 'flex-1 pt-1', children: [_jsxs("div", { className: 'flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between', children: [_jsx("p", { className: 'text-sm font-semibold text-text-primary dark:text-text-primary', children: item.title }), item.timestamp && (_jsx("time", { className: 'text-xs text-text-secondary dark:text-text-secondary', children: item.timestamp }))] }), item.description && (_jsx("p", { className: 'mt-0.5 text-sm text-text-secondary dark:text-text-secondary', children: item.description }))] })] }, item.id));
|
|
14
|
+
}) }));
|
|
15
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,40 @@ export * from './components/button';
|
|
|
5
5
|
export * from './components/button-group';
|
|
6
6
|
export * from './components/card';
|
|
7
7
|
export * from './components/chart';
|
|
8
|
+
export * from './components/chart-theme';
|
|
9
|
+
export * from './components/line-chart';
|
|
10
|
+
export * from './components/bar-chart';
|
|
11
|
+
export * from './components/area-chart';
|
|
12
|
+
export * from './components/pie-chart';
|
|
13
|
+
export * from './components/donut-chart';
|
|
14
|
+
export * from './components/sparkline';
|
|
15
|
+
export * from './components/scatter-chart';
|
|
16
|
+
export * from './components/radar-chart';
|
|
17
|
+
export * from './components/radial-bar-chart';
|
|
18
|
+
export * from './components/funnel-chart';
|
|
19
|
+
export * from './components/sankey-chart';
|
|
20
|
+
export * from './components/sunburst-chart';
|
|
21
|
+
export * from './components/stat-card';
|
|
22
|
+
export * from './components/dashboard-grid';
|
|
23
|
+
export * from './components/dashboard-section';
|
|
24
|
+
export * from './components/page-header';
|
|
25
|
+
export * from './components/sidebar';
|
|
26
|
+
export * from './components/data-table-toolbar';
|
|
27
|
+
export * from './components/data-table-filters';
|
|
28
|
+
export * from './components/data-table-column-toggle';
|
|
29
|
+
export * from './components/data-table-pagination';
|
|
30
|
+
export * from './components/skeleton';
|
|
31
|
+
export * from './components/stepper';
|
|
32
|
+
export * from './components/timeline';
|
|
33
|
+
export * from './components/data-list';
|
|
34
|
+
export * from './components/error-state';
|
|
35
|
+
export * from './components/loading-overlay';
|
|
36
|
+
export * from './components/date-range-picker';
|
|
37
|
+
export * from './components/filter-chip';
|
|
38
|
+
export * from './components/search-input';
|
|
39
|
+
export * from './components/dropdown-menu';
|
|
40
|
+
export * from './components/metric';
|
|
41
|
+
export * from './components/notification-badge';
|
|
8
42
|
export * from './components/accordion';
|
|
9
43
|
export * from './components/alert';
|
|
10
44
|
export * from './components/alert-dialog';
|
|
@@ -24,6 +58,7 @@ export * from './components/navigation-menu';
|
|
|
24
58
|
export * from './components/otp-input';
|
|
25
59
|
export * from './components/popover';
|
|
26
60
|
export * from './components/progress';
|
|
61
|
+
export * from './components/progress-stack';
|
|
27
62
|
export * from './components/radio-group';
|
|
28
63
|
export * from './components/checkbox';
|
|
29
64
|
export * from './components/scroll-area';
|
|
@@ -60,6 +95,7 @@ export { DataTable as TanStackDataTable } from './components/data-table';
|
|
|
60
95
|
export * from './components/tabs';
|
|
61
96
|
export * from './components/theme-toggle';
|
|
62
97
|
export * from './layout/app-shell';
|
|
98
|
+
export * from './layout/admin-shell';
|
|
63
99
|
export * from './layout/footer';
|
|
64
100
|
export * from './layout/header';
|
|
65
101
|
export * from './layout/panel-layout';
|
|
@@ -68,3 +104,5 @@ export * from './theme/theme-provider';
|
|
|
68
104
|
export * from './theme/theme-script';
|
|
69
105
|
export * from './theme/types';
|
|
70
106
|
export * from './utils/cn';
|
|
107
|
+
export * from './utils/format';
|
|
108
|
+
export * from './utils/hooks';
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,40 @@ export * from './components/button.js';
|
|
|
5
5
|
export * from './components/button-group.js';
|
|
6
6
|
export * from './components/card.js';
|
|
7
7
|
export * from './components/chart.js';
|
|
8
|
+
export * from './components/chart-theme.js';
|
|
9
|
+
export * from './components/line-chart.js';
|
|
10
|
+
export * from './components/bar-chart.js';
|
|
11
|
+
export * from './components/area-chart.js';
|
|
12
|
+
export * from './components/pie-chart.js';
|
|
13
|
+
export * from './components/donut-chart.js';
|
|
14
|
+
export * from './components/sparkline.js';
|
|
15
|
+
export * from './components/scatter-chart.js';
|
|
16
|
+
export * from './components/radar-chart.js';
|
|
17
|
+
export * from './components/radial-bar-chart.js';
|
|
18
|
+
export * from './components/funnel-chart.js';
|
|
19
|
+
export * from './components/sankey-chart.js';
|
|
20
|
+
export * from './components/sunburst-chart.js';
|
|
21
|
+
export * from './components/stat-card.js';
|
|
22
|
+
export * from './components/dashboard-grid.js';
|
|
23
|
+
export * from './components/dashboard-section.js';
|
|
24
|
+
export * from './components/page-header.js';
|
|
25
|
+
export * from './components/sidebar.js';
|
|
26
|
+
export * from './components/data-table-toolbar.js';
|
|
27
|
+
export * from './components/data-table-filters.js';
|
|
28
|
+
export * from './components/data-table-column-toggle.js';
|
|
29
|
+
export * from './components/data-table-pagination.js';
|
|
30
|
+
export * from './components/skeleton.js';
|
|
31
|
+
export * from './components/stepper.js';
|
|
32
|
+
export * from './components/timeline.js';
|
|
33
|
+
export * from './components/data-list.js';
|
|
34
|
+
export * from './components/error-state.js';
|
|
35
|
+
export * from './components/loading-overlay.js';
|
|
36
|
+
export * from './components/date-range-picker.js';
|
|
37
|
+
export * from './components/filter-chip.js';
|
|
38
|
+
export * from './components/search-input.js';
|
|
39
|
+
export * from './components/dropdown-menu.js';
|
|
40
|
+
export * from './components/metric.js';
|
|
41
|
+
export * from './components/notification-badge.js';
|
|
8
42
|
export * from './components/accordion.js';
|
|
9
43
|
export * from './components/alert.js';
|
|
10
44
|
export * from './components/alert-dialog.js';
|
|
@@ -24,6 +58,7 @@ export * from './components/navigation-menu.js';
|
|
|
24
58
|
export * from './components/otp-input.js';
|
|
25
59
|
export * from './components/popover.js';
|
|
26
60
|
export * from './components/progress.js';
|
|
61
|
+
export * from './components/progress-stack.js';
|
|
27
62
|
export * from './components/radio-group.js';
|
|
28
63
|
export * from './components/checkbox.js';
|
|
29
64
|
export * from './components/scroll-area.js';
|
|
@@ -60,6 +95,7 @@ export { DataTable as TanStackDataTable } from './components/data-table.js';
|
|
|
60
95
|
export * from './components/tabs.js';
|
|
61
96
|
export * from './components/theme-toggle.js';
|
|
62
97
|
export * from './layout/app-shell.js';
|
|
98
|
+
export * from './layout/admin-shell.js';
|
|
63
99
|
export * from './layout/footer.js';
|
|
64
100
|
export * from './layout/header.js';
|
|
65
101
|
export * from './layout/panel-layout.js';
|
|
@@ -68,3 +104,5 @@ export * from './theme/theme-provider.js';
|
|
|
68
104
|
export * from './theme/theme-script.js';
|
|
69
105
|
export * from './theme/types.js';
|
|
70
106
|
export * from './utils/cn.js';
|
|
107
|
+
export * from './utils/format.js';
|
|
108
|
+
export * from './utils/hooks.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface AdminShellProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
sidebar?: React.ReactNode;
|
|
6
|
+
header?: React.ReactNode;
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
contentClassName?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function AdminShell({ children, className, sidebar, header, footer, contentClassName }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils/cn.js';
|
|
3
|
+
export function AdminShell({ children, className, sidebar, header, footer, contentClassName }) {
|
|
4
|
+
return (_jsxs("div", { className: cn('flex min-h-screen flex-col bg-background text-foreground', className), children: [header, _jsxs("div", { className: 'flex flex-1 overflow-hidden', children: [sidebar, _jsxs("main", { className: cn('flex flex-1 flex-col min-h-0 overflow-y-auto scrollbar-thin bg-background', contentClassName), children: [_jsx("div", { className: 'flex-1 p-4 sm:p-6 lg:p-8', children: children }), footer && _jsx("div", { className: 'border-t border-border px-4 py-4 sm:px-6 lg:px-8', children: footer })] })] })] }));
|
|
5
|
+
}
|