@acronis-platform/shadcn-uikit 0.20.0 → 0.22.0
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/ui/widget-alert.d.ts +40 -0
- package/dist/components/ui/widget-alert.js +111 -0
- package/dist/components/ui/widget-alert.js.map +1 -0
- package/dist/components/ui/widget-placeholder.d.ts +25 -0
- package/dist/components/ui/widget-placeholder.js +112 -0
- package/dist/components/ui/widget-placeholder.js.map +1 -0
- package/dist/components/ui/widget-progress-chunks.d.ts +43 -0
- package/dist/components/ui/widget-progress-chunks.js +103 -0
- package/dist/components/ui/widget-progress-chunks.js.map +1 -0
- package/dist/components/ui/widget-progress-tiers.d.ts +45 -0
- package/dist/components/ui/widget-progress-tiers.js +129 -0
- package/dist/components/ui/widget-progress-tiers.js.map +1 -0
- package/dist/components/ui/widget-protection-status.d.ts +26 -0
- package/dist/components/ui/widget-protection-status.js +123 -0
- package/dist/components/ui/widget-protection-status.js.map +1 -0
- package/dist/components/ui/widget-protection-summary.d.ts +27 -0
- package/dist/components/ui/widget-protection-summary.js +118 -0
- package/dist/components/ui/widget-protection-summary.js.map +1 -0
- package/dist/components/ui/widget-table-data.d.ts +30 -0
- package/dist/components/ui/widget-table-data.js +152 -0
- package/dist/components/ui/widget-table-data.js.map +1 -0
- package/dist/components/ui/widget-text.d.ts +27 -0
- package/dist/components/ui/widget-text.js +124 -0
- package/dist/components/ui/widget-text.js.map +1 -0
- package/dist/components/ui/widget.d.ts +32 -0
- package/dist/components/ui/widget.js +143 -0
- package/dist/components/ui/widget.js.map +1 -0
- package/dist/components.css +1 -1
- package/dist/index.js +1398 -1306
- package/dist/index.js.map +1 -1
- package/dist/llms.txt +1 -1
- package/dist/react.d.ts +9 -0
- package/dist/react.js +1395 -1303
- package/dist/react.js.map +1 -1
- package/dist/shadcn-uikit.css +1 -1
- package/dist/utilities.css +1 -1
- package/package.json +7 -3
- package/tailwind.preset.d.ts +3 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { cn as i } from "../../lib/utils.js";
|
|
4
|
+
const s = d.forwardRef(
|
|
5
|
+
({ className: e, interactive: a, ...t }, l) => /* @__PURE__ */ r(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
ref: l,
|
|
9
|
+
tabIndex: a ? 0 : void 0,
|
|
10
|
+
className: i(
|
|
11
|
+
"relative flex flex-col rounded-lg border border-[var(--av-brand-light)] bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors",
|
|
12
|
+
a && "cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]",
|
|
13
|
+
e
|
|
14
|
+
),
|
|
15
|
+
...t
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
s.displayName = "WidgetTableData";
|
|
20
|
+
const o = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: t,
|
|
24
|
+
className: i("flex items-center gap-2 px-6 pt-4 pb-2", e),
|
|
25
|
+
...a
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
o.displayName = "WidgetTableDataHeader";
|
|
29
|
+
const b = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: t,
|
|
33
|
+
className: i("flex-1 truncate text-sm font-semibold leading-6", e),
|
|
34
|
+
...a
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
b.displayName = "WidgetTableDataTitle";
|
|
38
|
+
const n = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: t,
|
|
42
|
+
className: i("flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4", e),
|
|
43
|
+
...a
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
n.displayName = "WidgetTableDataIcon";
|
|
47
|
+
const c = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: t,
|
|
51
|
+
className: i("flex-1 px-6 py-2", e),
|
|
52
|
+
...a
|
|
53
|
+
}
|
|
54
|
+
));
|
|
55
|
+
c.displayName = "WidgetTableDataContent";
|
|
56
|
+
const f = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
57
|
+
"table",
|
|
58
|
+
{
|
|
59
|
+
ref: t,
|
|
60
|
+
className: i("w-full text-sm", e),
|
|
61
|
+
...a
|
|
62
|
+
}
|
|
63
|
+
));
|
|
64
|
+
f.displayName = "WidgetTableDataTable";
|
|
65
|
+
const v = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
66
|
+
"thead",
|
|
67
|
+
{
|
|
68
|
+
ref: t,
|
|
69
|
+
className: i(
|
|
70
|
+
"border-b border-[var(--av-brand-accent)] bg-[var(--av-brand-lightest)]",
|
|
71
|
+
e
|
|
72
|
+
),
|
|
73
|
+
...a
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
v.displayName = "WidgetTableDataThead";
|
|
77
|
+
const m = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
78
|
+
"th",
|
|
79
|
+
{
|
|
80
|
+
ref: t,
|
|
81
|
+
className: i(
|
|
82
|
+
"px-3 py-2 text-left text-xs font-semibold text-[var(--av-fixed-primary)]",
|
|
83
|
+
e
|
|
84
|
+
),
|
|
85
|
+
...a
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
m.displayName = "WidgetTableDataTh";
|
|
89
|
+
const T = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
90
|
+
"tbody",
|
|
91
|
+
{
|
|
92
|
+
ref: t,
|
|
93
|
+
className: i("[&>tr]:border-b [&>tr]:border-[var(--av-brand-accent)]", e),
|
|
94
|
+
...a
|
|
95
|
+
}
|
|
96
|
+
));
|
|
97
|
+
T.displayName = "WidgetTableDataTbody";
|
|
98
|
+
const g = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
99
|
+
"tr",
|
|
100
|
+
{
|
|
101
|
+
ref: t,
|
|
102
|
+
className: i("transition-colors hover:bg-[var(--av-el-secondary-hover)]", e),
|
|
103
|
+
...a
|
|
104
|
+
}
|
|
105
|
+
));
|
|
106
|
+
g.displayName = "WidgetTableDataTr";
|
|
107
|
+
const p = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
108
|
+
"td",
|
|
109
|
+
{
|
|
110
|
+
ref: t,
|
|
111
|
+
className: i("px-3 py-2 text-sm", e),
|
|
112
|
+
...a
|
|
113
|
+
}
|
|
114
|
+
));
|
|
115
|
+
p.displayName = "WidgetTableDataTd";
|
|
116
|
+
const x = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
117
|
+
"a",
|
|
118
|
+
{
|
|
119
|
+
ref: t,
|
|
120
|
+
className: i("text-[var(--av-fixed-link)] hover:underline cursor-pointer", e),
|
|
121
|
+
...a
|
|
122
|
+
}
|
|
123
|
+
));
|
|
124
|
+
x.displayName = "WidgetTableDataLink";
|
|
125
|
+
const y = d.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ r(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: t,
|
|
129
|
+
className: i(
|
|
130
|
+
"flex items-center justify-between border-t border-[var(--av-brand-accent)] px-6 py-2 text-xs",
|
|
131
|
+
e
|
|
132
|
+
),
|
|
133
|
+
...a
|
|
134
|
+
}
|
|
135
|
+
));
|
|
136
|
+
y.displayName = "WidgetTableDataFooter";
|
|
137
|
+
export {
|
|
138
|
+
s as WidgetTableData,
|
|
139
|
+
c as WidgetTableDataContent,
|
|
140
|
+
y as WidgetTableDataFooter,
|
|
141
|
+
o as WidgetTableDataHeader,
|
|
142
|
+
n as WidgetTableDataIcon,
|
|
143
|
+
x as WidgetTableDataLink,
|
|
144
|
+
f as WidgetTableDataTable,
|
|
145
|
+
T as WidgetTableDataTbody,
|
|
146
|
+
p as WidgetTableDataTd,
|
|
147
|
+
m as WidgetTableDataTh,
|
|
148
|
+
v as WidgetTableDataThead,
|
|
149
|
+
b as WidgetTableDataTitle,
|
|
150
|
+
g as WidgetTableDataTr
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=widget-table-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-table-data.js","sources":["../../../src/components/ui/widget-table-data.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * WidgetTableData — Data table widget for dashboard.\n * Figma: Charts-anatomy / Table-Data (node 826:86024)\n *\n * Shows tabular data with optional colored background rows, links, and pagination.\n * Two variants: full table (with header row) and compact (without header).\n * Background: inversed-primary, Border: brand-light\n * Colored-Background: brand-lightest\n * Divider: brand-accent\n *\n * States: hover (el-secondary-hover), active (el-secondary-active), focus (fixed-focus)\n */\n\nexport interface WidgetTableDataProps extends React.HTMLAttributes<HTMLDivElement> {\n interactive?: boolean\n}\n\nconst WidgetTableData = React.forwardRef<HTMLDivElement, WidgetTableDataProps>(\n ({ className, interactive, ...props }, ref) => (\n <div\n ref={ref}\n tabIndex={interactive ? 0 : undefined}\n className={cn(\n 'relative flex flex-col rounded-lg border border-[var(--av-brand-light)] bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors',\n interactive && 'cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]',\n className\n )}\n {...props}\n />\n )\n)\nWidgetTableData.displayName = 'WidgetTableData'\n\nconst WidgetTableDataHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex items-center gap-2 px-6 pt-4 pb-2', className)}\n {...props}\n />\n))\nWidgetTableDataHeader.displayName = 'WidgetTableDataHeader'\n\nconst WidgetTableDataTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-1 truncate text-sm font-semibold leading-6', className)}\n {...props}\n />\n))\nWidgetTableDataTitle.displayName = 'WidgetTableDataTitle'\n\nconst WidgetTableDataIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4', className)}\n {...props}\n />\n))\nWidgetTableDataIcon.displayName = 'WidgetTableDataIcon'\n\nconst WidgetTableDataContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-1 px-6 py-2', className)}\n {...props}\n />\n))\nWidgetTableDataContent.displayName = 'WidgetTableDataContent'\n\nconst WidgetTableDataTable = React.forwardRef<\n HTMLTableElement,\n React.TableHTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <table\n ref={ref}\n className={cn('w-full text-sm', className)}\n {...props}\n />\n))\nWidgetTableDataTable.displayName = 'WidgetTableDataTable'\n\nconst WidgetTableDataThead = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead\n ref={ref}\n className={cn(\n 'border-b border-[var(--av-brand-accent)] bg-[var(--av-brand-lightest)]',\n className\n )}\n {...props}\n />\n))\nWidgetTableDataThead.displayName = 'WidgetTableDataThead'\n\nconst WidgetTableDataTh = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n 'px-3 py-2 text-left text-xs font-semibold text-[var(--av-fixed-primary)]',\n className\n )}\n {...props}\n />\n))\nWidgetTableDataTh.displayName = 'WidgetTableDataTh'\n\nconst WidgetTableDataTbody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&>tr]:border-b [&>tr]:border-[var(--av-brand-accent)]', className)}\n {...props}\n />\n))\nWidgetTableDataTbody.displayName = 'WidgetTableDataTbody'\n\nconst WidgetTableDataTr = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn('transition-colors hover:bg-[var(--av-el-secondary-hover)]', className)}\n {...props}\n />\n))\nWidgetTableDataTr.displayName = 'WidgetTableDataTr'\n\nconst WidgetTableDataTd = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn('px-3 py-2 text-sm', className)}\n {...props}\n />\n))\nWidgetTableDataTd.displayName = 'WidgetTableDataTd'\n\nconst WidgetTableDataLink = React.forwardRef<\n HTMLAnchorElement,\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n>(({ className, ...props }, ref) => (\n <a\n ref={ref}\n className={cn('text-[var(--av-fixed-link)] hover:underline cursor-pointer', className)}\n {...props}\n />\n))\nWidgetTableDataLink.displayName = 'WidgetTableDataLink'\n\nconst WidgetTableDataFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-between border-t border-[var(--av-brand-accent)] px-6 py-2 text-xs',\n className\n )}\n {...props}\n />\n))\nWidgetTableDataFooter.displayName = 'WidgetTableDataFooter'\n\nexport {\n WidgetTableData,\n WidgetTableDataHeader,\n WidgetTableDataTitle,\n WidgetTableDataIcon,\n WidgetTableDataContent,\n WidgetTableDataTable,\n WidgetTableDataThead,\n WidgetTableDataTh,\n WidgetTableDataTbody,\n WidgetTableDataTr,\n WidgetTableDataTd,\n WidgetTableDataLink,\n WidgetTableDataFooter,\n}\n"],"names":["WidgetTableData","React","className","interactive","props","ref","jsx","cn","WidgetTableDataHeader","WidgetTableDataTitle","WidgetTableDataIcon","WidgetTableDataContent","WidgetTableDataTable","WidgetTableDataThead","WidgetTableDataTh","WidgetTableDataTbody","WidgetTableDataTr","WidgetTableDataTd","WidgetTableDataLink","WidgetTableDataFooter"],"mappings":";;;AAqBA,MAAMA,IAAkBC,EAAM;AAAA,EAC5B,CAAC,EAAE,WAAAC,GAAW,aAAAC,GAAa,GAAGC,EAAA,GAASC,MACrC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,UAAUF,IAAc,IAAI;AAAA,MAC5B,WAAWI;AAAA,QACT;AAAA,QACAJ,KAAe;AAAA,QACfD;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV;AACAJ,EAAgB,cAAc;AAE9B,MAAMQ,IAAwBP,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,0CAA0CL,CAAS;AAAA,IAChE,GAAGE;AAAA,EAAA;AACN,CACD;AACDI,EAAsB,cAAc;AAEpC,MAAMC,IAAuBR,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;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;AAAA,IAED,GAAGE;AAAA,EAAA;AACN,CACD;AACDe,EAAsB,cAAc;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WidgetText — Text-based dashboard widget.
|
|
4
|
+
* Figma: Charts-anatomy / Text-Widgets (node 829:95739)
|
|
5
|
+
*
|
|
6
|
+
* Shows text-based metrics: a large value, label, and optional trend indicator.
|
|
7
|
+
* Background: inversed-primary, Border: brand-light
|
|
8
|
+
*
|
|
9
|
+
* States: hover, active, focus
|
|
10
|
+
*/
|
|
11
|
+
export interface WidgetTextProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const WidgetText: React.ForwardRefExoticComponent<WidgetTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const WidgetTextHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const WidgetTextTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const WidgetTextIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const WidgetTextContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const WidgetTextValue: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const WidgetTextLabel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export interface WidgetTextTrendProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
direction?: 'up' | 'down' | 'neutral';
|
|
23
|
+
}
|
|
24
|
+
declare const WidgetTextTrend: React.ForwardRefExoticComponent<WidgetTextTrendProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const WidgetTextDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHRElement> & React.RefAttributes<HTMLHRElement>>;
|
|
26
|
+
declare const WidgetTextFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export { WidgetText, WidgetTextHeader, WidgetTextTitle, WidgetTextIcon, WidgetTextContent, WidgetTextValue, WidgetTextLabel, WidgetTextTrend, WidgetTextDivider, WidgetTextFooter, };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as d } from "../../lib/utils.js";
|
|
4
|
+
const n = i.forwardRef(
|
|
5
|
+
({ className: t, interactive: e, ...a }, o) => /* @__PURE__ */ r(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
ref: o,
|
|
9
|
+
tabIndex: e ? 0 : void 0,
|
|
10
|
+
className: d(
|
|
11
|
+
"relative flex flex-col rounded-lg border border-[var(--av-brand-light)] bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors",
|
|
12
|
+
e && "cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]",
|
|
13
|
+
t
|
|
14
|
+
),
|
|
15
|
+
...a
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
n.displayName = "WidgetText";
|
|
20
|
+
const x = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: a,
|
|
24
|
+
className: d("flex items-center gap-2 px-6 pt-4 pb-2", t),
|
|
25
|
+
...e
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
x.displayName = "WidgetTextHeader";
|
|
29
|
+
const c = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: a,
|
|
33
|
+
className: d("flex-1 truncate text-sm font-semibold leading-6", t),
|
|
34
|
+
...e
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
c.displayName = "WidgetTextTitle";
|
|
38
|
+
const v = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: a,
|
|
42
|
+
className: d("flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4", t),
|
|
43
|
+
...e
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
v.displayName = "WidgetTextIcon";
|
|
47
|
+
const f = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: a,
|
|
51
|
+
className: d("flex-1 flex flex-col gap-1 px-6 py-2", t),
|
|
52
|
+
...e
|
|
53
|
+
}
|
|
54
|
+
));
|
|
55
|
+
f.displayName = "WidgetTextContent";
|
|
56
|
+
const g = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
ref: a,
|
|
60
|
+
className: d("text-2xl font-semibold leading-8 tabular-nums", t),
|
|
61
|
+
...e
|
|
62
|
+
}
|
|
63
|
+
));
|
|
64
|
+
g.displayName = "WidgetTextValue";
|
|
65
|
+
const m = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
ref: a,
|
|
69
|
+
className: d("text-sm leading-6", t),
|
|
70
|
+
...e
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
m.displayName = "WidgetTextLabel";
|
|
74
|
+
const p = i.forwardRef(
|
|
75
|
+
({ className: t, direction: e = "neutral", children: a, ...o }, s) => /* @__PURE__ */ l(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref: s,
|
|
79
|
+
className: d("flex items-center gap-1 text-sm font-semibold", {
|
|
80
|
+
up: "text-[var(--av-chart-success)]",
|
|
81
|
+
down: "text-[var(--av-chart-danger)]",
|
|
82
|
+
neutral: "text-[var(--av-chart-neutral)]"
|
|
83
|
+
}[e], t),
|
|
84
|
+
...o,
|
|
85
|
+
children: [
|
|
86
|
+
e === "up" && /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ r("path", { d: "M6 2L10 7H2L6 2Z", fill: "currentColor" }) }),
|
|
87
|
+
e === "down" && /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ r("path", { d: "M6 10L2 5H10L6 10Z", fill: "currentColor" }) }),
|
|
88
|
+
a
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
p.displayName = "WidgetTextTrend";
|
|
94
|
+
const w = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
95
|
+
"hr",
|
|
96
|
+
{
|
|
97
|
+
ref: a,
|
|
98
|
+
className: d("border-t border-[var(--av-brand-accent)] mx-6", t),
|
|
99
|
+
...e
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
w.displayName = "WidgetTextDivider";
|
|
103
|
+
const T = i.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ r(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
ref: a,
|
|
107
|
+
className: d("px-6 pb-4 pt-0 text-xs", t),
|
|
108
|
+
...e
|
|
109
|
+
}
|
|
110
|
+
));
|
|
111
|
+
T.displayName = "WidgetTextFooter";
|
|
112
|
+
export {
|
|
113
|
+
n as WidgetText,
|
|
114
|
+
f as WidgetTextContent,
|
|
115
|
+
w as WidgetTextDivider,
|
|
116
|
+
T as WidgetTextFooter,
|
|
117
|
+
x as WidgetTextHeader,
|
|
118
|
+
v as WidgetTextIcon,
|
|
119
|
+
m as WidgetTextLabel,
|
|
120
|
+
c as WidgetTextTitle,
|
|
121
|
+
p as WidgetTextTrend,
|
|
122
|
+
g as WidgetTextValue
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=widget-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-text.js","sources":["../../../src/components/ui/widget-text.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * WidgetText — Text-based dashboard widget.\n * Figma: Charts-anatomy / Text-Widgets (node 829:95739)\n *\n * Shows text-based metrics: a large value, label, and optional trend indicator.\n * Background: inversed-primary, Border: brand-light\n *\n * States: hover, active, focus\n */\n\nexport interface WidgetTextProps extends React.HTMLAttributes<HTMLDivElement> {\n interactive?: boolean\n}\n\nconst WidgetText = React.forwardRef<HTMLDivElement, WidgetTextProps>(\n ({ className, interactive, ...props }, ref) => (\n <div\n ref={ref}\n tabIndex={interactive ? 0 : undefined}\n className={cn(\n 'relative flex flex-col rounded-lg border border-[var(--av-brand-light)] bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors',\n interactive && 'cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]',\n className\n )}\n {...props}\n />\n )\n)\nWidgetText.displayName = 'WidgetText'\n\nconst WidgetTextHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex items-center gap-2 px-6 pt-4 pb-2', className)}\n {...props}\n />\n))\nWidgetTextHeader.displayName = 'WidgetTextHeader'\n\nconst WidgetTextTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-1 truncate text-sm font-semibold leading-6', className)}\n {...props}\n />\n))\nWidgetTextTitle.displayName = 'WidgetTextTitle'\n\nconst WidgetTextIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4', className)}\n {...props}\n />\n))\nWidgetTextIcon.displayName = 'WidgetTextIcon'\n\nconst WidgetTextContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-1 flex flex-col gap-1 px-6 py-2', className)}\n {...props}\n />\n))\nWidgetTextContent.displayName = 'WidgetTextContent'\n\nconst WidgetTextValue = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-2xl font-semibold leading-8 tabular-nums', className)}\n {...props}\n />\n))\nWidgetTextValue.displayName = 'WidgetTextValue'\n\nconst WidgetTextLabel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm leading-6', className)}\n {...props}\n />\n))\nWidgetTextLabel.displayName = 'WidgetTextLabel'\n\nexport interface WidgetTextTrendProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'up' | 'down' | 'neutral'\n}\n\nconst WidgetTextTrend = React.forwardRef<HTMLDivElement, WidgetTextTrendProps>(\n ({ className, direction = 'neutral', children, ...props }, ref) => {\n const colorMap: Record<string, string> = {\n up: 'text-[var(--av-chart-success)]',\n down: 'text-[var(--av-chart-danger)]',\n neutral: 'text-[var(--av-chart-neutral)]',\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center gap-1 text-sm font-semibold', colorMap[direction], className)}\n {...props}\n >\n {direction === 'up' && (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 2L10 7H2L6 2Z\" fill=\"currentColor\" />\n </svg>\n )}\n {direction === 'down' && (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6 10L2 5H10L6 10Z\" fill=\"currentColor\" />\n </svg>\n )}\n {children}\n </div>\n )\n }\n)\nWidgetTextTrend.displayName = 'WidgetTextTrend'\n\nconst WidgetTextDivider = React.forwardRef<\n HTMLHRElement,\n React.HTMLAttributes<HTMLHRElement>\n>(({ className, ...props }, ref) => (\n <hr\n ref={ref}\n className={cn('border-t border-[var(--av-brand-accent)] mx-6', className)}\n {...props}\n />\n))\nWidgetTextDivider.displayName = 'WidgetTextDivider'\n\nconst WidgetTextFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('px-6 pb-4 pt-0 text-xs', className)}\n {...props}\n />\n))\nWidgetTextFooter.displayName = 'WidgetTextFooter'\n\nexport {\n WidgetText,\n WidgetTextHeader,\n WidgetTextTitle,\n WidgetTextIcon,\n WidgetTextContent,\n WidgetTextValue,\n WidgetTextLabel,\n WidgetTextTrend,\n WidgetTextDivider,\n WidgetTextFooter,\n}\n"],"names":["WidgetText","React","className","interactive","props","ref","jsx","cn","WidgetTextHeader","WidgetTextTitle","WidgetTextIcon","WidgetTextContent","WidgetTextValue","WidgetTextLabel","WidgetTextTrend","direction","children","jsxs","WidgetTextDivider","WidgetTextFooter"],"mappings":";;;AAkBA,MAAMA,IAAaC,EAAM;AA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MAAA;AAAA,IAAA;AAAA,EAAA;AAIT;AACAF,EAAgB,cAAc;AAE9B,MAAMI,IAAoBjB,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,iDAAiDL,CAAS;AAAA,IACvE,GAAGE;AAAA,EAAA;AACN,CACD;AACDc,EAAkB,cAAc;AAEhC,MAAMC,IAAmBlB,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,0BAA0BL,CAAS;AAAA,IAChD,GAAGE;AAAA,EAAA;AACN,CACD;AACDe,EAAiB,cAAc;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Widget — A dashboard card container for charts, progress indicators, and data displays.
|
|
5
|
+
* Follows the Figma "Charts-anatomy" design system.
|
|
6
|
+
*
|
|
7
|
+
* Anatomy:
|
|
8
|
+
* - Widget (root container)
|
|
9
|
+
* - WidgetHeader (title row with optional icon and actions)
|
|
10
|
+
* - WidgetIcon
|
|
11
|
+
* - WidgetTitle
|
|
12
|
+
* - WidgetActions (dropdown trigger, etc.)
|
|
13
|
+
* - WidgetContent (main visualization area)
|
|
14
|
+
* - WidgetFooter (optional legend, labels, or actions)
|
|
15
|
+
*/
|
|
16
|
+
declare const widgetVariants: (props?: ({
|
|
17
|
+
size?: "sm" | "lg" | "md" | "xl" | null | undefined;
|
|
18
|
+
interactive?: boolean | null | undefined;
|
|
19
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
|
+
export interface WidgetProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof widgetVariants> {
|
|
21
|
+
}
|
|
22
|
+
declare const Widget: React.ForwardRefExoticComponent<WidgetProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const WidgetHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const WidgetIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const WidgetTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
declare const WidgetActions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
declare const WidgetContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const WidgetFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const WidgetValue: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const WidgetLabel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const WidgetDivider: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHRElement> & React.RefAttributes<HTMLHRElement>>;
|
|
32
|
+
export { Widget, WidgetHeader, WidgetIcon, WidgetTitle, WidgetActions, WidgetContent, WidgetFooter, WidgetValue, WidgetLabel, WidgetDivider, widgetVariants, };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { cva as l } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as s } from "../../lib/utils.js";
|
|
5
|
+
const n = l(
|
|
6
|
+
"relative flex flex-col rounded-lg border bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
sm: "min-h-[112px]",
|
|
11
|
+
md: "min-h-[176px]",
|
|
12
|
+
lg: "min-h-[240px]",
|
|
13
|
+
xl: "min-h-[352px]"
|
|
14
|
+
},
|
|
15
|
+
interactive: {
|
|
16
|
+
true: "cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]",
|
|
17
|
+
false: ""
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: "md",
|
|
22
|
+
interactive: !1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
), f = r.forwardRef(
|
|
26
|
+
({ className: a, size: i, interactive: e, ...d }, o) => /* @__PURE__ */ t(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref: o,
|
|
30
|
+
tabIndex: e ? 0 : void 0,
|
|
31
|
+
className: s(n({ size: i, interactive: e }), a),
|
|
32
|
+
...d
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
f.displayName = "Widget";
|
|
37
|
+
const m = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: e,
|
|
41
|
+
className: s(
|
|
42
|
+
"flex items-center gap-2 px-6 pt-4 pb-0",
|
|
43
|
+
a
|
|
44
|
+
),
|
|
45
|
+
...i
|
|
46
|
+
}
|
|
47
|
+
));
|
|
48
|
+
m.displayName = "WidgetHeader";
|
|
49
|
+
const v = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: e,
|
|
53
|
+
className: s(
|
|
54
|
+
"flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4",
|
|
55
|
+
a
|
|
56
|
+
),
|
|
57
|
+
...i
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
v.displayName = "WidgetIcon";
|
|
61
|
+
const c = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
ref: e,
|
|
65
|
+
className: s(
|
|
66
|
+
"flex-1 truncate text-sm font-semibold leading-6",
|
|
67
|
+
a
|
|
68
|
+
),
|
|
69
|
+
...i
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
c.displayName = "WidgetTitle";
|
|
73
|
+
const g = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref: e,
|
|
77
|
+
className: s(
|
|
78
|
+
"flex-shrink-0 flex items-center gap-1 text-[var(--av-brand-primary)] [&>svg]:h-4 [&>svg]:w-4",
|
|
79
|
+
a
|
|
80
|
+
),
|
|
81
|
+
...i
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
g.displayName = "WidgetActions";
|
|
85
|
+
const p = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
ref: e,
|
|
89
|
+
className: s("flex-1 px-6 py-2", a),
|
|
90
|
+
...i
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
p.displayName = "WidgetContent";
|
|
94
|
+
const x = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: e,
|
|
98
|
+
className: s("px-6 pb-4 pt-0", a),
|
|
99
|
+
...i
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
x.displayName = "WidgetFooter";
|
|
103
|
+
const N = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
ref: e,
|
|
107
|
+
className: s("text-2xl font-semibold leading-8 tabular-nums", a),
|
|
108
|
+
...i
|
|
109
|
+
}
|
|
110
|
+
));
|
|
111
|
+
N.displayName = "WidgetValue";
|
|
112
|
+
const W = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
ref: e,
|
|
116
|
+
className: s("text-sm text-[var(--av-fixed-primary)] leading-6", a),
|
|
117
|
+
...i
|
|
118
|
+
}
|
|
119
|
+
));
|
|
120
|
+
W.displayName = "WidgetLabel";
|
|
121
|
+
const b = r.forwardRef(({ className: a, ...i }, e) => /* @__PURE__ */ t(
|
|
122
|
+
"hr",
|
|
123
|
+
{
|
|
124
|
+
ref: e,
|
|
125
|
+
className: s("border-t border-[var(--av-brand-accent)] mx-6", a),
|
|
126
|
+
...i
|
|
127
|
+
}
|
|
128
|
+
));
|
|
129
|
+
b.displayName = "WidgetDivider";
|
|
130
|
+
export {
|
|
131
|
+
f as Widget,
|
|
132
|
+
g as WidgetActions,
|
|
133
|
+
p as WidgetContent,
|
|
134
|
+
b as WidgetDivider,
|
|
135
|
+
x as WidgetFooter,
|
|
136
|
+
m as WidgetHeader,
|
|
137
|
+
v as WidgetIcon,
|
|
138
|
+
W as WidgetLabel,
|
|
139
|
+
c as WidgetTitle,
|
|
140
|
+
N as WidgetValue,
|
|
141
|
+
n as widgetVariants
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.js","sources":["../../../src/components/ui/widget.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Widget — A dashboard card container for charts, progress indicators, and data displays.\n * Follows the Figma \"Charts-anatomy\" design system.\n *\n * Anatomy:\n * - Widget (root container)\n * - WidgetHeader (title row with optional icon and actions)\n * - WidgetIcon\n * - WidgetTitle\n * - WidgetActions (dropdown trigger, etc.)\n * - WidgetContent (main visualization area)\n * - WidgetFooter (optional legend, labels, or actions)\n */\n\nconst widgetVariants = cva(\n 'relative flex flex-col rounded-lg border bg-[var(--av-inversed-primary)] text-[var(--av-fixed-primary)] transition-colors',\n {\n variants: {\n size: {\n sm: 'min-h-[112px]',\n md: 'min-h-[176px]',\n lg: 'min-h-[240px]',\n xl: 'min-h-[352px]',\n },\n interactive: {\n true: 'cursor-pointer hover:bg-[var(--av-el-secondary-hover)] active:bg-[var(--av-el-secondary-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--av-fixed-focus)]',\n false: '',\n },\n },\n defaultVariants: {\n size: 'md',\n interactive: false,\n },\n }\n)\n\nexport interface WidgetProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof widgetVariants> {}\n\nconst Widget = React.forwardRef<HTMLDivElement, WidgetProps>(\n ({ className, size, interactive, ...props }, ref) => (\n <div\n ref={ref}\n tabIndex={interactive ? 0 : undefined}\n className={cn(widgetVariants({ size, interactive }), className)}\n {...props}\n />\n )\n)\nWidget.displayName = 'Widget'\n\nconst WidgetHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex items-center gap-2 px-6 pt-4 pb-0',\n className\n )}\n {...props}\n />\n))\nWidgetHeader.displayName = 'WidgetHeader'\n\nconst WidgetIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4',\n className\n )}\n {...props}\n />\n))\nWidgetIcon.displayName = 'WidgetIcon'\n\nconst WidgetTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex-1 truncate text-sm font-semibold leading-6',\n className\n )}\n {...props}\n />\n))\nWidgetTitle.displayName = 'WidgetTitle'\n\nconst WidgetActions = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex-shrink-0 flex items-center gap-1 text-[var(--av-brand-primary)] [&>svg]:h-4 [&>svg]:w-4',\n className\n )}\n {...props}\n />\n))\nWidgetActions.displayName = 'WidgetActions'\n\nconst WidgetContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex-1 px-6 py-2', className)}\n {...props}\n />\n))\nWidgetContent.displayName = 'WidgetContent'\n\nconst WidgetFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('px-6 pb-4 pt-0', className)}\n {...props}\n />\n))\nWidgetFooter.displayName = 'WidgetFooter'\n\nconst WidgetValue = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-2xl font-semibold leading-8 tabular-nums', className)}\n {...props}\n />\n))\nWidgetValue.displayName = 'WidgetValue'\n\nconst WidgetLabel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm text-[var(--av-fixed-primary)] leading-6', className)}\n {...props}\n />\n))\nWidgetLabel.displayName = 'WidgetLabel'\n\nconst WidgetDivider = React.forwardRef<\n HTMLHRElement,\n React.HTMLAttributes<HTMLHRElement>\n>(({ className, ...props }, ref) => (\n <hr\n ref={ref}\n className={cn('border-t border-[var(--av-brand-accent)] mx-6', className)}\n {...props}\n />\n))\nWidgetDivider.displayName = 'WidgetDivider'\n\nexport {\n Widget,\n WidgetHeader,\n WidgetIcon,\n WidgetTitle,\n WidgetActions,\n WidgetContent,\n WidgetFooter,\n WidgetValue,\n WidgetLabel,\n WidgetDivider,\n widgetVariants,\n}\n"],"names":["widgetVariants","cva","Widget","React","className","size","interactive","props","ref","jsx","cn","WidgetHeader","WidgetIcon","WidgetTitle","WidgetActions","WidgetContent","WidgetFooter","WidgetValue","WidgetLabel","WidgetDivider"],"mappings":";;;;AAmBA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,aAAa;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAMMC,IAASC,EAAM;AAAA,EACnB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,aAAAC,GAAa,GAAGC,EAAA,GAASC,MAC3C,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,UAAUF,IAAc,IAAI;AAAA,MAC5B,WAAWI,EAAGV,EAAe,EAAE,MAAAK,GAAM,aAAAC,EAAA,CAAa,GAAGF,CAAS;AAAA,MAC7D,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV;AACAL,EAAO,cAAc;AAErB,MAAMS,IAAeR,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAN;AAA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