@lindaui/blocks 0.0.2
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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/area-chart.d.ts +11 -0
- package/dist/area-chart.d.ts.map +1 -0
- package/dist/area-chart.js +65 -0
- package/dist/auth-layout.d.ts +26 -0
- package/dist/auth-layout.d.ts.map +1 -0
- package/dist/auth-layout.js +85 -0
- package/dist/auth-provider.d.ts +13 -0
- package/dist/auth-provider.d.ts.map +1 -0
- package/dist/auth-provider.js +20 -0
- package/dist/bar-chart.d.ts +11 -0
- package/dist/bar-chart.d.ts.map +1 -0
- package/dist/bar-chart.js +64 -0
- package/dist/chart-card.d.ts +11 -0
- package/dist/chart-card.d.ts.map +1 -0
- package/dist/chart-card.js +43 -0
- package/dist/confirm-dialog.d.ts +19 -0
- package/dist/confirm-dialog.d.ts.map +1 -0
- package/dist/confirm-dialog.js +57 -0
- package/dist/detail-panel.d.ts +25 -0
- package/dist/detail-panel.d.ts.map +1 -0
- package/dist/detail-panel.js +116 -0
- package/dist/document-panel.d.ts +15 -0
- package/dist/document-panel.d.ts.map +1 -0
- package/dist/document-panel.js +80 -0
- package/dist/document-reader.d.ts +5 -0
- package/dist/document-reader.d.ts.map +1 -0
- package/dist/document-reader.js +27 -0
- package/dist/field-array-form.d.ts +30 -0
- package/dist/field-array-form.d.ts.map +1 -0
- package/dist/field-array-form.js +132 -0
- package/dist/image-viewer.d.ts +14 -0
- package/dist/image-viewer.d.ts.map +1 -0
- package/dist/image-viewer.js +108 -0
- package/dist/line-chart.d.ts +11 -0
- package/dist/line-chart.d.ts.map +1 -0
- package/dist/line-chart.js +44 -0
- package/dist/list-item.d.ts +16 -0
- package/dist/list-item.d.ts.map +1 -0
- package/dist/list-item.js +50 -0
- package/dist/list-pane.d.ts +27 -0
- package/dist/list-pane.d.ts.map +1 -0
- package/dist/list-pane.js +136 -0
- package/dist/login-form.d.ts +18 -0
- package/dist/login-form.d.ts.map +1 -0
- package/dist/login-form.js +109 -0
- package/dist/pie-chart.d.ts +12 -0
- package/dist/pie-chart.d.ts.map +1 -0
- package/dist/pie-chart.js +49 -0
- package/dist/radar-chart.d.ts +11 -0
- package/dist/radar-chart.d.ts.map +1 -0
- package/dist/radar-chart.js +37 -0
- package/dist/radial-chart.d.ts +12 -0
- package/dist/radial-chart.d.ts.map +1 -0
- package/dist/radial-chart.js +91 -0
- package/dist/recording-overlay.d.ts +13 -0
- package/dist/recording-overlay.d.ts.map +1 -0
- package/dist/recording-overlay.js +128 -0
- package/dist/split-workspace.d.ts +9 -0
- package/dist/split-workspace.d.ts.map +1 -0
- package/dist/split-workspace.js +50 -0
- package/dist/stat-card.d.ts +27 -0
- package/dist/stat-card.d.ts.map +1 -0
- package/dist/stat-card.js +166 -0
- package/dist/stats-grid.d.ts +8 -0
- package/dist/stats-grid.d.ts.map +1 -0
- package/dist/stats-grid.js +15 -0
- package/package.json +149 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Franco Carballar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @lindaui/blocks
|
|
2
|
+
|
|
3
|
+
Composed UI sections built on **@lindaui/ui** — auth flows, lists, master-detail
|
|
4
|
+
panels, and charts. This is an importable npm package, **not** a copy-paste /
|
|
5
|
+
shadcn-style registry: you `import` the blocks, you don't vendor their source.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @lindaui/blocks @lindaui/ui @lindaui/tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependencies: `react >=19`, `react-dom >=19`, `react-hook-form >=7`,
|
|
14
|
+
`lucide-react` (icons), and `recharts` (chart blocks).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import "@lindaui/tokens/css";
|
|
20
|
+
import { LoginForm } from "@lindaui/blocks/login-form";
|
|
21
|
+
import { BarChart } from "@lindaui/blocks/bar-chart";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Controlled blocks (`list-pane`, `detail-panel`, `document-panel`,
|
|
25
|
+
`split-workspace`, `confirm-dialog`) receive state + handlers. There is zero
|
|
26
|
+
data-fetching / backend in the library — you wire that up.
|
|
27
|
+
|
|
28
|
+
## Catalog
|
|
29
|
+
|
|
30
|
+
**UI sections:** `login-form`, `auth-layout`, `auth-provider`,
|
|
31
|
+
`field-array-form`, `list-item`, `list-pane`, `detail-panel`, `confirm-dialog`,
|
|
32
|
+
`image-viewer`, `document-panel`, `document-reader`, `recording-overlay`,
|
|
33
|
+
`split-workspace`.
|
|
34
|
+
|
|
35
|
+
**Charts** (on `@lindaui/ui/chart`): `area-chart`, `bar-chart`, `line-chart`,
|
|
36
|
+
`pie-chart`, `radar-chart`, `radial-chart`, `stat-card`, `chart-card`,
|
|
37
|
+
`stats-grid`.
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChartConfig } from "@lindaui/ui/chart";
|
|
2
|
+
export interface AreaChartProps {
|
|
3
|
+
data: Array<Record<string, string | number>>;
|
|
4
|
+
config: ChartConfig;
|
|
5
|
+
categoryKey: string;
|
|
6
|
+
series: string[];
|
|
7
|
+
variant?: "default" | "stacked" | "gradient";
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function AreaChart({ data, config, categoryKey, series, variant, className, }: AreaChartProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=area-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area-chart.d.ts","sourceRoot":"","sources":["../src/area-chart.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAmB,EACnB,SAAS,GACV,EAAE,cAAc,+BAmDhB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@lindaui/ui/chart';
|
|
4
|
+
import { AreaChart as AreaChart$1, CartesianGrid, XAxis, YAxis, Area } from 'recharts';
|
|
5
|
+
|
|
6
|
+
function AreaChart({ data, config, categoryKey, series, variant = "default", className }) {
|
|
7
|
+
const isStacked = variant === "stacked";
|
|
8
|
+
const isGradient = variant === "gradient";
|
|
9
|
+
return /*#__PURE__*/ jsx(ChartContainer, {
|
|
10
|
+
config: config,
|
|
11
|
+
className: className,
|
|
12
|
+
children: /*#__PURE__*/ jsxs(AreaChart$1, {
|
|
13
|
+
data: data,
|
|
14
|
+
children: [
|
|
15
|
+
isGradient && /*#__PURE__*/ jsx("defs", {
|
|
16
|
+
children: series.map((key)=>/*#__PURE__*/ jsxs("linearGradient", {
|
|
17
|
+
id: `gradient-${key}`,
|
|
18
|
+
x1: "0",
|
|
19
|
+
y1: "0",
|
|
20
|
+
x2: "0",
|
|
21
|
+
y2: "1",
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ jsx("stop", {
|
|
24
|
+
offset: "5%",
|
|
25
|
+
stopColor: `var(--color-${key})`,
|
|
26
|
+
stopOpacity: 0.8
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx("stop", {
|
|
29
|
+
offset: "95%",
|
|
30
|
+
stopColor: `var(--color-${key})`,
|
|
31
|
+
stopOpacity: 0.1
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}, key))
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsx(CartesianGrid, {
|
|
37
|
+
vertical: false
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsx(XAxis, {
|
|
40
|
+
dataKey: categoryKey,
|
|
41
|
+
tickLine: false,
|
|
42
|
+
axisLine: false
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ jsx(YAxis, {
|
|
45
|
+
tickLine: false,
|
|
46
|
+
axisLine: false
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ jsx(ChartTooltip, {
|
|
49
|
+
content: /*#__PURE__*/ jsx(ChartTooltipContent, {})
|
|
50
|
+
}),
|
|
51
|
+
series.length > 1 && /*#__PURE__*/ jsx(ChartLegend, {
|
|
52
|
+
content: /*#__PURE__*/ jsx(ChartLegendContent, {})
|
|
53
|
+
}),
|
|
54
|
+
series.map((key)=>/*#__PURE__*/ jsx(Area, {
|
|
55
|
+
dataKey: key,
|
|
56
|
+
fill: isGradient ? `url(#gradient-${key})` : `var(--color-${key})`,
|
|
57
|
+
stroke: `var(--color-${key})`,
|
|
58
|
+
stackId: isStacked ? "a" : undefined
|
|
59
|
+
}, key))
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AreaChart };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface AuthFeature {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthLayoutProps {
|
|
7
|
+
/** Marca (logo) del panel de marca (desktop). */
|
|
8
|
+
logo?: ReactNode;
|
|
9
|
+
/** Logo compacto del panel de contenido (mobile). Si no se pasa, usa `logo`. */
|
|
10
|
+
compactLogo?: ReactNode;
|
|
11
|
+
/** Contenido del panel de marca (solo desktop). Si no hay headline ni
|
|
12
|
+
* features, el panel de marca se omite y queda solo el form centrado. */
|
|
13
|
+
brandHeadline?: ReactNode;
|
|
14
|
+
brandDescription?: ReactNode;
|
|
15
|
+
brandFeatures?: AuthFeature[];
|
|
16
|
+
brandFooter?: ReactNode;
|
|
17
|
+
/** Panel de contenido. */
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
description?: ReactNode;
|
|
20
|
+
/** Nota al pie del panel de contenido (ej. "sesión protegida"). */
|
|
21
|
+
footer?: ReactNode;
|
|
22
|
+
/** El formulario u otro contenido de auth. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function AuthLayout({ logo, compactLogo, brandHeadline, brandDescription, brandFeatures, brandFooter, title, description, footer, children, }: AuthLayoutProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=auth-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-layout.d.ts","sourceRoot":"","sources":["../src/auth-layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;8EAC0E;IAC1E,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0BAA0B;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,+BAsFjB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function AuthLayout({ logo, compactLogo, brandHeadline, brandDescription, brandFeatures, brandFooter, title, description, footer, children }) {
|
|
5
|
+
const hasBrand = brandHeadline != null || brandDescription != null || brandFeatures != null && brandFeatures.length > 0 || brandFooter != null;
|
|
6
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
7
|
+
className: hasBrand ? "flex min-h-dvh flex-col lg:grid lg:grid-cols-[1.05fr_0.95fr]" : "flex min-h-dvh flex-col",
|
|
8
|
+
children: [
|
|
9
|
+
hasBrand && /*#__PURE__*/ jsxs("div", {
|
|
10
|
+
className: "relative hidden flex-col justify-between bg-viewer-bg p-12 text-viewer-foreground lg:flex",
|
|
11
|
+
style: {
|
|
12
|
+
backgroundImage: "repeating-linear-gradient(135deg, color-mix(in oklch, var(--viewer-foreground) 3%, transparent) 0 2px, transparent 2px 13px)"
|
|
13
|
+
},
|
|
14
|
+
children: [
|
|
15
|
+
logo && /*#__PURE__*/ jsx("div", {
|
|
16
|
+
className: "flex items-center gap-2.5",
|
|
17
|
+
children: logo
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ jsxs("div", {
|
|
20
|
+
className: "max-w-md",
|
|
21
|
+
children: [
|
|
22
|
+
brandHeadline && /*#__PURE__*/ jsx("h1", {
|
|
23
|
+
className: "text-3xl font-semibold leading-tight tracking-tight",
|
|
24
|
+
children: brandHeadline
|
|
25
|
+
}),
|
|
26
|
+
brandDescription && /*#__PURE__*/ jsx("p", {
|
|
27
|
+
className: "mt-4 text-sm leading-relaxed opacity-70",
|
|
28
|
+
children: brandDescription
|
|
29
|
+
}),
|
|
30
|
+
brandFeatures && brandFeatures.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
31
|
+
className: "mt-7 flex gap-6",
|
|
32
|
+
children: brandFeatures.map((f, i)=>/*#__PURE__*/ jsxs("div", {
|
|
33
|
+
className: "flex items-center gap-2 text-sm opacity-80",
|
|
34
|
+
children: [
|
|
35
|
+
f.icon,
|
|
36
|
+
f.label
|
|
37
|
+
]
|
|
38
|
+
}, i))
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
brandFooter ? /*#__PURE__*/ jsx("p", {
|
|
43
|
+
className: "text-xs opacity-40",
|
|
44
|
+
children: brandFooter
|
|
45
|
+
}) : /*#__PURE__*/ jsx("span", {
|
|
46
|
+
"aria-hidden": true
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ jsxs("div", {
|
|
51
|
+
className: "flex flex-1 flex-col justify-between p-6 pt-[max(env(safe-area-inset-top),2rem)] lg:justify-center lg:p-10 lg:pb-10",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsxs("div", {
|
|
54
|
+
className: "mx-auto w-full max-w-[360px]",
|
|
55
|
+
children: [
|
|
56
|
+
(compactLogo ?? logo) && hasBrand && /*#__PURE__*/ jsx("div", {
|
|
57
|
+
className: "mb-10 flex items-center gap-2.5 lg:hidden",
|
|
58
|
+
children: compactLogo ?? logo
|
|
59
|
+
}),
|
|
60
|
+
(compactLogo ?? logo) && !hasBrand && /*#__PURE__*/ jsx("div", {
|
|
61
|
+
className: "mb-10 flex items-center gap-2.5",
|
|
62
|
+
children: compactLogo ?? logo
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ jsx("h2", {
|
|
65
|
+
className: "mb-1.5 text-[28px] font-semibold tracking-tight lg:text-2xl",
|
|
66
|
+
children: title
|
|
67
|
+
}),
|
|
68
|
+
description && /*#__PURE__*/ jsx("p", {
|
|
69
|
+
className: "mb-7 text-sm text-muted-foreground",
|
|
70
|
+
children: description
|
|
71
|
+
}),
|
|
72
|
+
children
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
footer && /*#__PURE__*/ jsx("div", {
|
|
76
|
+
className: "mx-auto mt-10 flex w-full max-w-[360px] items-center justify-center gap-1.5 text-xs text-muted-foreground lg:mt-6",
|
|
77
|
+
children: footer
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { AuthLayout };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface AuthUser {
|
|
3
|
+
name?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare function AuthProvider({ user, children, }: {
|
|
7
|
+
user: AuthUser | null;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function useAuth(): {
|
|
11
|
+
user: AuthUser | null;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=auth-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-provider.d.ts","sourceRoot":"","sources":["../src/auth-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAQD,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAIA;AAED,wBAAgB,OAAO,IAAI;IAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,CAEnD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useContext, createContext } from 'react';
|
|
4
|
+
|
|
5
|
+
const AuthContext = /*#__PURE__*/ createContext({
|
|
6
|
+
user: null
|
|
7
|
+
});
|
|
8
|
+
function AuthProvider({ user, children }) {
|
|
9
|
+
return /*#__PURE__*/ jsx(AuthContext.Provider, {
|
|
10
|
+
value: {
|
|
11
|
+
user
|
|
12
|
+
},
|
|
13
|
+
children: children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function useAuth() {
|
|
17
|
+
return useContext(AuthContext);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { AuthProvider, useAuth };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChartConfig } from "@lindaui/ui/chart";
|
|
2
|
+
export interface BarChartProps {
|
|
3
|
+
data: Array<Record<string, string | number>>;
|
|
4
|
+
config: ChartConfig;
|
|
5
|
+
categoryKey: string;
|
|
6
|
+
series: string[];
|
|
7
|
+
variant?: "default" | "stacked" | "grouped" | "horizontal";
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function BarChart({ data, config, categoryKey, series, variant, className, }: BarChartProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=bar-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-chart.d.ts","sourceRoot":"","sources":["../src/bar-chart.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAmB,EACnB,SAAS,GACV,EAAE,aAAa,+BA4Cf"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@lindaui/ui/chart';
|
|
4
|
+
import { BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Bar } from 'recharts';
|
|
5
|
+
|
|
6
|
+
function BarChart({ data, config, categoryKey, series, variant = "default", className }) {
|
|
7
|
+
const isHorizontal = variant === "horizontal";
|
|
8
|
+
const isStacked = variant === "stacked";
|
|
9
|
+
return /*#__PURE__*/ jsx(ChartContainer, {
|
|
10
|
+
config: config,
|
|
11
|
+
className: className,
|
|
12
|
+
children: /*#__PURE__*/ jsxs(BarChart$1, {
|
|
13
|
+
data: data,
|
|
14
|
+
layout: isHorizontal ? "vertical" : "horizontal",
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ jsx(CartesianGrid, {
|
|
17
|
+
vertical: isHorizontal,
|
|
18
|
+
horizontal: !isHorizontal
|
|
19
|
+
}),
|
|
20
|
+
isHorizontal ? /*#__PURE__*/ jsxs(Fragment, {
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ jsx(XAxis, {
|
|
23
|
+
type: "number",
|
|
24
|
+
tickLine: false,
|
|
25
|
+
axisLine: false
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx(YAxis, {
|
|
28
|
+
dataKey: categoryKey,
|
|
29
|
+
type: "category",
|
|
30
|
+
tickLine: false,
|
|
31
|
+
axisLine: false
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ jsx(XAxis, {
|
|
37
|
+
dataKey: categoryKey,
|
|
38
|
+
tickLine: false,
|
|
39
|
+
axisLine: false
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ jsx(YAxis, {
|
|
42
|
+
tickLine: false,
|
|
43
|
+
axisLine: false
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx(ChartTooltip, {
|
|
48
|
+
content: /*#__PURE__*/ jsx(ChartTooltipContent, {})
|
|
49
|
+
}),
|
|
50
|
+
series.length > 1 && /*#__PURE__*/ jsx(ChartLegend, {
|
|
51
|
+
content: /*#__PURE__*/ jsx(ChartLegendContent, {})
|
|
52
|
+
}),
|
|
53
|
+
series.map((key)=>/*#__PURE__*/ jsx(Bar, {
|
|
54
|
+
dataKey: key,
|
|
55
|
+
fill: `var(--color-${key})`,
|
|
56
|
+
stackId: isStacked ? "a" : undefined,
|
|
57
|
+
radius: 4
|
|
58
|
+
}, key))
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { BarChart };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ChartCardProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
action?: ReactNode;
|
|
6
|
+
footer?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ChartCard({ title, description, action, footer, children, className, }: ChartCardProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=chart-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-card.d.ts","sourceRoot":"","sources":["../src/chart-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAc,GACf,EAAE,cAAc,+BAkBhB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@lindaui/ui/card';
|
|
3
|
+
|
|
4
|
+
function ChartCard({ title, description, action, footer, children, className = "" }) {
|
|
5
|
+
return /*#__PURE__*/ jsxs(Card, {
|
|
6
|
+
className: className,
|
|
7
|
+
children: [
|
|
8
|
+
/*#__PURE__*/ jsx(CardHeader, {
|
|
9
|
+
className: "pb-2",
|
|
10
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
11
|
+
className: "flex items-start justify-between gap-4",
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsxs("div", {
|
|
14
|
+
className: "min-w-0 flex-1",
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ jsx(CardTitle, {
|
|
17
|
+
children: title
|
|
18
|
+
}),
|
|
19
|
+
description && /*#__PURE__*/ jsx(CardDescription, {
|
|
20
|
+
className: "mt-1",
|
|
21
|
+
children: description
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
}),
|
|
25
|
+
action && /*#__PURE__*/ jsx("div", {
|
|
26
|
+
className: "shrink-0",
|
|
27
|
+
children: action
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ jsx(CardContent, {
|
|
33
|
+
className: "pt-0",
|
|
34
|
+
children: children
|
|
35
|
+
}),
|
|
36
|
+
footer && /*#__PURE__*/ jsx(CardFooter, {
|
|
37
|
+
children: footer
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { ChartCard };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ConfirmDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
confirmLabel?: string;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Acción irreversible: botón de confirmar en rojo + icon box destructivo. */
|
|
12
|
+
destructive?: boolean;
|
|
13
|
+
/** Chip del actor responsable (ej. firmante) bajo la descripción. */
|
|
14
|
+
identity?: {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function ConfirmDialog({ open, onOpenChange, onConfirm, title, description, confirmLabel, cancelLabel, icon, destructive, identity, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../src/confirm-dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B;AAYD,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAA0B,EAC1B,WAAwB,EACxB,IAAI,EACJ,WAAmB,EACnB,QAAQ,GACT,EAAE,kBAAkB,+BA2CpB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Dialog } from '@lindaui/ui/dialog';
|
|
4
|
+
import { Button } from '@lindaui/ui/button';
|
|
5
|
+
|
|
6
|
+
function getInitials(name) {
|
|
7
|
+
return name.split(" ").filter((p)=>p.length > 0).map((p)=>p[0]).join("").slice(0, 2).toUpperCase();
|
|
8
|
+
}
|
|
9
|
+
function ConfirmDialog({ open, onOpenChange, onConfirm, title, description, confirmLabel = "Confirmar", cancelLabel = "Cancelar", icon, destructive = false, identity }) {
|
|
10
|
+
return /*#__PURE__*/ jsxs(Dialog, {
|
|
11
|
+
open: open,
|
|
12
|
+
onClose: ()=>onOpenChange(false),
|
|
13
|
+
title: title,
|
|
14
|
+
footer: /*#__PURE__*/ jsxs("div", {
|
|
15
|
+
className: "flex flex-col-reverse gap-2 w-full sm:flex-row sm:justify-end sm:w-auto",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx(Button, {
|
|
18
|
+
variant: "ghost",
|
|
19
|
+
onPress: ()=>onOpenChange(false),
|
|
20
|
+
className: "w-full sm:w-auto",
|
|
21
|
+
children: cancelLabel
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx(Button, {
|
|
24
|
+
variant: destructive ? "danger" : "primary",
|
|
25
|
+
onPress: onConfirm,
|
|
26
|
+
className: "w-full sm:w-auto",
|
|
27
|
+
children: confirmLabel
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
children: [
|
|
32
|
+
icon && /*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: `w-10 h-10 rounded-[10px] grid place-items-center mb-3.5 ${destructive ? "bg-destructive/10 text-destructive" : "bg-primary/10 text-primary"}`,
|
|
34
|
+
children: icon
|
|
35
|
+
}),
|
|
36
|
+
description && /*#__PURE__*/ jsx("p", {
|
|
37
|
+
className: "text-sm text-muted-foreground",
|
|
38
|
+
children: description
|
|
39
|
+
}),
|
|
40
|
+
identity && /*#__PURE__*/ jsxs("div", {
|
|
41
|
+
className: "mt-4 px-3.5 py-3 rounded-[calc(var(--radius)-2px)] bg-muted flex items-center gap-2.5",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ jsx("div", {
|
|
44
|
+
className: "w-8 h-8 rounded-full bg-secondary text-secondary-foreground grid place-items-center text-xs font-semibold shrink-0",
|
|
45
|
+
children: getInitials(identity.name)
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx("span", {
|
|
48
|
+
className: "text-xs font-semibold",
|
|
49
|
+
children: identity.name
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { ConfirmDialog };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface DetailPanelMetaRow {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface DetailPanelAction {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
onPress: () => void;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface DetailPanelProps {
|
|
13
|
+
selected?: boolean;
|
|
14
|
+
emptyTitle?: string;
|
|
15
|
+
emptyDescription?: ReactNode;
|
|
16
|
+
emptyIcon?: ReactNode;
|
|
17
|
+
title?: string;
|
|
18
|
+
subtitle?: ReactNode;
|
|
19
|
+
badges?: ReactNode;
|
|
20
|
+
media?: ReactNode;
|
|
21
|
+
meta?: DetailPanelMetaRow[];
|
|
22
|
+
action?: DetailPanelAction;
|
|
23
|
+
}
|
|
24
|
+
export declare function DetailPanel({ selected, emptyTitle, emptyDescription, emptyIcon, title, subtitle, badges, media, meta, action, }: DetailPanelProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=detail-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detail-panel.d.ts","sourceRoot":"","sources":["../src/detail-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAgB,EAChB,UAAqC,EACrC,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,MAAM,GACP,EAAE,gBAAgB,+BA+ElB"}
|