@bridge-ui/vue 0.17.3 → 0.19.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 (164) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +36 -35
  2. package/ai/skills/bridge-ui-setup/SKILL.md +1 -1
  3. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  4. package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +1 -0
  5. package/dist/Components/ChartAxis/chartAxis.types.d.ts +17 -7
  6. package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +2 -2
  7. package/dist/Components/ChartAxis/composables/useChartAxis.js +15 -10
  8. package/dist/Components/ChartBar/ChartBar.js +5 -0
  9. package/dist/Components/ChartBar/ChartBar.vue.d.ts +16 -0
  10. package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +64 -0
  11. package/dist/Components/ChartBar/chartBar.types.d.ts +66 -0
  12. package/dist/Components/ChartBar/composables/useChartBar.d.ts +26 -0
  13. package/dist/Components/ChartBar/composables/useChartBar.js +13 -0
  14. package/dist/Components/ChartBar/index.d.ts +4 -0
  15. package/dist/Components/ChartBar/index.js +4 -0
  16. package/dist/Components/ChartBarSeries/ChartBarSeries.js +5 -0
  17. package/dist/Components/ChartBarSeries/ChartBarSeries.vue.d.ts +6 -0
  18. package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +28 -0
  19. package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +67 -0
  20. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
  21. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +23 -0
  22. package/dist/Components/ChartBarSeries/index.d.ts +4 -0
  23. package/dist/Components/ChartBarSeries/index.js +3 -0
  24. package/dist/Components/ChartFunnel/ChartFunnel.js +5 -0
  25. package/dist/Components/ChartFunnel/ChartFunnel.vue.d.ts +16 -0
  26. package/dist/Components/ChartFunnel/ChartFunnel.vue_vue_type_script_setup_true_lang.js +59 -0
  27. package/dist/Components/ChartFunnel/chartFunnel.types.d.ts +54 -0
  28. package/dist/Components/ChartFunnel/composables/useChartFunnel.d.ts +29 -0
  29. package/dist/Components/ChartFunnel/composables/useChartFunnel.js +68 -0
  30. package/dist/Components/ChartFunnel/index.d.ts +4 -0
  31. package/dist/Components/ChartFunnel/index.js +4 -0
  32. package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +2 -0
  33. package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -13
  34. package/dist/Components/ChartLegend/chartLegend.types.d.ts +41 -5
  35. package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +9 -5
  36. package/dist/Components/ChartLegend/composables/useChartLegend.js +88 -54
  37. package/dist/Components/ChartLine/ChartLine.js +5 -0
  38. package/dist/Components/ChartLine/ChartLine.vue.d.ts +20 -0
  39. package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +77 -0
  40. package/dist/Components/ChartLine/chartLine.types.d.ts +79 -0
  41. package/dist/Components/ChartLine/composables/useChartLine.d.ts +26 -0
  42. package/dist/Components/ChartLine/composables/useChartLine.js +13 -0
  43. package/dist/Components/ChartLine/index.d.ts +4 -0
  44. package/dist/Components/ChartLine/index.js +4 -0
  45. package/dist/Components/ChartLineSeries/ChartLineSeries.js +5 -0
  46. package/dist/Components/ChartLineSeries/ChartLineSeries.vue.d.ts +10 -0
  47. package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +45 -0
  48. package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +96 -0
  49. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
  50. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +28 -0
  51. package/dist/Components/ChartLineSeries/index.d.ts +4 -0
  52. package/dist/Components/ChartLineSeries/index.js +3 -0
  53. package/dist/Components/ChartPie/ChartPie.js +5 -0
  54. package/dist/Components/ChartPie/ChartPie.vue.d.ts +15 -0
  55. package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +76 -0
  56. package/dist/Components/ChartPie/chartPie.types.d.ts +92 -0
  57. package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
  58. package/dist/Components/ChartPie/composables/useChartPie.js +81 -0
  59. package/dist/Components/ChartPie/index.d.ts +4 -0
  60. package/dist/Components/ChartPie/index.js +4 -0
  61. package/dist/Components/ChartScatter/ChartScatter.js +5 -0
  62. package/dist/Components/{Chart/Chart.vue.d.ts → ChartScatter/ChartScatter.vue.d.ts} +3 -2
  63. package/dist/Components/ChartScatter/ChartScatter.vue_vue_type_script_setup_true_lang.js +49 -0
  64. package/dist/Components/ChartScatter/chartScatter.types.d.ts +23 -0
  65. package/dist/Components/ChartScatter/composables/useChartScatter.d.ts +29 -0
  66. package/dist/Components/ChartScatter/composables/useChartScatter.js +108 -0
  67. package/dist/Components/ChartScatter/index.d.ts +4 -0
  68. package/dist/Components/ChartScatter/index.js +4 -0
  69. package/dist/Components/ChartScatterSeries/ChartScatterSeries.js +5 -0
  70. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue.d.ts +4 -0
  71. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +22 -0
  72. package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +45 -0
  73. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
  74. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +19 -0
  75. package/dist/Components/ChartScatterSeries/index.d.ts +4 -0
  76. package/dist/Components/ChartScatterSeries/index.js +3 -0
  77. package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +22 -10
  78. package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +28 -9
  79. package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +4 -1
  80. package/dist/Components/ChartTooltip/composables/useChartTooltip.js +81 -63
  81. package/dist/Components/Heading/Heading.js +5 -0
  82. package/dist/Components/Heading/Heading.vue.d.ts +11 -0
  83. package/dist/Components/Heading/Heading.vue_vue_type_script_setup_true_lang.js +29 -0
  84. package/dist/Components/Heading/composables/useHeading.d.ts +10 -0
  85. package/dist/Components/Heading/composables/useHeading.js +56 -0
  86. package/dist/Components/Heading/heading.types.d.ts +56 -0
  87. package/dist/Components/Heading/index.d.ts +3 -0
  88. package/dist/Components/Heading/index.js +3 -0
  89. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
  90. package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
  91. package/dist/Components/Text/Text.js +5 -0
  92. package/dist/Components/Text/Text.vue.d.ts +11 -0
  93. package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +33 -0
  94. package/dist/Components/Text/composables/useText.d.ts +9 -0
  95. package/dist/Components/Text/composables/useText.js +56 -0
  96. package/dist/Components/Text/index.d.ts +3 -0
  97. package/dist/Components/Text/index.js +3 -0
  98. package/dist/Components/Text/text.types.d.ts +76 -0
  99. package/dist/Utils/Charts/ChartFrame.js +5 -0
  100. package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
  101. package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
  102. package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +33 -18
  103. package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
  104. package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
  105. package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
  106. package/dist/Utils/Charts/echarts/bar.js +23 -0
  107. package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
  108. package/dist/Utils/Charts/echarts/cartesian.js +290 -0
  109. package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
  110. package/dist/Utils/Charts/echarts/funnel.js +79 -0
  111. package/dist/Utils/Charts/echarts/line.d.ts +5 -0
  112. package/dist/Utils/Charts/echarts/line.js +20 -0
  113. package/dist/Utils/Charts/echarts/part.d.ts +19 -0
  114. package/dist/Utils/Charts/echarts/part.js +45 -0
  115. package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
  116. package/dist/Utils/Charts/echarts/pie.js +76 -0
  117. package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
  118. package/dist/Utils/Charts/echarts/plot.js +52 -0
  119. package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
  120. package/dist/Utils/Charts/echarts/scatter.js +161 -0
  121. package/dist/Utils/Charts/index.d.ts +6 -0
  122. package/dist/Utils/Charts/index.js +6 -0
  123. package/dist/Utils/Charts/useChartCartesian.d.ts +59 -0
  124. package/dist/Utils/Charts/useChartCartesian.js +169 -0
  125. package/dist/Utils/Charts/useChartPart.d.ts +45 -0
  126. package/dist/Utils/Charts/useChartPart.js +97 -0
  127. package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
  128. package/dist/Utils/Charts/useChartRegistry.js +40 -0
  129. package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
  130. package/dist/Utils/Charts/useChartRoot.js +342 -0
  131. package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
  132. package/dist/Utils/Charts/useChartSeries.js +22 -0
  133. package/dist/augments.d.ts +33 -7
  134. package/dist/index.d.ts +4 -0
  135. package/dist/index.js +90 -86
  136. package/docs/README.md +8 -1
  137. package/docs/components/BridgeUIProvider.md +1 -1
  138. package/docs/components/Card.md +15 -0
  139. package/docs/components/Chart.md +118 -151
  140. package/docs/components/ChartBar.md +190 -0
  141. package/docs/components/ChartFunnel.md +62 -0
  142. package/docs/components/ChartLine.md +192 -0
  143. package/docs/components/ChartPie.md +138 -0
  144. package/docs/components/ChartScatter.md +102 -0
  145. package/docs/components/Heading.md +85 -0
  146. package/docs/components/Text.md +118 -0
  147. package/package.json +2 -2
  148. package/dist/Components/Chart/Chart.js +0 -5
  149. package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
  150. package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
  151. package/dist/Components/Chart/composables/useChart.d.ts +0 -40
  152. package/dist/Components/Chart/composables/useChart.js +0 -346
  153. package/dist/Components/Chart/echartsChart.d.ts +0 -14
  154. package/dist/Components/Chart/echartsChart.js +0 -199
  155. package/dist/Components/Chart/index.d.ts +0 -4
  156. package/dist/Components/Chart/index.js +0 -4
  157. package/dist/Components/ChartSeries/ChartSeries.js +0 -5
  158. package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
  159. package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
  160. package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
  161. package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
  162. package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
  163. package/dist/Components/ChartSeries/index.d.ts +0 -3
  164. package/dist/Components/ChartSeries/index.js +0 -3
@@ -0,0 +1,342 @@
1
+ import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
2
+ import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../index.js";
3
+ import { CHART_INJECTION_KEY as i } from "./chartInjectionKey.js";
4
+ import { computed as a, onBeforeUnmount as o, onMounted as s, provide as c, ref as l, shallowRef as u, useAttrs as d, useId as f, watch as p } from "vue";
5
+ import { get as m, isEqual as h, isNil as g, isUndefined as _, omit as v, omitBy as y, pick as b } from "es-toolkit/compat";
6
+ import { DEFAULT_CHART_HEIGHT as x, DEFAULT_CHART_PALETTE as S, formatChartAnnouncement as C, getAdjacentChartIndex as w, resolveChartColor as T, toChartCssSize as E } from "@bridge-ui/core/Domain";
7
+ import { chartColorProps as D, chartSizeProps as O, chartThemeProps as k } from "@bridge-ui/core/Tokens";
8
+ import { cn as A, mergeBridgeUILayeredClasses as j, splitComponentProps as ee } from "@bridge-ui/core/Utils";
9
+ import { observeColorScheme as te, prefersReducedMotion as ne, readChartTheme as M, readCssColor as N } from "@bridge-ui/core/Runtime";
10
+ //#region src/Utils/Charts/useChartRoot.ts
11
+ var P = [
12
+ "size",
13
+ "width",
14
+ "height",
15
+ "classes",
16
+ "loading",
17
+ "palette",
18
+ "summary",
19
+ "animation",
20
+ "customProps"
21
+ ];
22
+ function F({ props: t, bridgeKeys: i, libDefaults: c, registryKeys: v, componentName: x, fallbackProps: C }) {
23
+ let w = f(), T = d(), E = `bridge-chart${w}`, A = e(), N = u(null), P = u(null), F = u(null), I = u(null), L = l(0), R = l([]), z = u({
24
+ width: 0,
25
+ height: 0
26
+ }), B = u(null), V = l(null), H = u({
27
+ index: null,
28
+ source: "pointer"
29
+ }), U = a(() => ee({
30
+ bridgeKeys: i,
31
+ props: {
32
+ ...C?.(),
33
+ ...y({
34
+ ...T,
35
+ ...t
36
+ }, _)
37
+ }
38
+ })), W = a(() => U.value.componentProps), { bridge: G, merged: K, entry: q } = n({
39
+ libDefaults: c,
40
+ componentName: x,
41
+ props: () => b(W.value, v)
42
+ }), re = r({
43
+ entry: q,
44
+ props: () => W.value
45
+ }), ie = a(() => G?.global.value.locale ?? "en-US"), J = a(() => K.value.customProps), ae = a(() => JSON.stringify(W.value.palette ?? K.value.palette ?? S)), oe = a(() => JSON.parse(ae.value)), se = a(() => j(O, q.value?.tokens?.size)), ce = a(() => j(D, q.value?.tokens?.color)), Y = a(() => j(k, q.value?.tokens?.theme)), X = a(() => m(se.value, K.value.size)), Z = a(() => G?.global.value.theme), Q;
46
+ s(() => {
47
+ Q = te(() => {
48
+ L.value += 1;
49
+ });
50
+ }), o(() => {
51
+ Q?.();
52
+ }), p([
53
+ N,
54
+ L,
55
+ Y,
56
+ () => X.value?.root,
57
+ Z
58
+ ], () => {
59
+ let e = N.value;
60
+ if (g(e)) return;
61
+ let t = M(e, {
62
+ axis: Y.value.axis ?? "",
63
+ grid: Y.value.grid ?? "",
64
+ text: Y.value.text ?? ""
65
+ });
66
+ h(B.value, t) || (B.value = t);
67
+ }, {
68
+ flush: "post",
69
+ immediate: !0
70
+ }), p(P, (e, t, n) => {
71
+ if (g(e)) return;
72
+ let r = () => {
73
+ let t = e.clientWidth, n = e.clientHeight;
74
+ (z.value.width !== t || z.value.height !== n) && (z.value = {
75
+ width: t,
76
+ height: n
77
+ });
78
+ };
79
+ if (r(), typeof ResizeObserver > "u") return;
80
+ let i = new ResizeObserver(r);
81
+ i.observe(e), n(() => {
82
+ i.disconnect();
83
+ });
84
+ }, {
85
+ flush: "post",
86
+ immediate: !0
87
+ });
88
+ function $(e) {
89
+ R.value = R.value.includes(e) ? R.value.filter((t) => t !== e) : [...R.value, e];
90
+ }
91
+ function le(e) {
92
+ I.value?.highlight(e);
93
+ }
94
+ function ue(e) {
95
+ H.value.index !== e && (H.value = {
96
+ index: e,
97
+ source: "pointer"
98
+ });
99
+ }
100
+ function de(e) {
101
+ let t = I.value?.getAnchor(e), n = P.value;
102
+ return g(t) || g(n) ? null : {
103
+ y: t.y + n.offsetTop,
104
+ x: t.x + n.offsetLeft
105
+ };
106
+ }
107
+ function fe() {
108
+ return {
109
+ width: N.value?.clientWidth ?? 0,
110
+ height: N.value?.clientHeight ?? 0
111
+ };
112
+ }
113
+ function pe(e) {
114
+ V.value = e;
115
+ }
116
+ return {
117
+ split: U,
118
+ theme: B,
119
+ merged: K,
120
+ active: H,
121
+ hidden: R,
122
+ locale: ie,
123
+ chartId: E,
124
+ palette: oe,
125
+ rootRef: N,
126
+ plotRef: P,
127
+ hostRef: F,
128
+ plotSize: z,
129
+ sizeItem: X,
130
+ animation: a(() => K.value.animation !== !1 && !ne()),
131
+ handleRef: I,
132
+ getBounds: fe,
133
+ schemeTick: L,
134
+ toggleItem: $,
135
+ bridgeTheme: Z,
136
+ customProps: J,
137
+ colorClasses: ce,
138
+ highlightItem: le,
139
+ mergedClasses: re,
140
+ legendPosition: V,
141
+ resolveMessage: A,
142
+ componentProps: W,
143
+ getTooltipAnchor: de,
144
+ setLegendPosition: pe,
145
+ onActiveIndexChange: ue
146
+ };
147
+ }
148
+ function I(e, t) {
149
+ let n = u({}), r = a(() => t().map((t, n) => {
150
+ let r = T({
151
+ index: n,
152
+ color: t.color,
153
+ palette: e.palette.value
154
+ });
155
+ return {
156
+ color: r,
157
+ id: t.id,
158
+ className: m(e.colorClasses.value, [r, "series"])
159
+ };
160
+ }));
161
+ return p([
162
+ e.rootRef,
163
+ e.schemeTick,
164
+ e.bridgeTheme,
165
+ r
166
+ ], () => {
167
+ let t = e.rootRef.value;
168
+ if (g(t)) return;
169
+ let i = {};
170
+ r.value.forEach((e) => {
171
+ i[e.id] = g(e.className) ? N(t, { color: e.color }) : N(t, { className: e.className });
172
+ }), h(n.value, i) || (n.value = i);
173
+ }, {
174
+ flush: "post",
175
+ immediate: !0
176
+ }), n;
177
+ }
178
+ function L(e, { mount: t, options: n }) {
179
+ let r = null, i = null, s = a(() => !g(e.hostRef.value) && !g(n.value));
180
+ function c() {
181
+ e.handleRef.value?.destroy(), e.handleRef.value = null, i = null, r?.remove(), r = null;
182
+ }
183
+ p([e.hostRef, s], () => {
184
+ c();
185
+ let a = e.hostRef.value, o = n.value;
186
+ if (!s.value || g(a) || g(o)) return;
187
+ let l = document.createElement("div");
188
+ l.className = "absolute inset-0", a.appendChild(l), r = l, e.handleRef.value = t({
189
+ ...o,
190
+ element: l,
191
+ onActiveIndexChange: e.onActiveIndexChange
192
+ }), i = o;
193
+ }, {
194
+ flush: "post",
195
+ immediate: !0
196
+ }), p(n, (t) => {
197
+ let n = e.handleRef.value;
198
+ g(n) || g(t) || i === t || (i = t, n.update(t));
199
+ }, { flush: "post" }), p(e.active, (t) => {
200
+ t.source === "keyboard" && e.handleRef.value?.setActiveIndex(t.index);
201
+ }, { flush: "post" }), o(() => {
202
+ c();
203
+ });
204
+ }
205
+ function R(e, n) {
206
+ let { active: r, customProps: i, mergedClasses: o, componentProps: s } = e, c = a(() => s.value.loading === !0), l = a(() => !c.value && n.value.isEmpty), u = a(() => e.resolveMessage("No data")), d = a(() => g(s.value.summary) ? n.value.isEmpty ? u.value : n.value.summary : s.value.summary), f = a(() => {
207
+ let t = n.value.tooltip;
208
+ return r.value.source !== "keyboard" || g(t) ? "" : C({
209
+ title: t.title,
210
+ items: t.items,
211
+ locale: e.locale.value
212
+ });
213
+ }), p = a(() => {
214
+ let t = e.legendPosition.value;
215
+ return t === "left" || t === "right";
216
+ });
217
+ function h(e) {
218
+ if (i.value?.plot?.onKeydown?.(e), e.defaultPrevented) return;
219
+ let t = w({
220
+ key: e.key,
221
+ count: n.value.count,
222
+ current: r.value.index
223
+ });
224
+ t !== void 0 && (e.preventDefault(), r.value = {
225
+ index: t,
226
+ source: "keyboard"
227
+ });
228
+ }
229
+ function _(e) {
230
+ i.value?.plot?.onBlur?.(e), r.value.source === "keyboard" && (r.value = {
231
+ index: null,
232
+ source: "keyboard"
233
+ });
234
+ }
235
+ let y = a(() => t(v(i.value?.root, ["style"]), v(e.split.value.inheritedAttrs, ["style"]), {
236
+ role: "figure",
237
+ "aria-busy": c.value || void 0,
238
+ style: [
239
+ { width: E(s.value.width, "100%") },
240
+ e.split.value.inheritedAttrs.style,
241
+ i.value?.root?.style
242
+ ],
243
+ class: A({
244
+ "relative flex min-w-0 gap-3": !0,
245
+ "flex-col": !p.value,
246
+ "flex-row items-center gap-6": p.value,
247
+ [m(e.sizeItem.value, "root") ?? ""]: !0,
248
+ [m(o.value, "root") ?? ""]: !0
249
+ })
250
+ })), b = a(() => t(v(i.value?.plot, [
251
+ "style",
252
+ "onBlur",
253
+ "onKeydown"
254
+ ]), void 0, {
255
+ role: "img",
256
+ tabindex: 0,
257
+ onBlur: _,
258
+ onKeydown: h,
259
+ "aria-label": d.value,
260
+ style: [{ height: E(e.merged.value.height, `${x}px`) }, i.value?.plot?.style],
261
+ class: A({
262
+ "relative min-w-0 rounded-md outline-none": !0,
263
+ "w-full": !p.value,
264
+ "flex-1": p.value,
265
+ "focus-visible:ring-2 focus-visible:ring-primary-500/50": !0,
266
+ [m(o.value, "plot") ?? ""]: !0
267
+ })
268
+ })), S = a(() => ({
269
+ "aria-hidden": !0,
270
+ class: "absolute inset-0"
271
+ })), T = a(() => ({ class: A({
272
+ "pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center": !0,
273
+ [m(o.value, "center") ?? ""]: !0
274
+ }) })), D = a(() => ({ class: A({
275
+ "absolute inset-0 z-10 flex items-center justify-center": !0,
276
+ "bg-white/50 dark:bg-dark-900/50": !0,
277
+ [m(o.value, "loading") ?? ""]: !0
278
+ }) })), O = a(() => ({ class: A({
279
+ "absolute inset-0 z-10 flex items-center justify-center": !0,
280
+ "text-dark-500 dark:text-dark-400": !0,
281
+ [m(o.value, "empty") ?? ""]: !0
282
+ }) })), k = a(() => ({
283
+ id: `${e.chartId}-table`,
284
+ class: A({
285
+ "sr-only block": !0,
286
+ [m(o.value, "table") ?? ""]: !0
287
+ })
288
+ })), j = a(() => ({
289
+ role: "status",
290
+ class: "sr-only",
291
+ "aria-atomic": !0,
292
+ "aria-live": "polite"
293
+ }));
294
+ return {
295
+ label: d,
296
+ table: a(() => n.value.table),
297
+ isEmpty: l,
298
+ hostBind: S,
299
+ plotBind: b,
300
+ rootBind: y,
301
+ liveBind: j,
302
+ emptyBind: O,
303
+ isLoading: c,
304
+ tableBind: k,
305
+ centerBind: T,
306
+ loadingBind: D,
307
+ announcement: f,
308
+ emptyMessage: u,
309
+ rootRef: e.rootRef,
310
+ plotRef: e.plotRef,
311
+ hostRef: e.hostRef
312
+ };
313
+ }
314
+ function z(e, t) {
315
+ let n = a(() => ({
316
+ ...t.value,
317
+ id: e.chartId,
318
+ getBounds: e.getBounds,
319
+ locale: e.locale.value,
320
+ toggleItem: e.toggleItem,
321
+ highlightItem: e.highlightItem,
322
+ activeIndex: e.active.value.index,
323
+ getTooltipAnchor: e.getTooltipAnchor,
324
+ setLegendPosition: e.setLegendPosition,
325
+ tokenClasses: {
326
+ legend: m(e.sizeItem.value, "legend"),
327
+ swatch: m(e.sizeItem.value, "swatch"),
328
+ tooltip: m(e.sizeItem.value, "tooltip"),
329
+ legendItem: m(e.sizeItem.value, "legendItem")
330
+ }
331
+ }));
332
+ return c(i, n), n;
333
+ }
334
+ function B(e, t, n) {
335
+ return e.map((e) => ({
336
+ ...e,
337
+ color: t[e.id] ?? "",
338
+ hidden: n.includes(e.id)
339
+ }));
340
+ }
341
+ //#endregion
342
+ export { P as chartRootBridgeKeys, B as toChartLegendItems, I as useChartColors, z as useChartContextValue, R as useChartFrame, L as useChartPlot, F as useChartRoot };
@@ -0,0 +1,10 @@
1
+ import { ChartFamily, ChartSeriesRegistration } from './chartInjectionKey';
2
+ /**
3
+ * Registers a series on the nearest chart root while mounted. Throws when
4
+ * the root is not one of `families` (`ChartBarSeries` inside `ChartLine`).
5
+ */
6
+ export declare function useChartSeries<Entry extends ChartSeriesRegistration>({ entry, families, componentName, }: {
7
+ componentName: string;
8
+ entry: () => Omit<Entry, "id">;
9
+ families: readonly ChartFamily[];
10
+ }): import('vue').ComputedRef<Entry>;
@@ -0,0 +1,22 @@
1
+ import { useChartContext as e } from "./chartInjectionKey.js";
2
+ import { computed as t, onBeforeUnmount as n, useId as r, watch as i } from "vue";
3
+ import { isNil as a, upperFirst as o } from "es-toolkit/compat";
4
+ //#region src/Utils/Charts/useChartSeries.ts
5
+ function s(e) {
6
+ return `Chart${o(e)}`;
7
+ }
8
+ function c({ entry: o, families: c, componentName: l }) {
9
+ let u = r(), d = e(), { upsertSeries: f, removeSeries: p } = d.value;
10
+ if (!c.includes(d.value.family) || a(f) || a(p)) throw Error(`${l} must be used within ${c.map(s).join(" or ")}`);
11
+ let m = `${d.value.id}-series${u}`, h = t(() => ({
12
+ ...o(),
13
+ id: m
14
+ }));
15
+ return i(h, (e) => {
16
+ f(e);
17
+ }, { immediate: !0 }), n(() => {
18
+ p(m);
19
+ }), h;
20
+ }
21
+ //#endregion
22
+ export { c as useChartSeries };
@@ -8,15 +8,19 @@ import { ButtonGroupClasses, ButtonGroupProps } from './Components/ButtonGroup';
8
8
  import { CardClasses, CardProps } from './Components/Card';
9
9
  import { CarouselClasses, CarouselProps } from './Components/Carousel';
10
10
  import { CarouselSlideClasses } from './Components/CarouselSlide';
11
- import { ChartClasses, ChartProps } from './Components/Chart';
11
+ import { ChartBarProps } from './Components/ChartBar';
12
+ import { ChartFunnelProps } from './Components/ChartFunnel';
12
13
  import { ChartLegendClasses, ChartLegendProps } from './Components/ChartLegend';
13
- import { ChartSeriesProps } from './Components/ChartSeries';
14
+ import { ChartClasses, ChartLineProps } from './Components/ChartLine';
15
+ import { ChartPieProps } from './Components/ChartPie';
16
+ import { ChartScatterProps } from './Components/ChartScatter';
14
17
  import { ChartTooltipClasses } from './Components/ChartTooltip';
15
18
  import { CheckboxClasses, CheckboxProps } from './Components/Checkbox';
16
19
  import { ChipClasses, ChipProps } from './Components/Chip';
17
20
  import { DividerClasses, DividerProps } from './Components/Divider';
18
21
  import { EmptyStateClasses, EmptyStateProps } from './Components/EmptyState';
19
22
  import { FileUploadClasses, FileUploadProps } from './Components/FileUpload';
23
+ import { HeadingClasses, HeadingProps } from './Components/Heading';
20
24
  import { IconProps } from './Components/Icon';
21
25
  import { LabelClasses, LabelProps } from './Components/Label';
22
26
  import { LinkClasses, LinkProps } from './Components/Link';
@@ -41,6 +45,7 @@ import { SliderClasses, SliderProps } from './Components/Slider';
41
45
  import { SnackbarClasses, SnackbarProps } from './Components/Snackbar';
42
46
  import { SpinnerClasses, SpinnerProps } from './Components/Spinner';
43
47
  import { SwitchClasses, SwitchProps } from './Components/Switch';
48
+ import { TextClasses, TextProps } from './Components/Text';
44
49
  import { TextareaClasses, TextareaProps } from './Components/Textarea';
45
50
  import { TextFieldClasses, TextFieldProps } from './Components/TextField';
46
51
  declare module "@bridge-ui/core/Config" {
@@ -83,16 +88,29 @@ declare module "@bridge-ui/core/Config" {
83
88
  interface CarouselSlideConfigOverrides {
84
89
  classes: CarouselSlideClasses;
85
90
  }
86
- interface ChartConfigOverrides {
91
+ interface ChartBarConfigOverrides {
87
92
  classes: ChartClasses;
88
- defaultProps: Partial<Pick<ChartProps, "size" | "height" | "palette" | "animation">>;
93
+ defaultProps: Partial<Pick<ChartBarProps, "size" | "height" | "labels" | "radius" | "palette" | "animation" | "orientation">>;
94
+ }
95
+ interface ChartFunnelConfigOverrides {
96
+ classes: ChartClasses;
97
+ defaultProps: Partial<Pick<ChartFunnelProps, "size" | "sort" | "align" | "height" | "labels" | "palette" | "animation" | "labelPosition">>;
89
98
  }
90
99
  interface ChartLegendConfigOverrides {
91
100
  classes: ChartLegendClasses;
92
- defaultProps: Partial<Pick<ChartLegendProps, "align" | "position" | "interactive">>;
101
+ defaultProps: Partial<Pick<ChartLegendProps, "align" | "position" | "showValue" | "interactive" | "showPercent">>;
93
102
  }
94
- interface ChartSeriesConfigOverrides {
95
- defaultProps: Partial<Pick<ChartSeriesProps, "type" | "curve">>;
103
+ interface ChartLineConfigOverrides {
104
+ classes: ChartClasses;
105
+ defaultProps: Partial<Pick<ChartLineProps, "area" | "size" | "step" | "curve" | "height" | "labels" | "palette" | "animation" | "showPoints">>;
106
+ }
107
+ interface ChartPieConfigOverrides {
108
+ classes: ChartClasses;
109
+ defaultProps: Partial<Pick<ChartPieProps, "size" | "height" | "labels" | "palette" | "variant" | "minAngle" | "animation" | "thickness" | "labelPosition">>;
110
+ }
111
+ interface ChartScatterConfigOverrides {
112
+ classes: ChartClasses;
113
+ defaultProps: Partial<Pick<ChartScatterProps, "size" | "height" | "palette" | "animation" | "bubbleSize" | "symbolSize">>;
96
114
  }
97
115
  interface ChartTooltipConfigOverrides {
98
116
  classes: ChartTooltipClasses;
@@ -117,6 +135,10 @@ declare module "@bridge-ui/core/Config" {
117
135
  classes: FileUploadClasses;
118
136
  defaultProps: Partial<Pick<FileUploadProps, "size" | "color" | "rounded" | "variant" | "multiple" | "orientation">>;
119
137
  }
138
+ interface HeadingConfigOverrides {
139
+ classes: HeadingClasses;
140
+ defaultProps: Partial<Pick<HeadingProps, "size" | "color" | "weight" | "variant">>;
141
+ }
120
142
  interface IconConfigOverrides {
121
143
  defaultProps: Partial<Pick<IconProps, "size">>;
122
144
  }
@@ -210,6 +232,10 @@ declare module "@bridge-ui/core/Config" {
210
232
  classes: SwitchClasses;
211
233
  defaultProps: Partial<Pick<SwitchProps, "size" | "color" | "rounded" | "hideErrorMessage">>;
212
234
  }
235
+ interface TextConfigOverrides {
236
+ classes: TextClasses;
237
+ defaultProps: Partial<Pick<TextProps, "size" | "color" | "weight" | "variant">>;
238
+ }
213
239
  interface TextareaConfigOverrides {
214
240
  classes: TextareaClasses;
215
241
  defaultProps: Partial<Pick<TextareaProps, "size" | "color" | "resize" | "rounded" | "variant" | "autosize" | "showErrorIcon" | "hideErrorMessage" | "showDescriptionOnError">>;
package/dist/index.d.ts CHANGED
@@ -82,6 +82,8 @@ export { FormControl, useFormControl } from './Components/FormControl';
82
82
  export type { FormControlClasses, FormControlCustomProps, FormControlOwnProps, FormControlProps, FormControlSizeOverrides, FormControlSlots, UseFormControlReturn, } from './Components/FormControl';
83
83
  export { FormField, useFormField } from './Components/FormField';
84
84
  export type { FormFieldClasses, FormFieldColorOverrides, FormFieldCustomProps, FormFieldOwnProps, FormFieldProps, FormFieldRoundedOverrides, FormFieldSizeOverrides, FormFieldSlots, FormFieldVariantOverrides, UseFormFieldReturn, } from './Components/FormField';
85
+ export { Heading, useHeading } from './Components/Heading';
86
+ export type { HeadingClasses, HeadingOwnProps, HeadingProps, HeadingSlots, } from './Components/Heading';
85
87
  export { Icon, type IconOwnProps, type IconProps } from './Components/Icon';
86
88
  export type { IconSizeOverrides } from './Components/Icon';
87
89
  export { Label, useLabel } from './Components/Label';
@@ -148,6 +150,8 @@ export { TabPanel, useTabPanel } from './Components/TabPanel';
148
150
  export type { TabPanelClasses, TabPanelCustomProps, TabPanelOwnProps, TabPanelProps, TabPanelSlots, } from './Components/TabPanel';
149
151
  export { TABS_INJECTION_KEY, Tabs, useTabs } from './Components/Tabs';
150
152
  export type { TabsClasses, TabsColorOverrides, TabsContextValue, TabsCustomProps, TabsEmits, TabsItemEntry, TabsOrientationOverrides, TabsOwnProps, TabsProps, TabsSizeOverrides, TabsSlots, TabsTokenClasses, TabsVariantOverrides, } from './Components/Tabs';
153
+ export { Text, useText } from './Components/Text';
154
+ export type { TextClasses, TextColorOverrides, TextOwnProps, TextProps, TextSizeOverrides, TextSlots, TextVariantOverrides, TextWeightOverrides, } from './Components/Text';
151
155
  export { Textarea, useTextarea } from './Components/Textarea';
152
156
  export type { TextareaClasses, TextareaCustomProps, TextareaOwnProps, TextareaProps, TextareaSlots, } from './Components/Textarea';
153
157
  export { TextField, useTextField } from './Components/TextField';