@acronis-platform/ui-react 0.36.0 → 0.43.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.
Files changed (102) hide show
  1. package/dist/components/ui/card/card.js +92 -0
  2. package/dist/components/ui/card/card.js.map +1 -0
  3. package/dist/components/ui/data-table/data-table-column-header.js +48 -0
  4. package/dist/components/ui/data-table/data-table-column-header.js.map +1 -0
  5. package/dist/components/ui/data-table/data-table-pagination.js +89 -0
  6. package/dist/components/ui/data-table/data-table-pagination.js.map +1 -0
  7. package/dist/components/ui/data-table/data-table-toolbar.js +46 -0
  8. package/dist/components/ui/data-table/data-table-toolbar.js.map +1 -0
  9. package/dist/components/ui/data-table/data-table-view-options.js +40 -0
  10. package/dist/components/ui/data-table/data-table-view-options.js.map +1 -0
  11. package/dist/components/ui/data-table/data-table.js +89 -0
  12. package/dist/components/ui/data-table/data-table.js.map +1 -0
  13. package/dist/components/ui/dialog/dialog.js +140 -0
  14. package/dist/components/ui/dialog/dialog.js.map +1 -0
  15. package/dist/components/ui/dropdown-menu/dropdown-menu.js +159 -0
  16. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -0
  17. package/dist/components/ui/empty/empty.js +78 -0
  18. package/dist/components/ui/empty/empty.js.map +1 -0
  19. package/dist/components/ui/input/input.js +2 -2
  20. package/dist/components/ui/input/input.js.map +1 -1
  21. package/dist/components/ui/input-search/input-search.js +4 -4
  22. package/dist/components/ui/input-search/input-search.js.map +1 -1
  23. package/dist/components/ui/input-text/input-text.js +1 -1
  24. package/dist/components/ui/input-text/input-text.js.map +1 -1
  25. package/dist/components/ui/label/label.js +12 -0
  26. package/dist/components/ui/label/label.js.map +1 -0
  27. package/dist/components/ui/popover/popover.js +48 -0
  28. package/dist/components/ui/popover/popover.js.map +1 -0
  29. package/dist/components/ui/progress/progress.js +30 -0
  30. package/dist/components/ui/progress/progress.js.map +1 -0
  31. package/dist/components/ui/search/search.js +2 -2
  32. package/dist/components/ui/search/search.js.map +1 -1
  33. package/dist/components/ui/separator/separator.js +22 -0
  34. package/dist/components/ui/separator/separator.js.map +1 -0
  35. package/dist/components/ui/spinner/spinner.js +38 -0
  36. package/dist/components/ui/spinner/spinner.js.map +1 -0
  37. package/dist/components/ui/table/table.js +118 -0
  38. package/dist/components/ui/table/table.js.map +1 -0
  39. package/dist/components/ui/tabs/tabs.js +44 -0
  40. package/dist/components/ui/tabs/tabs.js.map +1 -0
  41. package/dist/components/ui/toast/toast.js +83 -0
  42. package/dist/components/ui/toast/toast.js.map +1 -0
  43. package/dist/components/ui/widget-placeholder/widget-placeholder.js +106 -0
  44. package/dist/components/ui/widget-placeholder/widget-placeholder.js.map +1 -0
  45. package/dist/index.js +210 -113
  46. package/dist/index.js.map +1 -1
  47. package/dist/node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@tanstack/react-table/build/lib/index.js +104 -0
  48. package/dist/node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@tanstack/react-table/build/lib/index.js.map +1 -0
  49. package/dist/node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.js +1900 -0
  50. package/dist/node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.js.map +1 -0
  51. package/dist/react.js +210 -113
  52. package/dist/react.js.map +1 -1
  53. package/dist/src/components/ui/card/card.d.ts +17 -0
  54. package/dist/src/components/ui/card/index.d.ts +1 -0
  55. package/dist/src/components/ui/data-table/data-table-column-header.d.ts +8 -0
  56. package/dist/src/components/ui/data-table/data-table-pagination.d.ts +8 -0
  57. package/dist/src/components/ui/data-table/data-table-toolbar.d.ts +9 -0
  58. package/dist/src/components/ui/data-table/data-table-view-options.d.ts +6 -0
  59. package/dist/src/components/ui/data-table/data-table.d.ts +24 -0
  60. package/dist/src/components/ui/data-table/data-table.docs.d.ts +22 -0
  61. package/dist/src/components/ui/data-table/index.d.ts +5 -0
  62. package/dist/src/components/ui/dialog/dialog.d.ts +39 -0
  63. package/dist/src/components/ui/dialog/dialog.docs.d.ts +24 -0
  64. package/dist/src/components/ui/dialog/index.d.ts +1 -0
  65. package/dist/src/components/ui/dropdown-menu/dropdown-menu.d.ts +39 -0
  66. package/dist/src/components/ui/dropdown-menu/dropdown-menu.docs.d.ts +25 -0
  67. package/dist/src/components/ui/dropdown-menu/index.d.ts +1 -0
  68. package/dist/src/components/ui/empty/empty.d.ts +9 -0
  69. package/dist/src/components/ui/empty/index.d.ts +1 -0
  70. package/dist/src/components/ui/input/index.d.ts +1 -1
  71. package/dist/src/components/ui/input/input.d.ts +3 -3
  72. package/dist/src/components/ui/input-search/input-search.d.ts +2 -2
  73. package/dist/src/components/ui/label/index.d.ts +1 -0
  74. package/dist/src/components/ui/label/label.d.ts +5 -0
  75. package/dist/src/components/ui/label/label.docs.d.ts +10 -0
  76. package/dist/src/components/ui/popover/index.d.ts +1 -0
  77. package/dist/src/components/ui/popover/popover.d.ts +27 -0
  78. package/dist/src/components/ui/popover/popover.docs.d.ts +25 -0
  79. package/dist/src/components/ui/progress/index.d.ts +1 -0
  80. package/dist/src/components/ui/progress/progress.d.ts +9 -0
  81. package/dist/src/components/ui/progress/progress.docs.d.ts +16 -0
  82. package/dist/src/components/ui/search/index.d.ts +1 -1
  83. package/dist/src/components/ui/search/search.d.ts +3 -3
  84. package/dist/src/components/ui/separator/index.d.ts +1 -0
  85. package/dist/src/components/ui/separator/separator.d.ts +3 -0
  86. package/dist/src/components/ui/spinner/index.d.ts +1 -0
  87. package/dist/src/components/ui/spinner/spinner.d.ts +9 -0
  88. package/dist/src/components/ui/table/index.d.ts +1 -0
  89. package/dist/src/components/ui/table/table.d.ts +23 -0
  90. package/dist/src/components/ui/tabs/index.d.ts +1 -0
  91. package/dist/src/components/ui/tabs/tabs.d.ts +6 -0
  92. package/dist/src/components/ui/tabs/tabs.docs.d.ts +25 -0
  93. package/dist/src/components/ui/tag/tag.d.ts +1 -1
  94. package/dist/src/components/ui/toast/index.d.ts +1 -0
  95. package/dist/src/components/ui/toast/toast.d.ts +48 -0
  96. package/dist/src/components/ui/toast/toast.docs.d.ts +12 -0
  97. package/dist/src/components/ui/widget-placeholder/index.d.ts +1 -0
  98. package/dist/src/components/ui/widget-placeholder/widget-placeholder.d.ts +18 -0
  99. package/dist/src/components/ui/widget-placeholder/widget-placeholder.docs.d.ts +14 -0
  100. package/dist/src/index.d.ts +18 -2
  101. package/dist/ui-react.css +1 -1
  102. package/package.json +4 -1
@@ -0,0 +1,22 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { Separator as e } from "@base-ui/react/separator";
4
+ import { cn as f } from "../../../lib/utils.js";
5
+ const l = m.forwardRef(({ className: o, orientation: r = "horizontal", ...a }, p) => /* @__PURE__ */ t(
6
+ e,
7
+ {
8
+ ref: p,
9
+ orientation: r,
10
+ className: f(
11
+ "shrink-0 bg-border",
12
+ r === "horizontal" ? "h-px w-full" : "h-full w-px",
13
+ o
14
+ ),
15
+ ...a
16
+ }
17
+ ));
18
+ l.displayName = "Separator";
19
+ export {
20
+ l as Separator
21
+ };
22
+ //# sourceMappingURL=separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.js","sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `separator`\n// (packages/ui-legacy/src/components/ui/separator.tsx). A thin divider built on\n// the Base UI Separator primitive (sets the `separator` role + aria-orientation).\n// No `--ui-separator-*` tier; the line uses the shared divider token `bg-border`\n// (--ui-border-on-surface-border), replacing the legacy `bg-primary/10` hack.\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive>\n>(({ className, orientation = 'horizontal', ...props }, ref) => (\n <SeparatorPrimitive\n ref={ref}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = 'Separator';\n\nexport { Separator };\n"],"names":["Separator","React","className","orientation","props","ref","jsx","SeparatorPrimitive","cn"],"mappings":";;;;AAWA,MAAMA,IAAYC,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,aAAAC,IAAc,cAAc,GAAGC,KAASC,MACtD,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,aAAAF;AAAA,IACA,WAAWK;AAAA,MACT;AAAA,MACAL,MAAgB,eAAe,gBAAgB;AAAA,MAC/CD;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAU,cAAc;"}
@@ -0,0 +1,38 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { cva as o } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cn as t } from "../../../lib/utils.js";
5
+ const d = o(
6
+ "inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent text-secondary",
7
+ {
8
+ variants: {
9
+ size: {
10
+ sm: "size-4",
11
+ md: "size-6",
12
+ lg: "size-8",
13
+ xl: "size-12"
14
+ }
15
+ },
16
+ defaultVariants: {
17
+ size: "md"
18
+ }
19
+ }
20
+ ), l = n.forwardRef(
21
+ ({ className: e, size: a, ...i }, s) => /* @__PURE__ */ r(
22
+ "div",
23
+ {
24
+ ref: s,
25
+ role: "status",
26
+ "aria-label": "Loading",
27
+ className: t(d({ size: a }), e),
28
+ ...i,
29
+ children: /* @__PURE__ */ r("span", { className: "sr-only", children: "Loading…" })
30
+ }
31
+ )
32
+ );
33
+ l.displayName = "Spinner";
34
+ export {
35
+ l as Spinner,
36
+ d as spinnerVariants
37
+ };
38
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sources":["../../../../src/components/ui/spinner/spinner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `spinner`\n// (packages/ui-legacy/src/components/ui/spinner.tsx). A CSS loading spinner — no\n// Base UI primitive. No `--ui-spinner-*` tier; the ring color defaults to the\n// brand action blue via `text-secondary` (--ui-background-brand-secondary, used\n// through `border-current`), replacing the legacy `--spinner-color` var.\n// Override the color with a `text-*` class. `size` mirrors the legacy scale.\nconst spinnerVariants = cva(\n 'inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent text-secondary',\n {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-6',\n lg: 'size-8',\n xl: 'size-12',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n);\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof spinnerVariants> {}\n\nconst Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ className, size, ...props }, ref) => (\n <div\n ref={ref}\n role=\"status\"\n aria-label=\"Loading\"\n className={cn(spinnerVariants({ size }), className)}\n {...props}\n >\n <span className=\"sr-only\">Loading…</span>\n </div>\n )\n);\nSpinner.displayName = 'Spinner';\n\nexport { Spinner, spinnerVariants };\n"],"names":["spinnerVariants","cva","Spinner","React","className","size","props","ref","jsx","cn"],"mappings":";;;;AAWA,MAAMA,IAAkBC;AAAA,EACtB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAMMC,IAAUC,EAAM;AAAA,EACpB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAC9B,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,MAAK;AAAA,MACL,cAAW;AAAA,MACX,WAAWE,EAAGT,EAAgB,EAAE,MAAAK,EAAA,CAAM,GAAGD,CAAS;AAAA,MACjD,GAAGE;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,WAAA,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGxC;AACAN,EAAQ,cAAc;"}
@@ -0,0 +1,118 @@
1
+ import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import { ArrowUpIcon as n, ArrowDownIcon as m, ArrowsDownUpIcon as f } from "@acronis-platform/icons-react/stroke-mono";
4
+ import { cn as r } from "../../../lib/utils.js";
5
+ const u = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ l(
6
+ "table",
7
+ {
8
+ ref: o,
9
+ className: r(
10
+ "w-full caption-bottom border-collapse text-sm text-[var(--ui-table-data-value-color-idle)]",
11
+ a
12
+ ),
13
+ ...e
14
+ }
15
+ ) }));
16
+ u.displayName = "Table";
17
+ const p = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l("thead", { ref: o, className: r(a), ...e }));
18
+ p.displayName = "TableHeader";
19
+ const v = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l(
20
+ "tbody",
21
+ {
22
+ ref: o,
23
+ className: r("[&_tr:last-child]:border-0", a),
24
+ ...e
25
+ }
26
+ ));
27
+ v.displayName = "TableBody";
28
+ const g = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l(
29
+ "tfoot",
30
+ {
31
+ ref: o,
32
+ className: r(
33
+ "border-t border-[color:var(--ui-table-global-cell-border-color)] font-medium [&>tr]:last:border-b-0",
34
+ a
35
+ ),
36
+ ...e
37
+ }
38
+ ));
39
+ g.displayName = "TableFooter";
40
+ const h = t.forwardRef(
41
+ ({ className: a, selected: e, ...o }, i) => /* @__PURE__ */ l(
42
+ "tr",
43
+ {
44
+ ref: i,
45
+ "data-state": e ? "selected" : void 0,
46
+ className: r(
47
+ "border-b border-[color:var(--ui-table-global-cell-border-color)] bg-[var(--ui-table-global-row-color-idle)] transition-colors hover:bg-[var(--ui-table-global-row-color-hover)] data-[state=selected]:bg-[var(--ui-table-global-row-color-active)]",
48
+ a
49
+ ),
50
+ ...o
51
+ }
52
+ )
53
+ );
54
+ h.displayName = "TableRow";
55
+ function x({ direction: a }) {
56
+ const e = "size-[var(--ui-table-header-sort-icon-size)]";
57
+ return a === "asc" ? /* @__PURE__ */ l(n, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-active)]") }) : a === "desc" ? /* @__PURE__ */ l(m, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-active)]") }) : /* @__PURE__ */ l(f, { className: r(e, "text-[var(--ui-table-header-sort-icon-color-inactive)]") });
58
+ }
59
+ const w = t.forwardRef(
60
+ ({ className: a, children: e, sortable: o, sortDirection: i = !1, onSort: s, ...c }, d) => /* @__PURE__ */ l(
61
+ "th",
62
+ {
63
+ ref: d,
64
+ "aria-sort": i === "asc" ? "ascending" : i === "desc" ? "descending" : o ? "none" : void 0,
65
+ className: r(
66
+ "h-10 px-[var(--ui-table-header-cell-padding-x)] text-left align-middle text-sm font-semibold text-[var(--ui-table-header-label-color)] [&:has([role=checkbox])]:pr-0 [&_[role=checkbox]]:align-middle",
67
+ o && "cursor-pointer transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)]",
68
+ a
69
+ ),
70
+ ...c,
71
+ children: o ? /* @__PURE__ */ b(
72
+ "button",
73
+ {
74
+ type: "button",
75
+ onClick: s,
76
+ className: "-mx-1 inline-flex items-center gap-[var(--ui-table-header-gap)] rounded-sm px-1 outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
77
+ children: [
78
+ e,
79
+ /* @__PURE__ */ l(x, { direction: i })
80
+ ]
81
+ }
82
+ ) : e
83
+ }
84
+ )
85
+ );
86
+ w.displayName = "TableHead";
87
+ const N = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l(
88
+ "td",
89
+ {
90
+ ref: o,
91
+ className: r(
92
+ "h-10 px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm [&:has([role=checkbox])]:pr-0 [&_[role=checkbox]]:align-middle",
93
+ a
94
+ ),
95
+ ...e
96
+ }
97
+ ));
98
+ N.displayName = "TableCell";
99
+ const T = t.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ l(
100
+ "caption",
101
+ {
102
+ ref: o,
103
+ className: r("mt-4 text-sm text-muted-foreground", a),
104
+ ...e
105
+ }
106
+ ));
107
+ T.displayName = "TableCaption";
108
+ export {
109
+ u as Table,
110
+ v as TableBody,
111
+ T as TableCaption,
112
+ N as TableCell,
113
+ g as TableFooter,
114
+ w as TableHead,
115
+ p as TableHeader,
116
+ h as TableRow
117
+ };
118
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sources":["../../../../src/components/ui/table/table.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n ArrowsDownUpIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Composable table primitives ported from `@acronis-platform/shadcn-uikit`'s\n// `table` (packages/ui-legacy/src/components/ui/table.tsx) and informed by the\n// \"pre-release\" Table design in the shadcn-uikit Figma (node 2948-2416). Unlike\n// Card/Dialog, a `--ui-table-*` token tier already exists, so these parts theme\n// directly from it (imported in styles/index.css):\n// • cell -> --ui-table-global-cell-{border-color,padding-x,padding-y,min-height}\n// • row -> --ui-table-global-row-color-{idle,hover,active} (active = selected)\n// • header -> --ui-table-header-{label-color,cell-color-hover,cell-padding-x,gap}\n// • sort -> --ui-table-header-sort-icon-{color-active,color-inactive,size}\n// • data -> --ui-table-data-value-color-{idle,disabled}\n// The design's row checkboxes, tags, links and the column-settings button are\n// consumer composition (use Checkbox / Tag / Link / ButtonIcon in cells). A\n// TanStack-backed `DataTable` (sorting/selection logic over these primitives) is\n// a planned follow-up, mirroring legacy's separate `data-table`. Reconcile with\n// `/figma-component Table <url> --update` once the design is ready for dev.\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\n 'w-full caption-bottom border-collapse text-sm text-[var(--ui-table-data-value-color-idle)]',\n className\n )}\n {...props}\n />\n </div>\n));\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(className)} {...props} />\n));\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n));\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n 'border-t border-[color:var(--ui-table-global-cell-border-color)] font-medium [&>tr]:last:border-b-0',\n className\n )}\n {...props}\n />\n));\nTableFooter.displayName = 'TableFooter';\n\nexport interface TableRowProps\n extends React.HTMLAttributes<HTMLTableRowElement> {\n /** Mark the row as selected — applies the active row token + `data-state`. */\n selected?: boolean;\n}\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(\n ({ className, selected, ...props }, ref) => (\n <tr\n ref={ref}\n data-state={selected ? 'selected' : undefined}\n className={cn(\n 'border-b border-[color:var(--ui-table-global-cell-border-color)] bg-[var(--ui-table-global-row-color-idle)] transition-colors hover:bg-[var(--ui-table-global-row-color-hover)] data-[state=selected]:bg-[var(--ui-table-global-row-color-active)]',\n className\n )}\n {...props}\n />\n )\n);\nTableRow.displayName = 'TableRow';\n\ntype SortDirection = 'asc' | 'desc' | false;\n\nexport interface TableHeadProps\n extends React.ThHTMLAttributes<HTMLTableCellElement> {\n /** Render the column as sortable — adds a sort affordance and `aria-sort`. */\n sortable?: boolean;\n /** Current sort direction for this column (`false` = sortable but unsorted). */\n sortDirection?: SortDirection;\n /** Invoked when the user activates a sortable header (click / Enter / Space). */\n onSort?: () => void;\n}\n\nfunction SortIcon({ direction }: { direction: SortDirection }) {\n const size = 'size-[var(--ui-table-header-sort-icon-size)]';\n if (direction === 'asc') {\n return <ArrowUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n if (direction === 'desc') {\n return <ArrowDownIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-active)]')} />;\n }\n return <ArrowsDownUpIcon className={cn(size, 'text-[var(--ui-table-header-sort-icon-color-inactive)]')} />;\n}\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(\n ({ className, children, sortable, sortDirection = false, onSort, ...props }, ref) => (\n <th\n ref={ref}\n aria-sort={\n sortDirection === 'asc'\n ? 'ascending'\n : sortDirection === 'desc'\n ? 'descending'\n : sortable\n ? 'none'\n : undefined\n }\n className={cn(\n 'h-10 px-[var(--ui-table-header-cell-padding-x)] text-left align-middle text-sm font-semibold text-[var(--ui-table-header-label-color)] [&:has([role=checkbox])]:pr-0 [&_[role=checkbox]]:align-middle',\n sortable &&\n 'cursor-pointer transition-colors hover:bg-[var(--ui-table-header-cell-color-hover)]',\n className\n )}\n {...props}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className=\"-mx-1 inline-flex items-center gap-[var(--ui-table-header-gap)] rounded-sm px-1 outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]\"\n >\n {children}\n <SortIcon direction={sortDirection} />\n </button>\n ) : (\n children\n )}\n </th>\n )\n);\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\n 'h-10 px-[var(--ui-table-global-cell-padding-x)] py-[var(--ui-table-global-cell-padding-y)] align-middle text-sm [&:has([role=checkbox])]:pr-0 [&_[role=checkbox]]:align-middle',\n className\n )}\n {...props}\n />\n));\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn('mt-4 text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nTableCaption.displayName = 'TableCaption';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n"],"names":["Table","React","className","props","ref","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","selected","SortIcon","direction","size","ArrowUpIcon","ArrowDownIcon","ArrowsDownUpIcon","TableHead","children","sortable","sortDirection","onSort","jsxs","TableCell","TableCaption"],"mappings":";;;;AAyBA,MAAMA,IAAQC,EAAM,WAGlB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC,EAAC,OAAA,EAAI,WAAU,iCACb,UAAA,gBAAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,GACF,CACD;AACDH,EAAM,cAAc;AAEpB,MAAMO,IAAcN,EAAM,WAGxB,CAAC,E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AAM;AAAA,EACtB,CAAC,EAAE,WAAAC,GAAW,UAAAiB,GAAU,UAAAC,GAAU,eAAAC,IAAgB,IAAO,QAAAC,GAAQ,GAAGnB,KAASC,MAC3E,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aACEiB,MAAkB,QACd,cACAA,MAAkB,SAChB,eACAD,IACE,SACA;AAAA,MAEV,WAAWd;AAAA,QACT;AAAA,QACAc,KACE;AAAA,QACFlB;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEH,UAAAiB,IACC,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAASD;AAAA,UACT,WAAU;AAAA,UAET,UAAA;AAAA,YAAAH;AAAA,YACD,gBAAAd,EAACO,GAAA,EAAS,WAAWS,EAAA,CAAe;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,IAGtCF;AAAA,IAAA;AAAA,EAAA;AAIR;AACAD,EAAU,cAAc;AAExB,MAAMM,IAAYvB,EAAM,WAGtB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDqB,EAAU,cAAc;AAExB,MAAMC,IAAexB,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,sCAAsCJ,CAAS;AAAA,IAC5D,GAAGC;AAAA,EAAA;AACN,CACD;AACDsB,EAAa,cAAc;"}
@@ -0,0 +1,44 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { Tabs as a } from "@base-ui/react/tabs";
4
+ import { cn as t } from "../../../lib/utils.js";
5
+ const b = a.Root, n = o.forwardRef(({ className: e, ...s }, r) => /* @__PURE__ */ i(
6
+ a.List,
7
+ {
8
+ ref: r,
9
+ className: t("inline-flex items-stretch rounded-md", e),
10
+ ...s
11
+ }
12
+ ));
13
+ n.displayName = "TabsList";
14
+ const d = o.forwardRef(({ className: e, ...s }, r) => /* @__PURE__ */ i(
15
+ a.Tab,
16
+ {
17
+ ref: r,
18
+ className: t(
19
+ "-mr-px inline-flex flex-1 items-center justify-center whitespace-nowrap border border-secondary px-2 py-1 text-sm font-semibold text-secondary transition-colors first:rounded-l-md last:-mr-0 last:rounded-r-md outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary data-[active]:text-primary-foreground",
20
+ e
21
+ ),
22
+ ...s
23
+ }
24
+ ));
25
+ d.displayName = "TabsTrigger";
26
+ const m = o.forwardRef(({ className: e, ...s }, r) => /* @__PURE__ */ i(
27
+ a.Panel,
28
+ {
29
+ ref: r,
30
+ className: t(
31
+ "mt-2 outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
32
+ e
33
+ ),
34
+ ...s
35
+ }
36
+ ));
37
+ m.displayName = "TabsContent";
38
+ export {
39
+ b as Tabs,
40
+ m as TabsContent,
41
+ n as TabsList,
42
+ d as TabsTrigger
43
+ };
44
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/components/ui/tabs/tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `tabs`\n// (packages/ui-legacy/src/components/ui/tabs.tsx). A bordered segmented-control\n// tab group built on the Base UI Tabs primitive (keyboard nav, roving focus,\n// ARIA come from Base UI). No `--ui-tabs-*` token tier exists yet, so this\n// design-pending v1 themes from the shared semantic tokens:\n// • trigger idle -> border-secondary + text-secondary (brand outline segment)\n// • trigger active -> bg-secondary + text-primary-foreground (data-[active])\n// — pure-white label (glyph-on-brand-primary), like the default Button;\n// NOT text-secondary-foreground, which is a dimmed 60% white.\n// • focus ring -> var(--ui-focus-primary)\n// NB: the brand action blue is the `secondary` bridge (--ui-background-brand-\n// secondary, the same blue Button's primary uses); `primary` bridges to the\n// dark navy --ui-background-brand-primary, so it is NOT used here.\n// The legacy active treatment was a `bg-primary/10` tint; the opacity hack is\n// dropped for a token-pure filled segment. Reconcile (and a possible\n// `--ui-tabs-*` tier / underline-indicator variant) with\n// `/figma-component Tabs <url> --update` once a mockup lands.\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn('inline-flex items-stretch rounded-md', className)}\n {...props}\n />\n));\nTabsList.displayName = 'TabsList';\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Tab>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Tab>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Tab\n ref={ref}\n className={cn(\n '-mr-px inline-flex flex-1 items-center justify-center whitespace-nowrap border border-secondary px-2 py-1 text-sm font-semibold text-secondary transition-colors first:rounded-l-md last:-mr-0 last:rounded-r-md outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary data-[active]:text-primary-foreground',\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = 'TabsTrigger';\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Panel>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Panel>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Panel\n ref={ref}\n className={cn(\n 'mt-2 outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = 'TabsContent';\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"],"names":["Tabs","TabsPrimitive","TabsList","React","className","props","ref","jsx","cn","TabsTrigger","TabsContent"],"mappings":";;;;AAuBA,MAAMA,IAAOC,EAAc,MAErBC,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACN,EAAc;AAAA,EAAd;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE,EAAG,wCAAwCJ,CAAS;AAAA,IAC9D,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAS,cAAc;AAEvB,MAAMO,IAAcN,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACN,EAAc;AAAA,EAAd;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAY,cAAc;AAE1B,MAAMC,IAAcP,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACN,EAAc;AAAA,EAAd;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAY,cAAc;"}
@@ -0,0 +1,83 @@
1
+ import { jsx as s, jsxs as l } from "react/jsx-runtime";
2
+ import { Toast as o } from "@base-ui/react/toast";
3
+ import { TimesIcon as d, CircleTimesIcon as m, TriangleWarningIcon as u, CircleInfoIcon as f, CircleCheckIcon as g } from "@acronis-platform/icons-react/stroke-mono";
4
+ import { cn as x } from "../../../lib/utils.js";
5
+ import { Spinner as p } from "../spinner/spinner.js";
6
+ const r = o.createToastManager();
7
+ function n(t, e, a = {}) {
8
+ const { action: i, ...c } = a;
9
+ return r.add({
10
+ title: t,
11
+ type: e,
12
+ actionProps: i ? { children: i.label, onClick: i.onClick } : void 0,
13
+ ...c
14
+ });
15
+ }
16
+ const C = Object.assign(
17
+ (t, e) => n(t, void 0, e),
18
+ {
19
+ success: (t, e) => n(t, "success", e),
20
+ info: (t, e) => n(t, "info", e),
21
+ warning: (t, e) => n(t, "warning", e),
22
+ error: (t, e) => n(t, "error", e),
23
+ loading: (t, e) => n(t, "loading", { timeout: 0, ...e }),
24
+ dismiss: (t) => r.close(t),
25
+ promise: r.promise
26
+ }
27
+ ), v = {
28
+ success: /* @__PURE__ */ s(g, { className: "size-4 text-[var(--ui-text-on-status-success)]" }),
29
+ info: /* @__PURE__ */ s(f, { className: "size-4 text-[var(--ui-text-on-status-info)]" }),
30
+ warning: /* @__PURE__ */ s(u, { className: "size-4 text-[var(--ui-text-on-status-warning)]" }),
31
+ error: /* @__PURE__ */ s(m, { className: "size-4 text-[var(--ui-text-on-status-danger)]" }),
32
+ loading: /* @__PURE__ */ s(p, { size: "sm", className: "size-4" })
33
+ };
34
+ function h() {
35
+ const { toasts: t } = o.useToastManager();
36
+ return t.map((e) => {
37
+ const a = v[e.type];
38
+ return /* @__PURE__ */ l(
39
+ o.Root,
40
+ {
41
+ toast: e,
42
+ className: x(
43
+ "relative flex w-full items-start gap-3 rounded border border-border bg-background p-4 shadow-md",
44
+ "transition-all data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
45
+ "data-[starting-style]:translate-x-4 data-[ending-style]:translate-x-4"
46
+ ),
47
+ children: [
48
+ a ? /* @__PURE__ */ s("span", { className: "mt-0.5 shrink-0", children: a }) : null,
49
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
50
+ /* @__PURE__ */ s(o.Title, { className: "text-sm font-semibold leading-5 text-foreground" }),
51
+ /* @__PURE__ */ s(o.Description, { className: "text-sm leading-5 text-muted-foreground" }),
52
+ e.actionProps ? /* @__PURE__ */ s(o.Action, { className: "mt-1 self-start text-sm font-semibold text-secondary hover:underline" }) : null
53
+ ] }),
54
+ /* @__PURE__ */ s(
55
+ o.Close,
56
+ {
57
+ "aria-label": "Close",
58
+ className: "shrink-0 rounded text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-focus-primary)]",
59
+ children: /* @__PURE__ */ s(d, { className: "size-4" })
60
+ }
61
+ )
62
+ ]
63
+ },
64
+ e.id
65
+ );
66
+ });
67
+ }
68
+ function z({ timeout: t, limit: e, portalContainer: a }) {
69
+ return /* @__PURE__ */ s(
70
+ o.Provider,
71
+ {
72
+ toastManager: r,
73
+ timeout: t,
74
+ limit: e,
75
+ children: /* @__PURE__ */ s(o.Portal, { container: a, children: /* @__PURE__ */ s(o.Viewport, { className: "fixed bottom-4 right-4 z-[100] flex w-[384px] max-w-[calc(100vw-2rem)] flex-col gap-3 outline-none", children: /* @__PURE__ */ s(h, {}) }) })
76
+ }
77
+ );
78
+ }
79
+ export {
80
+ z as Toaster,
81
+ C as toast
82
+ };
83
+ //# sourceMappingURL=toast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.js","sources":["../../../../src/components/ui/toast/toast.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Toast as ToastPrimitive } from '@base-ui/react/toast';\nimport {\n CircleCheckIcon,\n CircleInfoIcon,\n CircleTimesIcon,\n TimesIcon,\n TriangleWarningIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { Spinner } from '../spinner';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `sonner`\n// (packages/ui-legacy/src/components/ui/sonner.tsx), which wrapped the Sonner\n// library. Rebuilt on the Base UI toast primitive (the ui-react convention), so\n// no Sonner dependency. The contract is preserved: drop a single `<Toaster />`\n// at the app root and call the imperative `toast(...)` / `toast.success(...)`\n// API from anywhere. No `--ui-toast-*` tier yet, so this design-pending v1 is a\n// neutral surface (bg-background + border-border + shadow) with the status\n// conveyed by a colored leading icon (`--ui-text-on-status-*`); per-status\n// surface tinting is design-pending. Auto-dismiss after `timeout` (default\n// 5000ms); `loading` toasts persist until updated or dismissed.\n\n// A module-level manager so `toast(...)` works outside React (like Sonner's\n// `toast`). `<Toaster />` subscribes this manager to its provider.\nconst toastManager = ToastPrimitive.createToastManager();\n\nexport type ToastType = 'success' | 'info' | 'warning' | 'error' | 'loading';\n\nexport interface ToastOptions {\n /** Secondary line under the title. */\n description?: React.ReactNode;\n /** Auto-dismiss delay in ms; `0` keeps the toast until dismissed. */\n timeout?: number;\n /** A single inline action button (e.g. Undo). */\n action?: { label: React.ReactNode; onClick?: () => void };\n /** Stable id — re-adding with the same id updates the toast in place. */\n id?: string;\n}\n\nfunction add(title: React.ReactNode, type?: ToastType, options: ToastOptions = {}) {\n const { action, ...rest } = options;\n return toastManager.add({\n title,\n type,\n actionProps: action\n ? { children: action.label, onClick: action.onClick }\n : undefined,\n ...rest,\n });\n}\n\n/**\n * Imperative toast API. `toast(title, options)` shows a neutral toast;\n * `toast.success` / `info` / `warning` / `error` / `loading` set the variant.\n * `toast.dismiss(id?)` closes one (or all) and `toast.promise` ties a toast to a\n * promise's lifecycle.\n */\nconst toast = Object.assign(\n (title: React.ReactNode, options?: ToastOptions) => add(title, undefined, options),\n {\n success: (title: React.ReactNode, options?: ToastOptions) =>\n add(title, 'success', options),\n info: (title: React.ReactNode, options?: ToastOptions) =>\n add(title, 'info', options),\n warning: (title: React.ReactNode, options?: ToastOptions) =>\n add(title, 'warning', options),\n error: (title: React.ReactNode, options?: ToastOptions) =>\n add(title, 'error', options),\n loading: (title: React.ReactNode, options?: ToastOptions) =>\n add(title, 'loading', { timeout: 0, ...options }),\n dismiss: (id?: string) => toastManager.close(id),\n promise: toastManager.promise,\n }\n);\n\nconst ICON_BY_TYPE: Record<ToastType, React.ReactNode> = {\n success: (\n <CircleCheckIcon className=\"size-4 text-[var(--ui-text-on-status-success)]\" />\n ),\n info: (\n <CircleInfoIcon className=\"size-4 text-[var(--ui-text-on-status-info)]\" />\n ),\n warning: (\n <TriangleWarningIcon className=\"size-4 text-[var(--ui-text-on-status-warning)]\" />\n ),\n error: (\n <CircleTimesIcon className=\"size-4 text-[var(--ui-text-on-status-danger)]\" />\n ),\n loading: <Spinner size=\"sm\" className=\"size-4\" />,\n};\n\nfunction ToastList() {\n const { toasts } = ToastPrimitive.useToastManager();\n return toasts.map((item) => {\n const icon = ICON_BY_TYPE[item.type as ToastType];\n return (\n <ToastPrimitive.Root\n key={item.id}\n toast={item}\n className={cn(\n 'relative flex w-full items-start gap-3 rounded border border-border bg-background p-4 shadow-md',\n 'transition-all data-[ending-style]:opacity-0 data-[starting-style]:opacity-0',\n 'data-[starting-style]:translate-x-4 data-[ending-style]:translate-x-4'\n )}\n >\n {icon ? <span className=\"mt-0.5 shrink-0\">{icon}</span> : null}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <ToastPrimitive.Title className=\"text-sm font-semibold leading-5 text-foreground\" />\n <ToastPrimitive.Description className=\"text-sm leading-5 text-muted-foreground\" />\n {item.actionProps ? (\n <ToastPrimitive.Action className=\"mt-1 self-start text-sm font-semibold text-secondary hover:underline\" />\n ) : null}\n </div>\n <ToastPrimitive.Close\n aria-label=\"Close\"\n className=\"shrink-0 rounded text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-focus-primary)]\"\n >\n <TimesIcon className=\"size-4\" />\n </ToastPrimitive.Close>\n </ToastPrimitive.Root>\n );\n });\n}\n\nexport interface ToasterProps {\n /** Default auto-dismiss delay in ms for toasts that don't set one. */\n timeout?: number;\n /** Max toasts shown at once; the oldest is dropped past the limit. */\n limit?: number;\n /**\n * Portal container for the toast stack. Pass a shadow-root mount for\n * isolated-style previews (the docs demos do this via `useShadowMount`).\n */\n portalContainer?: ToastPrimitive.Portal.Props['container'];\n}\n\n/**\n * The toast region. Render once near the app root; it portals a bottom-right\n * stack and renders every queued toast. Trigger toasts with the `toast` API.\n */\nfunction Toaster({ timeout, limit, portalContainer }: ToasterProps) {\n return (\n <ToastPrimitive.Provider\n toastManager={toastManager}\n timeout={timeout}\n limit={limit}\n >\n <ToastPrimitive.Portal container={portalContainer}>\n <ToastPrimitive.Viewport className=\"fixed bottom-4 right-4 z-[100] flex w-[384px] max-w-[calc(100vw-2rem)] flex-col gap-3 outline-none\">\n <ToastList />\n </ToastPrimitive.Viewport>\n </ToastPrimitive.Portal>\n </ToastPrimitive.Provider>\n );\n}\n\nexport { toast, Toaster };\n"],"names":["toastManager","ToastPrimitive","add","title","type","options","action","rest","toast","id","ICON_BY_TYPE","jsx","CircleCheckIcon","CircleInfoIcon","TriangleWarningIcon","CircleTimesIcon","Spinner","ToastList","toasts","item","icon","jsxs","cn","TimesIcon","Toaster","timeout","limit","portalContainer"],"mappings":";;;;;AA4BA,MAAMA,IAAeC,EAAe,mBAAA;AAepC,SAASC,EAAIC,GAAwBC,GAAkBC,IAAwB,CAAA,GAAI;AACjF,QAAM,EAAE,QAAAC,GAAQ,GAAGC,EAAA,IAASF;AAC5B,SAAOL,EAAa,IAAI;AAAA,IACtB,OAAAG;AAAA,IACA,MAAAC;AAAA,IACA,aAAaE,IACT,EAAE,UAAUA,EAAO,OAAO,SAASA,EAAO,QAAA,IAC1C;AAAA,IACJ,GAAGC;AAAA,EAAA,CACJ;AACH;AAQA,MAAMC,IAAQ,OAAO;AAAA,EACnB,CAACL,GAAwBE,MAA2BH,EAAIC,GAAO,QAAWE,CAAO;AAAA,EACjF;AAAA,IACE,SAAS,CAACF,GAAwBE,MAChCH,EAAIC,GAAO,WAAWE,CAAO;AAAA,IAC/B,MAAM,CAACF,GAAwBE,MAC7BH,EAAIC,GAAO,QAAQE,CAAO;AAAA,IAC5B,SAAS,CAACF,GAAwBE,MAChCH,EAA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ACJ,gBAAAR,EAACV,EAAe,QAAf,EAAsB,WAAU,wEAAuE,IACtG;AAAA,UAAA,GACN;AAAA,UACA,gBAAAU;AAAA,YAACV,EAAe;AAAA,YAAf;AAAA,cACC,cAAW;AAAA,cACX,WAAU;AAAA,cAEV,UAAA,gBAAAU,EAACY,GAAA,EAAU,WAAU,SAAA,CAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QAChC;AAAA,MAAA;AAAA,MArBKJ,EAAK;AAAA,IAAA;AAAA,EAwBhB,CAAC;AACH;AAkBA,SAASK,EAAQ,EAAE,SAAAC,GAAS,OAAAC,GAAO,iBAAAC,KAAiC;AAClE,SACE,gBAAAhB;AAAA,IAACV,EAAe;AAAA,IAAf;AAAA,MACC,cAAAD;AAAA,MACA,SAAAyB;AAAA,MACA,OAAAC;AAAA,MAEA,UAAA,gBAAAf,EAACV,EAAe,QAAf,EAAsB,WAAW0B,GAChC,UAAA,gBAAAhB,EAACV,EAAe,UAAf,EAAwB,WAAU,sGACjC,UAAA,gBAAAU,EAACM,GAAA,CAAA,CAAU,GACb,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,106 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { cn as d } from "../../../lib/utils.js";
4
+ const i = a.forwardRef(({ className: t, interactive: e, ...o }, l) => /* @__PURE__ */ r(
5
+ "div",
6
+ {
7
+ ref: l,
8
+ tabIndex: e ? 0 : void 0,
9
+ className: d(
10
+ "relative flex flex-col rounded-lg border border-border bg-background text-foreground transition-colors",
11
+ e && "cursor-pointer hover:bg-accent active:bg-[var(--ui-background-surface-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-focus-primary)]",
12
+ t
13
+ ),
14
+ ...o
15
+ }
16
+ ));
17
+ i.displayName = "WidgetPlaceholder";
18
+ const s = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
19
+ "div",
20
+ {
21
+ ref: o,
22
+ className: d("flex items-center gap-2 px-6 pb-2 pt-4", t),
23
+ ...e
24
+ }
25
+ ));
26
+ s.displayName = "WidgetPlaceholderHeader";
27
+ const c = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
28
+ "div",
29
+ {
30
+ ref: o,
31
+ className: d("flex-1 truncate text-sm font-semibold leading-6", t),
32
+ ...e
33
+ }
34
+ ));
35
+ c.displayName = "WidgetPlaceholderTitle";
36
+ const n = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
37
+ "div",
38
+ {
39
+ ref: o,
40
+ className: d(
41
+ "flex-shrink-0 text-secondary [&>svg]:size-4",
42
+ t
43
+ ),
44
+ ...e
45
+ }
46
+ ));
47
+ n.displayName = "WidgetPlaceholderIcon";
48
+ const f = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
49
+ "div",
50
+ {
51
+ ref: o,
52
+ className: d(
53
+ "flex flex-1 flex-col items-center justify-center gap-2 px-6 py-4 text-center",
54
+ t
55
+ ),
56
+ ...e
57
+ }
58
+ ));
59
+ f.displayName = "WidgetPlaceholderContent";
60
+ const m = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
61
+ "div",
62
+ {
63
+ ref: o,
64
+ className: d(
65
+ "flex items-center justify-center text-muted-foreground [&>svg]:size-[72px]",
66
+ t
67
+ ),
68
+ ...e
69
+ }
70
+ ));
71
+ m.displayName = "WidgetPlaceholderImage";
72
+ const g = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r("div", { ref: o, className: d("text-sm leading-6", t), ...e }));
73
+ g.displayName = "WidgetPlaceholderText";
74
+ const x = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
75
+ "div",
76
+ {
77
+ ref: o,
78
+ className: d(
79
+ "cursor-pointer text-sm font-semibold text-secondary hover:underline",
80
+ t
81
+ ),
82
+ ...e
83
+ }
84
+ ));
85
+ x.displayName = "WidgetPlaceholderAction";
86
+ const p = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ r(
87
+ "div",
88
+ {
89
+ ref: o,
90
+ className: d("px-6 pb-4 pt-0 text-xs text-muted-foreground", t),
91
+ ...e
92
+ }
93
+ ));
94
+ p.displayName = "WidgetPlaceholderFooter";
95
+ export {
96
+ i as WidgetPlaceholder,
97
+ x as WidgetPlaceholderAction,
98
+ f as WidgetPlaceholderContent,
99
+ p as WidgetPlaceholderFooter,
100
+ s as WidgetPlaceholderHeader,
101
+ n as WidgetPlaceholderIcon,
102
+ m as WidgetPlaceholderImage,
103
+ g as WidgetPlaceholderText,
104
+ c as WidgetPlaceholderTitle
105
+ };
106
+ //# sourceMappingURL=widget-placeholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-placeholder.js","sources":["../../../../src/components/ui/widget-placeholder/widget-placeholder.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Composable dashboard-widget empty-state parts, ported from\n// `@acronis-platform/shadcn-uikit`'s `widget-placeholder`\n// (packages/ui-legacy/src/components/ui/widget-placeholder.tsx). Plain styled\n// elements — no Base UI primitive. No `--ui-widget-placeholder-*` tier exists\n// yet, so this design-pending v1 themes from the shared semantic vocabulary:\n// • root -> border-border + bg-background + text-foreground\n// • icon/action (was --av-fixed-link) -> text-secondary (the brand action blue)\n// • image (was --av-brand-light, a soft brand tint) -> text-muted-foreground\n// (a muted decorative placeholder; the brand tint is design-pending)\n// • interactive hover/active -> bg-accent (surface-hover) /\n// surface-active; focus -> the standard 3px --ui-focus-primary ring\n// Reconcile with `/figma-component WidgetPlaceholder <url> --update` once a\n// mockup lands (Figma: Charts-anatomy / Placeholders, node 229:73962).\n\nexport interface WidgetPlaceholderProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Make the whole widget focusable and clickable (hover/active surface + focus\n * ring). Wire the behavior via `onClick`.\n */\n interactive?: boolean;\n}\n\nconst WidgetPlaceholder = React.forwardRef<\n HTMLDivElement,\n 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-border bg-background text-foreground transition-colors',\n interactive &&\n 'cursor-pointer hover:bg-accent active:bg-[var(--ui-background-surface-active)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-focus-primary)]',\n className\n )}\n {...props}\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 pb-2 pt-4', 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(\n 'flex-shrink-0 text-secondary [&>svg]:size-4',\n className\n )}\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 flex-1 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-muted-foreground [&>svg]:size-[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 ref={ref} className={cn('text-sm leading-6', className)} {...props} />\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 'cursor-pointer text-sm font-semibold text-secondary 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 text-muted-foreground', 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":";;;AA2BA,MAAMA,IAAoBC,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,aAAAC,GAAa,GAAGC,KAASC,MACvC,gBAAAC;AAAA,EAAC;A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