@acronis-platform/shadcn-uikit 0.21.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 +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* WidgetAlert — Dashboard alert notification widget.
|
|
5
|
+
* Figma: Charts-anatomy / Alert-Widget (node 201:65481)
|
|
6
|
+
*
|
|
7
|
+
* Variants: info, success, warning, danger
|
|
8
|
+
* Sizes: compact (112px), default (176px), expanded (with description + actions)
|
|
9
|
+
* States: hover, active, focus
|
|
10
|
+
*
|
|
11
|
+
* Anatomy:
|
|
12
|
+
* - WidgetAlert (root)
|
|
13
|
+
* - WidgetAlertIcon (left icon, 16x16)
|
|
14
|
+
* - WidgetAlertContent
|
|
15
|
+
* - WidgetAlertTitle (semibold, 14px)
|
|
16
|
+
* - WidgetAlertDate (regular, 14px)
|
|
17
|
+
* - WidgetAlertDescription (regular, 14px)
|
|
18
|
+
* - WidgetAlertActions (right side, more icon)
|
|
19
|
+
*
|
|
20
|
+
* Spacing: 24px horizontal padding, 16px vertical padding, 8px gap between title and description
|
|
21
|
+
* Colors per variant:
|
|
22
|
+
* info: bg=fixed-info-accent, border=fixed-info
|
|
23
|
+
* success: bg=fixed-success-accent, border=fixed-success
|
|
24
|
+
* warning: bg=fixed-warning-accent, border=fixed-warning
|
|
25
|
+
* danger: bg=fixed-danger-accent, border=fixed-danger
|
|
26
|
+
*/
|
|
27
|
+
declare const widgetAlertVariants: (props?: ({
|
|
28
|
+
variant?: "info" | "success" | "warning" | "danger" | null | undefined;
|
|
29
|
+
interactive?: boolean | null | undefined;
|
|
30
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
31
|
+
export interface WidgetAlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof widgetAlertVariants> {
|
|
32
|
+
}
|
|
33
|
+
declare const WidgetAlert: React.ForwardRefExoticComponent<WidgetAlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const WidgetAlertIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const WidgetAlertContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const WidgetAlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const WidgetAlertDate: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const WidgetAlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
39
|
+
declare const WidgetAlertActions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export { WidgetAlert, WidgetAlertIcon, WidgetAlertContent, WidgetAlertTitle, WidgetAlertDate, WidgetAlertDescription, WidgetAlertActions, widgetAlertVariants, };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as i 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 items-start rounded-lg border transition-colors",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
info: "bg-[var(--av-fixed-info-accent)] border-[var(--av-fixed-info)]",
|
|
11
|
+
success: "bg-[var(--av-fixed-success-accent)] border-[var(--av-fixed-success)]",
|
|
12
|
+
warning: "bg-[var(--av-fixed-warning-accent)] border-[var(--av-fixed-warning)]",
|
|
13
|
+
danger: "bg-[var(--av-fixed-danger-accent)] border-[var(--av-fixed-danger)]"
|
|
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
|
+
variant: "info",
|
|
22
|
+
interactive: !1
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
), v = i.forwardRef(
|
|
26
|
+
({ className: a, variant: t, interactive: e, ...d }, o) => /* @__PURE__ */ r(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref: o,
|
|
30
|
+
role: "alert",
|
|
31
|
+
tabIndex: e ? 0 : void 0,
|
|
32
|
+
className: s(n({ variant: t, interactive: e }), a),
|
|
33
|
+
...d
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
v.displayName = "WidgetAlert";
|
|
38
|
+
const f = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: e,
|
|
42
|
+
className: s(
|
|
43
|
+
"flex-shrink-0 flex items-start pl-6 pt-4 [&>svg]:h-4 [&>svg]:w-4",
|
|
44
|
+
a
|
|
45
|
+
),
|
|
46
|
+
...t
|
|
47
|
+
}
|
|
48
|
+
));
|
|
49
|
+
f.displayName = "WidgetAlertIcon";
|
|
50
|
+
const c = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
ref: e,
|
|
54
|
+
className: s(
|
|
55
|
+
"flex-1 flex flex-col gap-2 px-4 py-4 min-w-0 text-[var(--av-fixed-primary)]",
|
|
56
|
+
a
|
|
57
|
+
),
|
|
58
|
+
...t
|
|
59
|
+
}
|
|
60
|
+
));
|
|
61
|
+
c.displayName = "WidgetAlertContent";
|
|
62
|
+
const g = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
ref: e,
|
|
66
|
+
className: s("text-sm font-semibold leading-6 truncate", a),
|
|
67
|
+
...t
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
g.displayName = "WidgetAlertTitle";
|
|
71
|
+
const m = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
ref: e,
|
|
75
|
+
className: s("text-sm leading-6 text-[var(--av-fixed-primary)]", a),
|
|
76
|
+
...t
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
m.displayName = "WidgetAlertDate";
|
|
80
|
+
const x = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
81
|
+
"p",
|
|
82
|
+
{
|
|
83
|
+
ref: e,
|
|
84
|
+
className: s("text-sm leading-6 text-[var(--av-fixed-primary)]", a),
|
|
85
|
+
...t
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
x.displayName = "WidgetAlertDescription";
|
|
89
|
+
const p = i.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ r(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
ref: e,
|
|
93
|
+
className: s(
|
|
94
|
+
"flex-shrink-0 flex items-start pr-6 pt-4 text-[var(--av-brand-primary)] [&>svg]:h-4 [&>svg]:w-4",
|
|
95
|
+
a
|
|
96
|
+
),
|
|
97
|
+
...t
|
|
98
|
+
}
|
|
99
|
+
));
|
|
100
|
+
p.displayName = "WidgetAlertActions";
|
|
101
|
+
export {
|
|
102
|
+
v as WidgetAlert,
|
|
103
|
+
p as WidgetAlertActions,
|
|
104
|
+
c as WidgetAlertContent,
|
|
105
|
+
m as WidgetAlertDate,
|
|
106
|
+
x as WidgetAlertDescription,
|
|
107
|
+
f as WidgetAlertIcon,
|
|
108
|
+
g as WidgetAlertTitle,
|
|
109
|
+
n as widgetAlertVariants
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=widget-alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-alert.js","sources":["../../../src/components/ui/widget-alert.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * WidgetAlert — Dashboard alert notification widget.\n * Figma: Charts-anatomy / Alert-Widget (node 201:65481)\n *\n * Variants: info, success, warning, danger\n * Sizes: compact (112px), default (176px), expanded (with description + actions)\n * States: hover, active, focus\n *\n * Anatomy:\n * - WidgetAlert (root)\n * - WidgetAlertIcon (left icon, 16x16)\n * - WidgetAlertContent\n * - WidgetAlertTitle (semibold, 14px)\n * - WidgetAlertDate (regular, 14px)\n * - WidgetAlertDescription (regular, 14px)\n * - WidgetAlertActions (right side, more icon)\n *\n * Spacing: 24px horizontal padding, 16px vertical padding, 8px gap between title and description\n * Colors per variant:\n * info: bg=fixed-info-accent, border=fixed-info\n * success: bg=fixed-success-accent, border=fixed-success\n * warning: bg=fixed-warning-accent, border=fixed-warning\n * danger: bg=fixed-danger-accent, border=fixed-danger\n */\n\nconst widgetAlertVariants = cva(\n 'relative flex items-start rounded-lg border transition-colors',\n {\n variants: {\n variant: {\n info: 'bg-[var(--av-fixed-info-accent)] border-[var(--av-fixed-info)]',\n success: 'bg-[var(--av-fixed-success-accent)] border-[var(--av-fixed-success)]',\n warning: 'bg-[var(--av-fixed-warning-accent)] border-[var(--av-fixed-warning)]',\n danger: 'bg-[var(--av-fixed-danger-accent)] border-[var(--av-fixed-danger)]',\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 variant: 'info',\n interactive: false,\n },\n }\n)\n\nexport interface WidgetAlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof widgetAlertVariants> {}\n\nconst WidgetAlert = React.forwardRef<HTMLDivElement, WidgetAlertProps>(\n ({ className, variant, interactive, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n tabIndex={interactive ? 0 : undefined}\n className={cn(widgetAlertVariants({ variant, interactive }), className)}\n {...props}\n />\n )\n)\nWidgetAlert.displayName = 'WidgetAlert'\n\nconst WidgetAlertIcon = 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-start pl-6 pt-4 [&>svg]:h-4 [&>svg]:w-4',\n className\n )}\n {...props}\n />\n))\nWidgetAlertIcon.displayName = 'WidgetAlertIcon'\n\nconst WidgetAlertContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex-1 flex flex-col gap-2 px-4 py-4 min-w-0 text-[var(--av-fixed-primary)]',\n className\n )}\n {...props}\n />\n))\nWidgetAlertContent.displayName = 'WidgetAlertContent'\n\nconst WidgetAlertTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm font-semibold leading-6 truncate', className)}\n {...props}\n />\n))\nWidgetAlertTitle.displayName = 'WidgetAlertTitle'\n\nconst WidgetAlertDate = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm leading-6 text-[var(--av-fixed-primary)]', className)}\n {...props}\n />\n))\nWidgetAlertDate.displayName = 'WidgetAlertDate'\n\nconst WidgetAlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-sm leading-6 text-[var(--av-fixed-primary)]', className)}\n {...props}\n />\n))\nWidgetAlertDescription.displayName = 'WidgetAlertDescription'\n\nconst WidgetAlertActions = 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-start pr-6 pt-4 text-[var(--av-brand-primary)] [&>svg]:h-4 [&>svg]:w-4',\n className\n )}\n {...props}\n />\n))\nWidgetAlertActions.displayName = 'WidgetAlertActions'\n\nexport {\n WidgetAlert,\n WidgetAlertIcon,\n WidgetAlertContent,\n WidgetAlertTitle,\n WidgetAlertDate,\n WidgetAlertDescription,\n WidgetAlertActions,\n widgetAlertVariants,\n}\n"],"names":["widgetAlertVariants","cva","WidgetAlert","React","className","variant","interactive","props","ref","jsx","cn","WidgetAlertIcon","WidgetAlertContent","WidgetAlertTitle","WidgetAlertDate","WidgetAlertDescription","WidgetAlertActions"],"mappings":";;;;AA8BA,MAAMA,IAAsBC;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,MAAA;AAAA,MAEV,aAAa;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAMMC,IAAcC,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,aAAAC,GAAa,GAAGC,EAAA,GAASC,MAC9C,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,MAAK;AAAA,MACL,UAAUF,IAAc,IAAI;AAAA,MAC5B,WAAWI,EAAGV,EAAoB,EAAE,SAAAK,GAAS,aAAAC,EAAA,CAAa,GAAGF,CAAS;AAAA,MACrE,GAAGG;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EAAA;AACN,CACD;AACDQ,EAAuB,cAAc;AAErC,MAAMC,IAAqBb,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDS,EAAmB,cAAc;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WidgetPlaceholder — Empty state / placeholder widget for dashboard.
|
|
4
|
+
* Figma: Charts-anatomy / Placeholders (node 229:73962)
|
|
5
|
+
*
|
|
6
|
+
* Shows a placeholder with icon, title, and optional description/action.
|
|
7
|
+
* Two sizes: default (with large icon) and compact (with small icon).
|
|
8
|
+
* Background: inversed-primary, Border: brand-light
|
|
9
|
+
* Icon: brand-light (placeholder icon), fixed-link (action icon)
|
|
10
|
+
*
|
|
11
|
+
* States: hover (el-secondary-hover), active (el-secondary-active), focus (fixed-focus)
|
|
12
|
+
*/
|
|
13
|
+
export interface WidgetPlaceholderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
interactive?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const WidgetPlaceholder: React.ForwardRefExoticComponent<WidgetPlaceholderProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const WidgetPlaceholderHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const WidgetPlaceholderTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const WidgetPlaceholderIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const WidgetPlaceholderContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const WidgetPlaceholderImage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const WidgetPlaceholderText: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const WidgetPlaceholderAction: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const WidgetPlaceholderFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export { WidgetPlaceholder, WidgetPlaceholderHeader, WidgetPlaceholderTitle, WidgetPlaceholderIcon, WidgetPlaceholderContent, WidgetPlaceholderImage, WidgetPlaceholderText, WidgetPlaceholderAction, WidgetPlaceholderFooter, };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { cn as d } from "../../lib/utils.js";
|
|
4
|
+
const i = l.forwardRef(
|
|
5
|
+
({ className: a, interactive: e, ...r }, o) => /* @__PURE__ */ t(
|
|
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
|
+
a
|
|
14
|
+
),
|
|
15
|
+
...r
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
i.displayName = "WidgetPlaceholder";
|
|
20
|
+
const s = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: r,
|
|
24
|
+
className: d("flex items-center gap-2 px-6 pt-4 pb-2", a),
|
|
25
|
+
...e
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
s.displayName = "WidgetPlaceholderHeader";
|
|
29
|
+
const c = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: r,
|
|
33
|
+
className: d("flex-1 truncate text-sm font-semibold leading-6", a),
|
|
34
|
+
...e
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
c.displayName = "WidgetPlaceholderTitle";
|
|
38
|
+
const n = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: r,
|
|
42
|
+
className: d("flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4", a),
|
|
43
|
+
...e
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
n.displayName = "WidgetPlaceholderIcon";
|
|
47
|
+
const f = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: r,
|
|
51
|
+
className: d(
|
|
52
|
+
"flex-1 flex flex-col items-center justify-center gap-2 px-6 py-4 text-center",
|
|
53
|
+
a
|
|
54
|
+
),
|
|
55
|
+
...e
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
f.displayName = "WidgetPlaceholderContent";
|
|
59
|
+
const v = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
ref: r,
|
|
63
|
+
className: d(
|
|
64
|
+
"flex items-center justify-center text-[var(--av-brand-light)] [&>svg]:h-[72px] [&>svg]:w-[72px]",
|
|
65
|
+
a
|
|
66
|
+
),
|
|
67
|
+
...e
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
v.displayName = "WidgetPlaceholderImage";
|
|
71
|
+
const m = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
ref: r,
|
|
75
|
+
className: d("text-sm leading-6 text-[var(--av-fixed-primary)]", a),
|
|
76
|
+
...e
|
|
77
|
+
}
|
|
78
|
+
));
|
|
79
|
+
m.displayName = "WidgetPlaceholderText";
|
|
80
|
+
const x = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
ref: r,
|
|
84
|
+
className: d(
|
|
85
|
+
"text-sm font-semibold text-[var(--av-fixed-link)] cursor-pointer hover:underline",
|
|
86
|
+
a
|
|
87
|
+
),
|
|
88
|
+
...e
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
x.displayName = "WidgetPlaceholderAction";
|
|
92
|
+
const g = l.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
ref: r,
|
|
96
|
+
className: d("px-6 pb-4 pt-0 text-xs", a),
|
|
97
|
+
...e
|
|
98
|
+
}
|
|
99
|
+
));
|
|
100
|
+
g.displayName = "WidgetPlaceholderFooter";
|
|
101
|
+
export {
|
|
102
|
+
i as WidgetPlaceholder,
|
|
103
|
+
x as WidgetPlaceholderAction,
|
|
104
|
+
f as WidgetPlaceholderContent,
|
|
105
|
+
g as WidgetPlaceholderFooter,
|
|
106
|
+
s as WidgetPlaceholderHeader,
|
|
107
|
+
n as WidgetPlaceholderIcon,
|
|
108
|
+
v as WidgetPlaceholderImage,
|
|
109
|
+
m as WidgetPlaceholderText,
|
|
110
|
+
c as WidgetPlaceholderTitle
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=widget-placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-placeholder.js","sources":["../../../src/components/ui/widget-placeholder.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * WidgetPlaceholder — Empty state / placeholder widget for dashboard.\n * Figma: Charts-anatomy / Placeholders (node 229:73962)\n *\n * Shows a placeholder with icon, title, and optional description/action.\n * Two sizes: default (with large icon) and compact (with small icon).\n * Background: inversed-primary, Border: brand-light\n * Icon: brand-light (placeholder icon), fixed-link (action icon)\n *\n * States: hover (el-secondary-hover), active (el-secondary-active), focus (fixed-focus)\n */\n\nexport interface WidgetPlaceholderProps extends React.HTMLAttributes<HTMLDivElement> {\n interactive?: boolean\n}\n\nconst WidgetPlaceholder = React.forwardRef<HTMLDivElement, WidgetPlaceholderProps>(\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)\nWidgetPlaceholder.displayName = 'WidgetPlaceholder'\n\nconst WidgetPlaceholderHeader = 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))\nWidgetPlaceholderHeader.displayName = 'WidgetPlaceholderHeader'\n\nconst WidgetPlaceholderTitle = 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))\nWidgetPlaceholderTitle.displayName = 'WidgetPlaceholderTitle'\n\nconst WidgetPlaceholderIcon = 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))\nWidgetPlaceholderIcon.displayName = 'WidgetPlaceholderIcon'\n\nconst WidgetPlaceholderContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex-1 flex flex-col items-center justify-center gap-2 px-6 py-4 text-center',\n className\n )}\n {...props}\n />\n))\nWidgetPlaceholderContent.displayName = 'WidgetPlaceholderContent'\n\nconst WidgetPlaceholderImage = 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-center text-[var(--av-brand-light)] [&>svg]:h-[72px] [&>svg]:w-[72px]',\n className\n )}\n {...props}\n />\n))\nWidgetPlaceholderImage.displayName = 'WidgetPlaceholderImage'\n\nconst WidgetPlaceholderText = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm leading-6 text-[var(--av-fixed-primary)]', className)}\n {...props}\n />\n))\nWidgetPlaceholderText.displayName = 'WidgetPlaceholderText'\n\nconst WidgetPlaceholderAction = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'text-sm font-semibold text-[var(--av-fixed-link)] cursor-pointer hover:underline',\n className\n )}\n {...props}\n />\n))\nWidgetPlaceholderAction.displayName = 'WidgetPlaceholderAction'\n\nconst WidgetPlaceholderFooter = 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))\nWidgetPlaceholderFooter.displayName = 'WidgetPlaceholderFooter'\n\nexport {\n WidgetPlaceholder,\n WidgetPlaceholderHeader,\n WidgetPlaceholderTitle,\n WidgetPlaceholderIcon,\n WidgetPlaceholderContent,\n WidgetPlaceholderImage,\n WidgetPlaceholderText,\n WidgetPlaceholderAction,\n WidgetPlaceholderFooter,\n}\n"],"names":["WidgetPlaceholder","React","className","interactive","props","ref","jsx","cn","WidgetPlaceholderHeader","WidgetPlaceholderTitle","WidgetPlaceholderIcon","WidgetPlaceholderContent","WidgetPlaceholderImage","WidgetPlaceholderText","WidgetPlaceholderAction","WidgetPlaceholderFooter"],"mappings":";;;AAoBA,MAAMA,IAAoBC,EAAM;AAAA,EAC9B,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,EAAkB,cAAc;AAEhC,MAAMQ,IAA0BP,EAAM,WAGpC,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,EAAwB,cAAc;AAEtC,MAAMC,IAAyBR,EAAM,WAGnC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAA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B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,EAAA;AACN,CACD;AACDU,EAAwB,cAAc;AAEtC,MAAMC,IAA0Bd,EAAM,WAGpC,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;AACDW,EAAwB,cAAc;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WidgetProgressChunks — Chunked progress visualization widget.
|
|
4
|
+
* Figma: Charts-anatomy / Progress-Chunks (node 237:74702)
|
|
5
|
+
*
|
|
6
|
+
* Shows progress as discrete colored chunks/segments with labels and values.
|
|
7
|
+
* Colors: chart-success, chart-warning, chart-critical, chart-danger
|
|
8
|
+
* Background: inversed-primary, Border: brand-light
|
|
9
|
+
* Divider: brand-accent
|
|
10
|
+
*
|
|
11
|
+
* Anatomy:
|
|
12
|
+
* - WidgetProgressChunks (root)
|
|
13
|
+
* - Header: title + icon
|
|
14
|
+
* - Chunks: rows of labeled progress segments
|
|
15
|
+
* - Footer: optional summary
|
|
16
|
+
*
|
|
17
|
+
* States: hover, active, focus, focus-data
|
|
18
|
+
*/
|
|
19
|
+
export interface ProgressChunk {
|
|
20
|
+
label: string;
|
|
21
|
+
value: number;
|
|
22
|
+
total: number;
|
|
23
|
+
color: string;
|
|
24
|
+
}
|
|
25
|
+
export interface WidgetProgressChunksProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
interactive?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const WidgetProgressChunks: React.ForwardRefExoticComponent<WidgetProgressChunksProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const WidgetProgressChunksHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const WidgetProgressChunksTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const WidgetProgressChunksIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const WidgetProgressChunksBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export interface WidgetProgressChunkRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
label: string;
|
|
35
|
+
value: number;
|
|
36
|
+
total: number;
|
|
37
|
+
color: string;
|
|
38
|
+
formatValue?: (value: number) => string;
|
|
39
|
+
formatTotal?: (total: number) => string;
|
|
40
|
+
}
|
|
41
|
+
declare const WidgetProgressChunkRow: React.ForwardRefExoticComponent<WidgetProgressChunkRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
declare const WidgetProgressChunksFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
export { WidgetProgressChunks, WidgetProgressChunksHeader, WidgetProgressChunksTitle, WidgetProgressChunksIcon, WidgetProgressChunksBody, WidgetProgressChunkRow, WidgetProgressChunksFooter, };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { cn as o } from "../../lib/utils.js";
|
|
4
|
+
const h = i.forwardRef(
|
|
5
|
+
({ className: r, interactive: s, ...e }, d) => /* @__PURE__ */ a(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
ref: d,
|
|
9
|
+
tabIndex: s ? 0 : void 0,
|
|
10
|
+
className: o(
|
|
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
|
+
s && "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
|
+
r
|
|
14
|
+
),
|
|
15
|
+
...e
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
h.displayName = "WidgetProgressChunks";
|
|
20
|
+
const p = i.forwardRef(({ className: r, ...s }, e) => /* @__PURE__ */ a(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: e,
|
|
24
|
+
className: o("flex items-center gap-2 px-6 pt-4 pb-2", r),
|
|
25
|
+
...s
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
p.displayName = "WidgetProgressChunksHeader";
|
|
29
|
+
const x = i.forwardRef(({ className: r, ...s }, e) => /* @__PURE__ */ a(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: e,
|
|
33
|
+
className: o("flex-1 truncate text-sm font-semibold leading-6", r),
|
|
34
|
+
...s
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
x.displayName = "WidgetProgressChunksTitle";
|
|
38
|
+
const b = i.forwardRef(({ className: r, ...s }, e) => /* @__PURE__ */ a(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
ref: e,
|
|
42
|
+
className: o("flex-shrink-0 text-[var(--av-fixed-link)] [&>svg]:h-4 [&>svg]:w-4", r),
|
|
43
|
+
...s
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
b.displayName = "WidgetProgressChunksIcon";
|
|
47
|
+
const y = i.forwardRef(({ className: r, ...s }, e) => /* @__PURE__ */ a(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: e,
|
|
51
|
+
className: o("flex flex-col gap-2 px-6 py-2", r),
|
|
52
|
+
...s
|
|
53
|
+
}
|
|
54
|
+
));
|
|
55
|
+
y.displayName = "WidgetProgressChunksBody";
|
|
56
|
+
const N = i.forwardRef(
|
|
57
|
+
({ className: r, label: s, value: e, total: d, color: c, formatValue: n, formatTotal: l, ...g }, f) => {
|
|
58
|
+
const v = d > 0 ? e / d * 100 : 0, m = n ? n(e) : String(e), u = l ? l(d) : String(d);
|
|
59
|
+
return /* @__PURE__ */ t("div", { ref: f, className: o("flex flex-col gap-1", r), ...g, children: [
|
|
60
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-between text-xs", children: [
|
|
61
|
+
/* @__PURE__ */ a("span", { className: "text-[var(--av-fixed-primary)]", children: s }),
|
|
62
|
+
/* @__PURE__ */ t("span", { className: "font-semibold tabular-nums", children: [
|
|
63
|
+
m,
|
|
64
|
+
" / ",
|
|
65
|
+
u
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ a("div", { className: "h-2 w-full overflow-hidden rounded bg-[var(--av-brand-light)]", children: /* @__PURE__ */ a(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "h-full rounded transition-all",
|
|
72
|
+
style: {
|
|
73
|
+
width: `${Math.min(v, 100)}%`,
|
|
74
|
+
backgroundColor: c
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
) })
|
|
78
|
+
] });
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
N.displayName = "WidgetProgressChunkRow";
|
|
82
|
+
const k = i.forwardRef(({ className: r, ...s }, e) => /* @__PURE__ */ a(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref: e,
|
|
86
|
+
className: o(
|
|
87
|
+
"border-t border-[var(--av-brand-accent)] px-6 py-2 text-xs",
|
|
88
|
+
r
|
|
89
|
+
),
|
|
90
|
+
...s
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
k.displayName = "WidgetProgressChunksFooter";
|
|
94
|
+
export {
|
|
95
|
+
N as WidgetProgressChunkRow,
|
|
96
|
+
h as WidgetProgressChunks,
|
|
97
|
+
y as WidgetProgressChunksBody,
|
|
98
|
+
k as WidgetProgressChunksFooter,
|
|
99
|
+
p as WidgetProgressChunksHeader,
|
|
100
|
+
b as WidgetProgressChunksIcon,
|
|
101
|
+
x as WidgetProgressChunksTitle
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=widget-progress-chunks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-progress-chunks.js","sources":["../../../src/components/ui/widget-progress-chunks.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * WidgetProgressChunks — Chunked progress visualization widget.\n * Figma: Charts-anatomy / Progress-Chunks (node 237:74702)\n *\n * Shows progress as discrete colored chunks/segments with labels and values.\n * Colors: chart-success, chart-warning, chart-critical, chart-danger\n * Background: inversed-primary, Border: brand-light\n * Divider: brand-accent\n *\n * Anatomy:\n * - WidgetProgressChunks (root)\n * - Header: title + icon\n * - Chunks: rows of labeled progress segments\n * - Footer: optional summary\n *\n * States: hover, active, focus, focus-data\n */\n\nexport interface ProgressChunk {\n label: string\n value: number\n total: number\n color: string\n}\n\nexport interface WidgetProgressChunksProps extends React.HTMLAttributes<HTMLDivElement> {\n interactive?: boolean\n}\n\nconst WidgetProgressChunks = React.forwardRef<HTMLDivElement, WidgetProgressChunksProps>(\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)\nWidgetProgressChunks.displayName = 'WidgetProgressChunks'\n\nconst WidgetProgressChunksHeader = 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))\nWidgetProgressChunksHeader.displayName = 'WidgetProgressChunksHeader'\n\nconst WidgetProgressChunksTitle = 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))\nWidgetProgressChunksTitle.displayName = 'WidgetProgressChunksTitle'\n\nconst WidgetProgressChunksIcon = 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))\nWidgetProgressChunksIcon.displayName = 'WidgetProgressChunksIcon'\n\nconst WidgetProgressChunksBody = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('flex flex-col gap-2 px-6 py-2', className)}\n {...props}\n />\n))\nWidgetProgressChunksBody.displayName = 'WidgetProgressChunksBody'\n\nexport interface WidgetProgressChunkRowProps extends React.HTMLAttributes<HTMLDivElement> {\n label: string\n value: number\n total: number\n color: string\n formatValue?: (value: number) => string\n formatTotal?: (total: number) => string\n}\n\nconst WidgetProgressChunkRow = React.forwardRef<HTMLDivElement, WidgetProgressChunkRowProps>(\n ({ className, label, value, total, color, formatValue, formatTotal, ...props }, ref) => {\n const pct = total > 0 ? (value / total) * 100 : 0\n const displayValue = formatValue ? formatValue(value) : String(value)\n const displayTotal = formatTotal ? formatTotal(total) : String(total)\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1', className)} {...props}>\n <div className=\"flex items-center justify-between text-xs\">\n <span className=\"text-[var(--av-fixed-primary)]\">{label}</span>\n <span className=\"font-semibold tabular-nums\">\n {displayValue} / {displayTotal}\n </span>\n </div>\n <div className=\"h-2 w-full overflow-hidden rounded bg-[var(--av-brand-light)]\">\n <div\n className=\"h-full rounded transition-all\"\n style={{\n width: `${Math.min(pct, 100)}%`,\n backgroundColor: color,\n }}\n />\n </div>\n </div>\n )\n }\n)\nWidgetProgressChunkRow.displayName = 'WidgetProgressChunkRow'\n\nconst WidgetProgressChunksFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'border-t border-[var(--av-brand-accent)] px-6 py-2 text-xs',\n className\n )}\n {...props}\n />\n))\nWidgetProgressChunksFooter.displayName = 'WidgetProgressChunksFooter'\n\nexport {\n WidgetProgressChunks,\n WidgetProgressChunksHeader,\n WidgetProgressChunksTitle,\n WidgetProgressChunksIcon,\n WidgetProgressChunksBody,\n WidgetProgressChunkRow,\n WidgetProgressChunksFooter,\n}\n"],"names":["WidgetProgressChunks","React","className","interactive","props","ref","jsx","cn","WidgetProgressChunksHeader","WidgetProgressChunksTitle","WidgetProgressChunksIcon","WidgetProgressChunksBody","WidgetProgressChunkRow","label","value","total","color","formatValue","formatTotal","pct","displayValue","displayTotal","jsxs","WidgetProgressChunksFooter"],"mappings":";;;AAiCA,MAAMA,IAAuBC,EAAM;AAAA,EACjC,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;AAG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H,CAAK,IAAI,OAAOA,CAAK,GAC9DO,IAAeH,IAAcA,EAAYH,CAAK,IAAI,OAAOA,CAAK;AAEpE,WACE,gBAAAO,EAAC,SAAI,KAAAjB,GAAU,WAAWE,EAAG,uBAAuBL,CAAS,GAAI,GAAGE,GAClE,UAAA;AAAA,MAAA,gBAAAkB,EAAC,OAAA,EAAI,WAAU,6CACb,UAAA;AAAA,QAAA,gBAAAhB,EAAC,QAAA,EAAK,WAAU,kCAAkC,UAAAO,GAAM;AAAA,QACxD,gBAAAS,EAAC,QAAA,EAAK,WAAU,8BACb,UAAA;AAAA,UAAAF;AAAA,UAAa;AAAA,UAAIC;AAAA,QAAA,EAAA,CACpB;AAAA,MAAA,GACF;AAAA,MACA,gBAAAf,EAAC,OAAA,EAAI,WAAU,iEACb,UAAA,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO;AAAA,YACL,OAAO,GAAG,KAAK,IAAIa,GAAK,GAAG,CAAC;AAAA,YAC5B,iBAAiBH;AAAA,UAAA;AAAA,QACnB;AAAA,MAAA,EACF,CACF;AAAA,IAAA,GACF;AAAA,EAEJ;AACF;AACAJ,EAAuB,cAAc;AAErC,MAAMW,IAA6BtB,EAAM,WAGvC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,EAAA;AACN,CACD;AACDmB,EAA2B,cAAc;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WidgetProgressTiers — Tiered progress bar widget for dashboard.
|
|
4
|
+
* Figma: Charts-anatomy / Progress-Tiers (node 229:70578)
|
|
5
|
+
*
|
|
6
|
+
* Shows a horizontal stacked bar with colored tiers and labels.
|
|
7
|
+
* Colors: chart-success, chart-warning, chart-critical, chart-danger, chart-neutral
|
|
8
|
+
* Background: inversed-primary, Border: brand-light
|
|
9
|
+
* Divider: brand-accent
|
|
10
|
+
*
|
|
11
|
+
* Anatomy:
|
|
12
|
+
* - WidgetProgressTiers (root)
|
|
13
|
+
* - Header: title + icon + dropdown
|
|
14
|
+
* - Bar: stacked horizontal segments
|
|
15
|
+
* - Legend: tier labels with values
|
|
16
|
+
* - Footer: optional summary
|
|
17
|
+
*
|
|
18
|
+
* States: hover (el-secondary-hover), active (el-secondary-active), focus (fixed-focus), focus-data (fixed-focus on tier)
|
|
19
|
+
*/
|
|
20
|
+
export interface ProgressTier {
|
|
21
|
+
label: string;
|
|
22
|
+
value: number;
|
|
23
|
+
color: string;
|
|
24
|
+
}
|
|
25
|
+
export interface WidgetProgressTiersProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
interactive?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const WidgetProgressTiers: React.ForwardRefExoticComponent<WidgetProgressTiersProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const WidgetProgressTiersHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const WidgetProgressTiersTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const WidgetProgressTiersIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export interface WidgetProgressTiersBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
tiers: ProgressTier[];
|
|
34
|
+
total?: number;
|
|
35
|
+
}
|
|
36
|
+
declare const WidgetProgressTiersBar: React.ForwardRefExoticComponent<WidgetProgressTiersBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const WidgetProgressTiersLegend: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export interface WidgetProgressTiersLegendItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
color: string;
|
|
40
|
+
label: string;
|
|
41
|
+
value?: string | number;
|
|
42
|
+
}
|
|
43
|
+
declare const WidgetProgressTiersLegendItem: React.ForwardRefExoticComponent<WidgetProgressTiersLegendItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
declare const WidgetProgressTiersFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export { WidgetProgressTiers, WidgetProgressTiersHeader, WidgetProgressTiersTitle, WidgetProgressTiersIcon, WidgetProgressTiersBar, WidgetProgressTiersLegend, WidgetProgressTiersLegendItem, WidgetProgressTiersFooter, };
|