@bridge-ui/vue 0.17.3 → 0.18.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 (141) hide show
  1. package/ai/skills/bridge-ui-components/SKILL.md +33 -33
  2. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  3. package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +1 -0
  4. package/dist/Components/ChartAxis/chartAxis.types.d.ts +17 -7
  5. package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +2 -2
  6. package/dist/Components/ChartAxis/composables/useChartAxis.js +15 -10
  7. package/dist/Components/ChartBar/ChartBar.js +5 -0
  8. package/dist/Components/ChartBar/ChartBar.vue.d.ts +16 -0
  9. package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +59 -0
  10. package/dist/Components/ChartBar/chartBar.types.d.ts +56 -0
  11. package/dist/Components/ChartBar/composables/useChartBar.d.ts +26 -0
  12. package/dist/Components/ChartBar/composables/useChartBar.js +13 -0
  13. package/dist/Components/ChartBar/index.d.ts +4 -0
  14. package/dist/Components/ChartBar/index.js +4 -0
  15. package/dist/Components/ChartBarSeries/ChartBarSeries.js +5 -0
  16. package/dist/Components/ChartBarSeries/ChartBarSeries.vue.d.ts +6 -0
  17. package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +25 -0
  18. package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +45 -0
  19. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
  20. package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +20 -0
  21. package/dist/Components/ChartBarSeries/index.d.ts +3 -0
  22. package/dist/Components/ChartBarSeries/index.js +3 -0
  23. package/dist/Components/ChartFunnel/ChartFunnel.js +5 -0
  24. package/dist/Components/ChartFunnel/ChartFunnel.vue.d.ts +16 -0
  25. package/dist/Components/ChartFunnel/ChartFunnel.vue_vue_type_script_setup_true_lang.js +59 -0
  26. package/dist/Components/ChartFunnel/chartFunnel.types.d.ts +54 -0
  27. package/dist/Components/ChartFunnel/composables/useChartFunnel.d.ts +29 -0
  28. package/dist/Components/ChartFunnel/composables/useChartFunnel.js +68 -0
  29. package/dist/Components/ChartFunnel/index.d.ts +4 -0
  30. package/dist/Components/ChartFunnel/index.js +4 -0
  31. package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +2 -0
  32. package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -13
  33. package/dist/Components/ChartLegend/chartLegend.types.d.ts +41 -5
  34. package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +9 -5
  35. package/dist/Components/ChartLegend/composables/useChartLegend.js +88 -54
  36. package/dist/Components/ChartLine/ChartLine.js +5 -0
  37. package/dist/Components/ChartLine/ChartLine.vue.d.ts +20 -0
  38. package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +76 -0
  39. package/dist/Components/ChartLine/chartLine.types.d.ts +72 -0
  40. package/dist/Components/ChartLine/composables/useChartLine.d.ts +26 -0
  41. package/dist/Components/ChartLine/composables/useChartLine.js +13 -0
  42. package/dist/Components/ChartLine/index.d.ts +4 -0
  43. package/dist/Components/ChartLine/index.js +4 -0
  44. package/dist/Components/ChartLineSeries/ChartLineSeries.js +5 -0
  45. package/dist/Components/ChartLineSeries/ChartLineSeries.vue.d.ts +10 -0
  46. package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +42 -0
  47. package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +75 -0
  48. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
  49. package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +25 -0
  50. package/dist/Components/ChartLineSeries/index.d.ts +3 -0
  51. package/dist/Components/ChartLineSeries/index.js +3 -0
  52. package/dist/Components/ChartPie/ChartPie.js +5 -0
  53. package/dist/Components/ChartPie/ChartPie.vue.d.ts +15 -0
  54. package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +73 -0
  55. package/dist/Components/ChartPie/chartPie.types.d.ts +73 -0
  56. package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
  57. package/dist/Components/ChartPie/composables/useChartPie.js +71 -0
  58. package/dist/Components/ChartPie/index.d.ts +4 -0
  59. package/dist/Components/ChartPie/index.js +4 -0
  60. package/dist/Components/ChartScatter/ChartScatter.js +5 -0
  61. package/dist/Components/{Chart/Chart.vue.d.ts → ChartScatter/ChartScatter.vue.d.ts} +3 -2
  62. package/dist/Components/ChartScatter/ChartScatter.vue_vue_type_script_setup_true_lang.js +49 -0
  63. package/dist/Components/ChartScatter/chartScatter.types.d.ts +23 -0
  64. package/dist/Components/ChartScatter/composables/useChartScatter.d.ts +29 -0
  65. package/dist/Components/ChartScatter/composables/useChartScatter.js +103 -0
  66. package/dist/Components/ChartScatter/index.d.ts +4 -0
  67. package/dist/Components/ChartScatter/index.js +4 -0
  68. package/dist/Components/ChartScatterSeries/ChartScatterSeries.js +5 -0
  69. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue.d.ts +4 -0
  70. package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +21 -0
  71. package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +38 -0
  72. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
  73. package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +18 -0
  74. package/dist/Components/ChartScatterSeries/index.d.ts +3 -0
  75. package/dist/Components/ChartScatterSeries/index.js +3 -0
  76. package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +18 -10
  77. package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +24 -9
  78. package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +3 -1
  79. package/dist/Components/ChartTooltip/composables/useChartTooltip.js +78 -64
  80. package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
  81. package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
  82. package/dist/Utils/Charts/ChartFrame.js +5 -0
  83. package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
  84. package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
  85. package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +16 -18
  86. package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
  87. package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
  88. package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
  89. package/dist/Utils/Charts/echarts/bar.js +22 -0
  90. package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
  91. package/dist/Utils/Charts/echarts/cartesian.js +255 -0
  92. package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
  93. package/dist/Utils/Charts/echarts/funnel.js +79 -0
  94. package/dist/Utils/Charts/echarts/line.d.ts +5 -0
  95. package/dist/Utils/Charts/echarts/line.js +19 -0
  96. package/dist/Utils/Charts/echarts/part.d.ts +19 -0
  97. package/dist/Utils/Charts/echarts/part.js +45 -0
  98. package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
  99. package/dist/Utils/Charts/echarts/pie.js +75 -0
  100. package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
  101. package/dist/Utils/Charts/echarts/plot.js +52 -0
  102. package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
  103. package/dist/Utils/Charts/echarts/scatter.js +152 -0
  104. package/dist/Utils/Charts/index.d.ts +6 -0
  105. package/dist/Utils/Charts/index.js +6 -0
  106. package/dist/Utils/Charts/useChartCartesian.d.ts +57 -0
  107. package/dist/Utils/Charts/useChartCartesian.js +155 -0
  108. package/dist/Utils/Charts/useChartPart.d.ts +45 -0
  109. package/dist/Utils/Charts/useChartPart.js +97 -0
  110. package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
  111. package/dist/Utils/Charts/useChartRegistry.js +40 -0
  112. package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
  113. package/dist/Utils/Charts/useChartRoot.js +342 -0
  114. package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
  115. package/dist/Utils/Charts/useChartSeries.js +22 -0
  116. package/dist/augments.d.ts +23 -7
  117. package/docs/README.md +6 -1
  118. package/docs/components/Chart.md +114 -154
  119. package/docs/components/ChartBar.md +137 -0
  120. package/docs/components/ChartFunnel.md +62 -0
  121. package/docs/components/ChartLine.md +151 -0
  122. package/docs/components/ChartPie.md +115 -0
  123. package/docs/components/ChartScatter.md +84 -0
  124. package/package.json +2 -2
  125. package/dist/Components/Chart/Chart.js +0 -5
  126. package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
  127. package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
  128. package/dist/Components/Chart/composables/useChart.d.ts +0 -40
  129. package/dist/Components/Chart/composables/useChart.js +0 -346
  130. package/dist/Components/Chart/echartsChart.d.ts +0 -14
  131. package/dist/Components/Chart/echartsChart.js +0 -199
  132. package/dist/Components/Chart/index.d.ts +0 -4
  133. package/dist/Components/Chart/index.js +0 -4
  134. package/dist/Components/ChartSeries/ChartSeries.js +0 -5
  135. package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
  136. package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
  137. package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
  138. package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
  139. package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
  140. package/dist/Components/ChartSeries/index.d.ts +0 -3
  141. package/dist/Components/ChartSeries/index.js +0 -3
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes } from 'vue';
2
+ import { MergeHtmlProps } from '@bridge-ui/core/Utils';
3
+ import { ChartRootOwnProps } from '../../Utils/Charts';
4
+ /**
5
+ * Scatter / bubble chart root. Compose with `ChartScatterSeries`,
6
+ * `ChartAxis`, `ChartLegend`, and `ChartTooltip`. Both axes are numeric.
7
+ */
8
+ export interface ChartScatterOwnProps extends ChartRootOwnProps {
9
+ /**
10
+ * Min / max bubble diameter (px) for `[x, y, size]` points. Sizes scale by
11
+ * area across all series.
12
+ *
13
+ * @default [8, 40]
14
+ */
15
+ bubbleSize?: [number, number];
16
+ /**
17
+ * Point diameter (px) for `[x, y]` points.
18
+ *
19
+ * @default 8
20
+ */
21
+ symbolSize?: number;
22
+ }
23
+ export type ChartScatterProps = MergeHtmlProps<ChartScatterOwnProps, HTMLAttributes>;
@@ -0,0 +1,29 @@
1
+ import { ChartScatterRenderOptions } from '@bridge-ui/core/Domain';
2
+ import { ChartScatterOwnProps } from '../chartScatter.types';
3
+ import { ChartRootMerged } from '../../../Utils/Charts';
4
+ type ChartScatterMerged = ChartRootMerged & Pick<ChartScatterOwnProps, "bubbleSize" | "symbolSize">;
5
+ export declare function useChartScatter(props: ChartScatterOwnProps, libDefaults: Partial<ChartScatterMerged>): {
6
+ frame: {
7
+ label: import('vue').ComputedRef<string>;
8
+ table: import('vue').ComputedRef<import('@bridge-ui/core/Domain').ChartTable>;
9
+ isEmpty: import('vue').ComputedRef<boolean>;
10
+ hostBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
11
+ plotBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
12
+ rootBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
13
+ liveBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
14
+ emptyBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
15
+ isLoading: import('vue').ComputedRef<boolean>;
16
+ tableBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
17
+ centerBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
18
+ loadingBind: import('vue').ComputedRef<import('vue').HTMLAttributes>;
19
+ announcement: import('vue').ComputedRef<string>;
20
+ emptyMessage: import('vue').ComputedRef<string>;
21
+ rootRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
22
+ plotRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
23
+ hostRef: import('vue').ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
24
+ };
25
+ merged: import('vue').ComputedRef<ChartScatterMerged>;
26
+ context: import('vue').ComputedRef<import('../../../Utils/Charts').ChartContextValue>;
27
+ options: import('vue').ComputedRef<ChartScatterRenderOptions | null>;
28
+ };
29
+ export {};
@@ -0,0 +1,103 @@
1
+ import { useChartRegistry as e } from "../../../Utils/Charts/useChartRegistry.js";
2
+ import { chartRootBridgeKeys as t, toChartLegendItems as n, useChartColors as r, useChartContextValue as i, useChartFrame as a, useChartPlot as o, useChartRoot as s } from "../../../Utils/Charts/useChartRoot.js";
3
+ import { mountEchartsScatter as c } from "../../../Utils/Charts/echarts/scatter.js";
4
+ import { computed as l } from "vue";
5
+ import { isNil as u } from "es-toolkit/compat";
6
+ import { DEFAULT_CHART_BUBBLE_SIZE as d, DEFAULT_CHART_SYMBOL_SIZE as f, getChartBubbleSizeDomain as p, getChartScatterPoints as m, getChartScatterTable as h, getChartScatterTooltip as g, isChartScatterEmpty as _ } from "@bridge-ui/core/Domain";
7
+ //#region src/Components/ChartScatter/composables/useChartScatter.ts
8
+ var v = [
9
+ ...t,
10
+ "bubbleSize",
11
+ "symbolSize"
12
+ ], y = [
13
+ "size",
14
+ "height",
15
+ "classes",
16
+ "animation",
17
+ "symbolSize",
18
+ "customProps"
19
+ ];
20
+ function b(t, b) {
21
+ let x = s({
22
+ props: t,
23
+ libDefaults: b,
24
+ componentName: "ChartScatter",
25
+ bridgeKeys: v,
26
+ registryKeys: y
27
+ }), S = e(), { merged: C, hidden: w, locale: T, resolveMessage: E } = x, D = l(() => JSON.stringify(t.bubbleSize ?? C.value.bubbleSize ?? d)), O = l(() => JSON.parse(D.value)), k = r(x, () => S.entries.value), A = l(() => S.entries.value.filter((e) => !w.value.includes(e.id)).map((e) => ({
28
+ ...e,
29
+ color: k.value[e.id] ?? ""
30
+ }))), j = l(() => m(A.value)), M = l(() => {
31
+ let e = x.theme.value;
32
+ return u(e) ? null : {
33
+ theme: e,
34
+ points: j.value,
35
+ series: A.value,
36
+ bubbleSize: O.value,
37
+ animation: x.animation.value,
38
+ width: x.plotSize.value.width,
39
+ height: x.plotSize.value.height,
40
+ xAxis: { ...S.axes.value.x },
41
+ yAxis: { ...S.axes.value.y },
42
+ sizeDomain: p(A.value),
43
+ symbolSize: C.value.symbolSize ?? f
44
+ };
45
+ });
46
+ o(x, {
47
+ options: M,
48
+ mount: c
49
+ });
50
+ let N = l(() => ({
51
+ size: E("Size"),
52
+ x: S.axes.value.x?.label ?? "x",
53
+ y: S.axes.value.y?.label ?? "y"
54
+ })), P = l(() => {
55
+ let e = x.active.value.index, t = u(e) ? void 0 : j.value[e], n = u(t) ? void 0 : A.value[t.seriesIndex];
56
+ return u(t) || u(n) ? null : g({
57
+ point: t,
58
+ series: n,
59
+ labels: {
60
+ ...N.value,
61
+ size: n.sizeName ?? N.value.size
62
+ }
63
+ });
64
+ });
65
+ return {
66
+ frame: a(x, l(() => {
67
+ let e = S.entries.value;
68
+ return {
69
+ tooltip: P.value,
70
+ count: j.value.length,
71
+ isEmpty: _(e),
72
+ summary: E("Scatter chart with {{count}} series ({{names}}) and {{points}} points.", {
73
+ count: e.length,
74
+ points: m(e).length,
75
+ names: e.map((e) => e.name).join(", ")
76
+ }),
77
+ table: h({
78
+ series: e,
79
+ locale: T.value,
80
+ headers: {
81
+ x: N.value.x,
82
+ y: N.value.y,
83
+ series: E("Series"),
84
+ size: e.find((e) => !u(e.sizeName))?.sizeName ?? N.value.size
85
+ }
86
+ })
87
+ };
88
+ })),
89
+ merged: C,
90
+ context: i(x, l(() => ({
91
+ tooltip: P.value,
92
+ setAxis: S.setAxis,
93
+ family: "scatter",
94
+ removeAxis: S.removeAxis,
95
+ upsertSeries: S.upsertSeries,
96
+ removeSeries: S.removeSeries,
97
+ legendItems: n(S.entries.value, k.value, w.value)
98
+ }))),
99
+ options: M
100
+ };
101
+ }
102
+ //#endregion
103
+ export { b as useChartScatter };
@@ -0,0 +1,4 @@
1
+ export type { ChartScatterOwnProps, ChartScatterProps, } from './chartScatter.types';
2
+ export { default as ChartScatter } from './ChartScatter.vue';
3
+ export { useChartScatter } from './composables/useChartScatter';
4
+ export { useChartContext, type ChartClasses, type ChartColorOverrides, type ChartColorValue, type ChartContextValue, type ChartCustomProps, type ChartSizeOverrides, type ChartSlots, } from '../../Utils/Charts';
@@ -0,0 +1,4 @@
1
+ import { useChartContext as e } from "../../Utils/Charts/chartInjectionKey.js";
2
+ import { useChartScatter as t } from "./composables/useChartScatter.js";
3
+ import n from "./ChartScatter.js";
4
+ export { n as ChartScatter, e as useChartContext, t as useChartScatter };
@@ -0,0 +1,5 @@
1
+ import e from "./ChartScatterSeries.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Components/ChartScatterSeries/ChartScatterSeries.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,4 @@
1
+ import { ChartScatterSeriesOwnProps } from './chartScatterSeries.types';
2
+ declare const __VLS_export: import('vue').DefineComponent<ChartScatterSeriesOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ChartScatterSeriesOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { useChartScatterSeries as e } from "./composables/useChartScatterSeries.js";
2
+ import { createElementBlock as t, defineComponent as n, openBlock as r } from "vue";
3
+ //#region src/Components/ChartScatterSeries/ChartScatterSeries.vue?vue&type=script&setup=true&lang.ts
4
+ var i = {
5
+ hidden: "",
6
+ "aria-hidden": "true"
7
+ }, a = /*@__PURE__*/ n({
8
+ __name: "ChartScatterSeries",
9
+ props: {
10
+ color: {},
11
+ data: {},
12
+ name: {},
13
+ sizeName: {},
14
+ symbolSize: {}
15
+ },
16
+ setup(n) {
17
+ return e(n), (e, n) => (r(), t("span", i));
18
+ }
19
+ });
20
+ //#endregion
21
+ export { a as default };
@@ -0,0 +1,38 @@
1
+ import { ChartScatterPoint } from '@bridge-ui/core/Domain';
2
+ import { ChartColorValue } from '../../Utils/Charts';
3
+ /**
4
+ * One group of points registered on the nearest `ChartScatter`.
5
+ * Renders nothing.
6
+ */
7
+ export interface ChartScatterSeriesOwnProps {
8
+ /**
9
+ * Series color (token key or CSS color). Falls back to the palette.
10
+ *
11
+ * @default undefined
12
+ */
13
+ color?: ChartColorValue;
14
+ /**
15
+ * Points: `[x, y]`, or `[x, y, size]` for bubbles.
16
+ */
17
+ data: ChartScatterPoint[];
18
+ /**
19
+ * Series name shown in the legend, tooltip, and data table.
20
+ */
21
+ name: string;
22
+ /**
23
+ * Label for the third value (bubble size) in the tooltip and data table.
24
+ *
25
+ * @default "Size"
26
+ */
27
+ sizeName?: string;
28
+ /**
29
+ * Point diameter (px) for `[x, y]` points. Ignored for bubbles.
30
+ *
31
+ * @default ChartScatter `symbolSize`
32
+ */
33
+ symbolSize?: number;
34
+ }
35
+ /**
36
+ * `ChartScatterSeries` has no DOM element, so it takes no HTML attributes.
37
+ */
38
+ export type ChartScatterSeriesProps = ChartScatterSeriesOwnProps;
@@ -0,0 +1,4 @@
1
+ import { ChartScatterSeriesOwnProps } from '../chartScatterSeries.types';
2
+ export declare function useChartScatterSeries(props: ChartScatterSeriesOwnProps): {
3
+ entry: import('vue').ComputedRef<import('@bridge-ui/core/Domain').ChartScatterSeriesEntry>;
4
+ };
@@ -0,0 +1,18 @@
1
+ import { useChartSeries as e } from "../../../Utils/Charts/useChartSeries.js";
2
+ //#region src/Components/ChartScatterSeries/composables/useChartScatterSeries.ts
3
+ function t(t) {
4
+ return { entry: e({
5
+ families: ["scatter"],
6
+ componentName: "ChartScatterSeries",
7
+ entry: () => ({
8
+ kind: "scatter",
9
+ name: t.name,
10
+ data: t.data,
11
+ color: t.color,
12
+ sizeName: t.sizeName,
13
+ symbolSize: t.symbolSize
14
+ })
15
+ }) };
16
+ }
17
+ //#endregion
18
+ export { t as useChartScatterSeries };
@@ -0,0 +1,3 @@
1
+ export type { ChartScatterSeriesOwnProps, ChartScatterSeriesProps, } from './chartScatterSeries.types';
2
+ export { default as ChartScatterSeries } from './ChartScatterSeries.vue';
3
+ export { useChartScatterSeries } from './composables/useChartScatterSeries';
@@ -0,0 +1,3 @@
1
+ import { useChartScatterSeries as e } from "./composables/useChartScatterSeries.js";
2
+ import t from "./ChartScatterSeries.js";
3
+ export { t as ChartScatterSeries, e as useChartScatterSeries };
@@ -1,25 +1,33 @@
1
1
  import { useChartTooltip as e } from "./composables/useChartTooltip.js";
2
- import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, guardReactiveProps as o, mergeProps as s, normalizeProps as c, openBlock as l, renderList as u, renderSlot as d, toDisplayString as f, unref as p, useTemplateRef as m } from "vue";
2
+ import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, guardReactiveProps as s, mergeProps as c, normalizeProps as l, openBlock as u, renderList as d, renderSlot as f, toDisplayString as p, unref as m, useTemplateRef as h } from "vue";
3
3
  //#region src/Components/ChartTooltip/ChartTooltip.vue?vue&type=script&setup=true&lang.ts
4
- var h = /*@__PURE__*/ a({
4
+ var g = /*@__PURE__*/ o({
5
5
  inheritAttrs: !1,
6
6
  __name: "ChartTooltip",
7
7
  props: {
8
8
  classes: {},
9
9
  customProps: {},
10
+ formatPercent: { type: Function },
10
11
  formatValue: { type: Function }
11
12
  },
12
- setup(a) {
13
- let h = a, g = m("tooltip"), { isOpen: _, context: v, itemBind: y, rootBind: b, labelBind: x, titleBind: S, valueBind: C, formatValue: w, getSwatchBind: T } = e(h, g);
14
- return (e, a) => p(_) && p(v) ? (l(), r("div", s({
13
+ setup(o) {
14
+ let g = o, _ = h("tooltip"), { isOpen: v, context: y, itemBind: b, rootBind: x, labelBind: S, titleBind: C, valueBind: w, percentBind: T, formatValue: E, formatPercent: D, getSwatchBind: O } = e(g, _);
15
+ return (e, o) => m(v) && m(y) ? (u(), r("div", c({
15
16
  key: 0,
16
17
  ref: "tooltip"
17
- }, p(b)), [d(e.$slots, "content", c(o(p(v))), () => [i("div", c(o(p(S))), f(p(v).category), 17), (l(!0), r(t, null, u(p(v).items, (e) => (l(), r("div", s({ key: e.id }, { ref_for: !0 }, p(y)), [
18
- i("span", s({ ref_for: !0 }, p(T)(e)), null, 16),
19
- i("span", s({ ref_for: !0 }, p(x)), f(e.name), 17),
20
- i("span", s({ ref_for: !0 }, p(C)), f(p(w)(e)), 17)
18
+ }, m(x)), [f(e.$slots, "content", l(s(m(y))), () => [m(y).title ? (u(), r("div", l(c({ key: 0 }, m(C))), [m(y).color ? (u(), r("span", l(c({ key: 0 }, m(O)(m(y).color))), null, 16)) : n("", !0), a(" " + p(m(y).title), 1)], 16)) : n("", !0), (u(!0), r(t, null, d(m(y).items, (e) => (u(), r("div", c({ key: e.id }, { ref_for: !0 }, m(b)), [
19
+ e.color ? (u(), r("span", c({
20
+ key: 0,
21
+ ref_for: !0
22
+ }, m(O)(e.color)), null, 16)) : n("", !0),
23
+ i("span", c({ ref_for: !0 }, m(S)), p(e.name), 17),
24
+ i("span", c({ ref_for: !0 }, m(w)), p(m(E)(e)), 17),
25
+ m(D)(e) === null ? n("", !0) : (u(), r("span", c({
26
+ key: 1,
27
+ ref_for: !0
28
+ }, m(T)), p(m(D)(e)), 17))
21
29
  ], 16))), 128))])], 16)) : n("", !0);
22
30
  }
23
31
  });
24
32
  //#endregion
25
- export { h as default };
33
+ export { g as default };
@@ -3,13 +3,17 @@ import { ChartTooltipItem } from '@bridge-ui/core/Domain';
3
3
  import { MergeHtmlProps } from '@bridge-ui/core/Utils';
4
4
  export interface ChartTooltipClasses {
5
5
  /**
6
- * Classes merged onto each series row.
6
+ * Classes merged onto each row.
7
7
  */
8
8
  item?: string;
9
9
  /**
10
- * Classes merged onto each series name.
10
+ * Classes merged onto each row label.
11
11
  */
12
12
  label?: string;
13
+ /**
14
+ * Classes merged onto each percent (pie, funnel).
15
+ */
16
+ percent?: string;
13
17
  /**
14
18
  * Classes merged onto the tooltip box.
15
19
  */
@@ -19,7 +23,7 @@ export interface ChartTooltipClasses {
19
23
  */
20
24
  swatch?: string;
21
25
  /**
22
- * Classes merged onto the category title.
26
+ * Classes merged onto the title (category, series name).
23
27
  */
24
28
  title?: string;
25
29
  /**
@@ -29,17 +33,21 @@ export interface ChartTooltipClasses {
29
33
  }
30
34
  export interface ChartTooltipContentContext {
31
35
  /**
32
- * Active category label.
36
+ * Swatch color next to the title (scatter series).
33
37
  */
34
- category: string;
38
+ color?: string;
35
39
  /**
36
- * Active category index.
40
+ * Active item index (category, point, slice, or stage).
37
41
  */
38
42
  index: number;
39
43
  /**
40
- * Visible series values at the active category.
44
+ * Rows: series values, point dimensions, or the active slice.
41
45
  */
42
46
  items: ChartTooltipItem[];
47
+ /**
48
+ * Title: the category or series name. Empty for slices.
49
+ */
50
+ title: string;
43
51
  }
44
52
  export interface ChartTooltipCustomProps {
45
53
  /**
@@ -50,8 +58,8 @@ export interface ChartTooltipCustomProps {
50
58
  root?: HTMLAttributes;
51
59
  }
52
60
  /**
53
- * Tooltip for the active category of the nearest `Chart`
54
- * (pointer hover or arrow keys on the focused plot).
61
+ * Tooltip for the active item of the nearest chart (pointer hover or arrow
62
+ * keys on the focused plot).
55
63
  */
56
64
  export interface ChartTooltipOwnProps {
57
65
  /**
@@ -66,6 +74,13 @@ export interface ChartTooltipOwnProps {
66
74
  * @default undefined
67
75
  */
68
76
  customProps?: ChartTooltipCustomProps;
77
+ /**
78
+ * Formats each percent (pie, funnel). Defaults to `Intl.NumberFormat`
79
+ * with the Bridge locale.
80
+ *
81
+ * @default undefined
82
+ */
83
+ formatPercent?: (percent: number, item: ChartTooltipItem) => string;
69
84
  /**
70
85
  * Formats each value. Defaults to `Intl.NumberFormat` with the Bridge locale.
71
86
  *
@@ -10,6 +10,8 @@ export declare function useChartTooltip(props: ChartTooltipOwnProps, tooltipRef:
10
10
  labelBind: import('vue').ComputedRef<HTMLAttributes>;
11
11
  titleBind: import('vue').ComputedRef<HTMLAttributes>;
12
12
  valueBind: import('vue').ComputedRef<HTMLAttributes>;
13
+ percentBind: import('vue').ComputedRef<HTMLAttributes>;
13
14
  formatValue: (item: ChartTooltipItem) => string;
14
- getSwatchBind: (item: ChartTooltipItem) => HTMLAttributes;
15
+ formatPercent: (item: ChartTooltipItem) => string | null;
16
+ getSwatchBind: (color: string) => HTMLAttributes;
15
17
  };
@@ -1,110 +1,124 @@
1
1
  import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
- import { useChartContext as r } from "../../Chart/chartInjectionKey.js";
2
+ import { useChartContext as r } from "../../../Utils/Charts/chartInjectionKey.js";
3
3
  import { computed as i, shallowRef as a, useAttrs as o, watch as s } from "vue";
4
4
  import { get as c, isEqual as l, isNil as u } from "es-toolkit/compat";
5
- import { formatChartValue as d, resolveChartTooltipPosition as f } from "@bridge-ui/core/Domain";
6
- import { cn as p, splitComponentProps as m } from "@bridge-ui/core/Utils";
5
+ import { formatChartPercent as d, formatChartValue as f, resolveChartTooltipPosition as p } from "@bridge-ui/core/Domain";
6
+ import { cn as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
7
7
  //#region src/Components/ChartTooltip/composables/useChartTooltip.ts
8
- var h = [
8
+ var g = [
9
9
  "classes",
10
10
  "customProps",
11
- "formatValue"
11
+ "formatValue",
12
+ "formatPercent"
12
13
  ];
13
- function g(g, _) {
14
- let v = o(), y = r(), b = a(null), x = i(() => m({
14
+ function _(_, v) {
15
+ let y = o(), b = r(), x = a(null), S = i(() => h({
15
16
  props: {
16
- ...v,
17
- ...g
17
+ ...y,
18
+ ..._
18
19
  },
19
- bridgeKeys: h
20
- })), { merged: S, entry: C } = t({
20
+ bridgeKeys: g
21
+ })), { merged: C, entry: w } = t({
21
22
  componentName: "ChartTooltip",
22
- props: () => x.value.componentProps
23
- }), w = n({
24
- entry: C,
25
- props: () => x.value.componentProps
26
- }), T = i(() => S.value.customProps), E = i(() => !u(y.value.activeIndex) && y.value.tooltipItems.length > 0);
23
+ props: () => S.value.componentProps
24
+ }), T = n({
25
+ entry: w,
26
+ props: () => S.value.componentProps
27
+ }), E = i(() => C.value.customProps), D = i(() => {
28
+ let e = b.value.tooltip;
29
+ return !u(b.value.activeIndex) && !u(e) && e.items.length > 0;
30
+ });
27
31
  s([
28
- E,
29
- _,
30
- () => y.value.activeIndex,
31
- () => y.value.tooltipItems
32
+ D,
33
+ v,
34
+ () => b.value.activeIndex,
35
+ () => b.value.tooltip
32
36
  ], () => {
33
- let e = _.value, t = y.value.activeIndex;
34
- if (!E.value || u(e) || u(t)) return;
35
- let n = y.value.getTooltipAnchor(t), r = u(n) ? null : f({
37
+ let e = v.value, t = b.value.activeIndex;
38
+ if (!D.value || u(e) || u(t)) return;
39
+ let n = b.value.getTooltipAnchor(t), r = u(n) ? null : p({
36
40
  anchor: n,
37
- bounds: y.value.getBounds(),
41
+ bounds: b.value.getBounds(),
38
42
  size: {
39
43
  width: e.offsetWidth,
40
44
  height: e.offsetHeight
41
45
  }
42
46
  });
43
- l(b.value, r) || (b.value = r);
47
+ l(x.value, r) || (x.value = r);
44
48
  }, {
45
49
  flush: "post",
46
50
  immediate: !0
47
51
  });
48
- let D = i(() => {
49
- let e = y.value.activeIndex;
50
- return u(e) ? null : {
52
+ let O = i(() => {
53
+ let e = b.value.activeIndex, t = b.value.tooltip;
54
+ return u(e) || u(t) ? null : {
51
55
  index: e,
52
- items: y.value.tooltipItems,
53
- category: y.value.categories[e] ?? ""
56
+ color: t.color,
57
+ title: t.title,
58
+ items: t.items
54
59
  };
55
60
  });
56
- function O(e) {
57
- return S.value.formatValue?.(e.value, e) ?? d(e.value, y.value.locale);
61
+ function k(e) {
62
+ return C.value.formatValue?.(e.value, e) ?? f(e.value, b.value.locale);
63
+ }
64
+ function A(e) {
65
+ return u(e.percent) ? null : C.value.formatPercent?.(e.percent, e) ?? d(e.percent, b.value.locale);
58
66
  }
59
- let k = i(() => e(T.value?.root, x.value.inheritedAttrs, {
67
+ let j = i(() => e(E.value?.root, S.value.inheritedAttrs, {
60
68
  "aria-hidden": !0,
61
69
  style: {
62
- top: `${b.value?.top ?? 0}px`,
63
- left: `${b.value?.left ?? 0}px`,
64
- visibility: u(b.value) ? "hidden" : "visible"
70
+ top: `${x.value?.top ?? 0}px`,
71
+ left: `${x.value?.left ?? 0}px`,
72
+ visibility: u(x.value) ? "hidden" : "visible"
65
73
  },
66
- class: p({
74
+ class: m({
67
75
  "pointer-events-none absolute z-20 flex min-w-32 flex-col": !0,
68
76
  "rounded-md border border-dark-200 bg-white text-dark-700 shadow-lg": !0,
69
77
  "dark:border-dark-700 dark:bg-dark-800 dark:text-dark-100": !0,
70
- [y.value.tokenClasses.tooltip ?? ""]: !0,
71
- [c(w.value, "root") ?? ""]: !0
78
+ [b.value.tokenClasses.tooltip ?? ""]: !0,
79
+ [c(T.value, "root") ?? ""]: !0
72
80
  })
73
- })), A = i(() => ({ class: p({
74
- "font-semibold": !0,
75
- [c(w.value, "title") ?? ""]: !0
76
- }) })), j = i(() => ({ class: p({
81
+ })), M = i(() => ({ class: m({
82
+ "flex items-center gap-2 font-semibold": !0,
83
+ [c(T.value, "title") ?? ""]: !0
84
+ }) })), N = i(() => ({ class: m({
77
85
  "flex items-center gap-2": !0,
78
- [c(w.value, "item") ?? ""]: !0
86
+ [c(T.value, "item") ?? ""]: !0
79
87
  }) }));
80
- function M(e) {
88
+ function P(e) {
81
89
  return {
82
- style: { backgroundColor: e.color },
83
- class: p({
90
+ style: { backgroundColor: e },
91
+ class: m({
84
92
  "shrink-0 rounded-full": !0,
85
- [y.value.tokenClasses.swatch ?? ""]: !0,
86
- [c(w.value, "swatch") ?? ""]: !0
93
+ [b.value.tokenClasses.swatch ?? ""]: !0,
94
+ [c(T.value, "swatch") ?? ""]: !0
87
95
  })
88
96
  };
89
97
  }
98
+ let F = i(() => ({ class: m({
99
+ "flex-1 text-dark-500 dark:text-dark-400": !0,
100
+ [c(T.value, "label") ?? ""]: !0
101
+ }) })), I = i(() => ({ class: m({
102
+ "text-dark-500 tabular-nums dark:text-dark-400": !0,
103
+ [c(T.value, "percent") ?? ""]: !0
104
+ }) }));
90
105
  return {
91
- isOpen: E,
92
- merged: S,
93
- context: D,
94
- itemBind: j,
95
- rootBind: k,
96
- labelBind: i(() => ({ class: p({
97
- "flex-1 text-dark-500 dark:text-dark-400": !0,
98
- [c(w.value, "label") ?? ""]: !0
99
- }) })),
100
- titleBind: A,
101
- valueBind: i(() => ({ class: p({
106
+ isOpen: D,
107
+ merged: C,
108
+ context: O,
109
+ itemBind: N,
110
+ rootBind: j,
111
+ labelBind: F,
112
+ titleBind: M,
113
+ valueBind: i(() => ({ class: m({
102
114
  "font-medium tabular-nums": !0,
103
- [c(w.value, "value") ?? ""]: !0
115
+ [c(T.value, "value") ?? ""]: !0
104
116
  }) })),
105
- formatValue: O,
106
- getSwatchBind: M
117
+ percentBind: I,
118
+ formatValue: k,
119
+ formatPercent: A,
120
+ getSwatchBind: P
107
121
  };
108
122
  }
109
123
  //#endregion
110
- export { g as useChartTooltip };
124
+ export { _ as useChartTooltip };
@@ -13,7 +13,7 @@ export declare function useResizablePanel(props: ResizablePanelOwnProps, libDefa
13
13
  [x: string]: string;
14
14
  };
15
15
  class: string;
16
- }, "class", {}, Omit<Omit<ResizablePanelProps, "classes" | "maxSize" | "collapsedSize" | "collapsible" | "defaultSize" | "minSize">, "style">>>;
16
+ }, "class", {}, Omit<Omit<ResizablePanelProps, "classes" | "minSize" | "maxSize" | "collapsedSize" | "collapsible" | "defaultSize">, "style">>>;
17
17
  collapsed: import('vue').ComputedRef<boolean>;
18
18
  elementRef: Ref<HTMLElement | null, HTMLElement | null>;
19
19
  id: string;
@@ -13,7 +13,7 @@ export declare function useSpinner(props: SpinnerOwnProps, libDefaults: SpinnerL
13
13
  "aria-valuemax"?: number | undefined;
14
14
  "aria-valuenow"?: number | undefined;
15
15
  role: string;
16
- }, "class", import('vue').HTMLAttributes | undefined, Omit<SpinnerProps, "color" | "size" | "value" | "classes" | "customProps" | "variant" | "disableShrink" | "enableTrack" | "thickness">>>;
16
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<SpinnerProps, "color" | "size" | "value" | "classes" | "customProps" | "variant" | "thickness" | "disableShrink" | "enableTrack">>>;
17
17
  trackBind: import('vue').ComputedRef<(object & {
18
18
  cx: number;
19
19
  cy: number;
@@ -0,0 +1,5 @@
1
+ import e from "./ChartFrame.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/Utils/Charts/ChartFrame.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };