reburn-ui 0.3.10 → 0.3.12
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type { DivElement } from '../../element-types.js';
|
|
2
|
+
import type { DivElement, SvgElement } from '../../element-types.js';
|
|
3
3
|
import { getThemeColor } from '../../MantineProvider/index.js';
|
|
4
4
|
import type { MantineColor } from '../../MantineProvider/theme.types.js';
|
|
5
5
|
import { rem } from '../../utils/index.js';
|
|
@@ -104,6 +104,9 @@
|
|
|
104
104
|
|
|
105
105
|
/** Color of the text displayed inside the chart, `dimmed` by default */
|
|
106
106
|
textColor?: MantineColor;
|
|
107
|
+
|
|
108
|
+
/** SVG props */
|
|
109
|
+
svgProps?: SvgElement;
|
|
107
110
|
}
|
|
108
111
|
</script>
|
|
109
112
|
|
|
@@ -129,6 +132,7 @@
|
|
|
129
132
|
textColor,
|
|
130
133
|
children,
|
|
131
134
|
tooltipProps,
|
|
135
|
+
svgProps,
|
|
132
136
|
...props
|
|
133
137
|
}: ChartRootProps<T> = $props();
|
|
134
138
|
|
|
@@ -157,7 +161,7 @@
|
|
|
157
161
|
style:--chart-text-color={textColor ? getThemeColor(textColor) : undefined}
|
|
158
162
|
>
|
|
159
163
|
<div class="chart-container" bind:clientWidth={context.chartWidth} bind:clientHeight={context.chartHeight}>
|
|
160
|
-
<svg class=
|
|
164
|
+
<svg {...svgProps} class={['chart', svgProps?.class]} viewBox="0 0 {context.chartWidth} {context.chartHeight}" bind:this={context.chartRef}>
|
|
161
165
|
{@render children(context)}
|
|
162
166
|
|
|
163
167
|
{#if xGrid}
|
|
@@ -187,7 +191,7 @@
|
|
|
187
191
|
user-select: none;
|
|
188
192
|
display: grid;
|
|
189
193
|
grid-template-columns: max-content 1fr;
|
|
190
|
-
grid-template-rows: 1fr
|
|
194
|
+
grid-template-rows: 1fr max-content;
|
|
191
195
|
grid-template-areas: "y-axis chart" "empty x-axis";
|
|
192
196
|
position: relative;
|
|
193
197
|
gap: 0.5rem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DivElement } from '../../element-types.js';
|
|
1
|
+
import type { DivElement, SvgElement } from '../../element-types.js';
|
|
2
2
|
import type { MantineColor } from '../../MantineProvider/theme.types.js';
|
|
3
3
|
import { type ChartTooltipProps } from '../ChartTooltip/ChartTooltip.svelte';
|
|
4
4
|
import { scaleLinear } from '../d3/scale/scaleLinear.js';
|
|
@@ -59,6 +59,8 @@ export interface ChartRootProps<T extends Record<string, unknown>> extends Omit<
|
|
|
59
59
|
yGrid?: boolean | 'top' | 'bottom' | 'top-bottom';
|
|
60
60
|
/** Color of the text displayed inside the chart, `dimmed` by default */
|
|
61
61
|
textColor?: MantineColor;
|
|
62
|
+
/** SVG props */
|
|
63
|
+
svgProps?: SvgElement;
|
|
62
64
|
}
|
|
63
65
|
import { type Snippet } from 'svelte';
|
|
64
66
|
declare function $$render<T extends Record<string, any>>(): {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<style>.container {
|
|
16
16
|
grid-area: x-axis;
|
|
17
17
|
position: relative;
|
|
18
|
+
height: 1.25rem;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.label {
|
|
@@ -23,4 +24,5 @@
|
|
|
23
24
|
font-family: var(--mantine-font-family);
|
|
24
25
|
color: var(--chart-text-color, var(--mantine-color-dimmed));
|
|
25
26
|
transform: translateX(-50%);
|
|
27
|
+
white-space: nowrap;
|
|
26
28
|
}</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reburn-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"type-fest": "^4.41.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@eslint/compat": "^1.3.
|
|
68
|
+
"@eslint/compat": "^1.3.2",
|
|
69
69
|
"@eslint/js": "^9.32.0",
|
|
70
|
-
"@sveltejs/adapter-auto": "^6.0.
|
|
71
|
-
"@sveltejs/kit": "^2.27.
|
|
72
|
-
"@sveltejs/package": "^2.4.
|
|
73
|
-
"@sveltejs/vite-plugin-svelte": "^6.1.
|
|
70
|
+
"@sveltejs/adapter-auto": "^6.0.2",
|
|
71
|
+
"@sveltejs/kit": "^2.27.3",
|
|
72
|
+
"@sveltejs/package": "^2.4.1",
|
|
73
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.1",
|
|
74
74
|
"@types/bun": "^1.2.19",
|
|
75
75
|
"@types/d3": "^7.4.3",
|
|
76
76
|
"csstype": "^3.1.3",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"svelte-check": "^4.3.1",
|
|
90
90
|
"typescript": "^5.9.2",
|
|
91
91
|
"typescript-eslint": "^8.39.0",
|
|
92
|
-
"vite": "^7.1.
|
|
92
|
+
"vite": "^7.1.1"
|
|
93
93
|
},
|
|
94
94
|
"keywords": [
|
|
95
95
|
"svelte"
|