@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.
Files changed (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/dist/area-chart.d.ts +11 -0
  4. package/dist/area-chart.d.ts.map +1 -0
  5. package/dist/area-chart.js +65 -0
  6. package/dist/auth-layout.d.ts +26 -0
  7. package/dist/auth-layout.d.ts.map +1 -0
  8. package/dist/auth-layout.js +85 -0
  9. package/dist/auth-provider.d.ts +13 -0
  10. package/dist/auth-provider.d.ts.map +1 -0
  11. package/dist/auth-provider.js +20 -0
  12. package/dist/bar-chart.d.ts +11 -0
  13. package/dist/bar-chart.d.ts.map +1 -0
  14. package/dist/bar-chart.js +64 -0
  15. package/dist/chart-card.d.ts +11 -0
  16. package/dist/chart-card.d.ts.map +1 -0
  17. package/dist/chart-card.js +43 -0
  18. package/dist/confirm-dialog.d.ts +19 -0
  19. package/dist/confirm-dialog.d.ts.map +1 -0
  20. package/dist/confirm-dialog.js +57 -0
  21. package/dist/detail-panel.d.ts +25 -0
  22. package/dist/detail-panel.d.ts.map +1 -0
  23. package/dist/detail-panel.js +116 -0
  24. package/dist/document-panel.d.ts +15 -0
  25. package/dist/document-panel.d.ts.map +1 -0
  26. package/dist/document-panel.js +80 -0
  27. package/dist/document-reader.d.ts +5 -0
  28. package/dist/document-reader.d.ts.map +1 -0
  29. package/dist/document-reader.js +27 -0
  30. package/dist/field-array-form.d.ts +30 -0
  31. package/dist/field-array-form.d.ts.map +1 -0
  32. package/dist/field-array-form.js +132 -0
  33. package/dist/image-viewer.d.ts +14 -0
  34. package/dist/image-viewer.d.ts.map +1 -0
  35. package/dist/image-viewer.js +108 -0
  36. package/dist/line-chart.d.ts +11 -0
  37. package/dist/line-chart.d.ts.map +1 -0
  38. package/dist/line-chart.js +44 -0
  39. package/dist/list-item.d.ts +16 -0
  40. package/dist/list-item.d.ts.map +1 -0
  41. package/dist/list-item.js +50 -0
  42. package/dist/list-pane.d.ts +27 -0
  43. package/dist/list-pane.d.ts.map +1 -0
  44. package/dist/list-pane.js +136 -0
  45. package/dist/login-form.d.ts +18 -0
  46. package/dist/login-form.d.ts.map +1 -0
  47. package/dist/login-form.js +109 -0
  48. package/dist/pie-chart.d.ts +12 -0
  49. package/dist/pie-chart.d.ts.map +1 -0
  50. package/dist/pie-chart.js +49 -0
  51. package/dist/radar-chart.d.ts +11 -0
  52. package/dist/radar-chart.d.ts.map +1 -0
  53. package/dist/radar-chart.js +37 -0
  54. package/dist/radial-chart.d.ts +12 -0
  55. package/dist/radial-chart.d.ts.map +1 -0
  56. package/dist/radial-chart.js +91 -0
  57. package/dist/recording-overlay.d.ts +13 -0
  58. package/dist/recording-overlay.d.ts.map +1 -0
  59. package/dist/recording-overlay.js +128 -0
  60. package/dist/split-workspace.d.ts +9 -0
  61. package/dist/split-workspace.d.ts.map +1 -0
  62. package/dist/split-workspace.js +50 -0
  63. package/dist/stat-card.d.ts +27 -0
  64. package/dist/stat-card.d.ts.map +1 -0
  65. package/dist/stat-card.js +166 -0
  66. package/dist/stats-grid.d.ts +8 -0
  67. package/dist/stats-grid.d.ts.map +1 -0
  68. package/dist/stats-grid.js +15 -0
  69. package/package.json +149 -0
@@ -0,0 +1,50 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { ChevronRight } from 'lucide-react';
4
+ import { Badge } from '@lindaui/ui/badge';
5
+
6
+ function ListItem({ title, subtitle, meta, leading, badge, selected = false, onSelect, showChevron = false }) {
7
+ return /*#__PURE__*/ jsxs("button", {
8
+ type: "button",
9
+ "aria-pressed": selected,
10
+ onClick: onSelect,
11
+ className: [
12
+ "flex w-full items-center gap-3 border-b border-border px-3 py-3.5 text-left transition-colors sm:px-4",
13
+ "min-h-[72px] cursor-pointer font-[inherit] text-[inherit] active:bg-accent",
14
+ selected ? "bg-primary/5 lg:border-l-2 lg:border-l-primary" : "bg-card hover:bg-accent/50"
15
+ ].join(" "),
16
+ children: [
17
+ leading != null && /*#__PURE__*/ jsx("div", {
18
+ className: "flex-none",
19
+ children: leading
20
+ }),
21
+ /*#__PURE__*/ jsxs("div", {
22
+ className: "min-w-0 flex-1",
23
+ children: [
24
+ /*#__PURE__*/ jsx("div", {
25
+ className: "truncate text-sm font-semibold",
26
+ children: title
27
+ }),
28
+ subtitle != null && /*#__PURE__*/ jsx("div", {
29
+ className: "mt-0.5 truncate text-xs text-muted-foreground",
30
+ children: subtitle
31
+ }),
32
+ meta != null && /*#__PURE__*/ jsx("div", {
33
+ className: "mt-0.5 text-xs text-muted-foreground tabular-nums",
34
+ children: meta
35
+ })
36
+ ]
37
+ }),
38
+ badge != null && /*#__PURE__*/ jsx(Badge, {
39
+ variant: badge.variant ?? "default",
40
+ children: badge.label
41
+ }),
42
+ showChevron && /*#__PURE__*/ jsx(ChevronRight, {
43
+ "aria-hidden": true,
44
+ className: "-mr-1 size-4 flex-none text-muted-foreground/50 lg:hidden"
45
+ })
46
+ ]
47
+ });
48
+ }
49
+
50
+ export { ListItem };
@@ -0,0 +1,27 @@
1
+ import React, { type ReactNode } from "react";
2
+ export interface ListPaneFilter {
3
+ key: string;
4
+ label: string;
5
+ count?: number;
6
+ }
7
+ export interface ListPaneProps {
8
+ filters?: ListPaneFilter[];
9
+ activeFilter?: string;
10
+ onFilterChange?: (key: string) => void;
11
+ searchValue?: string;
12
+ onSearchChange?: (value: string) => void;
13
+ searchPlaceholder?: string;
14
+ searchLabel?: string;
15
+ loading?: boolean;
16
+ error?: string | null;
17
+ onRetry?: () => void;
18
+ errorTitle?: string;
19
+ retryLabel?: string;
20
+ isEmpty?: boolean;
21
+ emptyTitle?: string;
22
+ emptyDescription?: ReactNode;
23
+ emptyIcon?: ReactNode;
24
+ children?: ReactNode;
25
+ }
26
+ export declare function ListPane({ filters, activeFilter, onFilterChange, searchValue, onSearchChange, searchPlaceholder, searchLabel, loading, error, onRetry, errorTitle, retryLabel, isEmpty, emptyTitle, emptyDescription, emptyIcon, children, }: ListPaneProps): React.JSX.Element;
27
+ //# sourceMappingURL=list-pane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-pane.d.ts","sourceRoot":"","sources":["../src/list-pane.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,YAAY,EACZ,cAAc,EACd,WAAgB,EAChB,cAAc,EACd,iBAA4B,EAC5B,WAAsB,EACtB,OAAe,EACf,KAAY,EACZ,OAAO,EACP,UAA8C,EAC9C,UAAyB,EACzB,OAAO,EACP,UAA6B,EAC7B,gBAAgB,EAChB,SAAS,EACT,QAAQ,GACT,EAAE,aAAa,qBAgGf"}
@@ -0,0 +1,136 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React from 'react';
4
+ import { Search, AlertCircle, RotateCcw, FileText } from 'lucide-react';
5
+ import { Button } from '@lindaui/ui/button';
6
+ import { Input } from '@lindaui/ui/input';
7
+ import { Skeleton } from '@lindaui/ui/skeleton';
8
+
9
+ function ListPane({ filters, activeFilter, onFilterChange, searchValue = "", onSearchChange, searchPlaceholder = "Buscar", searchLabel = "Buscar", loading = false, error = null, onRetry, errorTitle = "No se pudieron cargar los datos", retryLabel = "Reintentar", isEmpty, emptyTitle = "Sin resultados", emptyDescription, emptyIcon, children }) {
10
+ const showEmpty = !loading && !error && (isEmpty !== undefined ? isEmpty : React.Children.count(children) === 0);
11
+ return /*#__PURE__*/ jsxs("div", {
12
+ className: "flex h-full min-h-0 flex-col bg-background",
13
+ children: [
14
+ /*#__PURE__*/ jsxs("div", {
15
+ className: "flex-none space-y-3 px-3 pb-3 pt-3 sm:px-4",
16
+ children: [
17
+ filters && filters.length > 0 && /*#__PURE__*/ jsx("div", {
18
+ className: "flex flex-wrap gap-2 overflow-x-auto",
19
+ children: filters.map((f)=>/*#__PURE__*/ jsxs(Button, {
20
+ variant: activeFilter === f.key ? "primary" : "ghost",
21
+ onPress: ()=>onFilterChange?.(f.key),
22
+ size: "sm",
23
+ children: [
24
+ f.label,
25
+ f.count != null && /*#__PURE__*/ jsx("span", {
26
+ "aria-hidden": true,
27
+ className: "ml-1.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-muted-foreground/15 px-1 text-[11px] font-semibold tabular-nums text-muted-foreground",
28
+ children: f.count
29
+ })
30
+ ]
31
+ }, f.key))
32
+ }),
33
+ /*#__PURE__*/ jsxs("div", {
34
+ className: "relative",
35
+ children: [
36
+ /*#__PURE__*/ jsx(Search, {
37
+ className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground z-10"
38
+ }),
39
+ /*#__PURE__*/ jsx(Input, {
40
+ type: "search",
41
+ value: searchValue,
42
+ onChange: onSearchChange ?? (()=>{}),
43
+ placeholder: searchPlaceholder,
44
+ "aria-label": searchLabel,
45
+ className: "h-9 pl-8"
46
+ })
47
+ ]
48
+ })
49
+ ]
50
+ }),
51
+ /*#__PURE__*/ jsxs("div", {
52
+ className: "min-h-0 flex-1 overflow-y-auto border-t border-border",
53
+ children: [
54
+ loading && /*#__PURE__*/ jsx("div", {
55
+ role: "status",
56
+ "aria-label": "Cargando",
57
+ children: Array.from({
58
+ length: 6
59
+ }).map((_, i)=>/*#__PURE__*/ jsxs("div", {
60
+ className: "flex items-center gap-3 border-b border-border px-3 py-3.5 sm:px-4",
61
+ children: [
62
+ /*#__PURE__*/ jsx(Skeleton, {
63
+ className: "h-[42px] w-[42px] rounded-[11px]"
64
+ }),
65
+ /*#__PURE__*/ jsxs("div", {
66
+ className: "flex flex-1 flex-col gap-2",
67
+ children: [
68
+ /*#__PURE__*/ jsx(Skeleton, {
69
+ className: "h-3 w-36"
70
+ }),
71
+ /*#__PURE__*/ jsx(Skeleton, {
72
+ className: "h-2.5 w-28"
73
+ }),
74
+ /*#__PURE__*/ jsx(Skeleton, {
75
+ className: "h-2.5 w-20"
76
+ })
77
+ ]
78
+ })
79
+ ]
80
+ }, i))
81
+ }),
82
+ !loading && error && /*#__PURE__*/ jsxs("div", {
83
+ className: "m-3 rounded-xl border border-destructive/35 bg-destructive/5 p-6 text-center",
84
+ children: [
85
+ /*#__PURE__*/ jsx(AlertCircle, {
86
+ className: "mx-auto h-6 w-6 text-destructive"
87
+ }),
88
+ /*#__PURE__*/ jsx("p", {
89
+ className: "mt-2 text-sm font-semibold",
90
+ children: errorTitle
91
+ }),
92
+ /*#__PURE__*/ jsx("p", {
93
+ className: "mt-1 text-xs text-muted-foreground",
94
+ children: error
95
+ }),
96
+ onRetry && /*#__PURE__*/ jsxs(Button, {
97
+ variant: "secondary",
98
+ size: "sm",
99
+ onPress: onRetry,
100
+ className: "mt-3",
101
+ children: [
102
+ /*#__PURE__*/ jsx(RotateCcw, {
103
+ className: "h-3.5 w-3.5"
104
+ }),
105
+ retryLabel
106
+ ]
107
+ })
108
+ ]
109
+ }),
110
+ showEmpty && /*#__PURE__*/ jsxs("div", {
111
+ className: "py-16 text-center",
112
+ children: [
113
+ /*#__PURE__*/ jsx("div", {
114
+ className: "mx-auto grid h-11 w-11 place-items-center rounded-xl bg-secondary",
115
+ children: emptyIcon ?? /*#__PURE__*/ jsx(FileText, {
116
+ className: "h-5 w-5 text-muted-foreground"
117
+ })
118
+ }),
119
+ /*#__PURE__*/ jsx("p", {
120
+ className: "mt-3 text-sm font-semibold",
121
+ children: emptyTitle
122
+ }),
123
+ emptyDescription && /*#__PURE__*/ jsx("div", {
124
+ className: "mt-1 text-xs text-muted-foreground",
125
+ children: emptyDescription
126
+ })
127
+ ]
128
+ }),
129
+ !loading && !error && !showEmpty && children
130
+ ]
131
+ })
132
+ ]
133
+ });
134
+ }
135
+
136
+ export { ListPane };
@@ -0,0 +1,18 @@
1
+ export interface LoginValues {
2
+ email: string;
3
+ password: string;
4
+ }
5
+ export interface LoginFormProps {
6
+ onSubmit: (values: LoginValues) => void | Promise<void>;
7
+ title?: string;
8
+ emailLabel?: string;
9
+ passwordLabel?: string;
10
+ submitLabel?: string;
11
+ loading?: boolean;
12
+ error?: string;
13
+ className?: string;
14
+ /** Sin Card ni título (para componer dentro de AuthLayout u otro shell). */
15
+ bare?: boolean;
16
+ }
17
+ export declare function LoginForm({ onSubmit, title, emailLabel, passwordLabel, submitLabel, loading, error, className, bare, }: LoginFormProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=login-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../src/login-form.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,KAAwB,EACxB,UAAoB,EACpB,aAA4B,EAC5B,WAAwB,EACxB,OAAe,EACf,KAAK,EACL,SAAS,EACT,IAAY,GACb,EAAE,cAAc,+BA+EhB"}
@@ -0,0 +1,109 @@
1
+ 'use client';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useForm } from 'react-hook-form';
4
+ import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@lindaui/ui/card';
5
+ import { Input } from '@lindaui/ui/input';
6
+ import { Button } from '@lindaui/ui/button';
7
+ import { Field } from '@lindaui/ui/field';
8
+ import { Text } from '@lindaui/ui/text';
9
+
10
+ function LoginForm({ onSubmit, title = "Iniciar sesión", emailLabel = "Email", passwordLabel = "Contraseña", submitLabel = "Ingresar", loading = false, error, className, bare = false }) {
11
+ const { control, handleSubmit } = useForm({
12
+ defaultValues: {
13
+ email: "",
14
+ password: ""
15
+ }
16
+ });
17
+ const fields = /*#__PURE__*/ jsxs(Fragment, {
18
+ children: [
19
+ /*#__PURE__*/ jsx(Field, {
20
+ control: control,
21
+ name: "email",
22
+ children: ({ field, invalid })=>/*#__PURE__*/ jsx(Input, {
23
+ label: emailLabel,
24
+ type: "email",
25
+ autoComplete: "username",
26
+ value: field.value,
27
+ onChange: (value)=>field.onChange(value),
28
+ onBlur: field.onBlur,
29
+ name: field.name,
30
+ isInvalid: invalid
31
+ })
32
+ }),
33
+ /*#__PURE__*/ jsx(Field, {
34
+ control: control,
35
+ name: "password",
36
+ children: ({ field, invalid })=>/*#__PURE__*/ jsx(Input, {
37
+ label: passwordLabel,
38
+ type: "password",
39
+ autoComplete: "current-password",
40
+ value: field.value,
41
+ onChange: (value)=>field.onChange(value),
42
+ onBlur: field.onBlur,
43
+ name: field.name,
44
+ isInvalid: invalid
45
+ })
46
+ }),
47
+ error && /*#__PURE__*/ jsx(Text, {
48
+ role: "alert",
49
+ className: "text-sm text-[var(--danger,#dc2626)]",
50
+ children: error
51
+ })
52
+ ]
53
+ });
54
+ if (bare) {
55
+ return /*#__PURE__*/ jsxs("form", {
56
+ onSubmit: handleSubmit((values)=>onSubmit(values)),
57
+ noValidate: true,
58
+ className: `space-y-5 ${className ?? ""}`.trim(),
59
+ children: [
60
+ /*#__PURE__*/ jsx("div", {
61
+ className: "flex flex-col gap-5",
62
+ children: fields
63
+ }),
64
+ /*#__PURE__*/ jsx(Button, {
65
+ type: "submit",
66
+ variant: "primary",
67
+ size: "lg",
68
+ isDisabled: loading,
69
+ className: "w-full",
70
+ children: submitLabel
71
+ })
72
+ ]
73
+ });
74
+ }
75
+ return /*#__PURE__*/ jsxs(Card, {
76
+ className: `w-full max-w-sm ${className ?? ""}`.trim(),
77
+ children: [
78
+ /*#__PURE__*/ jsx(CardHeader, {
79
+ className: "px-4 py-4 sm:px-6 sm:py-5",
80
+ children: /*#__PURE__*/ jsx(CardTitle, {
81
+ className: "text-xl sm:text-2xl",
82
+ children: title
83
+ })
84
+ }),
85
+ /*#__PURE__*/ jsxs("form", {
86
+ onSubmit: handleSubmit((values)=>onSubmit(values)),
87
+ noValidate: true,
88
+ children: [
89
+ /*#__PURE__*/ jsx(CardContent, {
90
+ className: "flex flex-col gap-4 px-4 sm:px-6",
91
+ children: fields
92
+ }),
93
+ /*#__PURE__*/ jsx(CardFooter, {
94
+ className: "px-4 pb-4 sm:px-6 sm:pb-5",
95
+ children: /*#__PURE__*/ jsx(Button, {
96
+ type: "submit",
97
+ variant: "primary",
98
+ isDisabled: loading,
99
+ className: "w-full",
100
+ children: submitLabel
101
+ })
102
+ })
103
+ ]
104
+ })
105
+ ]
106
+ });
107
+ }
108
+
109
+ export { LoginForm };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type ChartConfig } from "@lindaui/ui/chart";
3
+ export interface PieChartProps {
4
+ data: Array<Record<string, string | number>>;
5
+ config: ChartConfig;
6
+ categoryKey: string;
7
+ valueKey: string;
8
+ variant?: "pie" | "donut" | "label";
9
+ className?: string;
10
+ }
11
+ export declare function PieChart({ data, config, categoryKey, valueKey, variant, className, }: PieChartProps): React.JSX.Element;
12
+ //# sourceMappingURL=pie-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie-chart.d.ts","sourceRoot":"","sources":["../src/pie-chart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,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,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,QAAQ,EACR,OAAe,EACf,SAAS,GACV,EAAE,aAAa,qBAoCf"}
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import 'react';
4
+ import { PieChart as PieChart$1, Pie, Cell, LabelList } from 'recharts';
5
+ import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@lindaui/ui/chart';
6
+
7
+ function PieChart({ data, config, categoryKey, valueKey, variant = "pie", className }) {
8
+ const innerRadius = variant === "donut" ? "55%" : variant === "label" ? "45%" : 0;
9
+ return /*#__PURE__*/ jsx(ChartContainer, {
10
+ config: config,
11
+ className: className,
12
+ children: /*#__PURE__*/ jsxs(PieChart$1, {
13
+ children: [
14
+ /*#__PURE__*/ jsx(ChartTooltip, {
15
+ content: /*#__PURE__*/ jsx(ChartTooltipContent, {})
16
+ }),
17
+ /*#__PURE__*/ jsx(ChartLegend, {
18
+ content: /*#__PURE__*/ jsx(ChartLegendContent, {})
19
+ }),
20
+ /*#__PURE__*/ jsxs(Pie, {
21
+ data: data,
22
+ dataKey: valueKey,
23
+ nameKey: categoryKey,
24
+ innerRadius: innerRadius,
25
+ outerRadius: "80%",
26
+ paddingAngle: 2,
27
+ children: [
28
+ data.map((entry, index)=>{
29
+ const key = String(entry[categoryKey]);
30
+ return /*#__PURE__*/ jsx(Cell, {
31
+ fill: `var(--color-${key})`
32
+ }, `cell-${index}`);
33
+ }),
34
+ variant === "label" && /*#__PURE__*/ jsx(LabelList, {
35
+ dataKey: categoryKey,
36
+ position: "outside",
37
+ style: {
38
+ fontSize: 12,
39
+ fill: "var(--foreground)"
40
+ }
41
+ })
42
+ ]
43
+ })
44
+ ]
45
+ })
46
+ });
47
+ }
48
+
49
+ export { PieChart };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { type ChartConfig } from "@lindaui/ui/chart";
3
+ export interface RadarChartProps {
4
+ data: Array<Record<string, string | number>>;
5
+ config: ChartConfig;
6
+ categoryKey: string;
7
+ series: string[];
8
+ className?: string;
9
+ }
10
+ export declare function RadarChart({ data, config, categoryKey, series, className, }: RadarChartProps): React.JSX.Element;
11
+ //# sourceMappingURL=radar-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radar-chart.d.ts","sourceRoot":"","sources":["../src/radar-chart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,eAAe;IAC9B,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,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,MAAM,EACN,SAAS,GACV,EAAE,eAAe,qBAsBjB"}
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import 'react';
4
+ import { RadarChart as RadarChart$1, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Radar } from 'recharts';
5
+ import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from '@lindaui/ui/chart';
6
+
7
+ function RadarChart({ data, config, categoryKey, series, className }) {
8
+ return /*#__PURE__*/ jsx(ChartContainer, {
9
+ config: config,
10
+ className: className,
11
+ children: /*#__PURE__*/ jsxs(RadarChart$1, {
12
+ data: data,
13
+ children: [
14
+ /*#__PURE__*/ jsx(ChartTooltip, {
15
+ content: /*#__PURE__*/ jsx(ChartTooltipContent, {})
16
+ }),
17
+ /*#__PURE__*/ jsx(ChartLegend, {
18
+ content: /*#__PURE__*/ jsx(ChartLegendContent, {})
19
+ }),
20
+ /*#__PURE__*/ jsx(PolarGrid, {}),
21
+ /*#__PURE__*/ jsx(PolarAngleAxis, {
22
+ dataKey: categoryKey
23
+ }),
24
+ /*#__PURE__*/ jsx(PolarRadiusAxis, {}),
25
+ series.map((key)=>/*#__PURE__*/ jsx(Radar, {
26
+ dataKey: key,
27
+ name: key,
28
+ fill: `var(--color-${key})`,
29
+ stroke: `var(--color-${key})`,
30
+ fillOpacity: 0.5
31
+ }, key))
32
+ ]
33
+ })
34
+ });
35
+ }
36
+
37
+ export { RadarChart };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type ChartConfig } from "@lindaui/ui/chart";
3
+ export interface RadialChartProps {
4
+ data: Array<Record<string, string | number>>;
5
+ config: ChartConfig;
6
+ categoryKey: string;
7
+ series: string[];
8
+ variant?: "default" | "stacked" | "label";
9
+ className?: string;
10
+ }
11
+ export declare function RadialChart({ data, config, categoryKey, series, variant, className, }: RadialChartProps): React.JSX.Element;
12
+ //# sourceMappingURL=radial-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-chart.d.ts","sourceRoot":"","sources":["../src/radial-chart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAgB;IAC/B,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,OAAO,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAmB,EACnB,SAAS,GACV,EAAE,gBAAgB,qBAsElB"}
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { RadialBarChart, PolarGrid, PolarRadiusAxis, Label, RadialBar } from 'recharts';
5
+ import { ChartContainer, ChartTooltip, ChartTooltipContent } from '@lindaui/ui/chart';
6
+
7
+ function RadialChart({ data, config, categoryKey, series, variant = "default", className }) {
8
+ const isStacked = variant === "stacked";
9
+ const showLabel = variant === "label";
10
+ const total = React.useMemo(()=>{
11
+ if (!showLabel) return null;
12
+ return data.reduce((acc, row)=>{
13
+ series.forEach((key)=>{
14
+ const v = row[key];
15
+ if (typeof v === "number") acc += v;
16
+ });
17
+ return acc;
18
+ }, 0);
19
+ }, [
20
+ data,
21
+ series,
22
+ showLabel
23
+ ]);
24
+ return /*#__PURE__*/ jsx(ChartContainer, {
25
+ config: config,
26
+ className: className,
27
+ children: /*#__PURE__*/ jsxs(RadialBarChart, {
28
+ data: data,
29
+ innerRadius: "30%",
30
+ outerRadius: "90%",
31
+ startAngle: 90,
32
+ endAngle: -270,
33
+ children: [
34
+ /*#__PURE__*/ jsx(PolarGrid, {
35
+ gridType: "circle",
36
+ radialLines: false
37
+ }),
38
+ /*#__PURE__*/ jsx(ChartTooltip, {
39
+ content: /*#__PURE__*/ jsx(ChartTooltipContent, {})
40
+ }),
41
+ showLabel && /*#__PURE__*/ jsx(PolarRadiusAxis, {
42
+ tick: false,
43
+ axisLine: false,
44
+ children: /*#__PURE__*/ jsx(Label, {
45
+ content: ({ viewBox })=>{
46
+ if (!viewBox || !("cx" in viewBox) || !("cy" in viewBox)) return null;
47
+ const { cx, cy } = viewBox;
48
+ return /*#__PURE__*/ jsxs("text", {
49
+ x: cx,
50
+ y: cy,
51
+ textAnchor: "middle",
52
+ dominantBaseline: "middle",
53
+ children: [
54
+ /*#__PURE__*/ jsx("tspan", {
55
+ x: cx,
56
+ y: cy,
57
+ className: "fill-foreground text-2xl font-bold",
58
+ style: {
59
+ fontSize: 24,
60
+ fontWeight: 700
61
+ },
62
+ children: total
63
+ }),
64
+ /*#__PURE__*/ jsx("tspan", {
65
+ x: cx,
66
+ y: (cy ?? 0) + 20,
67
+ className: "fill-muted-foreground",
68
+ style: {
69
+ fontSize: 12
70
+ },
71
+ children: "Total"
72
+ })
73
+ ]
74
+ });
75
+ }
76
+ })
77
+ }),
78
+ series.map((key)=>/*#__PURE__*/ jsx(RadialBar, {
79
+ dataKey: key,
80
+ name: key,
81
+ fill: `var(--color-${key})`,
82
+ stackId: isStacked ? "stack" : undefined,
83
+ background: !isStacked,
84
+ cornerRadius: 4
85
+ }, key))
86
+ ]
87
+ })
88
+ });
89
+ }
90
+
91
+ export { RadialChart };
@@ -0,0 +1,13 @@
1
+ export interface RecordingOverlayProps {
2
+ label: string;
3
+ description?: string;
4
+ elapsed: number;
5
+ error?: string | null;
6
+ onStop: () => void;
7
+ onCancel: () => void;
8
+ stopLabel?: string;
9
+ errorTitle?: string;
10
+ backLabel?: string;
11
+ }
12
+ export declare function RecordingOverlay({ label, description, elapsed, error, onStop, onCancel, stopLabel, errorTitle, backLabel, }: RecordingOverlayProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=recording-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recording-overlay.d.ts","sourceRoot":"","sources":["../src/recording-overlay.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmCD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAqB,EACrB,UAA8C,EAC9C,SAAoB,GACrB,EAAE,qBAAqB,+BAiEvB"}