@alfadocs/ui-kit 0.82.0 → 0.84.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 (92) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DLrcSTK_.js → actions-cell-renderer-DaL80uqL.js} +2 -2
  2. package/dist/_chunks/chart-GFLv4cXm.js +609 -0
  3. package/dist/_chunks/dashboard-grid-D2dm0IRN.js +691 -0
  4. package/dist/_chunks/{editable-currency-cell-renderer-GwfA9tTR.js → editable-currency-cell-renderer-Dus_sBvX.js} +2 -2
  5. package/dist/_chunks/{face-scheme-C0rk21gg.js → face-scheme-CjQAHvSP.js} +2 -2
  6. package/dist/_chunks/{file-manager-DfTG7bxx.js → file-manager-DLJlinIO.js} +3 -3
  7. package/dist/_chunks/{header-settings-DMfdx0Vq.js → header-settings-CLwFqMHI.js} +2 -2
  8. package/dist/_chunks/{icon-button-group-C_lqXTAj.js → icon-button-group-BLHPN6jg.js} +178 -163
  9. package/dist/_chunks/{marketplace-app-shell-Bxq1PYAj.js → marketplace-app-shell-Br2yebEK.js} +2 -2
  10. package/dist/_chunks/{patient-table-DweKjiXg.js → patient-table-BHzmUbzu.js} +2 -2
  11. package/dist/_chunks/{theme-toggle-BJCz_UOi.js → theme-toggle-B4mOrQX1.js} +2 -2
  12. package/dist/_chunks/widget-picker-DEmTVuFL.js +193 -0
  13. package/dist/agent-catalog.json +238 -4
  14. package/dist/agent-i18n/en.json +27 -1
  15. package/dist/components/chart/chart.d.ts +36 -1
  16. package/dist/components/chart/index.js +1 -1
  17. package/dist/components/dashboard-grid/dashboard-grid-engine.d.ts +37 -0
  18. package/dist/components/dashboard-grid/dashboard-grid.agent.d.ts +4 -0
  19. package/dist/components/dashboard-grid/dashboard-grid.d.ts +74 -0
  20. package/dist/components/dashboard-grid/index.d.ts +3 -0
  21. package/dist/components/dashboard-grid/index.js +6 -0
  22. package/dist/components/data-table/index.js +2 -2
  23. package/dist/components/face-scheme/index.js +1 -1
  24. package/dist/components/file-manager/index.js +1 -1
  25. package/dist/components/header-settings/index.js +1 -1
  26. package/dist/components/icon-button-group/index.js +1 -1
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/components/patient-table/index.js +1 -1
  29. package/dist/components/theme-toggle/index.js +1 -1
  30. package/dist/components/widget-picker/index.d.ts +3 -0
  31. package/dist/components/widget-picker/index.js +6 -0
  32. package/dist/components/widget-picker/widget-picker.agent.d.ts +4 -0
  33. package/dist/components/widget-picker/widget-picker.d.ts +49 -0
  34. package/dist/i18n/locales/ar.d.ts +29 -0
  35. package/dist/i18n/locales/ar.js +29 -0
  36. package/dist/i18n/locales/de.d.ts +29 -0
  37. package/dist/i18n/locales/de.js +29 -0
  38. package/dist/i18n/locales/el.d.ts +29 -0
  39. package/dist/i18n/locales/el.js +29 -0
  40. package/dist/i18n/locales/en.d.ts +29 -0
  41. package/dist/i18n/locales/en.js +29 -0
  42. package/dist/i18n/locales/es.d.ts +29 -0
  43. package/dist/i18n/locales/es.js +29 -0
  44. package/dist/i18n/locales/fr.d.ts +29 -0
  45. package/dist/i18n/locales/fr.js +29 -0
  46. package/dist/i18n/locales/hi.d.ts +29 -0
  47. package/dist/i18n/locales/hi.js +29 -0
  48. package/dist/i18n/locales/it.d.ts +29 -0
  49. package/dist/i18n/locales/it.js +29 -0
  50. package/dist/i18n/locales/ja.d.ts +29 -0
  51. package/dist/i18n/locales/ja.js +29 -0
  52. package/dist/i18n/locales/nl.d.ts +29 -0
  53. package/dist/i18n/locales/nl.js +29 -0
  54. package/dist/i18n/locales/pl.d.ts +29 -0
  55. package/dist/i18n/locales/pl.js +29 -0
  56. package/dist/i18n/locales/pt.d.ts +29 -0
  57. package/dist/i18n/locales/pt.js +29 -0
  58. package/dist/i18n/locales/ro.d.ts +29 -0
  59. package/dist/i18n/locales/ro.js +29 -0
  60. package/dist/i18n/locales/ru.d.ts +29 -0
  61. package/dist/i18n/locales/ru.js +29 -0
  62. package/dist/i18n/locales/sq.d.ts +29 -0
  63. package/dist/i18n/locales/sq.js +29 -0
  64. package/dist/i18n/locales/sv.d.ts +29 -0
  65. package/dist/i18n/locales/sv.js +29 -0
  66. package/dist/i18n/locales/tr.d.ts +29 -0
  67. package/dist/i18n/locales/tr.js +29 -0
  68. package/dist/i18n/locales/zh.d.ts +29 -0
  69. package/dist/i18n/locales/zh.js +29 -0
  70. package/dist/index.js +82 -76
  71. package/dist/locales/ar.json +29 -0
  72. package/dist/locales/de.json +29 -0
  73. package/dist/locales/el.json +29 -0
  74. package/dist/locales/en.json +29 -0
  75. package/dist/locales/es.json +29 -0
  76. package/dist/locales/fr.json +29 -0
  77. package/dist/locales/hi.json +29 -0
  78. package/dist/locales/it.json +29 -0
  79. package/dist/locales/ja.json +29 -0
  80. package/dist/locales/nl.json +29 -0
  81. package/dist/locales/pl.json +29 -0
  82. package/dist/locales/pt.json +29 -0
  83. package/dist/locales/ro.json +29 -0
  84. package/dist/locales/ru.json +29 -0
  85. package/dist/locales/sq.json +29 -0
  86. package/dist/locales/sv.json +29 -0
  87. package/dist/locales/tr.json +29 -0
  88. package/dist/locales/zh.json +29 -0
  89. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  90. package/dist/tokens.css +1 -1
  91. package/package.json +9 -1
  92. package/dist/_chunks/chart-CpkpA74k.js +0 -374
@@ -0,0 +1,193 @@
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import { forwardRef as P, useState as N, useEffect as S, useMemo as f, useCallback as T, useImperativeHandle as W } from "react";
3
+ import { c as _ } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as j } from "react-i18next";
5
+ import { D as l } from "./dialog-UbKJCi1X.js";
6
+ import { T as z } from "./text-input-CUvCb6ST.js";
7
+ import { B as C } from "./badge-DCOqV9mI.js";
8
+ import { u as I } from "./registry-DvAUVLHh.js";
9
+ import { S as L } from "./search-QbWPlY5f.js";
10
+ const R = {
11
+ id: "widget-picker",
12
+ capabilities: ["pick"],
13
+ state: {
14
+ open: {
15
+ type: "boolean",
16
+ descriptionKey: "ui.agent.widgetPicker.state.open",
17
+ description: "Whether the picker dialog is currently open.",
18
+ read: (i) => i.getPickerState().open
19
+ },
20
+ items: {
21
+ type: "{ id: string, disabled: boolean }[]",
22
+ descriptionKey: "ui.agent.widgetPicker.state.items",
23
+ description: "Widget-type ids on offer and whether each is pickable. Ids only — titles are host-app strings.",
24
+ read: (i) => i.getPickerState().items
25
+ }
26
+ },
27
+ actions: {
28
+ pick_widget: {
29
+ // Picking adds a widget to the host dashboard — a write, reversible
30
+ // by removing the widget again.
31
+ safety: "write",
32
+ argsType: "id",
33
+ argsSchema: {
34
+ type: "object",
35
+ properties: {
36
+ id: {
37
+ type: "string",
38
+ description: "Widget-type id (see items state)."
39
+ }
40
+ },
41
+ required: ["id"]
42
+ },
43
+ returns: "boolean (accepted)",
44
+ returnsSchema: {
45
+ type: "boolean",
46
+ description: "True when the pick was applied; false when the picker is closed, the id is unknown, or the item is disabled."
47
+ },
48
+ idempotent: !1,
49
+ descriptionKey: "ui.agent.widgetPicker.actions.pickWidget",
50
+ description: "Pick a widget type from the open catalogue. The picker closes and the host adds the widget. Refused while the dialog is closed and for disabled items.",
51
+ invoke: (i, a) => i.pick(a.id)
52
+ }
53
+ },
54
+ domHooks: {
55
+ root: { attr: "data-component", value: "widget-picker" },
56
+ instanceId: {
57
+ attr: "data-component-id",
58
+ sourceProp: "id",
59
+ description: "Sourced from the id prop."
60
+ },
61
+ item: {
62
+ attr: "data-widget-type-id",
63
+ description: "Each option tile carries its widget-type id."
64
+ }
65
+ }
66
+ }, A = _(
67
+ [
68
+ "ds:flex ds:w-full ds:min-h-[var(--min-target-size)] ds:items-start ds:gap-[var(--spacing-sm)]",
69
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-[var(--card)]",
70
+ "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-md)]",
71
+ "ds:text-start ds:transition-colors",
72
+ "ds:hover:bg-muted/10",
73
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
74
+ "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed ds:disabled:hover:bg-transparent"
75
+ ].join(" "),
76
+ { variants: {}, defaultVariants: {} }
77
+ ), B = P(
78
+ ({ open: i, onOpenChange: a, items: d, onPick: m, title: k, id: h }, y) => {
79
+ const { t: r } = j(), [p, v] = N("");
80
+ S(() => {
81
+ i || v("");
82
+ }, [i]);
83
+ const b = f(() => {
84
+ const e = p.trim().toLowerCase();
85
+ return e ? d.filter(
86
+ (s) => s.title.toLowerCase().includes(e) || (s.description ?? "").toLowerCase().includes(e)
87
+ ) : d;
88
+ }, [d, p]), w = f(() => {
89
+ const e = [];
90
+ for (const s of b) {
91
+ const n = s.category || null;
92
+ let o = e.find((x) => x.category === n);
93
+ o || (o = { category: n, entries: [] }, n === null ? e.unshift(o) : e.push(o)), o.entries.push(s);
94
+ }
95
+ return e;
96
+ }, [b]), g = T(
97
+ (e) => {
98
+ m(e), a(!1);
99
+ },
100
+ [m, a]
101
+ ), u = f(
102
+ () => ({
103
+ pick(e) {
104
+ if (!i) return !1;
105
+ const s = d.find((n) => n.id === e);
106
+ return !s || s.disabled ? !1 : (g(e), !0);
107
+ },
108
+ getPickerState() {
109
+ return {
110
+ open: i,
111
+ items: d.map((e) => ({
112
+ id: e.id,
113
+ disabled: !!e.disabled
114
+ }))
115
+ };
116
+ }
117
+ }),
118
+ [i, d, g]
119
+ );
120
+ return W(y, () => u, [u]), I(R, u, h), /* @__PURE__ */ t(l.Root, { open: i, onOpenChange: a, children: /* @__PURE__ */ t(l.Content, { size: "lg", children: /* @__PURE__ */ c("div", { "data-component": "widget-picker", "data-component-id": h, children: [
121
+ /* @__PURE__ */ t(l.Title, { children: k ?? r("widgetPicker.title") }),
122
+ /* @__PURE__ */ t(l.Description, { className: "ds:sr-only", children: r("widgetPicker.description") }),
123
+ /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
124
+ z,
125
+ {
126
+ "aria-label": r("widgetPicker.searchLabel"),
127
+ placeholder: r("widgetPicker.searchPlaceholder"),
128
+ startAdornment: /* @__PURE__ */ t(L, { "aria-hidden": "true" }),
129
+ value: p,
130
+ onChange: (e) => v(e.target.value)
131
+ }
132
+ ) }),
133
+ /* @__PURE__ */ t(
134
+ "div",
135
+ {
136
+ tabIndex: 0,
137
+ className: "ds:mt-[var(--spacing-md)] ds:flex ds:max-h-[60vh] ds:flex-col ds:gap-[var(--spacing-md)] ds:overflow-y-auto ds:pe-[var(--spacing-xs)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
138
+ children: w.length === 0 ? /* @__PURE__ */ t(
139
+ "p",
140
+ {
141
+ role: "status",
142
+ className: "ds:py-[var(--spacing-lg)] ds:text-center ds:text-sm ds:text-muted-foreground",
143
+ children: d.length === 0 ? r("widgetPicker.none") : r("widgetPicker.empty")
144
+ }
145
+ ) : w.map((e) => /* @__PURE__ */ c(
146
+ "section",
147
+ {
148
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
149
+ children: [
150
+ e.category ? /* @__PURE__ */ t("h3", { className: "ds:text-xs ds:font-semibold ds:uppercase ds:tracking-wide ds:text-muted-foreground", children: e.category }) : null,
151
+ /* @__PURE__ */ t("div", { className: "ds:grid ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: e.entries.map((s) => /* @__PURE__ */ c(
152
+ "button",
153
+ {
154
+ type: "button",
155
+ disabled: s.disabled,
156
+ onClick: () => g(s.id),
157
+ className: A(),
158
+ "data-widget-type-id": s.id,
159
+ children: [
160
+ s.icon ? /* @__PURE__ */ t(
161
+ "span",
162
+ {
163
+ "aria-hidden": "true",
164
+ className: "ds:mt-[var(--spacing-2xs)] ds:inline-flex ds:size-5 ds:shrink-0 ds:items-center ds:justify-center ds:text-muted-foreground ds:[&_svg]:size-5",
165
+ children: s.icon
166
+ }
167
+ ) : null,
168
+ /* @__PURE__ */ c("span", { className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
169
+ /* @__PURE__ */ c("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
170
+ /* @__PURE__ */ t("span", { className: "ds:truncate ds:text-sm ds:font-medium", children: s.title }),
171
+ s.badge ? /* @__PURE__ */ t(C, { variant: "info", size: "sm", children: s.badge }) : null
172
+ ] }),
173
+ s.description ? /* @__PURE__ */ t("span", { className: "ds:text-xs ds:text-muted-foreground", children: s.description }) : null
174
+ ] })
175
+ ]
176
+ },
177
+ s.id
178
+ )) })
179
+ ]
180
+ },
181
+ e.category ?? "__ungrouped__"
182
+ ))
183
+ }
184
+ )
185
+ ] }) }) });
186
+ }
187
+ );
188
+ B.displayName = "WidgetPicker";
189
+ export {
190
+ B as W,
191
+ R as w
192
+ };
193
+ //# sourceMappingURL=widget-picker-DEmTVuFL.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.82.0",
3
+ "packageVersion": "0.84.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1756,9 +1756,62 @@
1756
1756
  {
1757
1757
  "kind": "component",
1758
1758
  "id": "chart",
1759
- "capabilities": [],
1760
- "state": [],
1759
+ "capabilities": [
1760
+ "view_change"
1761
+ ],
1762
+ "state": [
1763
+ {
1764
+ "name": "declaredType",
1765
+ "type": "'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'",
1766
+ "description": "The consumer-declared chart type — the shape `update_series` expects.",
1767
+ "descriptionKey": "ui.agent.chart.state.declaredType"
1768
+ },
1769
+ {
1770
+ "name": "effectiveType",
1771
+ "type": "'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'",
1772
+ "description": "The type currently rendered — differs from declaredType after a type-switcher pick.",
1773
+ "descriptionKey": "ui.agent.chart.state.effectiveType"
1774
+ },
1775
+ {
1776
+ "name": "availableTypes",
1777
+ "type": "ChartType[]",
1778
+ "description": "Types the switcher offers. Empty when the chart has no type switcher.",
1779
+ "descriptionKey": "ui.agent.chart.state.availableTypes"
1780
+ }
1781
+ ],
1761
1782
  "actions": [
1783
+ {
1784
+ "name": "change_view",
1785
+ "safety": "write",
1786
+ "argsType": "type",
1787
+ "argsSchema": {
1788
+ "type": "object",
1789
+ "properties": {
1790
+ "type": {
1791
+ "type": "string",
1792
+ "enum": [
1793
+ "line",
1794
+ "bar",
1795
+ "area",
1796
+ "pie",
1797
+ "donut"
1798
+ ],
1799
+ "description": "The chart type to render."
1800
+ }
1801
+ },
1802
+ "required": [
1803
+ "type"
1804
+ ]
1805
+ },
1806
+ "returns": "boolean (accepted)",
1807
+ "returnsSchema": {
1808
+ "type": "boolean",
1809
+ "description": "True when the switch was applied; false when the chart has no type switcher or the type is not offered (check availableTypes first)."
1810
+ },
1811
+ "idempotent": true,
1812
+ "description": "Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.",
1813
+ "descriptionKey": "ui.agent.chart.actions.changeView"
1814
+ },
1762
1815
  {
1763
1816
  "name": "update_series",
1764
1817
  "safety": "write",
@@ -1805,7 +1858,7 @@
1805
1858
  ]
1806
1859
  },
1807
1860
  "idempotent": true,
1808
- "description": "Replace the chart series without remounting.",
1861
+ "description": "Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state) — when the user has switched the view cross-shape the values are converted to the rendered shape. The write targets the live instance only: a later type switch re-reads the original props and discards it.",
1809
1862
  "descriptionKey": "ui.agent.chart.actions.updateSeries"
1810
1863
  },
1811
1864
  {
@@ -2817,6 +2870,124 @@
2817
2870
  }
2818
2871
  }
2819
2872
  },
2873
+ {
2874
+ "kind": "component",
2875
+ "id": "dashboard-grid",
2876
+ "capabilities": [
2877
+ "edit_inline"
2878
+ ],
2879
+ "state": [
2880
+ {
2881
+ "name": "layout",
2882
+ "type": "{ id: string, x: number, y: number, w: number, h: number }[]",
2883
+ "description": "Current widget geometry in cell units — ids and rectangles only, no widget content.",
2884
+ "descriptionKey": "ui.agent.dashboardGrid.state.layout"
2885
+ },
2886
+ {
2887
+ "name": "cols",
2888
+ "type": "number",
2889
+ "description": "Logical column count of the board.",
2890
+ "descriptionKey": "ui.agent.dashboardGrid.state.cols"
2891
+ },
2892
+ {
2893
+ "name": "editing",
2894
+ "type": "boolean",
2895
+ "description": "Whether edit mode is on. Move/resize actions are refused while it is off — the host app owns the toggle.",
2896
+ "descriptionKey": "ui.agent.dashboardGrid.state.editing"
2897
+ }
2898
+ ],
2899
+ "actions": [
2900
+ {
2901
+ "name": "move_widget",
2902
+ "safety": "write",
2903
+ "argsType": "id, x, y",
2904
+ "argsSchema": {
2905
+ "type": "object",
2906
+ "properties": {
2907
+ "id": {
2908
+ "type": "string",
2909
+ "description": "Widget id (see layout state)."
2910
+ },
2911
+ "x": {
2912
+ "type": "integer",
2913
+ "minimum": 0,
2914
+ "description": "0-based logical column."
2915
+ },
2916
+ "y": {
2917
+ "type": "integer",
2918
+ "minimum": 0,
2919
+ "description": "0-based row."
2920
+ }
2921
+ },
2922
+ "required": [
2923
+ "id",
2924
+ "x",
2925
+ "y"
2926
+ ]
2927
+ },
2928
+ "returns": "boolean (accepted)",
2929
+ "returnsSchema": {
2930
+ "type": "boolean",
2931
+ "description": "True when applied; false when edit mode is off or the id is unknown."
2932
+ },
2933
+ "idempotent": true,
2934
+ "description": "Move a widget to a cell. Out-of-bounds targets are clamped; colliding widgets are pushed down and the layout re-compacts. Refused while edit mode is off.",
2935
+ "descriptionKey": "ui.agent.dashboardGrid.actions.moveWidget"
2936
+ },
2937
+ {
2938
+ "name": "resize_widget",
2939
+ "safety": "write",
2940
+ "argsType": "id, w, h",
2941
+ "argsSchema": {
2942
+ "type": "object",
2943
+ "properties": {
2944
+ "id": {
2945
+ "type": "string",
2946
+ "description": "Widget id (see layout state)."
2947
+ },
2948
+ "w": {
2949
+ "type": "integer",
2950
+ "minimum": 1,
2951
+ "description": "Column span (≥ 1)."
2952
+ },
2953
+ "h": {
2954
+ "type": "integer",
2955
+ "minimum": 1,
2956
+ "description": "Row span (≥ 1)."
2957
+ }
2958
+ },
2959
+ "required": [
2960
+ "id",
2961
+ "w",
2962
+ "h"
2963
+ ]
2964
+ },
2965
+ "returns": "boolean (accepted)",
2966
+ "returnsSchema": {
2967
+ "type": "boolean",
2968
+ "description": "True when applied; false when edit mode is off or the id is unknown."
2969
+ },
2970
+ "idempotent": true,
2971
+ "description": "Resize a widget to a span. Clamped to the grid and the widget’s min/max; colliding widgets are pushed down. Refused while edit mode is off.",
2972
+ "descriptionKey": "ui.agent.dashboardGrid.actions.resizeWidget"
2973
+ }
2974
+ ],
2975
+ "domHooks": {
2976
+ "root": {
2977
+ "attr": "data-component",
2978
+ "value": "dashboard-grid"
2979
+ },
2980
+ "instanceId": {
2981
+ "attr": "data-component-id",
2982
+ "sourceProp": "id",
2983
+ "description": "Sourced from the id prop."
2984
+ },
2985
+ "item": {
2986
+ "attr": "data-widget-id",
2987
+ "description": "Each widget wrapper carries its layout id."
2988
+ }
2989
+ }
2990
+ },
2820
2991
  {
2821
2992
  "kind": "component",
2822
2993
  "id": "data-table",
@@ -12688,6 +12859,69 @@
12688
12859
  }
12689
12860
  }
12690
12861
  },
12862
+ {
12863
+ "kind": "component",
12864
+ "id": "widget-picker",
12865
+ "capabilities": [
12866
+ "pick"
12867
+ ],
12868
+ "state": [
12869
+ {
12870
+ "name": "open",
12871
+ "type": "boolean",
12872
+ "description": "Whether the picker dialog is currently open.",
12873
+ "descriptionKey": "ui.agent.widgetPicker.state.open"
12874
+ },
12875
+ {
12876
+ "name": "items",
12877
+ "type": "{ id: string, disabled: boolean }[]",
12878
+ "description": "Widget-type ids on offer and whether each is pickable. Ids only — titles are host-app strings.",
12879
+ "descriptionKey": "ui.agent.widgetPicker.state.items"
12880
+ }
12881
+ ],
12882
+ "actions": [
12883
+ {
12884
+ "name": "pick_widget",
12885
+ "safety": "write",
12886
+ "argsType": "id",
12887
+ "argsSchema": {
12888
+ "type": "object",
12889
+ "properties": {
12890
+ "id": {
12891
+ "type": "string",
12892
+ "description": "Widget-type id (see items state)."
12893
+ }
12894
+ },
12895
+ "required": [
12896
+ "id"
12897
+ ]
12898
+ },
12899
+ "returns": "boolean (accepted)",
12900
+ "returnsSchema": {
12901
+ "type": "boolean",
12902
+ "description": "True when the pick was applied; false when the picker is closed, the id is unknown, or the item is disabled."
12903
+ },
12904
+ "idempotent": false,
12905
+ "description": "Pick a widget type from the open catalogue. The picker closes and the host adds the widget. Refused while the dialog is closed and for disabled items.",
12906
+ "descriptionKey": "ui.agent.widgetPicker.actions.pickWidget"
12907
+ }
12908
+ ],
12909
+ "domHooks": {
12910
+ "root": {
12911
+ "attr": "data-component",
12912
+ "value": "widget-picker"
12913
+ },
12914
+ "instanceId": {
12915
+ "attr": "data-component-id",
12916
+ "sourceProp": "id",
12917
+ "description": "Sourced from the id prop."
12918
+ },
12919
+ "item": {
12920
+ "attr": "data-widget-type-id",
12921
+ "description": "Each option tile carries its widget-type id."
12922
+ }
12923
+ }
12924
+ },
12691
12925
  {
12692
12926
  "kind": "component",
12693
12927
  "id": "workflow-card",
@@ -190,8 +190,14 @@
190
190
  }
191
191
  },
192
192
  "chart": {
193
+ "state": {
194
+ "declaredType": "The consumer-declared chart type — the shape `update_series` expects.",
195
+ "effectiveType": "The type currently rendered — differs from declaredType after a type-switcher pick.",
196
+ "availableTypes": "Types the switcher offers. Empty when the chart has no type switcher."
197
+ },
193
198
  "actions": {
194
- "updateSeries": "Replace the chart series without remounting.",
199
+ "changeView": "Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.",
200
+ "updateSeries": "Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state) — when the user has switched the view cross-shape the values are converted to the rendered shape. The write targets the live instance only: a later type switch re-reads the original props and discards it.",
195
201
  "exportPng": "Return a PNG data URI of the chart for export or screenshotting."
196
202
  }
197
203
  },
@@ -323,6 +329,17 @@
323
329
  "clearSelection": "Clear the selected country."
324
330
  }
325
331
  },
332
+ "dashboardGrid": {
333
+ "state": {
334
+ "layout": "Current widget geometry in cell units — ids and rectangles only, no widget content.",
335
+ "cols": "Logical column count of the board.",
336
+ "editing": "Whether edit mode is on. Move/resize actions are refused while it is off — the host app owns the toggle."
337
+ },
338
+ "actions": {
339
+ "moveWidget": "Move a widget to a cell. Out-of-bounds targets are clamped; colliding widgets are pushed down and the layout re-compacts. Refused while edit mode is off.",
340
+ "resizeWidget": "Resize a widget to a span. Clamped to the grid and the widget’s min/max; colliding widgets are pushed down. Refused while edit mode is off."
341
+ }
342
+ },
326
343
  "dataTableTabs": {
327
344
  "state": {
328
345
  "activeTabId": "Id of the currently-active saved-filter tab.",
@@ -1292,6 +1309,15 @@
1292
1309
  "getResult": "Return the converted value in the to-unit, or null when no source value is set."
1293
1310
  }
1294
1311
  },
1312
+ "widgetPicker": {
1313
+ "state": {
1314
+ "open": "Whether the picker dialog is currently open.",
1315
+ "items": "Widget-type ids on offer and whether each is pickable. Ids only — titles are host-app strings."
1316
+ },
1317
+ "actions": {
1318
+ "pickWidget": "Pick a widget type from the open catalogue. The picker closes and the host adds the widget. Refused while the dialog is closed and for disabled items."
1319
+ }
1320
+ },
1295
1321
  "workflowEditor": {
1296
1322
  "state": {
1297
1323
  "totalSteps": "Total number of nodes currently in the workflow graph.",
@@ -60,14 +60,49 @@ export interface ChartProps extends VariantProps<typeof chartVariants> {
60
60
  * `radialValueFormatter` for that.
61
61
  */
62
62
  valueFormatter?: (value: number) => string;
63
+ /**
64
+ * Opt-in type switcher. Pass two or more of `'line' | 'bar' | 'area' |
65
+ * 'pie' | 'donut'` to render an icon radiogroup (an `IconButtonGroup`)
66
+ * above the plot that lets the user flip the chart between those types.
67
+ * `type` is the initial selection and is always offered; the user's pick
68
+ * then sticks across re-renders (remount with a new `key` to reset it).
69
+ * When the picked type reads the other data shape, the data adapts: axis
70
+ * series collapse to one slice per series (that series' total) for `pie` /
71
+ * `donut`, and slice values become a single-series axis chart with
72
+ * `labels` as the categories. `radialBar` cannot participate — such
73
+ * entries are ignored (DEV warning) and a `radialBar` chart never shows
74
+ * the switcher.
75
+ */
76
+ switchableTypes?: ChartType[];
77
+ /** Called when the user picks a different type via the switcher. */
78
+ onTypeChange?: (type: ChartType) => void;
63
79
  /** Extra class names on the wrapper. */
64
80
  className?: string;
65
81
  }
66
82
  export interface ChartHandle {
67
83
  /** Returns a PNG data URI for the chart. */
68
84
  dataURI: () => Promise<string>;
69
- /** Updates series without remounting. */
85
+ /**
86
+ * Updates series without remounting. Always pass the DECLARED `type`'s
87
+ * shape — while the user has switched the view across the axis/slice
88
+ * boundary the values (and, for axis→slice, the slice labels) are
89
+ * converted to the rendered shape; for slice→axis the categories stay
90
+ * the `labels` prop, so keep the value count stable. The update writes
91
+ * to the live ApexCharts instance only: a later type switch remounts
92
+ * from the original props and discards it.
93
+ */
70
94
  updateSeries: (next: ChartProps['series']) => void;
95
+ /**
96
+ * Switches the rendered type via the type switcher. Returns `false`
97
+ * (no-op) when the switcher is not enabled or the type is not offered.
98
+ */
99
+ setType: (next: ChartType) => boolean;
100
+ /** Declared vs rendered type plus the types the switcher offers ([] when disabled). */
101
+ getTypeState: () => {
102
+ declaredType: ChartType;
103
+ effectiveType: ChartType;
104
+ availableTypes: ChartType[];
105
+ };
71
106
  }
72
107
  export declare const Chart: import("react").ForwardRefExoticComponent<ChartProps & import("react").RefAttributes<ChartHandle>>;
73
108
  export { chartVariants };
@@ -1,4 +1,4 @@
1
- import { C as t, c as s, a as c } from "../../_chunks/chart-CpkpA74k.js";
1
+ import { C as t, c as s, a as c } from "../../_chunks/chart-GFLv4cXm.js";
2
2
  export {
3
3
  t as Chart,
4
4
  s as chartAgent,
@@ -0,0 +1,37 @@
1
+ export interface DashboardWidgetLayout {
2
+ id: string;
3
+ /** 0-based logical column of the inline-start edge. */
4
+ x: number;
5
+ /** 0-based row of the block-start edge. */
6
+ y: number;
7
+ /** Column span (≥ 1). */
8
+ w: number;
9
+ /** Row span (≥ 1). */
10
+ h: number;
11
+ minW?: number;
12
+ minH?: number;
13
+ maxW?: number;
14
+ maxH?: number;
15
+ }
16
+ export declare function collides(a: DashboardWidgetLayout, b: DashboardWidgetLayout): boolean;
17
+ /** Clamp a rect to the grid bounds and its own min/max constraints. */
18
+ export declare function clampRect(item: DashboardWidgetLayout, cols: number): DashboardWidgetLayout;
19
+ /**
20
+ * Resolve overlaps and apply upward gravity. The `activeId` rect (the one
21
+ * being dragged/resized) keeps its exact position; every other widget is
22
+ * pushed down out of collisions, then pulled up as far as gravity allows.
23
+ * Deterministic: non-active widgets settle in reading order (y, then x).
24
+ */
25
+ export declare function normalise(layout: DashboardWidgetLayout[], cols: number, activeId?: string): DashboardWidgetLayout[];
26
+ /** Move a widget to a target cell, resolving collisions around it. */
27
+ export declare function moveItem(layout: DashboardWidgetLayout[], id: string, x: number, y: number, cols: number): DashboardWidgetLayout[];
28
+ /** Resize a widget to a target span, resolving collisions around it. */
29
+ export declare function resizeItem(layout: DashboardWidgetLayout[], id: string, w: number, h: number, cols: number): DashboardWidgetLayout[];
30
+ /** First free slot (reading order) that fits a `w`×`h` rect. */
31
+ export declare function firstFit(layout: DashboardWidgetLayout[], cols: number, w: number, h: number): {
32
+ x: number;
33
+ y: number;
34
+ };
35
+ /** Total rows the layout occupies (for sizing the add tile / container). */
36
+ export declare function rowCount(layout: DashboardWidgetLayout[]): number;
37
+ //# sourceMappingURL=dashboard-grid-engine.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { AgentAdapter } from '../../agent/types';
2
+ import type { DashboardGridHandle } from './dashboard-grid';
3
+ export declare const dashboardGridAgent: AgentAdapter<DashboardGridHandle>;
4
+ //# sourceMappingURL=dashboard-grid.agent.d.ts.map