reburn-ui 0.2.1 → 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 +10 -12
- package/dist/core/components/Table/Table.svelte.d.ts +4 -1
- package/dist/core/components/Table/TableContext.svelte.d.ts +2 -0
- package/dist/core/components/Table/TableContext.svelte.js +1 -0
- package/dist/core/components/Table/TableTh.svelte +10 -1
- package/dist/core/components/Table/getTableDataAttr.d.ts +1 -0
- package/dist/core/components/Table/getTableDataAttr.js +3 -0
- package/dist/core/components/index.d.ts +4 -0
- package/dist/core/components/index.js +4 -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,35 @@
|
|
|
1
|
+
import type { FileError } from '../Dropzone.svelte';
|
|
2
|
+
export declare const FILE_INVALID_TYPE = "file-invalid-type";
|
|
3
|
+
export declare const FILE_TOO_LARGE = "file-too-large";
|
|
4
|
+
export declare const FILE_TOO_SMALL = "file-too-small";
|
|
5
|
+
export declare const TOO_MANY_FILES = "too-many-files";
|
|
6
|
+
export declare const TOO_MANY_FILES_REJECTION = "too-many-files-rejection";
|
|
7
|
+
export declare const ErrorCode: {
|
|
8
|
+
FileInvalidType: string;
|
|
9
|
+
FileTooLarge: string;
|
|
10
|
+
FileTooSmall: string;
|
|
11
|
+
TooManyFiles: string;
|
|
12
|
+
TooManyFilesRejection: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getInvalidTypeRejectionErr(accept?: string): {
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
interface AllFilesAcceptedOptions {
|
|
19
|
+
files: File[];
|
|
20
|
+
accept: string;
|
|
21
|
+
minSize: number;
|
|
22
|
+
maxSize: number;
|
|
23
|
+
multiple: boolean;
|
|
24
|
+
maxFiles: number;
|
|
25
|
+
validator: (f: File) => FileError | FileError[] | null;
|
|
26
|
+
}
|
|
27
|
+
export declare function allFilesAccepted({ files, accept, minSize, maxSize, multiple, maxFiles, validator }: AllFilesAcceptedOptions): boolean;
|
|
28
|
+
export declare function fileAccepted(file: File, accept: string): (boolean | {
|
|
29
|
+
code: string;
|
|
30
|
+
message: string;
|
|
31
|
+
} | null)[];
|
|
32
|
+
export declare function fileMatchSize(file: File, minSize: number, maxSize: number): (boolean | null)[] | (boolean | {
|
|
33
|
+
code: string;
|
|
34
|
+
})[];
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Error codes
|
|
2
|
+
export const FILE_INVALID_TYPE = 'file-invalid-type';
|
|
3
|
+
export const FILE_TOO_LARGE = 'file-too-large';
|
|
4
|
+
export const FILE_TOO_SMALL = 'file-too-small';
|
|
5
|
+
export const TOO_MANY_FILES = 'too-many-files';
|
|
6
|
+
export const TOO_MANY_FILES_REJECTION = 'too-many-files-rejection';
|
|
7
|
+
export const ErrorCode = {
|
|
8
|
+
FileInvalidType: FILE_INVALID_TYPE,
|
|
9
|
+
FileTooLarge: FILE_TOO_LARGE,
|
|
10
|
+
FileTooSmall: FILE_TOO_SMALL,
|
|
11
|
+
TooManyFiles: TOO_MANY_FILES,
|
|
12
|
+
TooManyFilesRejection: TOO_MANY_FILES_REJECTION,
|
|
13
|
+
};
|
|
14
|
+
export function getInvalidTypeRejectionErr(accept = '') {
|
|
15
|
+
const acceptArr = accept.split(',');
|
|
16
|
+
const msg = acceptArr.length > 1 ? `one of ${acceptArr.join(', ')}` : acceptArr[0];
|
|
17
|
+
return {
|
|
18
|
+
code: FILE_INVALID_TYPE,
|
|
19
|
+
message: `File type must be ${msg}`,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// https://github.com/react-dropzone/attr-accept/blob/main/src/index.js
|
|
23
|
+
function accepts(file, acceptedFiles) {
|
|
24
|
+
if (file && acceptedFiles) {
|
|
25
|
+
const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
|
|
26
|
+
if (acceptedFilesArray.length === 0) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
const fileName = file.name || '';
|
|
30
|
+
const mimeType = (file.type || '').toLowerCase();
|
|
31
|
+
const baseMimeType = mimeType.replace(/\/.*$/, '');
|
|
32
|
+
return acceptedFilesArray.some((type) => {
|
|
33
|
+
const validType = type.trim().toLowerCase();
|
|
34
|
+
if (validType.charAt(0) === '.') {
|
|
35
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
36
|
+
}
|
|
37
|
+
else if (validType.endsWith('/*')) {
|
|
38
|
+
// This is something like a image/* mime type
|
|
39
|
+
return baseMimeType === validType.replace(/\/.*$/, '');
|
|
40
|
+
}
|
|
41
|
+
return mimeType === validType;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
export function allFilesAccepted({ files, accept, minSize, maxSize, multiple, maxFiles, validator }) {
|
|
47
|
+
if ((!multiple && files.length > 1) || (multiple && maxFiles >= 1 && files.length > maxFiles)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return files.every((file) => {
|
|
51
|
+
const [accepted] = fileAccepted(file, accept);
|
|
52
|
+
const [sizeMatch] = fileMatchSize(file, minSize, maxSize);
|
|
53
|
+
const customErrors = validator ? validator(file) : null;
|
|
54
|
+
return accepted && sizeMatch && !customErrors;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export function fileAccepted(file, accept) {
|
|
58
|
+
const isAcceptable = file.type === 'application/x-moz-file' || accepts(file, accept);
|
|
59
|
+
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
|
|
60
|
+
}
|
|
61
|
+
export function fileMatchSize(file, minSize, maxSize) {
|
|
62
|
+
if (!file.size)
|
|
63
|
+
return [true, null];
|
|
64
|
+
if (file.size > maxSize)
|
|
65
|
+
return [false, { code: FILE_TOO_LARGE }];
|
|
66
|
+
if (file.size < minSize)
|
|
67
|
+
return [false, { code: FILE_TOO_SMALL }];
|
|
68
|
+
return [true, null];
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEvtWithFiles(event: DragEvent): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function isEvtWithFiles(event) {
|
|
2
|
+
if (!event.dataTransfer) {
|
|
3
|
+
return !!event.target && !!event.target.files;
|
|
4
|
+
}
|
|
5
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types
|
|
6
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
|
|
7
|
+
return Array.prototype.some.call(event.dataTransfer.types, (type) => type === 'Files' || type === 'application/x-moz-file');
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if v is a MIME type string.
|
|
3
|
+
*
|
|
4
|
+
* See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.
|
|
5
|
+
*/
|
|
6
|
+
export function isMIMEType(v) {
|
|
7
|
+
return v === 'audio/*' || v === 'video/*' || v === 'image/*' || v === 'text/*' || v === 'application/*' || /\w+\/[-+.\w]+/g.test(v);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPropagationStopped(event: Event): any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// React's synthetic events has event.isPropagationStopped,
|
|
2
|
+
// but to remain compatibility with other libs (Preact) fall back
|
|
3
|
+
// to check event.cancelBubble
|
|
4
|
+
export function isPropagationStopped(event) {
|
|
5
|
+
if (typeof event.isPropagationStopped === 'function') {
|
|
6
|
+
return event.isPropagationStopped();
|
|
7
|
+
}
|
|
8
|
+
else if (typeof event.cancelBubble !== 'undefined') {
|
|
9
|
+
return event.cancelBubble;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { MantineRadius } from '../../MantineProvider/theme.types.js';
|
|
3
|
+
import { getRadius } from '../../utils/get-size.js';
|
|
4
|
+
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
type FieldsetElement = SvelteHTMLElements['fieldset'];
|
|
7
|
+
export type FieldsetVariant = 'default' | 'filled' | 'unstyled';
|
|
8
|
+
|
|
9
|
+
export interface FieldsetProps extends FieldsetElement {
|
|
10
|
+
/** Fieldset legend */
|
|
11
|
+
legend?: string;
|
|
12
|
+
|
|
13
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */
|
|
14
|
+
radius?: MantineRadius;
|
|
15
|
+
|
|
16
|
+
/** Determines the variant of the fieldset */
|
|
17
|
+
variant?: FieldsetVariant;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
let { legend, radius, children, variant = 'default', ...props }: FieldsetProps = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<fieldset {...props} class={['root', `root--${variant}`, props.class]} style:--fieldset-radius={radius ? getRadius(radius) : undefined}>
|
|
26
|
+
{#if legend}
|
|
27
|
+
<legend class="legend">{legend}</legend>
|
|
28
|
+
{/if}
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</fieldset>
|
|
31
|
+
|
|
32
|
+
<style>.root {
|
|
33
|
+
padding: var(--mantine-spacing-lg);
|
|
34
|
+
padding-top: var(--mantine-spacing-xs);
|
|
35
|
+
border-radius: var(--fieldset-radius, var(--mantine-radius-default));
|
|
36
|
+
min-inline-size: auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.root--default {
|
|
40
|
+
border: calc(0.0625rem * var(--mantine-scale)) solid;
|
|
41
|
+
}
|
|
42
|
+
:global(:where([data-mantine-color-scheme="light"])) .root--default {
|
|
43
|
+
border-color: var(--mantine-color-gray-3);
|
|
44
|
+
background-color: var(--mantine-color-white);
|
|
45
|
+
}
|
|
46
|
+
:global(:where([data-mantine-color-scheme="dark"])) .root--default {
|
|
47
|
+
border-color: var(--mantine-color-dark-4);
|
|
48
|
+
background-color: var(--mantine-color-dark-7);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.root--filled {
|
|
52
|
+
border: calc(0.0625rem * var(--mantine-scale)) solid;
|
|
53
|
+
}
|
|
54
|
+
:global(:where([data-mantine-color-scheme="light"])) .root--filled {
|
|
55
|
+
border-color: var(--mantine-color-gray-3);
|
|
56
|
+
background-color: var(--mantine-color-gray-0);
|
|
57
|
+
}
|
|
58
|
+
:global(:where([data-mantine-color-scheme="dark"])) .root--filled {
|
|
59
|
+
border-color: var(--mantine-color-dark-4);
|
|
60
|
+
background-color: var(--mantine-color-dark-6);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.root--unstyled {
|
|
64
|
+
padding: 0;
|
|
65
|
+
border: 0;
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.legend {
|
|
70
|
+
font-size: var(--mantine-font-size-sm);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.legend--unstyled {
|
|
74
|
+
padding: 0;
|
|
75
|
+
margin-bottom: var(--mantine-spacing-sm);
|
|
76
|
+
}</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MantineRadius } from '../../MantineProvider/theme.types.js';
|
|
2
|
+
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
+
type FieldsetElement = SvelteHTMLElements['fieldset'];
|
|
4
|
+
export type FieldsetVariant = 'default' | 'filled' | 'unstyled';
|
|
5
|
+
export interface FieldsetProps extends FieldsetElement {
|
|
6
|
+
/** Fieldset legend */
|
|
7
|
+
legend?: string;
|
|
8
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius`, `theme.defaultRadius` by default */
|
|
9
|
+
radius?: MantineRadius;
|
|
10
|
+
/** Determines the variant of the fieldset */
|
|
11
|
+
variant?: FieldsetVariant;
|
|
12
|
+
}
|
|
13
|
+
declare const Fieldset: import("svelte").Component<FieldsetProps, {}, "">;
|
|
14
|
+
type Fieldset = ReturnType<typeof Fieldset>;
|
|
15
|
+
export default Fieldset;
|
|
@@ -27,11 +27,6 @@ export class CreateFloating {
|
|
|
27
27
|
updatePosition = () => {
|
|
28
28
|
if (!this.#elementsSet())
|
|
29
29
|
return;
|
|
30
|
-
console.log({
|
|
31
|
-
strategy: this.#strategy,
|
|
32
|
-
placement: this.#placement,
|
|
33
|
-
middleware: this.#middleware,
|
|
34
|
-
});
|
|
35
30
|
computePosition(this.#referenceElement, this.#floatingElement, {
|
|
36
31
|
strategy: this.#strategy,
|
|
37
32
|
placement: this.#placement,
|
|
@@ -39,11 +39,9 @@
|
|
|
39
39
|
}: GroupProps = $props();
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
|
-
<!-- TODO: add child width -->
|
|
43
|
-
|
|
44
42
|
<div
|
|
45
43
|
{...props}
|
|
46
|
-
class={['
|
|
44
|
+
class={['root-23noxnit', props.class]}
|
|
47
45
|
data-grow={grow || undefined}
|
|
48
46
|
style:--group-algin={align}
|
|
49
47
|
style:--group-gap={getSpacing(gap)}
|
|
@@ -53,7 +51,7 @@
|
|
|
53
51
|
{@render children?.()}
|
|
54
52
|
</div>
|
|
55
53
|
|
|
56
|
-
<style
|
|
54
|
+
<style>:global(.root-23noxnit) {
|
|
57
55
|
display: flex;
|
|
58
56
|
flex-direction: row;
|
|
59
57
|
flex-wrap: var(--group-wrap, wrap);
|
|
@@ -61,11 +59,8 @@
|
|
|
61
59
|
align-items: var(--group-align, center);
|
|
62
60
|
gap: var(--group-gap, var(--mantine-spacing-md));
|
|
63
61
|
}
|
|
64
|
-
.mantine-group:where([data-grow]) > * {
|
|
65
|
-
flex-grow: 1;
|
|
66
|
-
max-width: var(--group-child-width);
|
|
67
|
-
}
|
|
68
62
|
|
|
69
|
-
.
|
|
63
|
+
:global(.root-23noxnit:where([data-grow]) > *) {
|
|
70
64
|
flex-grow: 1;
|
|
65
|
+
max-width: var(--group-child-width);
|
|
71
66
|
}</style>
|
|
@@ -64,7 +64,7 @@ export type InputProps<T extends keyof SvelteHTMLElements = 'input'> = SvelteHTM
|
|
|
64
64
|
declare function $$render<T extends keyof SvelteHTMLElements>(): {
|
|
65
65
|
props: InputProps<T>;
|
|
66
66
|
exports: {};
|
|
67
|
-
bindings: "
|
|
67
|
+
bindings: "value" | "ref";
|
|
68
68
|
slots: {};
|
|
69
69
|
events: {};
|
|
70
70
|
};
|
|
@@ -72,7 +72,7 @@ declare class __sveltets_Render<T extends keyof SvelteHTMLElements> {
|
|
|
72
72
|
props(): ReturnType<typeof $$render<T>>['props'];
|
|
73
73
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
74
74
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
75
|
-
bindings(): "
|
|
75
|
+
bindings(): "value" | "ref";
|
|
76
76
|
exports(): {};
|
|
77
77
|
}
|
|
78
78
|
interface $$IsomorphicComponent {
|
|
@@ -15,7 +15,7 @@ export type InputBaseProps<T extends keyof SvelteHTMLElements = 'input'> = __Bas
|
|
|
15
15
|
declare function $$render<T extends keyof SvelteHTMLElements = 'input'>(): {
|
|
16
16
|
props: InputBaseProps<T>;
|
|
17
17
|
exports: {};
|
|
18
|
-
bindings: "
|
|
18
|
+
bindings: "value" | "ref";
|
|
19
19
|
slots: {};
|
|
20
20
|
events: {};
|
|
21
21
|
};
|
|
@@ -23,7 +23,7 @@ declare class __sveltets_Render<T extends keyof SvelteHTMLElements = 'input'> {
|
|
|
23
23
|
props(): ReturnType<typeof $$render<T>>['props'];
|
|
24
24
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
25
25
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
26
|
-
bindings(): "
|
|
26
|
+
bindings(): "value" | "ref";
|
|
27
27
|
exports(): {};
|
|
28
28
|
}
|
|
29
29
|
interface $$IsomorphicComponent {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<script lang="ts">
|
|
28
|
-
import { getThemeColor } from '../../MantineProvider/color-functions/
|
|
28
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
29
29
|
import { getSize } from '../../utils/get-size.js';
|
|
30
30
|
import Bars from './loaders/Bars.svelte';
|
|
31
31
|
import Dots from './loaders/Dots.svelte';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { DivElement } from '../../element-types.js';
|
|
3
|
+
import { theme } from '../../MantineProvider/theme.svelte.js';
|
|
4
|
+
import { getDefaultZIndex } from '../../utils/get-default-z-index.js';
|
|
5
|
+
import type { LoaderProps } from '../Loader/Loader.svelte';
|
|
6
|
+
import Loader from '../Loader/Loader.svelte';
|
|
7
|
+
import type { OverlayProps } from '../Overlay/Overlay.svelte';
|
|
8
|
+
import Overlay from '../Overlay/Overlay.svelte';
|
|
9
|
+
import { transitions, type TransitionOverrides } from '../Transitions/transitions.js';
|
|
10
|
+
|
|
11
|
+
export interface LoadingOverlayProps extends DivElement {
|
|
12
|
+
/** Props passed down to `Transition` component, `{ transition: 'fade', duration: 0 }` by default */
|
|
13
|
+
transitionProps?: TransitionOverrides;
|
|
14
|
+
|
|
15
|
+
/** Props passed down to `Loader` component */
|
|
16
|
+
loaderProps?: LoaderProps;
|
|
17
|
+
|
|
18
|
+
/** Props passed down to `Overlay` component */
|
|
19
|
+
overlayProps?: OverlayProps;
|
|
20
|
+
|
|
21
|
+
/** Determines whether the overlay should be visible, `false` by default */
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
|
|
24
|
+
/** Controls overlay `z-index`, `400` by default */
|
|
25
|
+
zIndex?: string | number;
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<script lang="ts">
|
|
30
|
+
let {
|
|
31
|
+
transitionProps = {
|
|
32
|
+
transition: 'fade',
|
|
33
|
+
options: { duration: 0 },
|
|
34
|
+
},
|
|
35
|
+
overlayProps = { backgroundOpacity: 0.75 },
|
|
36
|
+
zIndex = getDefaultZIndex('overlay'),
|
|
37
|
+
visible,
|
|
38
|
+
loaderProps,
|
|
39
|
+
...props
|
|
40
|
+
}: LoadingOverlayProps = $props();
|
|
41
|
+
|
|
42
|
+
const transition = $derived(transitions[transitionProps.transition]);
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
{#if visible}
|
|
46
|
+
<div {...props} class={['root', props.class]} transition:transition={{ ...transitionProps.options }} style:--lo-z-index={zIndex}>
|
|
47
|
+
<Loader {...loaderProps} class={['loader', props.class]} />
|
|
48
|
+
|
|
49
|
+
<Overlay {...overlayProps} data-dark-hidden color={overlayProps?.color || theme.white} />
|
|
50
|
+
|
|
51
|
+
<Overlay {...overlayProps} data-light-hidden color={overlayProps?.color || theme.colors.dark[5]} />
|
|
52
|
+
</div>
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
55
|
+
<style>.root {
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset: 0;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
z-index: var(--lo-z-index);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.loader {
|
|
66
|
+
position: relative;
|
|
67
|
+
z-index: calc(var(--lo-z-index) + 1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.overlay {
|
|
71
|
+
z-index: var(--lo-z-index);
|
|
72
|
+
}</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DivElement } from '../../element-types.js';
|
|
2
|
+
import type { LoaderProps } from '../Loader/Loader.svelte';
|
|
3
|
+
import type { OverlayProps } from '../Overlay/Overlay.svelte';
|
|
4
|
+
import { type TransitionOverrides } from '../Transitions/transitions.js';
|
|
5
|
+
export interface LoadingOverlayProps extends DivElement {
|
|
6
|
+
/** Props passed down to `Transition` component, `{ transition: 'fade', duration: 0 }` by default */
|
|
7
|
+
transitionProps?: TransitionOverrides;
|
|
8
|
+
/** Props passed down to `Loader` component */
|
|
9
|
+
loaderProps?: LoaderProps;
|
|
10
|
+
/** Props passed down to `Overlay` component */
|
|
11
|
+
overlayProps?: OverlayProps;
|
|
12
|
+
/** Determines whether the overlay should be visible, `false` by default */
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
/** Controls overlay `z-index`, `400` by default */
|
|
15
|
+
zIndex?: string | number;
|
|
16
|
+
}
|
|
17
|
+
declare const LoadingOverlay: import("svelte").Component<LoadingOverlayProps, {}, "">;
|
|
18
|
+
type LoadingOverlay = ReturnType<typeof LoadingOverlay>;
|
|
19
|
+
export default LoadingOverlay;
|
|
@@ -38,10 +38,12 @@
|
|
|
38
38
|
height: var(--modal-content-height, auto);
|
|
39
39
|
overflow-y: auto;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
:global(.content-6K9pQmku[data-full-screen]) {
|
|
42
43
|
border-radius: 0;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
|
|
46
|
+
:global(.content-6K9pQmku[data-hidden]) {
|
|
45
47
|
opacity: 0 !important;
|
|
46
48
|
pointer-events: none;
|
|
47
49
|
}
|
|
@@ -185,9 +185,6 @@
|
|
|
185
185
|
justify-content: center;
|
|
186
186
|
transition: transform 150ms ease;
|
|
187
187
|
}
|
|
188
|
-
.section > svg {
|
|
189
|
-
display: block;
|
|
190
|
-
}
|
|
191
188
|
.section:where([data-position=left]) {
|
|
192
189
|
margin-inline-end: var(--mantine-spacing-sm);
|
|
193
190
|
}
|
|
@@ -198,6 +195,10 @@
|
|
|
198
195
|
transform: rotate(90deg);
|
|
199
196
|
}
|
|
200
197
|
|
|
198
|
+
:global(.section > svg) {
|
|
199
|
+
display: block;
|
|
200
|
+
}
|
|
201
|
+
|
|
201
202
|
.label {
|
|
202
203
|
font-size: var(--mantine-font-size-sm);
|
|
203
204
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { DivElement } from '../../element-types.js';
|
|
3
|
-
import { getThemeColor } from '../../MantineProvider/index.js';
|
|
4
3
|
import type { MantineColor, MantineRadius } from '../../MantineProvider/theme.types.js';
|
|
5
|
-
import { getRadius } from '../../utils/get-size.js';
|
|
6
4
|
import type { Snippet } from 'svelte';
|
|
7
5
|
import type { CloseButtonProps } from '../CloseButton/CloseButton.svelte';
|
|
8
|
-
import CloseButton from '../CloseButton/CloseButton.svelte';
|
|
9
6
|
import type { LoaderProps } from '../Loader/Loader.svelte';
|
|
10
|
-
import Loader from '../Loader/Loader.svelte';
|
|
11
7
|
|
|
12
8
|
export interface NotificationProps extends Omit<DivElement, 'title'> {
|
|
13
9
|
variant?: string;
|
|
@@ -48,6 +44,11 @@
|
|
|
48
44
|
</script>
|
|
49
45
|
|
|
50
46
|
<script lang="ts">
|
|
47
|
+
import { getThemeColor } from '../../MantineProvider/color-functions/get-theme-color.js';
|
|
48
|
+
import { getRadius } from '../../utils/get-size.js';
|
|
49
|
+
import CloseButton from '../CloseButton/CloseButton.svelte';
|
|
50
|
+
import Loader from '../Loader/Loader.svelte';
|
|
51
|
+
|
|
51
52
|
let {
|
|
52
53
|
children,
|
|
53
54
|
title,
|