reburn-ui 0.2.0 → 0.3.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/dist/core/MantineProvider/color-functions/get-contrast-color.svelte.js +1 -1
- package/dist/core/MantineProvider/color-functions/index.d.ts +1 -1
- package/dist/core/MantineProvider/color-functions/index.js +1 -1
- package/dist/core/MantineProvider/color-functions/parse-theme-color.svelte.js +1 -1
- package/dist/core/MantineProvider/theme.types.d.ts +5 -6
- package/dist/core/charts/ChartRoot/ChartContext.svelte.d.ts +64 -0
- package/dist/core/charts/ChartRoot/ChartContext.svelte.js +56 -0
- package/dist/core/charts/ChartRoot/ChartRoot.svelte +238 -0
- package/dist/core/charts/ChartRoot/ChartRoot.svelte.d.ts +87 -0
- package/dist/core/charts/ChartRoot/ChartXGrid.svelte +32 -0
- package/dist/core/charts/ChartRoot/ChartXGrid.svelte.d.ts +18 -0
- package/dist/core/charts/ChartRoot/ChartXLabels.svelte +26 -0
- package/dist/core/charts/ChartRoot/ChartXLabels.svelte.d.ts +18 -0
- package/dist/core/charts/ChartRoot/ChartYGrid.svelte +32 -0
- package/dist/core/charts/ChartRoot/ChartYGrid.svelte.d.ts +18 -0
- package/dist/core/charts/ChartRoot/ChartYLabels.svelte +31 -0
- package/dist/core/charts/ChartRoot/ChartYLabels.svelte.d.ts +18 -0
- package/dist/core/charts/ChartRoot/tickLabels.d.ts +8 -0
- package/dist/core/charts/ChartRoot/tickLabels.js +21 -0
- package/dist/core/charts/ChartTooltip/ChartTooltip.svelte +260 -0
- package/dist/core/charts/ChartTooltip/ChartTooltip.svelte.d.ts +34 -0
- package/dist/core/charts/ChartTooltip/ChartTooltipData.svelte +47 -0
- package/dist/core/charts/ChartTooltip/ChartTooltipData.svelte.d.ts +29 -0
- package/dist/core/charts/ChartTooltip/utils/findClosestElement.d.ts +2 -0
- package/dist/core/charts/ChartTooltip/utils/findClosestElement.js +21 -0
- package/dist/core/charts/ChartTooltip/utils/getTooltipPosition.d.ts +9 -0
- package/dist/core/charts/ChartTooltip/utils/getTooltipPosition.js +6 -0
- package/dist/core/charts/CompositeChart/CompositeChart.svelte +82 -0
- package/dist/core/charts/CompositeChart/CompositeChart.svelte.d.ts +60 -0
- package/dist/core/charts/LineChart/LineChart.svelte +30 -321
- package/dist/core/charts/LineChart/LineChart.svelte.d.ts +16 -64
- package/dist/core/charts/LineChart/LineChartInner.svelte +66 -0
- package/dist/core/charts/LineChart/LineChartInner.svelte.d.ts +34 -0
- package/dist/core/charts/ScatterChart/ScatterChart.svelte +33 -0
- package/dist/core/charts/ScatterChart/ScatterChart.svelte.d.ts +39 -0
- package/dist/core/charts/ScatterChart/ScatterChartInner.svelte +67 -0
- package/dist/core/charts/ScatterChart/ScatterChartInner.svelte.d.ts +32 -0
- package/dist/core/charts/d3/array/tick.d.ts +1 -0
- package/dist/core/charts/d3/array/tick.js +66 -0
- package/dist/core/charts/d3/scale/scaleLinear.d.ts +4 -0
- package/dist/core/charts/d3/scale/scaleLinear.js +14 -0
- package/dist/core/charts/d3/shape/curve/curveLinear.d.ts +2 -0
- package/dist/core/charts/d3/shape/curve/curveLinear.js +16 -0
- package/dist/core/charts/d3/shape/line.d.ts +7 -0
- package/dist/core/charts/d3/shape/line.js +6 -0
- package/dist/core/charts/d3/shape/toFixed.d.ts +1 -0
- package/dist/core/charts/d3/shape/toFixed.js +7 -0
- package/dist/core/charts/d3/shape/withPath.d.ts +1 -0
- package/dist/core/charts/d3/shape/withPath.js +18 -0
- package/dist/core/charts/index.d.ts +5 -0
- package/dist/core/charts/index.js +5 -0
- package/dist/core/charts/types.d.ts +10 -0
- package/dist/core/charts/utils/minMaxObject.d.ts +6 -0
- package/dist/core/charts/utils/minMaxObject.js +26 -0
- package/dist/core/components/Badge/Badge.svelte +1 -1
- package/dist/core/components/Burger/Burger.svelte +1 -1
- package/dist/core/components/Checkbox/Checkbox.svelte +1 -1
- package/dist/core/components/Checkbox/CheckboxCard/CheckboxCard.svelte +8 -6
- package/dist/core/components/Checkbox/CheckboxIndicator.svelte +4 -1
- package/dist/core/components/ColorPicker/ColorSlider.svelte +10 -14
- package/dist/core/components/ColorPicker/Saturation.svelte +8 -4
- package/dist/core/components/ColorPicker/converters/index.d.ts +2 -2
- package/dist/core/components/ColorPicker/converters/index.js +2 -2
- package/dist/core/components/Combobox/ComboboxChevron.svelte +4 -3
- package/dist/core/components/Combobox/ComboboxDropdown.svelte +0 -3
- package/dist/core/components/Dropzone/Dropzone.svelte +396 -0
- package/dist/core/components/Dropzone/Dropzone.svelte.d.ts +104 -0
- package/dist/core/components/Dropzone/DropzoneContext.svelte.js +3 -0
- package/dist/core/components/Dropzone/index.d.ts +3 -0
- package/dist/core/components/Dropzone/index.js +2 -0
- package/dist/core/components/Dropzone/mime-types.d.ts +30 -0
- package/dist/core/components/Dropzone/mime-types.js +41 -0
- package/dist/core/components/Dropzone/utils/acceptPropAsAccaptAttr.d.ts +5 -0
- package/dist/core/components/Dropzone/utils/acceptPropAsAccaptAttr.js +21 -0
- package/dist/core/components/Dropzone/utils/fromEvent.d.ts +6 -0
- package/dist/core/components/Dropzone/utils/fromEvent.js +45 -0
- package/dist/core/components/Dropzone/utils/getAllFilesAccepted.d.ts +35 -0
- package/dist/core/components/Dropzone/utils/getAllFilesAccepted.js +69 -0
- package/dist/core/components/Dropzone/utils/isEvtWithFiles.d.ts +1 -0
- package/dist/core/components/Dropzone/utils/isEvtWithFiles.js +8 -0
- package/dist/core/components/Dropzone/utils/isExt.d.ts +4 -0
- package/dist/core/components/Dropzone/utils/isExt.js +6 -0
- package/dist/core/components/Dropzone/utils/isMIMEType.d.ts +6 -0
- package/dist/core/components/Dropzone/utils/isMIMEType.js +8 -0
- package/dist/core/components/Dropzone/utils/isPropagationStopped.d.ts +1 -0
- package/dist/core/components/Dropzone/utils/isPropagationStopped.js +12 -0
- package/dist/core/components/Fieldset/Fieldset.svelte +76 -0
- package/dist/core/components/Fieldset/Fieldset.svelte.d.ts +15 -0
- package/dist/core/components/Floating/CreateFloating.svelte.js +0 -5
- package/dist/core/components/Group/Group.svelte +4 -9
- package/dist/core/components/Input/Input.svelte.d.ts +2 -2
- package/dist/core/components/InputBase/InputBase.svelte.d.ts +2 -2
- package/dist/core/components/Loader/Loader.svelte +1 -1
- package/dist/core/components/LoadingOverlay/LoadingOverlay.svelte +72 -0
- package/dist/core/components/LoadingOverlay/LoadingOverlay.svelte.d.ts +19 -0
- package/dist/core/components/Modal/ModalContent.svelte +4 -2
- package/dist/core/components/NavLink/NavLink.svelte +4 -3
- package/dist/core/components/Notification/Notification.svelte +5 -4
- package/dist/core/components/Pill/Pill.svelte +172 -0
- package/dist/core/components/Pill/Pill.svelte.d.ts +23 -0
- package/dist/core/components/Pill/PillGroup.svelte +47 -0
- package/dist/core/components/Pill/PillGroup.svelte.d.ts +13 -0
- package/dist/core/components/Pill/PillGroupContext.svelte.d.ts +15 -0
- package/dist/core/components/Pill/PillGroupContext.svelte.js +13 -0
- package/dist/core/components/Pill/index.d.ts +8 -0
- package/dist/core/components/Pill/index.js +5 -0
- package/dist/core/components/Progress/ProgressSection.svelte +3 -1
- package/dist/core/components/SegmentedControl/SegmentedControl.svelte +18 -7
- package/dist/core/components/Select/Select.svelte.d.ts +1 -1
- package/dist/core/components/Slider/SliderRoot.svelte +5 -1
- package/dist/core/components/Slider/Thumb.svelte +5 -1
- package/dist/core/components/Slider/Track.svelte +16 -6
- package/dist/core/components/Switch/Switch.svelte +1 -1
- package/dist/core/components/Table/Table.svelte +158 -0
- package/dist/core/components/Table/Table.svelte.d.ts +51 -0
- package/dist/core/components/Table/TableBodyContext.d.ts +2 -0
- package/dist/core/components/Table/TableBodyContext.js +5 -0
- package/dist/core/components/Table/TableCaption.svelte +30 -0
- package/dist/core/components/Table/TableCaption.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableContext.svelte.d.ts +25 -0
- package/dist/core/components/Table/TableContext.svelte.js +19 -0
- package/dist/core/components/Table/TableDataRenderer.svelte +55 -0
- package/dist/core/components/Table/TableDataRenderer.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableHeaderContext.d.ts +2 -0
- package/dist/core/components/Table/TableHeaderContext.js +5 -0
- package/dist/core/components/Table/TableTbody.svelte +20 -0
- package/dist/core/components/Table/TableTbody.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableTd.svelte +27 -0
- package/dist/core/components/Table/TableTd.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableTfoot.svelte +15 -0
- package/dist/core/components/Table/TableTfoot.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableTh.svelte +45 -0
- package/dist/core/components/Table/TableTh.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableThead.svelte +32 -0
- package/dist/core/components/Table/TableThead.svelte.d.ts +7 -0
- package/dist/core/components/Table/TableTr.svelte +62 -0
- package/dist/core/components/Table/TableTr.svelte.d.ts +7 -0
- package/dist/core/components/Table/getTableDataAttr.d.ts +12 -0
- package/dist/core/components/Table/getTableDataAttr.js +28 -0
- package/dist/core/components/Table/index.d.ts +20 -0
- package/dist/core/components/Table/index.js +17 -0
- package/dist/core/components/index.d.ts +5 -0
- package/dist/core/components/index.js +5 -0
- package/dist/core/hooks/use-id.d.ts +1 -0
- package/dist/core/hooks/use-id.js +4 -0
- package/dist/core/utils/get-default-z-index.d.ts +1 -1
- package/package.json +11 -9
- package/dist/core/charts/LineChart/LineChart.types.js +0 -1
- package/dist/core/charts/LineChart/types.d.ts +0 -68
- /package/dist/core/MantineProvider/color-functions/{get-primary-shade.d.ts → get-primary-shade.svelte.d.ts} +0 -0
- /package/dist/core/MantineProvider/color-functions/{get-primary-shade.js → get-primary-shade.svelte.js} +0 -0
- /package/dist/core/charts/{LineChart/types.js → types.js} +0 -0
- /package/dist/core/{charts/LineChart/LineChart.types.d.ts → components/Dropzone/DropzoneContext.svelte.d.ts} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { getThemeColor } from '../../MantineProvider/index.js';
|
|
3
|
+
import type { MantineColor } from '../../MantineProvider/theme.types.js';
|
|
4
|
+
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
5
|
+
import type { ChartContext } from '../ChartRoot/ChartContext.svelte.js';
|
|
6
|
+
import type { ChartData, ChartSeries } from '../types.js';
|
|
7
|
+
import type { __ScatterChartProps } from './ScatterChart.svelte';
|
|
8
|
+
|
|
9
|
+
type CircleElement = SvelteHTMLElements['circle'];
|
|
10
|
+
|
|
11
|
+
export interface ScatterChartInnerProps<T extends ChartData> extends __ScatterChartProps, Omit<CircleElement, 'color'> {
|
|
12
|
+
context: ChartContext<T>;
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" generics="T extends ChartData">
|
|
17
|
+
let { context, color, dotSize = 4.5, ...props }: ScatterChartInnerProps<T> = $props();
|
|
18
|
+
|
|
19
|
+
const cachedColors: Record<string, string> = {
|
|
20
|
+
default: getThemeColor(color),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function getColor(color: MantineColor | undefined) {
|
|
24
|
+
if (!color) return cachedColors.default;
|
|
25
|
+
|
|
26
|
+
if (cachedColors[color]) {
|
|
27
|
+
return cachedColors[color];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const colorValue = getThemeColor(color);
|
|
31
|
+
cachedColors[color] = colorValue;
|
|
32
|
+
return colorValue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isScatterSeries(series: ChartSeries<T, keyof T>) {
|
|
36
|
+
if (!('type' in series)) return true;
|
|
37
|
+
|
|
38
|
+
return series.type === 'scatter';
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
{#snippet dot(item: T, series: ChartSeries<T, keyof T>, value: T[keyof T])}
|
|
43
|
+
<circle
|
|
44
|
+
{...props}
|
|
45
|
+
cx={context.xScale(context.xAccessor(item))}
|
|
46
|
+
cy={context.yScale(series.accessor?.(value) || value)}
|
|
47
|
+
class="dot"
|
|
48
|
+
fill={getColor(series.color || color)}
|
|
49
|
+
r={dotSize}
|
|
50
|
+
/>
|
|
51
|
+
{/snippet}
|
|
52
|
+
|
|
53
|
+
{#if context.xRange}
|
|
54
|
+
{#each context.data as item}
|
|
55
|
+
{#each context.series as series}
|
|
56
|
+
{#if isScatterSeries(series)}
|
|
57
|
+
{#if Array.isArray(item[series.name])}
|
|
58
|
+
{#each item[series.name] as value}
|
|
59
|
+
{@render dot(item, series, value)}
|
|
60
|
+
{/each}
|
|
61
|
+
{:else}
|
|
62
|
+
{@render dot(item, series, item[series.name])}
|
|
63
|
+
{/if}
|
|
64
|
+
{/if}
|
|
65
|
+
{/each}
|
|
66
|
+
{/each}
|
|
67
|
+
{/if}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
2
|
+
import type { ChartContext } from '../ChartRoot/ChartContext.svelte.js';
|
|
3
|
+
import type { ChartData } from '../types.js';
|
|
4
|
+
import type { __ScatterChartProps } from './ScatterChart.svelte';
|
|
5
|
+
type CircleElement = SvelteHTMLElements['circle'];
|
|
6
|
+
export interface ScatterChartInnerProps<T extends ChartData> extends __ScatterChartProps, Omit<CircleElement, 'color'> {
|
|
7
|
+
context: ChartContext<T>;
|
|
8
|
+
}
|
|
9
|
+
declare function $$render<T extends ChartData>(): {
|
|
10
|
+
props: ScatterChartInnerProps<T>;
|
|
11
|
+
exports: {};
|
|
12
|
+
bindings: "";
|
|
13
|
+
slots: {};
|
|
14
|
+
events: {};
|
|
15
|
+
};
|
|
16
|
+
declare class __sveltets_Render<T extends ChartData> {
|
|
17
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
18
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
19
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
20
|
+
bindings(): "";
|
|
21
|
+
exports(): {};
|
|
22
|
+
}
|
|
23
|
+
interface $$IsomorphicComponent {
|
|
24
|
+
new <T extends ChartData>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
25
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
26
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
27
|
+
<T extends ChartData>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
28
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
29
|
+
}
|
|
30
|
+
declare const ScatterChartInner: $$IsomorphicComponent;
|
|
31
|
+
type ScatterChartInner<T extends ChartData> = InstanceType<typeof ScatterChartInner<T>>;
|
|
32
|
+
export default ScatterChartInner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ticks(start: number, stop: number, count: number): number[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const e10 = Math.sqrt(50);
|
|
2
|
+
const e5 = Math.sqrt(10);
|
|
3
|
+
const e2 = Math.sqrt(2);
|
|
4
|
+
// we need to make ticks better for the chart
|
|
5
|
+
function tickSpec(start, stop, count) {
|
|
6
|
+
const step = (stop - start) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
|
|
7
|
+
let i1, i2, inc;
|
|
8
|
+
if (power < 0) {
|
|
9
|
+
inc = Math.pow(10, -power) / factor;
|
|
10
|
+
i1 = Math.round(start * inc);
|
|
11
|
+
i2 = Math.round(stop * inc);
|
|
12
|
+
if (i1 / inc < start)
|
|
13
|
+
++i1;
|
|
14
|
+
if (i2 / inc > stop)
|
|
15
|
+
--i2;
|
|
16
|
+
inc = -inc;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
inc = Math.pow(10, power) * factor;
|
|
20
|
+
i1 = Math.round(start / inc);
|
|
21
|
+
i2 = Math.round(stop / inc);
|
|
22
|
+
if (i1 * inc < start)
|
|
23
|
+
++i1;
|
|
24
|
+
if (i2 * inc > stop)
|
|
25
|
+
--i2;
|
|
26
|
+
}
|
|
27
|
+
if (i2 < i1 && 0.5 <= count && count < 2)
|
|
28
|
+
return tickSpec(start, stop, count * 2);
|
|
29
|
+
return [i1, i2, inc];
|
|
30
|
+
}
|
|
31
|
+
export default function ticks(start, stop, count) {
|
|
32
|
+
stop = +stop;
|
|
33
|
+
start = +start;
|
|
34
|
+
count = +count;
|
|
35
|
+
if (!(count > 0))
|
|
36
|
+
return [];
|
|
37
|
+
if (start === stop)
|
|
38
|
+
return [start];
|
|
39
|
+
const reverse = stop < start;
|
|
40
|
+
const [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
|
|
41
|
+
if (!(i2 >= i1))
|
|
42
|
+
return [];
|
|
43
|
+
const n = i2 - i1 + 1;
|
|
44
|
+
const ticks = new Array(n);
|
|
45
|
+
if (reverse) {
|
|
46
|
+
if (inc < 0) {
|
|
47
|
+
for (let i = 0; i < n; ++i)
|
|
48
|
+
ticks[i] = (i2 - i) / -inc;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
for (let i = 0; i < n; ++i)
|
|
52
|
+
ticks[i] = (i2 - i) * inc;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (inc < 0) {
|
|
57
|
+
for (let i = 0; i < n; ++i)
|
|
58
|
+
ticks[i] = (i1 + i) / -inc;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
for (let i = 0; i < n; ++i)
|
|
62
|
+
ticks[i] = (i1 + i) * inc;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return ticks;
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function scaleLinear(domain, range) {
|
|
2
|
+
// Pre-calculate the scale factor and offset
|
|
3
|
+
const domainRange = domain[1] - domain[0];
|
|
4
|
+
const rangeRange = range[1] - range[0];
|
|
5
|
+
const scale = rangeRange / domainRange;
|
|
6
|
+
const offset = range[0] - domain[0] * scale;
|
|
7
|
+
function _scale(value) {
|
|
8
|
+
return value * scale + offset;
|
|
9
|
+
}
|
|
10
|
+
_scale.invert = (value) => {
|
|
11
|
+
return (value - offset) / scale;
|
|
12
|
+
};
|
|
13
|
+
return _scale;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { roundFloat } from '../toFixed.js';
|
|
2
|
+
export function curveLinear(data, x, y) {
|
|
3
|
+
if (!data || data.length === 0)
|
|
4
|
+
return '';
|
|
5
|
+
// Fallback to simple linear path for curveLinear or no curve
|
|
6
|
+
const startXVal = x(data[0], 0, data);
|
|
7
|
+
const startYVal = y(data[0], 0, data);
|
|
8
|
+
let path = `M${roundFloat(startXVal)},${roundFloat(startYVal)}`;
|
|
9
|
+
for (let i = 1; i < data.length; i++) {
|
|
10
|
+
const d = data[i];
|
|
11
|
+
const xVal = x(d, i, data);
|
|
12
|
+
const yVal = y(d, i, data);
|
|
13
|
+
path += `L${roundFloat(xVal)},${roundFloat(yVal)}`;
|
|
14
|
+
}
|
|
15
|
+
return path;
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { curveLinear } from './curve/curveLinear.js';
|
|
2
|
+
export interface LineProps<T> {
|
|
3
|
+
x: (d: T, i: number, data: T[]) => number;
|
|
4
|
+
y: (d: T, i: number, data: T[]) => number;
|
|
5
|
+
curve?: typeof curveLinear;
|
|
6
|
+
}
|
|
7
|
+
export declare function line<T>({ x, y, curve }: LineProps<T>): (data: T[]) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function roundFloat(n: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withPath(shape: any): () => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function withPath(shape) {
|
|
2
|
+
let digits = 3;
|
|
3
|
+
shape.digits = function (_) {
|
|
4
|
+
if (!arguments.length)
|
|
5
|
+
return digits;
|
|
6
|
+
if (_ == null) {
|
|
7
|
+
digits = null;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
const d = Math.floor(_);
|
|
11
|
+
if (!(d >= 0))
|
|
12
|
+
throw new RangeError(`invalid digits: ${_}`);
|
|
13
|
+
digits = d;
|
|
14
|
+
}
|
|
15
|
+
return shape;
|
|
16
|
+
};
|
|
17
|
+
return () => new Path(digits);
|
|
18
|
+
}
|
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export { default as LineChart } from './LineChart/LineChart.svelte';
|
|
2
|
+
export { default as ScatterChart } from './ScatterChart/ScatterChart.svelte';
|
|
3
|
+
export { max } from './utils/max.js';
|
|
4
|
+
export { min } from './utils/min.js';
|
|
5
|
+
export { minMax } from './utils/minMax.js';
|
|
6
|
+
export { minMaxObject } from './utils/minMaxObject.js';
|
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export { default as LineChart } from './LineChart/LineChart.svelte';
|
|
2
|
+
export { default as ScatterChart } from './ScatterChart/ScatterChart.svelte';
|
|
3
|
+
export { max } from './utils/max.js';
|
|
4
|
+
export { min } from './utils/min.js';
|
|
5
|
+
export { minMax } from './utils/minMax.js';
|
|
6
|
+
export { minMaxObject } from './utils/minMaxObject.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MantineColor } from '../MantineProvider/theme.types.js';
|
|
2
|
+
export interface ChartSeries<T extends ChartData, K extends keyof T> {
|
|
3
|
+
name: K;
|
|
4
|
+
color?: MantineColor;
|
|
5
|
+
label?: string;
|
|
6
|
+
yAxisId?: string;
|
|
7
|
+
accessor?: (value: T[K]) => number;
|
|
8
|
+
formatLabel?: (value: number) => string;
|
|
9
|
+
}
|
|
10
|
+
export type ChartData = Record<string, unknown>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function minMaxObject(data, keys) {
|
|
2
|
+
if (!data || data.length === 0)
|
|
3
|
+
return [0, 0];
|
|
4
|
+
let min = Infinity;
|
|
5
|
+
let max = -Infinity;
|
|
6
|
+
for (let i = 0; i < data.length; i++) {
|
|
7
|
+
for (let j = 0; j < keys.length; j++) {
|
|
8
|
+
const value = keys[j].accessor(data[i]);
|
|
9
|
+
if (Array.isArray(value)) {
|
|
10
|
+
for (let k = 0; k < value.length; k++) {
|
|
11
|
+
if (value[k] < min)
|
|
12
|
+
min = value[k];
|
|
13
|
+
if (value[k] > max)
|
|
14
|
+
max = value[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
if (value < min)
|
|
19
|
+
min = value;
|
|
20
|
+
if (value > max)
|
|
21
|
+
max = value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return [min, max];
|
|
26
|
+
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<script lang="ts">
|
|
42
|
-
import { getThemeColor } from '../../MantineProvider/color-functions/
|
|
42
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
43
43
|
import { theme } from '../../MantineProvider/theme.svelte.js';
|
|
44
44
|
import { getRadius, getSize } from '../../utils/get-size.js';
|
|
45
45
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<script lang="ts">
|
|
27
|
-
import { getThemeColor } from '../../MantineProvider/color-functions/
|
|
27
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
28
28
|
import { getSize } from '../../utils/get-size.js';
|
|
29
29
|
import { rem } from '../../utils/units-converters/rem.js';
|
|
30
30
|
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</script>
|
|
57
57
|
|
|
58
58
|
<script lang="ts">
|
|
59
|
-
import { parseThemeColor } from '../../MantineProvider/color-functions/
|
|
59
|
+
import { parseThemeColor } from '../../MantineProvider/color-functions/parse-theme-color.svelte.js';
|
|
60
60
|
import { theme } from '../../MantineProvider/theme.svelte.js';
|
|
61
61
|
import { getRadius, getSize } from '../../utils/get-size.js';
|
|
62
62
|
import InlineInput from '../InlineInput/InlineInput.svelte';
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
<button
|
|
59
59
|
{...props}
|
|
60
|
-
class={[props.class, 'mantine-unstyled-button', 'card']}
|
|
60
|
+
class={[props.class, 'mantine-unstyled-button', 'card-nx0ZB2nP']}
|
|
61
61
|
data-with-border={withBorder || undefined}
|
|
62
62
|
role="checkbox"
|
|
63
63
|
aria-checked={checkboxCardContext.checked}
|
|
@@ -67,22 +67,24 @@
|
|
|
67
67
|
{@render children?.()}
|
|
68
68
|
</button>
|
|
69
69
|
|
|
70
|
-
<style
|
|
70
|
+
<style>:global(.card-nx0ZB2nP) {
|
|
71
71
|
--card-radius: var(--mantine-radius-default);
|
|
72
72
|
display: block;
|
|
73
73
|
width: 100%;
|
|
74
74
|
border-radius: var(--card-radius);
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
:global(.card-nx0ZB2nP :where(*)) {
|
|
78
79
|
cursor: inherit;
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
|
|
82
|
+
:global(.card-nx0ZB2nP:where([data-with-border])) {
|
|
81
83
|
border: 1px solid transparent;
|
|
82
84
|
}
|
|
83
|
-
:global(:where([data-mantine-color-scheme="light"])) .card:where([data-with-border]) {
|
|
85
|
+
:global(:where([data-mantine-color-scheme="light"])) :global(.card-nx0ZB2nP:where([data-with-border])) {
|
|
84
86
|
border-color: var(--mantine-color-gray-3);
|
|
85
87
|
}
|
|
86
|
-
:global(:where([data-mantine-color-scheme="dark"])) .card:where([data-with-border]) {
|
|
88
|
+
:global(:where([data-mantine-color-scheme="dark"])) :global(.card-nx0ZB2nP:where([data-with-border])) {
|
|
87
89
|
border-color: var(--mantine-color-dark-4);
|
|
88
90
|
}</style>
|
|
@@ -40,7 +40,10 @@
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<script lang="ts">
|
|
43
|
-
import { getAutoContrastValue
|
|
43
|
+
import { getAutoContrastValue } from '../../MantineProvider/color-functions/get-auto-contrast-value.svelte.js';
|
|
44
|
+
import { getContrastColor } from '../../MantineProvider/color-functions/get-contrast-color.svelte.js';
|
|
45
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
46
|
+
import { parseThemeColor } from '../../MantineProvider/color-functions/parse-theme-color.svelte.js';
|
|
44
47
|
import { theme } from '../../MantineProvider/theme.svelte.js';
|
|
45
48
|
import { getRadius, getSize } from '../../utils/get-size.js';
|
|
46
49
|
import { getCheckboxCardContext } from './CheckboxCard/CheckboxCardContext.svelte.js';
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<!-- TODO: data-focus-ring={theme.focusRing} -->
|
|
91
91
|
<div
|
|
92
92
|
{...props}
|
|
93
|
-
class="slider"
|
|
93
|
+
class="slider-e0Ngz9YB"
|
|
94
94
|
style:--cp-thumb-size="var(--cp-thumb-size-{size})"
|
|
95
95
|
role="slider"
|
|
96
96
|
aria-valuenow={value}
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
<Thumb {position} style="top: calc(0.0625rem * var(--mantine-scale)); background: {thumbColor}" />
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
|
-
<style>.slider {
|
|
109
|
+
<style>.slider-e0Ngz9YB {
|
|
110
110
|
--cp-thumb-size-xs: calc(0.5rem * var(--mantine-scale));
|
|
111
111
|
--cp-thumb-size-sm: calc(0.75rem * var(--mantine-scale));
|
|
112
112
|
--cp-thumb-size-md: calc(1rem * var(--mantine-scale));
|
|
@@ -118,24 +118,20 @@
|
|
|
118
118
|
margin-inline: calc(var(--cp-thumb-size) / 2);
|
|
119
119
|
outline: none;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
:global(:where([data-mantine-color-scheme="light"])) .slider-e0Ngz9YB {
|
|
122
|
+
--slider-checkers: var(--mantine-color-gray-3);
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
:global(:where([data-mantine-color-scheme="dark"])) .slider-e0Ngz9YB {
|
|
125
|
+
--slider-checkers: var(--mantine-color-dark-4);
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
|
|
128
|
+
:global(.slider-e0Ngz9YB:where([data-focus-ring="auto"]:focus:focus-visible) .thumb) {
|
|
128
129
|
outline: 2px solid var(--mantine-color-blue-filled);
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
+
|
|
132
|
+
:global(.slider-e0Ngz9YB:where([data-focus-ring="always"]:focus) .thumb) {
|
|
131
133
|
outline: 2px solid var(--mantine-color-blue-filled);
|
|
132
134
|
}
|
|
133
|
-
:global(:where([data-mantine-color-scheme="light"])) .slider {
|
|
134
|
-
--slider-checkers: var(--mantine-color-gray-3);
|
|
135
|
-
}
|
|
136
|
-
:global(:where([data-mantine-color-scheme="dark"])) .slider {
|
|
137
|
-
--slider-checkers: var(--mantine-color-dark-4);
|
|
138
|
-
}
|
|
139
135
|
|
|
140
136
|
* :global(.overlay) {
|
|
141
137
|
position: absolute;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import { clampUseMovePosition, move, type UseMovePosition } from '../../attachments/attach-move.svelte.js';
|
|
3
3
|
import type { DivElement } from '../../element-types.js';
|
|
4
|
+
import { theme } from '../../MantineProvider/theme.svelte.js';
|
|
4
5
|
import type { MantineSize } from '../../MantineProvider/theme.types.js';
|
|
5
6
|
import type { HsvaColor } from './ColorPicker.types.js';
|
|
6
7
|
import { convertHsvaTo } from './converters/converters.js';
|
|
@@ -102,13 +103,14 @@
|
|
|
102
103
|
|
|
103
104
|
<div
|
|
104
105
|
{...props}
|
|
105
|
-
class="saturation"
|
|
106
|
+
class="saturation-oqomBq6E"
|
|
106
107
|
role="slider"
|
|
107
108
|
aria-label={saturationLabel}
|
|
108
109
|
aria-valuenow={position.x}
|
|
109
110
|
aria-valuetext={convertHsvaTo('rgba', value)}
|
|
110
111
|
tabindex={focusable ? 0 : -1}
|
|
111
112
|
onkeydown={handleKeyDown}
|
|
113
|
+
data-focus-ring={theme.focusRing}
|
|
112
114
|
{@attach move({ onChange: handleChange, onScrubEnd: handleScrubEnd, onScrubStart: onscrubstart })}
|
|
113
115
|
>
|
|
114
116
|
<div class="overlay" style:background-color="hsla({value.h}, 100%, 50%)"></div>
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
<Thumb {position} style="background-color: {color}" />
|
|
118
120
|
</div>
|
|
119
121
|
|
|
120
|
-
<style>.saturation {
|
|
122
|
+
<style>.saturation-oqomBq6E {
|
|
121
123
|
--cp-thumb-size-xs: calc(0.5rem * var(--mantine-scale));
|
|
122
124
|
--cp-thumb-size-sm: calc(0.75rem * var(--mantine-scale));
|
|
123
125
|
--cp-thumb-size-md: calc(1rem * var(--mantine-scale));
|
|
@@ -129,10 +131,12 @@
|
|
|
129
131
|
border-radius: var(--mantine-radius-sm);
|
|
130
132
|
margin: calc(var(--cp-thumb-size) / 2);
|
|
131
133
|
}
|
|
132
|
-
|
|
134
|
+
|
|
135
|
+
:global(.saturation-oqomBq6E:where([data-focus-ring="auto"]:focus:focus-visible) .thumb) {
|
|
133
136
|
outline: 2px solid var(--mantine-color-blue-filled);
|
|
134
137
|
}
|
|
135
|
-
|
|
138
|
+
|
|
139
|
+
:global(.saturation-oqomBq6E:where([data-focus-ring="always"]:focus) .thumb) {
|
|
136
140
|
outline: 2px solid var(--mantine-color-blue-filled);
|
|
137
141
|
}
|
|
138
142
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { convertHsvaTo } from './converters';
|
|
2
|
-
export {
|
|
1
|
+
export { convertHsvaTo } from './converters.js';
|
|
2
|
+
export { isColorValid, parseColor } from './parsers.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { convertHsvaTo } from './converters';
|
|
2
|
-
export {
|
|
1
|
+
export { convertHsvaTo } from './converters.js';
|
|
2
|
+
export { isColorValid, parseColor } from './parsers.js';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import { getThemeColor } from '../../MantineProvider/color-functions/index.js';
|
|
3
2
|
import type { MantineColor, MantineSize } from '../../MantineProvider/theme.types.js';
|
|
4
|
-
import { getSize } from '../../utils/get-size.js';
|
|
5
3
|
import type { IconContainerProps } from '../../../icons/IconContainer.svelte';
|
|
6
|
-
import { getComboboxContext } from './ComboboxContext.svelte.js';
|
|
7
4
|
|
|
8
5
|
export interface ComboboxChevronProps extends Omit<IconContainerProps, 'name' | 'children'> {
|
|
9
6
|
size?: MantineSize | (string & {});
|
|
@@ -13,6 +10,10 @@
|
|
|
13
10
|
</script>
|
|
14
11
|
|
|
15
12
|
<script lang="ts">
|
|
13
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
14
|
+
import { getSize } from '../../utils/get-size.js';
|
|
15
|
+
import { getComboboxContext } from './ComboboxContext.svelte.js';
|
|
16
|
+
|
|
16
17
|
const ctx = getComboboxContext();
|
|
17
18
|
|
|
18
19
|
let { size = ctx.size, error, color, ...props }: ComboboxChevronProps = $props();
|
|
@@ -36,9 +36,6 @@
|
|
|
36
36
|
--combobox-option-padding-xl: calc(0.875rem * var(--mantine-scale)) calc(1.25rem * var(--mantine-scale));
|
|
37
37
|
--combobox-option-padding: var(--combobox-option-padding-sm);
|
|
38
38
|
}
|
|
39
|
-
:global(.dropdown-PyNnHqYi):has([data-mantine-scrollbar]) .search {
|
|
40
|
-
max-width: calc(100% + var(--combobox-padding));
|
|
41
|
-
}
|
|
42
39
|
|
|
43
40
|
:global(.dropdown-PyNnHqYi[data-composed]) {
|
|
44
41
|
padding-inline-end: 0;
|