@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.
- package/ai/skills/bridge-ui-components/SKILL.md +36 -35
- package/ai/skills/bridge-ui-setup/SKILL.md +1 -1
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
- package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/Components/ChartAxis/chartAxis.types.d.ts +17 -7
- package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +2 -2
- package/dist/Components/ChartAxis/composables/useChartAxis.js +15 -10
- package/dist/Components/ChartBar/ChartBar.js +5 -0
- package/dist/Components/ChartBar/ChartBar.vue.d.ts +16 -0
- package/dist/Components/ChartBar/ChartBar.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/Components/ChartBar/chartBar.types.d.ts +66 -0
- package/dist/Components/ChartBar/composables/useChartBar.d.ts +26 -0
- package/dist/Components/ChartBar/composables/useChartBar.js +13 -0
- package/dist/Components/ChartBar/index.d.ts +4 -0
- package/dist/Components/ChartBar/index.js +4 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.js +5 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue.d.ts +6 -0
- package/dist/Components/ChartBarSeries/ChartBarSeries.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/Components/ChartBarSeries/chartBarSeries.types.d.ts +67 -0
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.d.ts +5 -0
- package/dist/Components/ChartBarSeries/composables/useChartBarSeries.js +23 -0
- package/dist/Components/ChartBarSeries/index.d.ts +4 -0
- package/dist/Components/ChartBarSeries/index.js +3 -0
- package/dist/Components/ChartFunnel/ChartFunnel.js +5 -0
- package/dist/Components/ChartFunnel/ChartFunnel.vue.d.ts +16 -0
- package/dist/Components/ChartFunnel/ChartFunnel.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/Components/ChartFunnel/chartFunnel.types.d.ts +54 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.d.ts +29 -0
- package/dist/Components/ChartFunnel/composables/useChartFunnel.js +68 -0
- package/dist/Components/ChartFunnel/index.d.ts +4 -0
- package/dist/Components/ChartFunnel/index.js +4 -0
- package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +2 -0
- package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -13
- package/dist/Components/ChartLegend/chartLegend.types.d.ts +41 -5
- package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +9 -5
- package/dist/Components/ChartLegend/composables/useChartLegend.js +88 -54
- package/dist/Components/ChartLine/ChartLine.js +5 -0
- package/dist/Components/ChartLine/ChartLine.vue.d.ts +20 -0
- package/dist/Components/ChartLine/ChartLine.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/Components/ChartLine/chartLine.types.d.ts +79 -0
- package/dist/Components/ChartLine/composables/useChartLine.d.ts +26 -0
- package/dist/Components/ChartLine/composables/useChartLine.js +13 -0
- package/dist/Components/ChartLine/index.d.ts +4 -0
- package/dist/Components/ChartLine/index.js +4 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.js +5 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue.d.ts +10 -0
- package/dist/Components/ChartLineSeries/ChartLineSeries.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/Components/ChartLineSeries/chartLineSeries.types.d.ts +96 -0
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.d.ts +5 -0
- package/dist/Components/ChartLineSeries/composables/useChartLineSeries.js +28 -0
- package/dist/Components/ChartLineSeries/index.d.ts +4 -0
- package/dist/Components/ChartLineSeries/index.js +3 -0
- package/dist/Components/ChartPie/ChartPie.js +5 -0
- package/dist/Components/ChartPie/ChartPie.vue.d.ts +15 -0
- package/dist/Components/ChartPie/ChartPie.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/Components/ChartPie/chartPie.types.d.ts +92 -0
- package/dist/Components/ChartPie/composables/useChartPie.d.ts +30 -0
- package/dist/Components/ChartPie/composables/useChartPie.js +81 -0
- package/dist/Components/ChartPie/index.d.ts +4 -0
- package/dist/Components/ChartPie/index.js +4 -0
- package/dist/Components/ChartScatter/ChartScatter.js +5 -0
- package/dist/Components/{Chart/Chart.vue.d.ts → ChartScatter/ChartScatter.vue.d.ts} +3 -2
- package/dist/Components/ChartScatter/ChartScatter.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/ChartScatter/chartScatter.types.d.ts +23 -0
- package/dist/Components/ChartScatter/composables/useChartScatter.d.ts +29 -0
- package/dist/Components/ChartScatter/composables/useChartScatter.js +108 -0
- package/dist/Components/ChartScatter/index.d.ts +4 -0
- package/dist/Components/ChartScatter/index.js +4 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.js +5 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue.d.ts +4 -0
- package/dist/Components/ChartScatterSeries/ChartScatterSeries.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/Components/ChartScatterSeries/chartScatterSeries.types.d.ts +45 -0
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.d.ts +4 -0
- package/dist/Components/ChartScatterSeries/composables/useChartScatterSeries.js +19 -0
- package/dist/Components/ChartScatterSeries/index.d.ts +4 -0
- package/dist/Components/ChartScatterSeries/index.js +3 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +22 -10
- package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +28 -9
- package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +4 -1
- package/dist/Components/ChartTooltip/composables/useChartTooltip.js +81 -63
- package/dist/Components/Heading/Heading.js +5 -0
- package/dist/Components/Heading/Heading.vue.d.ts +11 -0
- package/dist/Components/Heading/Heading.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/Components/Heading/composables/useHeading.d.ts +10 -0
- package/dist/Components/Heading/composables/useHeading.js +56 -0
- package/dist/Components/Heading/heading.types.d.ts +56 -0
- package/dist/Components/Heading/index.d.ts +3 -0
- package/dist/Components/Heading/index.js +3 -0
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +1 -1
- package/dist/Components/Spinner/composables/useSpinner.d.ts +1 -1
- package/dist/Components/Text/Text.js +5 -0
- package/dist/Components/Text/Text.vue.d.ts +11 -0
- package/dist/Components/Text/Text.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Text/composables/useText.d.ts +9 -0
- package/dist/Components/Text/composables/useText.js +56 -0
- package/dist/Components/Text/index.d.ts +3 -0
- package/dist/Components/Text/index.js +3 -0
- package/dist/Components/Text/text.types.d.ts +76 -0
- package/dist/Utils/Charts/ChartFrame.js +5 -0
- package/dist/Utils/Charts/ChartFrame.vue.d.ts +24 -0
- package/dist/Utils/Charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/{Components/Chart → Utils/Charts}/chart.types.d.ts +33 -18
- package/dist/Utils/Charts/chartInjectionKey.d.ts +151 -0
- package/dist/{Components/Chart → Utils/Charts}/chartInjectionKey.js +2 -2
- package/dist/Utils/Charts/echarts/bar.d.ts +6 -0
- package/dist/Utils/Charts/echarts/bar.js +23 -0
- package/dist/Utils/Charts/echarts/cartesian.d.ts +15 -0
- package/dist/Utils/Charts/echarts/cartesian.js +290 -0
- package/dist/Utils/Charts/echarts/funnel.d.ts +15 -0
- package/dist/Utils/Charts/echarts/funnel.js +79 -0
- package/dist/Utils/Charts/echarts/line.d.ts +5 -0
- package/dist/Utils/Charts/echarts/line.js +20 -0
- package/dist/Utils/Charts/echarts/part.d.ts +19 -0
- package/dist/Utils/Charts/echarts/part.js +45 -0
- package/dist/Utils/Charts/echarts/pie.d.ts +14 -0
- package/dist/Utils/Charts/echarts/pie.js +76 -0
- package/dist/Utils/Charts/echarts/plot.d.ts +44 -0
- package/dist/Utils/Charts/echarts/plot.js +52 -0
- package/dist/Utils/Charts/echarts/scatter.d.ts +14 -0
- package/dist/Utils/Charts/echarts/scatter.js +161 -0
- package/dist/Utils/Charts/index.d.ts +6 -0
- package/dist/Utils/Charts/index.js +6 -0
- package/dist/Utils/Charts/useChartCartesian.d.ts +59 -0
- package/dist/Utils/Charts/useChartCartesian.js +169 -0
- package/dist/Utils/Charts/useChartPart.d.ts +45 -0
- package/dist/Utils/Charts/useChartPart.js +97 -0
- package/dist/Utils/Charts/useChartRegistry.d.ts +13 -0
- package/dist/Utils/Charts/useChartRegistry.js +40 -0
- package/dist/Utils/Charts/useChartRoot.d.ts +156 -0
- package/dist/Utils/Charts/useChartRoot.js +342 -0
- package/dist/Utils/Charts/useChartSeries.d.ts +10 -0
- package/dist/Utils/Charts/useChartSeries.js +22 -0
- package/dist/augments.d.ts +33 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +90 -86
- package/docs/README.md +8 -1
- package/docs/components/BridgeUIProvider.md +1 -1
- package/docs/components/Card.md +15 -0
- package/docs/components/Chart.md +118 -151
- package/docs/components/ChartBar.md +190 -0
- package/docs/components/ChartFunnel.md +62 -0
- package/docs/components/ChartLine.md +192 -0
- package/docs/components/ChartPie.md +138 -0
- package/docs/components/ChartScatter.md +102 -0
- package/docs/components/Heading.md +85 -0
- package/docs/components/Text.md +118 -0
- package/package.json +2 -2
- package/dist/Components/Chart/Chart.js +0 -5
- package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +0 -52
- package/dist/Components/Chart/chartInjectionKey.d.ts +0 -94
- package/dist/Components/Chart/composables/useChart.d.ts +0 -40
- package/dist/Components/Chart/composables/useChart.js +0 -346
- package/dist/Components/Chart/echartsChart.d.ts +0 -14
- package/dist/Components/Chart/echartsChart.js +0 -199
- package/dist/Components/Chart/index.d.ts +0 -4
- package/dist/Components/Chart/index.js +0 -4
- package/dist/Components/ChartSeries/ChartSeries.js +0 -5
- package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +0 -4
- package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +0 -24
- package/dist/Components/ChartSeries/chartSeries.types.d.ts +0 -37
- package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +0 -10
- package/dist/Components/ChartSeries/composables/useChartSeries.js +0 -29
- package/dist/Components/ChartSeries/index.d.ts +0 -3
- package/dist/Components/ChartSeries/index.js +0 -3
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# ChartLine
|
|
2
|
+
|
|
3
|
+
Line and area charts: trends, stacked areas, steps, reference lines, time axes, and sparklines. Compose with `ChartLineSeries`, `ChartAxis`, `ChartLegend`, and `ChartTooltip`. Shared parts, colors, and a11y are in [Chart](./Chart.md).
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { ChartLine } from "@bridge-ui/vue/Components/ChartLine";
|
|
9
|
+
import { ChartLineSeries } from "@bridge-ui/vue/Components/ChartLineSeries";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Examples
|
|
13
|
+
|
|
14
|
+
### Usage
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"];
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<ChartLine :categories="months">
|
|
23
|
+
<ChartLineSeries name="Revenue" :data="[120, 180, 150, 220, 260, 240]" />
|
|
24
|
+
<ChartLegend />
|
|
25
|
+
<ChartTooltip />
|
|
26
|
+
</ChartLine>
|
|
27
|
+
</template>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Area
|
|
31
|
+
|
|
32
|
+
`area` fills under the line. Set it on the root for every series, or per series.
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<ChartLine area curve="smooth" :categories="months">
|
|
36
|
+
<ChartLineSeries name="Visitors" :data="visitors" />
|
|
37
|
+
</ChartLine>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Stacked area
|
|
41
|
+
|
|
42
|
+
Series with the same `stack` key stack on top of each other.
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<ChartLine area stack="total" :area-opacity="0.6" :categories="months">
|
|
46
|
+
<ChartLineSeries color="info" name="Organic" :data="organic" />
|
|
47
|
+
<ChartLineSeries name="Paid" :data="paid" color="warning" />
|
|
48
|
+
<ChartLegend />
|
|
49
|
+
</ChartLine>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`area-opacity` sets the fill opacity (`0.15` by default). Stacked bands read better with a stronger fill. Set it on the root for every series, or per series.
|
|
53
|
+
|
|
54
|
+
### Color by value
|
|
55
|
+
|
|
56
|
+
`color-ranges` recolors the line (and its area) piece by piece. A value in `[min, max)` takes the range color; values outside every range keep the series color. Range labels show in the tooltip, the data table, and the keyboard announcements.
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<ChartLine :categories="days">
|
|
60
|
+
<ChartLineSeries
|
|
61
|
+
name="AQI"
|
|
62
|
+
:data="aqi"
|
|
63
|
+
:reference="[{ value: 50 }, { value: 100 }]"
|
|
64
|
+
:color-ranges="[
|
|
65
|
+
{ max: 50, color: 'success', label: 'Good' },
|
|
66
|
+
{ min: 50, max: 100, color: 'warning', label: 'Moderate' },
|
|
67
|
+
{ min: 100, color: 'error', label: 'Unhealthy' },
|
|
68
|
+
]"
|
|
69
|
+
/>
|
|
70
|
+
<ChartTooltip />
|
|
71
|
+
</ChartLine>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Highlight categories
|
|
75
|
+
|
|
76
|
+
With `color-by="category"`, `min` and `max` are category indices (zero-based, both included): the line changes color over that stretch of the axis. On a time axis the indices still point at the categories.
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<ChartLine area curve="smooth" :categories="months">
|
|
80
|
+
<ChartLineSeries
|
|
81
|
+
name="Visitors"
|
|
82
|
+
:data="visitors"
|
|
83
|
+
color-by="category"
|
|
84
|
+
:color-ranges="[{ min: 2, max: 4, color: 'warning', label: 'Campaign' }]"
|
|
85
|
+
/>
|
|
86
|
+
</ChartLine>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step, dashed, and points
|
|
90
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<ChartLine :categories="days">
|
|
93
|
+
<ChartLineSeries step="end" name="Plan" :data="plan" />
|
|
94
|
+
<ChartLineSeries dashed show-points name="Forecast" :data="forecast" />
|
|
95
|
+
</ChartLine>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Reference lines
|
|
99
|
+
|
|
100
|
+
`reference` draws a dashed line for a statistic of the series (`average`, `min`, `max`) or a fixed `value`.
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<ChartLine :categories="months">
|
|
104
|
+
<ChartLineSeries
|
|
105
|
+
name="Spending"
|
|
106
|
+
:data="spending"
|
|
107
|
+
:reference="[{ type: 'average' }, { value: 3000, label: 'Budget' }]"
|
|
108
|
+
/>
|
|
109
|
+
</ChartLine>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Time axis
|
|
113
|
+
|
|
114
|
+
Pass dates as `categories` to get a time axis: points are spaced by elapsed time, and tick labels (days, months, years) follow the span and the Bridge locale. `format-date` formats the dates in the tooltip, data table, and summary.
|
|
115
|
+
|
|
116
|
+
```vue
|
|
117
|
+
<script setup lang="ts">
|
|
118
|
+
const days = [new Date(2026, 9, 1), new Date(2026, 9, 2), new Date(2026, 9, 6)];
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<ChartLine :categories="days" :format-date="(date) => format(date, 'dd/MM')">
|
|
123
|
+
<ChartLineSeries area name="Spent" :data="[120, 260, 410]" />
|
|
124
|
+
<ChartAxis position="x" :format-tick="(time) => format(time, 'dd')" />
|
|
125
|
+
</ChartLine>
|
|
126
|
+
</template>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Sparkline
|
|
130
|
+
|
|
131
|
+
`sparkline` drops axes, grid, and padding, and defaults the height to `48`. The summary and data table stay.
|
|
132
|
+
|
|
133
|
+
```vue
|
|
134
|
+
<ChartLine sparkline :categories="weeks">
|
|
135
|
+
<ChartLineSeries area name="Balance" :data="balance" />
|
|
136
|
+
</ChartLine>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Value labels
|
|
140
|
+
|
|
141
|
+
```vue
|
|
142
|
+
<ChartLine labels :categories="months" :format-label="(value) => `${value}k`">
|
|
143
|
+
<ChartLineSeries name="Revenue" :data="revenue" />
|
|
144
|
+
</ChartLine>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Gaps
|
|
148
|
+
|
|
149
|
+
`null` values leave a gap and are skipped in the tooltip.
|
|
150
|
+
|
|
151
|
+
```vue
|
|
152
|
+
<ChartLineSeries name="Costs" :data="[80, 90, null, 140, 150, 170]" />
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Props (`ChartLine`)
|
|
156
|
+
|
|
157
|
+
Shared root props (`height`, `palette`, `loading`, `summary`, …) are listed in [Chart](./Chart.md#props-every-root).
|
|
158
|
+
|
|
159
|
+
| Prop | Type | Default | Description |
|
|
160
|
+
| -------------- | --------------------------------------- | ---------- | ----------------------------------------------- |
|
|
161
|
+
| `categories` | `string[] \| Date[]` | required | Category labels, or dates for a time axis. |
|
|
162
|
+
| `area` | `boolean` | `false` | Fill under every series. |
|
|
163
|
+
| `area-opacity` | `number` | `0.15` | Area fill opacity (`0`–`1`) for every series. |
|
|
164
|
+
| `curve` | `"linear" \| "smooth"` | `"linear"` | Interpolation for every series. |
|
|
165
|
+
| `step` | `false \| "start" \| "middle" \| "end"` | `false` | Step line for every series. |
|
|
166
|
+
| `stack` | `string` | — | Stack every series under this key. |
|
|
167
|
+
| `labels` | `boolean` | `false` | Value labels on every series. |
|
|
168
|
+
| `show-points` | `boolean` | `false` | Always draw point symbols. |
|
|
169
|
+
| `sparkline` | `boolean` | `false` | No axes, grid, or padding; 48px default height. |
|
|
170
|
+
| `format-date` | `(date: Date) => string` | — | Date labels in the tooltip, table, and summary. |
|
|
171
|
+
| `format-label` | `(value: number) => string` | — | Value labels and reference line labels. |
|
|
172
|
+
|
|
173
|
+
## Props (`ChartLineSeries`)
|
|
174
|
+
|
|
175
|
+
Unset options fall back to the `ChartLine` props.
|
|
176
|
+
|
|
177
|
+
| Prop | Type | Default | Description |
|
|
178
|
+
| -------------- | --------------------------------------- | --------- | ------------------------------------------------------------------------------------------- |
|
|
179
|
+
| `name` | `string` | required | Legend, tooltip, and table name. |
|
|
180
|
+
| `data` | `(number \| null)[]` | required | One value per category; `null` leaves a gap. |
|
|
181
|
+
| `color` | `ChartColorValue` | palette | Token key or CSS color. |
|
|
182
|
+
| `area` | `boolean` | root | Fill under the line. |
|
|
183
|
+
| `area-opacity` | `number` | root | Area fill opacity (`0`–`1`). |
|
|
184
|
+
| `curve` | `"linear" \| "smooth"` | root | Interpolation. |
|
|
185
|
+
| `step` | `false \| "start" \| "middle" \| "end"` | root | Step line. |
|
|
186
|
+
| `stack` | `string` | root | Stack key. |
|
|
187
|
+
| `dashed` | `boolean` | `false` | Dashed stroke. |
|
|
188
|
+
| `labels` | `boolean` | root | Value labels. |
|
|
189
|
+
| `show-points` | `boolean` | root | Point symbols. |
|
|
190
|
+
| `reference` | `ChartReference \| ChartReference[]` | — | `{ type: "average" \| "min" \| "max" }` or `{ value }`, each with an optional `label`. |
|
|
191
|
+
| `color-ranges` | `ChartColorRangeOption[]` | — | `{ min?, max?, color, label? }`: the line takes `color` where the value is in `[min, max)`. |
|
|
192
|
+
| `color-by` | `"value" \| "category"` | `"value"` | `category` matches `color-ranges` against category indices (both ends included). |
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# ChartPie
|
|
2
|
+
|
|
3
|
+
Pie and donut charts: the share of each part in a whole. Slices come from `data`; compose with `ChartLegend` and `ChartTooltip`. Shared parts, colors, and a11y are in [Chart](./Chart.md).
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { ChartPie } from "@bridge-ui/vue/Components/ChartPie";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
const tags = [
|
|
18
|
+
{ label: "Housing", value: 3450 },
|
|
19
|
+
{ label: "Kids", value: 1310 },
|
|
20
|
+
{ label: "Groceries", value: 1240 },
|
|
21
|
+
];
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<ChartPie :data="tags">
|
|
26
|
+
<ChartLegend />
|
|
27
|
+
<ChartTooltip />
|
|
28
|
+
</ChartPie>
|
|
29
|
+
</template>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Non-positive values are skipped. Shares are whole percents that always sum to 100.
|
|
33
|
+
|
|
34
|
+
### Donut with center content
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<ChartPie :data="tags" variant="donut">
|
|
38
|
+
<template #center>
|
|
39
|
+
<strong>R$ 6,9 mil</strong>
|
|
40
|
+
<span>in outflows</span>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<ChartLegend show-percent position="right" />
|
|
44
|
+
</ChartPie>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`thickness` sets the ring width as a fraction of the radius (default `0.3`).
|
|
48
|
+
|
|
49
|
+
### Labels: plot, legend, or both
|
|
50
|
+
|
|
51
|
+
`labels` turns slice labels on the plot on, and `label-position` places them (`"outside"` by default, or `"inside"`). The legend comes from `ChartLegend`.
|
|
52
|
+
|
|
53
|
+
Plot only:
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<ChartPie labels :data="tags" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Legend only:
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<ChartPie :data="tags">
|
|
63
|
+
<ChartLegend show-percent />
|
|
64
|
+
</ChartPie>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Both:
|
|
68
|
+
|
|
69
|
+
```vue
|
|
70
|
+
<ChartPie labels :data="tags" label-position="inside" label-content="percent">
|
|
71
|
+
<ChartLegend />
|
|
72
|
+
</ChartPie>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`label-content` is `"label"`, `"value"`, `"percent"`, or a function that receives `{ label, value, percent }`.
|
|
76
|
+
|
|
77
|
+
### Slice colors
|
|
78
|
+
|
|
79
|
+
```vue
|
|
80
|
+
<ChartPie
|
|
81
|
+
:data="[
|
|
82
|
+
{ label: 'Paid', value: 32, color: 'success' },
|
|
83
|
+
{ label: 'Late', value: 4, color: 'error' },
|
|
84
|
+
]"
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Gaps and rounded corners
|
|
89
|
+
|
|
90
|
+
`pad-angle` sets the gap between slices (deg) and `corner-radius` rounds the slice corners (px). A pie is solid by default; a donut gets `:pad-angle="1"` and `:corner-radius="2"`.
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<ChartPie :data="tags" :pad-angle="3" variant="donut" :corner-radius="8" />
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Nightingale (rose)
|
|
97
|
+
|
|
98
|
+
`rose` draws each slice with a radius that shows its value. With `"radius"` the angle still shows the share; with `"area"` every slice gets the same angle and only the radius changes.
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<ChartPie :data="tags" rose="radius">
|
|
102
|
+
<ChartLegend show-percent />
|
|
103
|
+
</ChartPie>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`rose` works with `variant="donut"`. The tooltip, legend, and data table still show each slice's share of the total.
|
|
107
|
+
|
|
108
|
+
### Group small slices
|
|
109
|
+
|
|
110
|
+
`max-slices` keeps the largest slices and groups the rest into "Other".
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<ChartPie :data="tags" :max-slices="5" />
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Hiding slices
|
|
117
|
+
|
|
118
|
+
Legend entries hide and show slices; shares are recomputed for the visible slices. The data table keeps the shares of all data.
|
|
119
|
+
|
|
120
|
+
## Props (`ChartPie`)
|
|
121
|
+
|
|
122
|
+
Shared root props (`height`, `palette`, `loading`, `summary`, …) are listed in [Chart](./Chart.md#props-every-root).
|
|
123
|
+
|
|
124
|
+
| Prop | Type | Default | Description |
|
|
125
|
+
| ---------------- | ------------------------------------------------------ | --------------------- | ---------------------------------------------- |
|
|
126
|
+
| `data` | `{ label, value, color? }[]` | required | Slices in order. |
|
|
127
|
+
| `variant` | `"pie" \| "donut"` | `"pie"` | `donut` leaves a hole for the `center` slot. |
|
|
128
|
+
| `thickness` | `number` | `0.3` | Donut ring thickness (fraction of the radius). |
|
|
129
|
+
| `labels` | `boolean` | `false` | Slice labels on the plot. |
|
|
130
|
+
| `label-position` | `"inside" \| "outside"` | `"outside"` | Where plot labels sit. |
|
|
131
|
+
| `label-content` | `"label" \| "value" \| "percent" \| (slice) => string` | `"label"` | What plot labels show. |
|
|
132
|
+
| `min-angle` | `number` | `2` | Minimum slice angle (deg). |
|
|
133
|
+
| `pad-angle` | `number` | `0` (`1` for `donut`) | Gap between slices (deg). |
|
|
134
|
+
| `corner-radius` | `number` | `0` (`2` for `donut`) | Slice corner radius (px). |
|
|
135
|
+
| `rose` | `"radius" \| "area"` | — | Nightingale pie: slice radius shows the value. |
|
|
136
|
+
| `max-slices` | `number` | — | Group the rest into "Other". |
|
|
137
|
+
|
|
138
|
+
Slots: `center` (inside the donut hole), `empty`, `loading`, `default`.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ChartScatter
|
|
2
|
+
|
|
3
|
+
Scatter and bubble charts: the relation between two numbers, with an optional third value as bubble size. Both axes are numeric. Compose with `ChartScatterSeries`, `ChartAxis`, `ChartLegend`, and `ChartTooltip`. Shared parts, colors, and a11y are in [Chart](./Chart.md).
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { ChartScatter } from "@bridge-ui/vue/Components/ChartScatter";
|
|
9
|
+
import { ChartScatterSeries } from "@bridge-ui/vue/Components/ChartScatterSeries";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Examples
|
|
13
|
+
|
|
14
|
+
### Usage
|
|
15
|
+
|
|
16
|
+
```vue
|
|
17
|
+
<ChartScatter>
|
|
18
|
+
<ChartScatterSeries
|
|
19
|
+
name="Customers"
|
|
20
|
+
:data="[
|
|
21
|
+
[24, 340],
|
|
22
|
+
[31, 520],
|
|
23
|
+
[45, 410],
|
|
24
|
+
]"
|
|
25
|
+
/>
|
|
26
|
+
<ChartAxis label="Age" position="x" />
|
|
27
|
+
<ChartAxis position="y" label="Ticket" />
|
|
28
|
+
<ChartTooltip />
|
|
29
|
+
</ChartScatter>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The tooltip shows the series name and each value, labelled with the axis titles.
|
|
33
|
+
|
|
34
|
+
### Bubbles
|
|
35
|
+
|
|
36
|
+
A third value per point sets the bubble size. `bubble-size` maps the smallest and largest values (across all series) to a diameter range, scaled by area: a value twice as big covers twice the area.
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<ChartScatter :bubble-size="[8, 48]">
|
|
40
|
+
<ChartScatterSeries
|
|
41
|
+
name="Countries"
|
|
42
|
+
size-name="Population"
|
|
43
|
+
:data="[
|
|
44
|
+
[12000, 76, 210],
|
|
45
|
+
[45000, 82, 38],
|
|
46
|
+
]"
|
|
47
|
+
/>
|
|
48
|
+
</ChartScatter>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`size-name` labels the third value in the tooltip and data table.
|
|
52
|
+
|
|
53
|
+
### Several groups
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<ChartScatter :symbol-size="6">
|
|
57
|
+
<ChartScatterSeries name="Customers" :data="customers" />
|
|
58
|
+
<ChartScatterSeries name="Leads" :data="leads" />
|
|
59
|
+
<ChartLegend />
|
|
60
|
+
</ChartScatter>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Color by range
|
|
64
|
+
|
|
65
|
+
`color-ranges` recolors single points by their `y`. A `y` in `[min, max)` takes the range color; other points keep the series color. Range labels show in the tooltip and the data table.
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<ChartScatter>
|
|
69
|
+
<ChartScatterSeries
|
|
70
|
+
name="Runs"
|
|
71
|
+
:data="runs"
|
|
72
|
+
:color-ranges="[
|
|
73
|
+
{ max: 5, color: 'success', label: 'Fast' },
|
|
74
|
+
{ min: 5, color: 'warning', label: 'Slow' },
|
|
75
|
+
]"
|
|
76
|
+
/>
|
|
77
|
+
</ChartScatter>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Keyboard
|
|
81
|
+
|
|
82
|
+
Arrow keys move through the points ordered by `x`, then `y`. Each point is announced with its series and values.
|
|
83
|
+
|
|
84
|
+
## Props (`ChartScatter`)
|
|
85
|
+
|
|
86
|
+
Shared root props (`height`, `palette`, `loading`, `summary`, …) are listed in [Chart](./Chart.md#props-every-root).
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Description |
|
|
89
|
+
| ------------- | ------------------ | --------- | -------------------------------------------------- |
|
|
90
|
+
| `symbol-size` | `number` | `8` | Point diameter (px) for `[x, y]` points. |
|
|
91
|
+
| `bubble-size` | `[number, number]` | `[8, 40]` | Min / max bubble diameter (px) for `[x, y, size]`. |
|
|
92
|
+
|
|
93
|
+
## Props (`ChartScatterSeries`)
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Default | Description |
|
|
96
|
+
| -------------- | -------------------------------------------------- | -------- | ------------------------------------------------------------------------------ |
|
|
97
|
+
| `name` | `string` | required | Legend, tooltip, and table name. |
|
|
98
|
+
| `data` | `[number, number][] \| [number, number, number][]` | required | Points; the third value makes a bubble. |
|
|
99
|
+
| `color` | `ChartColorValue` | palette | Token key or CSS color. |
|
|
100
|
+
| `size-name` | `string` | `"Size"` | Label for the third value. |
|
|
101
|
+
| `symbol-size` | `number` | root | Point size override (ignored for bubbles). |
|
|
102
|
+
| `color-ranges` | `ChartColorRangeOption[]` | — | `{ min?, max?, color, label? }`: points with `y` in `[min, max)` take `color`. |
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Heading
|
|
2
|
+
|
|
3
|
+
Section and page titles. `level` sets the element (`h1`–`h6`) and the default font size; `size` changes only the look.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Heading } from "@bridge-ui/vue/Components/Heading";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Heading :level="1">Workspaces</Heading>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Levels
|
|
20
|
+
|
|
21
|
+
Without `size`, each level has its own font size.
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<Heading :level="1">Level 1</Heading>
|
|
25
|
+
<Heading :level="2">Level 2</Heading>
|
|
26
|
+
<Heading :level="3">Level 3</Heading>
|
|
27
|
+
<Heading :level="4">Level 4</Heading>
|
|
28
|
+
<Heading :level="5">Level 5</Heading>
|
|
29
|
+
<Heading :level="6">Level 6</Heading>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Size
|
|
33
|
+
|
|
34
|
+
Keep the right level for the page outline and set the look with `size`.
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<Heading size="lg" :level="2">
|
|
38
|
+
Recent transactions
|
|
39
|
+
</Heading>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Tone, color, and weight
|
|
43
|
+
|
|
44
|
+
`Heading` shares `variant`, `color`, and `weight` with `Text`. `global.defaultColor` does not apply; the default stays `dark`.
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<Heading :level="3" variant="muted">
|
|
48
|
+
Archived
|
|
49
|
+
</Heading>
|
|
50
|
+
<Heading :level="3" weight="bold" color="primary">
|
|
51
|
+
Highlights
|
|
52
|
+
</Heading>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Provider tokens
|
|
56
|
+
|
|
57
|
+
`tokens.level` sets the font size per level.
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<BridgeUIProvider
|
|
61
|
+
:components="{
|
|
62
|
+
Heading: {
|
|
63
|
+
defaultProps: { weight: 'bold' },
|
|
64
|
+
tokens: { level: { '1': 'text-4xl', '2': 'text-3xl' } },
|
|
65
|
+
},
|
|
66
|
+
}"
|
|
67
|
+
>
|
|
68
|
+
<App />
|
|
69
|
+
</BridgeUIProvider>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Props
|
|
73
|
+
|
|
74
|
+
| Prop | Type | Default | Description |
|
|
75
|
+
| --------- | ---------------------------- | ------------ | ------------------------------------------------------------------------------------------- |
|
|
76
|
+
| `classes` | `HeadingClasses` | — | The classes to apply to the heading. |
|
|
77
|
+
| `color` | `TextColor` | `"dark"` | The color of the heading. Ignores `global.defaultColor`. |
|
|
78
|
+
| `level` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `2` | The heading level. Sets the element (`h1`–`h6`) and, when `size` is not set, the font size. |
|
|
79
|
+
| `size` | `TextSize` | — | The font size of the heading. When unset, it follows `level`. |
|
|
80
|
+
| `variant` | `TextVariant` | `"default"` | The tone of the heading: `default` for main text, `muted` for secondary text. |
|
|
81
|
+
| `weight` | `TextWeight` | `"semibold"` | The font weight of the heading. |
|
|
82
|
+
|
|
83
|
+
## Related components
|
|
84
|
+
|
|
85
|
+
Text, Card, EmptyState
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
Body text with a semantic tone (`default` or `muted`), a color, a size, and a weight. Colors cover light and dark themes, so pages do not repeat `text-dark-* dark:text-dark-*` pairs.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Text } from "@bridge-ui/vue/Components/Text";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Text>Monthly summary for your workspace.</Text>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Muted
|
|
20
|
+
|
|
21
|
+
Use `variant="muted"` for subtitles, captions, and metadata.
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<Text size="xs" variant="muted">
|
|
25
|
+
Compared to last month
|
|
26
|
+
</Text>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Values
|
|
30
|
+
|
|
31
|
+
`numeric` aligns digits (tabular figures) for money and counts.
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<Text numeric size="2xl" weight="semibold">
|
|
35
|
+
$9,300.00
|
|
36
|
+
</Text>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Color
|
|
40
|
+
|
|
41
|
+
`color` works with both variants. `global.defaultColor` does not apply to `Text`; the default stays `dark`.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<Text numeric color="success" weight="semibold">
|
|
45
|
+
+$1,250.00
|
|
46
|
+
</Text>
|
|
47
|
+
<Text numeric color="error" weight="semibold">
|
|
48
|
+
−$480.00
|
|
49
|
+
</Text>
|
|
50
|
+
<Text size="sm" color="error" variant="muted">
|
|
51
|
+
Payment overdue
|
|
52
|
+
</Text>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Label
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<Text uppercase size="xs" variant="muted" weight="medium">
|
|
59
|
+
Balance
|
|
60
|
+
</Text>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Element
|
|
64
|
+
|
|
65
|
+
`Text` renders a `p` by default. Use `as` for inline or list content.
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<Text as="span" size="sm" variant="muted">
|
|
69
|
+
Updated 5 minutes ago
|
|
70
|
+
</Text>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Truncate
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<Text truncate class="max-w-48">
|
|
77
|
+
A very long account name that does not fit
|
|
78
|
+
</Text>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Provider defaults and tokens
|
|
82
|
+
|
|
83
|
+
Change the muted tone for the whole app in one place with `tokens`, or set defaults with `defaultProps`.
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<BridgeUIProvider
|
|
87
|
+
:components="{
|
|
88
|
+
Text: {
|
|
89
|
+
defaultProps: { size: 'sm' },
|
|
90
|
+
tokens: {
|
|
91
|
+
variant: {
|
|
92
|
+
muted: { dark: 'text-dark-600 dark:text-dark-300' },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}"
|
|
97
|
+
>
|
|
98
|
+
<App />
|
|
99
|
+
</BridgeUIProvider>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Props
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Default | Description |
|
|
105
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- |
|
|
106
|
+
| `as` | `"p" \| "dd" \| "dt" \| "em" \| "li" \| "div" \| "span" \| "label" \| "small" \| "strong" \| "figcaption"` | `"p"` | The element rendered as the root. |
|
|
107
|
+
| `classes` | `TextClasses` | — | The classes to apply to the text. |
|
|
108
|
+
| `color` | `TextColor` | `"dark"` | The color of the text. Ignores `global.defaultColor`. |
|
|
109
|
+
| `numeric` | `boolean` | `false` | Whether digits use tabular figures and tight tracking (money, counts). |
|
|
110
|
+
| `size` | `TextSize` | `"md"` | The size of the text (`2xs` to `4xl`). |
|
|
111
|
+
| `truncate` | `boolean` | `false` | Whether the text is cut to one line with an ellipsis. |
|
|
112
|
+
| `uppercase` | `boolean` | `false` | Whether the text is uppercase with wide tracking (small labels). |
|
|
113
|
+
| `variant` | `TextVariant` | `"default"` | The tone of the text: `default` for main text, `muted` for secondary text. |
|
|
114
|
+
| `weight` | `TextWeight` | `"normal"` | The font weight of the text (`normal`, `medium`, `semibold`, `bold`). |
|
|
115
|
+
|
|
116
|
+
## Related components
|
|
117
|
+
|
|
118
|
+
Heading, Card, Label
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.19.0",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@bridge-ui/core": "^0.
|
|
112
|
+
"@bridge-ui/core": "^0.19.0",
|
|
113
113
|
"@tailwindcss/typography": "^0.5.20",
|
|
114
114
|
"clsx": "^2.1.1",
|
|
115
115
|
"es-toolkit": "^1.52.0",
|