@tableslayer/ui 0.1.4 → 0.1.5
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/components/PropsTable/PropsTable.svelte +1 -1
- package/package.json +9 -9
- package/src/lib/components/Avatar/Avatar.svelte +0 -82
- package/src/lib/components/Avatar/AvatarFileInput.svelte +0 -85
- package/src/lib/components/Avatar/AvatarPopover.svelte +0 -34
- package/src/lib/components/Avatar/index.ts +0 -4
- package/src/lib/components/Avatar/types.ts +0 -24
- package/src/lib/components/BrushSizeSlider/BrushSizeSlider.svelte +0 -174
- package/src/lib/components/BrushSizeSlider/index.ts +0 -1
- package/src/lib/components/Button/Button.svelte +0 -182
- package/src/lib/components/Button/ConfirmActionButton.svelte +0 -98
- package/src/lib/components/Button/IconButton.svelte +0 -121
- package/src/lib/components/Button/RadioButton.svelte +0 -93
- package/src/lib/components/Button/index.ts +0 -5
- package/src/lib/components/Button/types.ts +0 -54
- package/src/lib/components/CardFan/CardFan.svelte +0 -165
- package/src/lib/components/CardFan/index.ts +0 -2
- package/src/lib/components/CardFan/types.ts +0 -6
- package/src/lib/components/CodeBlock/Code.svelte +0 -7
- package/src/lib/components/CodeBlock/CodeBlock.svelte +0 -102
- package/src/lib/components/CodeBlock/index.ts +0 -3
- package/src/lib/components/CodeBlock/types.ts +0 -10
- package/src/lib/components/ColorMode/ColorMode.svelte +0 -8
- package/src/lib/components/ColorMode/index.ts +0 -2
- package/src/lib/components/ColorMode/types.ts +0 -12
- package/src/lib/components/ColorPicker/ColorPicker.svelte +0 -838
- package/src/lib/components/ColorPicker/ColorPickerSwatch.svelte +0 -32
- package/src/lib/components/ColorPicker/index.ts +0 -3
- package/src/lib/components/ColorPicker/types.ts +0 -51
- package/src/lib/components/ContextMenu/ContextMenu.svelte +0 -86
- package/src/lib/components/ContextMenu/index.ts +0 -2
- package/src/lib/components/ContextMenu/types.ts +0 -15
- package/src/lib/components/DrawingSliders/DrawingSliders.svelte +0 -379
- package/src/lib/components/DrawingSliders/index.ts +0 -1
- package/src/lib/components/Editor/Editor.svelte +0 -825
- package/src/lib/components/Editor/index.ts +0 -1
- package/src/lib/components/FogSliders/FogSliders.svelte +0 -33
- package/src/lib/components/FogSliders/index.ts +0 -1
- package/src/lib/components/Hr/Hr.svelte +0 -15
- package/src/lib/components/Hr/index.ts +0 -1
- package/src/lib/components/Icon/Icon.svelte +0 -6
- package/src/lib/components/Icon/index.ts +0 -2
- package/src/lib/components/Icon/types.ts +0 -20
- package/src/lib/components/Input/DualInputSlider.svelte +0 -126
- package/src/lib/components/Input/FileInput.svelte +0 -176
- package/src/lib/components/Input/FormControl.svelte +0 -150
- package/src/lib/components/Input/FormError.svelte +0 -37
- package/src/lib/components/Input/Input.svelte +0 -56
- package/src/lib/components/Input/InputCheckbox.svelte +0 -99
- package/src/lib/components/Input/InputSlider.svelte +0 -86
- package/src/lib/components/Input/Label.svelte +0 -19
- package/src/lib/components/Input/index.ts +0 -9
- package/src/lib/components/Input/types.ts +0 -39
- package/src/lib/components/Link/Link.svelte +0 -41
- package/src/lib/components/Link/LinkBox.svelte +0 -20
- package/src/lib/components/Link/LinkOverlay.svelte +0 -23
- package/src/lib/components/Link/index.ts +0 -4
- package/src/lib/components/Link/types.ts +0 -17
- package/src/lib/components/Loading/Loader.svelte +0 -60
- package/src/lib/components/Loading/Skeleton.svelte +0 -9
- package/src/lib/components/Loading/index.ts +0 -2
- package/src/lib/components/Logo/Logo.svelte +0 -16
- package/src/lib/components/Logo/index.ts +0 -1
- package/src/lib/components/MarkerTooltip/MarkerTooltip.svelte +0 -435
- package/src/lib/components/MarkerTooltip/index.ts +0 -1
- package/src/lib/components/Menu/SelectorMenu.svelte +0 -280
- package/src/lib/components/Menu/index.ts +0 -2
- package/src/lib/components/Menu/types.ts +0 -17
- package/src/lib/components/MyCounterButton.svelte +0 -11
- package/src/lib/components/Panel/index.ts +0 -2
- package/src/lib/components/Panel/panel.svelte +0 -18
- package/src/lib/components/Panel/types.ts +0 -8
- package/src/lib/components/PersistButton/PersistButton.svelte +0 -100
- package/src/lib/components/PersistButton/index.ts +0 -1
- package/src/lib/components/Popover/Popover.svelte +0 -81
- package/src/lib/components/Popover/index.ts +0 -2
- package/src/lib/components/Popover/types.ts +0 -19
- package/src/lib/components/PropsTable/PropsTable.svelte +0 -107
- package/src/lib/components/RadialMenu/EffectPreview.svelte +0 -36
- package/src/lib/components/RadialMenu/EffectPreviewScene.svelte +0 -194
- package/src/lib/components/RadialMenu/RadialMenu.svelte +0 -503
- package/src/lib/components/RadialMenu/RadialMenuItem.svelte +0 -176
- package/src/lib/components/RadialMenu/index.ts +0 -2
- package/src/lib/components/RadialMenu/types.ts +0 -35
- package/src/lib/components/Select/Select.svelte +0 -342
- package/src/lib/components/Select/index.ts +0 -2
- package/src/lib/components/Select/types.ts +0 -22
- package/src/lib/components/Spacer/Spacer.svelte +0 -14
- package/src/lib/components/Spacer/index.ts +0 -2
- package/src/lib/components/Spacer/types.ts +0 -5
- package/src/lib/components/Stage/components/AnnotationLayer/AnnotationLayer.svelte +0 -445
- package/src/lib/components/Stage/components/AnnotationLayer/AnnotationMaterial.svelte +0 -167
- package/src/lib/components/Stage/components/AnnotationLayer/types.ts +0 -196
- package/src/lib/components/Stage/components/CursorLayer/CursorLayer.svelte +0 -148
- package/src/lib/components/Stage/components/CursorLayer/cursor.svg +0 -26
- package/src/lib/components/Stage/components/CursorLayer/index.ts +0 -2
- package/src/lib/components/Stage/components/CursorLayer/types.ts +0 -23
- package/src/lib/components/Stage/components/DrawingLayer/DrawingMaterial.svelte +0 -364
- package/src/lib/components/Stage/components/DrawingLayer/types.ts +0 -65
- package/src/lib/components/Stage/components/EdgeOverlayLayer/EdgeOverlayLayer.svelte +0 -72
- package/src/lib/components/Stage/components/EdgeOverlayLayer/types.ts +0 -34
- package/src/lib/components/Stage/components/FogLayer/FogLayer.svelte +0 -75
- package/src/lib/components/Stage/components/FogLayer/types.ts +0 -51
- package/src/lib/components/Stage/components/FogOfWarLayer/FogOfWarLayer.svelte +0 -249
- package/src/lib/components/Stage/components/FogOfWarLayer/FogOfWarMaterial.svelte +0 -200
- package/src/lib/components/Stage/components/FogOfWarLayer/types.ts +0 -116
- package/src/lib/components/Stage/components/GridLayer/GridLayer.svelte +0 -20
- package/src/lib/components/Stage/components/GridLayer/GridMaterial.svelte +0 -69
- package/src/lib/components/Stage/components/GridLayer/types.ts +0 -79
- package/src/lib/components/Stage/components/LayerInput/LayerInput.svelte +0 -300
- package/src/lib/components/Stage/components/MapLayer/MapLayer.svelte +0 -196
- package/src/lib/components/Stage/components/MapLayer/dataSources/GifDataSource.ts +0 -265
- package/src/lib/components/Stage/components/MapLayer/dataSources/IMapDataSource.ts +0 -55
- package/src/lib/components/Stage/components/MapLayer/dataSources/ImageDataSource.ts +0 -87
- package/src/lib/components/Stage/components/MapLayer/dataSources/VideoDataSource.ts +0 -150
- package/src/lib/components/Stage/components/MapLayer/dataSources/dataSourceFactory.ts +0 -48
- package/src/lib/components/Stage/components/MapLayer/dataSources/index.ts +0 -16
- package/src/lib/components/Stage/components/MapLayer/types.ts +0 -58
- package/src/lib/components/Stage/components/MarkerLayer/MarkerLayer.svelte +0 -398
- package/src/lib/components/Stage/components/MarkerLayer/MarkerToken.svelte +0 -262
- package/src/lib/components/Stage/components/MarkerLayer/types.ts +0 -126
- package/src/lib/components/Stage/components/MeasurementLayer/MeasurementLayer.svelte +0 -364
- package/src/lib/components/Stage/components/MeasurementLayer/MeasurementManager.svelte +0 -473
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/BaseMeasurement.ts +0 -427
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/BeamMeasurement.ts +0 -105
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/CircleMeasurement.ts +0 -98
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/ConeMeasurement.ts +0 -163
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/LineMeasurement.ts +0 -102
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/RectangleMeasurement.ts +0 -120
- package/src/lib/components/Stage/components/MeasurementLayer/measurements/index.ts +0 -7
- package/src/lib/components/Stage/components/MeasurementLayer/types.ts +0 -94
- package/src/lib/components/Stage/components/MeasurementLayer/utils/canvasDrawing.ts +0 -357
- package/src/lib/components/Stage/components/MeasurementLayer/utils/distanceCalculations.ts +0 -170
- package/src/lib/components/Stage/components/ParticleSystem/ParticleSystem.svelte +0 -220
- package/src/lib/components/Stage/components/ParticleSystem/particles/atlases/ash.png +0 -0
- package/src/lib/components/Stage/components/ParticleSystem/particles/atlases/leaves.png +0 -0
- package/src/lib/components/Stage/components/ParticleSystem/particles/atlases/rain.png +0 -0
- package/src/lib/components/Stage/components/ParticleSystem/particles/atlases/snow.png +0 -0
- package/src/lib/components/Stage/components/ParticleSystem/rng.js +0 -20
- package/src/lib/components/Stage/components/ParticleSystem/types.ts +0 -95
- package/src/lib/components/Stage/components/PerformanceDebugger/PerformanceDebugger.svelte +0 -144
- package/src/lib/components/Stage/components/PerformanceDebugger/index.ts +0 -1
- package/src/lib/components/Stage/components/PerformanceOverlay/PerformanceOverlay.svelte +0 -208
- package/src/lib/components/Stage/components/PerformanceOverlay/index.ts +0 -1
- package/src/lib/components/Stage/components/PointerInputManager/PointerInputManager.svelte +0 -201
- package/src/lib/components/Stage/components/Scene/Scene.svelte +0 -651
- package/src/lib/components/Stage/components/Scene/luts.ts +0 -24
- package/src/lib/components/Stage/components/Scene/types.ts +0 -225
- package/src/lib/components/Stage/components/Stage/Stage.svelte +0 -332
- package/src/lib/components/Stage/components/Stage/types.ts +0 -136
- package/src/lib/components/Stage/components/WeatherLayer/WeatherLayer.svelte +0 -135
- package/src/lib/components/Stage/components/WeatherLayer/presets/AshPreset.ts +0 -71
- package/src/lib/components/Stage/components/WeatherLayer/presets/LeavesPreset.ts +0 -70
- package/src/lib/components/Stage/components/WeatherLayer/presets/RainPreset.ts +0 -68
- package/src/lib/components/Stage/components/WeatherLayer/presets/SnowPreset.ts +0 -70
- package/src/lib/components/Stage/components/WeatherLayer/presets/index.ts +0 -6
- package/src/lib/components/Stage/components/WeatherLayer/types.ts +0 -35
- package/src/lib/components/Stage/helpers/clippingPlaneStore.svelte.ts +0 -28
- package/src/lib/components/Stage/helpers/debugState.svelte.ts +0 -18
- package/src/lib/components/Stage/helpers/grid.ts +0 -548
- package/src/lib/components/Stage/helpers/lazyBrush.ts +0 -171
- package/src/lib/components/Stage/helpers/performanceMetrics.svelte.ts +0 -220
- package/src/lib/components/Stage/helpers/utils.ts +0 -21
- package/src/lib/components/Stage/index.ts +0 -49
- package/src/lib/components/Stage/shaders/AnnotationEffects.frag +0 -1070
- package/src/lib/components/Stage/shaders/Annotations.frag +0 -29
- package/src/lib/components/Stage/shaders/Drawing.frag +0 -83
- package/src/lib/components/Stage/shaders/Drawing.vert +0 -5
- package/src/lib/components/Stage/shaders/Fog.frag +0 -147
- package/src/lib/components/Stage/shaders/FractalNoise.frag +0 -96
- package/src/lib/components/Stage/shaders/GridShader.frag +0 -174
- package/src/lib/components/Stage/shaders/Overlay.frag +0 -23
- package/src/lib/components/Stage/shaders/Overlay.vert +0 -0
- package/src/lib/components/Stage/shaders/Particles.frag +0 -27
- package/src/lib/components/Stage/shaders/Particles.vert +0 -51
- package/src/lib/components/Stage/shaders/ToolOutline.frag +0 -59
- package/src/lib/components/Stage/shaders/default.vert +0 -8
- package/src/lib/components/Stage/types.ts +0 -4
- package/src/lib/components/Table/Table.svelte +0 -16
- package/src/lib/components/Table/Td.svelte +0 -17
- package/src/lib/components/Table/Th.svelte +0 -18
- package/src/lib/components/Table/index.ts +0 -4
- package/src/lib/components/Table/types.ts +0 -14
- package/src/lib/components/Text/Text.svelte +0 -23
- package/src/lib/components/Text/index.ts +0 -2
- package/src/lib/components/Text/types.ts +0 -12
- package/src/lib/components/Title/Title.svelte +0 -54
- package/src/lib/components/Title/index.ts +0 -2
- package/src/lib/components/Title/types.ts +0 -9
- package/src/lib/components/Toast/Toast.svelte +0 -155
- package/src/lib/components/Toast/index.ts +0 -5
- package/src/lib/components/Toast/toastCookie.ts +0 -24
- package/src/lib/components/Toast/types.ts +0 -6
- package/src/lib/components/ToolTip/ToolTip.svelte +0 -70
- package/src/lib/components/ToolTip/index.ts +0 -2
- package/src/lib/components/ToolTip/types.ts +0 -14
- package/src/lib/components/index.ts +0 -32
- package/src/lib/components/types.ts +0 -0
- package/src/lib/index.ts +0 -2
- package/src/lib/styles/globals.css +0 -108
- package/src/lib/styles/normalize.css +0 -9
- package/src/lib/styles/reset.css +0 -133
- package/src/lib/styles/utilities.css +0 -179
- package/src/lib/styles/vars.css +0 -1103
- package/src/lib/types/awareness.ts +0 -17
- package/src/lib/utils/rle.ts +0 -217
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
precision highp float;
|
|
2
|
-
|
|
3
|
-
uniform vec2 uStart;
|
|
4
|
-
uniform vec2 uEnd;
|
|
5
|
-
uniform float uBrushSize;
|
|
6
|
-
uniform vec2 uTextureSize;
|
|
7
|
-
uniform int uShapeType;
|
|
8
|
-
uniform vec3 uOutlineColor;
|
|
9
|
-
uniform float uOutlineThickness;
|
|
10
|
-
uniform float uOutlineOpacity;
|
|
11
|
-
|
|
12
|
-
varying vec2 vUv;
|
|
13
|
-
|
|
14
|
-
// Re-use the distance functions from Drawing.frag
|
|
15
|
-
float isInsideEllipse(vec2 p, vec2 a, vec2 b) {
|
|
16
|
-
vec2 center = (a + b) / 2.0;
|
|
17
|
-
vec2 radii = abs(b - a) / 2.0;
|
|
18
|
-
vec2 p0 = p - center;
|
|
19
|
-
float value = (p0.x * p0.x) / (radii.x * radii.x) + (p0.y * p0.y) / (radii.y * radii.y);
|
|
20
|
-
vec2 scaledP = vec2(p0.x / radii.x, p0.y / radii.y);
|
|
21
|
-
float dist = (length(scaledP) - 1.0) * min(radii.x, radii.y);
|
|
22
|
-
return dist;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
float distanceToRectangle(vec2 p, vec2 a, vec2 b) {
|
|
26
|
-
vec2 rectMin = vec2(min(a.x, b.x), min(a.y, b.y));
|
|
27
|
-
vec2 rectMax = vec2(max(a.x, b.x), max(a.y, b.y));
|
|
28
|
-
vec2 closest = vec2(clamp(p.x, rectMin.x, rectMax.x), clamp(p.y, rectMin.y, rectMax.y));
|
|
29
|
-
return length(p - closest);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
float distanceToLine(vec2 p, vec2 a, vec2 b) {
|
|
33
|
-
vec2 pa = p - a;
|
|
34
|
-
vec2 ba = b - a;
|
|
35
|
-
float t = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0);
|
|
36
|
-
return length(pa - ba * t);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
void main() {
|
|
40
|
-
vec2 pixelPos = vUv * uTextureSize;
|
|
41
|
-
float dist;
|
|
42
|
-
float outlineWidth = uOutlineThickness;
|
|
43
|
-
|
|
44
|
-
if(uShapeType == 1) { // Brush
|
|
45
|
-
dist = distanceToLine(pixelPos, uStart, uEnd);
|
|
46
|
-
float inner = smoothstep(uBrushSize - outlineWidth, uBrushSize, dist);
|
|
47
|
-
float outer = smoothstep(uBrushSize, uBrushSize + outlineWidth, dist);
|
|
48
|
-
float outline = inner - outer;
|
|
49
|
-
gl_FragColor = vec4(uOutlineColor, outline * uOutlineOpacity);
|
|
50
|
-
} else if(uShapeType == 2) { // Rectangle
|
|
51
|
-
dist = distanceToRectangle(pixelPos, uStart, uEnd);
|
|
52
|
-
float outline = smoothstep(0.0, outlineWidth, dist) - smoothstep(outlineWidth, outlineWidth * 2.0, dist);
|
|
53
|
-
gl_FragColor = vec4(uOutlineColor, outline * uOutlineOpacity);
|
|
54
|
-
} else if(uShapeType == 3) { // Ellipse
|
|
55
|
-
dist = isInsideEllipse(pixelPos, uStart, uEnd);
|
|
56
|
-
float outline = smoothstep(0.0, outlineWidth, dist) - smoothstep(outlineWidth, outlineWidth * 2.0, dist);
|
|
57
|
-
gl_FragColor = vec4(uOutlineColor, outline * uOutlineOpacity);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TableProps } from './types';
|
|
3
|
-
let { children, ...restProps }: TableProps = $props();
|
|
4
|
-
let tableClasses = $derived(['table', restProps.class ?? '']);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<table {...restProps} class={tableClasses}>
|
|
8
|
-
{@render children()}
|
|
9
|
-
</table>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
.table {
|
|
13
|
-
width: 100%;
|
|
14
|
-
border-collapse: collapse;
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TdProps } from './types';
|
|
3
|
-
let { children, ...restProps }: TdProps = $props();
|
|
4
|
-
let tdClasses = $derived(['td', restProps.class ?? '']);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<td {...restProps} class={tdClasses}>
|
|
8
|
-
{@render children()}
|
|
9
|
-
</td>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
.td {
|
|
13
|
-
text-align: left;
|
|
14
|
-
padding: var(--size-1) var(--size-3);
|
|
15
|
-
border-bottom: var(--borderThin);
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { ThProps } from './types';
|
|
3
|
-
let { children, ...restProps }: ThProps = $props();
|
|
4
|
-
let thClasses = $derived(['th', restProps.class ?? '']);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<th {...restProps} class={thClasses}>
|
|
8
|
-
{@render children()}
|
|
9
|
-
</th>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
.th {
|
|
13
|
-
text-align: left;
|
|
14
|
-
font-weight: var(--font-weight-6);
|
|
15
|
-
padding: var(--size-1) var(--size-3);
|
|
16
|
-
border-bottom: var(--borderThin);
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLTableAttributes, HTMLThAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
export type TableProps = {
|
|
5
|
-
children: Snippet;
|
|
6
|
-
} & HTMLTableAttributes;
|
|
7
|
-
|
|
8
|
-
export type ThProps = {
|
|
9
|
-
children: Snippet;
|
|
10
|
-
} & HTMLThAttributes;
|
|
11
|
-
|
|
12
|
-
export type TdProps = {
|
|
13
|
-
children: Snippet;
|
|
14
|
-
} & HTMLThAttributes;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TextProps } from './types';
|
|
3
|
-
let { children, as = 'p', size = '1rem', color = 'var(--fg)', weight = 400, ...restProps }: TextProps = $props();
|
|
4
|
-
let titleClasses = $derived(['text', restProps.class ?? '']);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<svelte:element
|
|
8
|
-
this={as}
|
|
9
|
-
{...restProps}
|
|
10
|
-
class={titleClasses}
|
|
11
|
-
style="--textFontWeight: {weight}; --textColor: {color}; --textSize: {size}"
|
|
12
|
-
>
|
|
13
|
-
{@render children()}
|
|
14
|
-
</svelte:element>
|
|
15
|
-
|
|
16
|
-
<style>
|
|
17
|
-
.text {
|
|
18
|
-
line-height: 1.5;
|
|
19
|
-
font-size: var(--textSize);
|
|
20
|
-
color: var(--textColor);
|
|
21
|
-
font-weight: var(--textFontWeight);
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
export type TextProps = {
|
|
5
|
-
children: Snippet;
|
|
6
|
-
as?: 'p' | 'span';
|
|
7
|
-
size?: string;
|
|
8
|
-
weight?: number;
|
|
9
|
-
color?: string;
|
|
10
|
-
style?: string;
|
|
11
|
-
pretty?: boolean;
|
|
12
|
-
} & HTMLAttributes<HTMLHeadingElement>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { TitleProps } from './types';
|
|
3
|
-
let { children, as = 'p', size, style, ...restProps }: TitleProps = $props();
|
|
4
|
-
let titleClasses = $derived(['title', `title-${size}`, restProps.class ?? '']);
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<svelte:element this={as} {...restProps} class={titleClasses} {style}>
|
|
8
|
-
{@render children()}
|
|
9
|
-
</svelte:element>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
.title {
|
|
13
|
-
font-family: var(--font-serif);
|
|
14
|
-
font-variation-settings:
|
|
15
|
-
'wght' 600,
|
|
16
|
-
'TAIL' 100,
|
|
17
|
-
'ROUN' 50;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.title-xs {
|
|
21
|
-
font-size: 1.25rem;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.title-sm {
|
|
25
|
-
font-size: 1.5rem;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.title-md {
|
|
29
|
-
font-size: 2.5rem;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.title-lg {
|
|
33
|
-
font-size: 3rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.title-xl {
|
|
37
|
-
font-size: 4.5rem;
|
|
38
|
-
font-feature-settings: 'ss03' 1;
|
|
39
|
-
}
|
|
40
|
-
@media (max-width: 768px) {
|
|
41
|
-
.title-lg {
|
|
42
|
-
font-size: 1.25rem;
|
|
43
|
-
}
|
|
44
|
-
.title-md {
|
|
45
|
-
font-size: 1.25rem;
|
|
46
|
-
}
|
|
47
|
-
.title-sm {
|
|
48
|
-
font-size: 1.25rem;
|
|
49
|
-
}
|
|
50
|
-
.title-xl {
|
|
51
|
-
font-size: 1.25rem;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
|
|
4
|
-
export type TitleProps = {
|
|
5
|
-
children: Snippet;
|
|
6
|
-
as: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';
|
|
7
|
-
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
-
style?: string;
|
|
9
|
-
} & HTMLAttributes<HTMLHeadingElement>;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { ToastDataProps } from './types';
|
|
3
|
-
import { flip } from 'svelte/animate';
|
|
4
|
-
import { fly } from 'svelte/transition';
|
|
5
|
-
import { IconX } from '@tabler/icons-svelte';
|
|
6
|
-
import { Icon, Loader } from '../';
|
|
7
|
-
import { page } from '$app/state';
|
|
8
|
-
const {
|
|
9
|
-
elements: { content, title, description, close },
|
|
10
|
-
helpers,
|
|
11
|
-
states: { toasts },
|
|
12
|
-
actions: { portal }
|
|
13
|
-
} = createToaster<ToastDataProps>({ hover: 'pause-all' });
|
|
14
|
-
|
|
15
|
-
let isHovered = $state(false);
|
|
16
|
-
let leaveTimeout: ReturnType<typeof setTimeout>;
|
|
17
|
-
|
|
18
|
-
const handleMouseEnter = () => {
|
|
19
|
-
if (leaveTimeout) {
|
|
20
|
-
clearTimeout(leaveTimeout);
|
|
21
|
-
}
|
|
22
|
-
isHovered = true;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const handleMouseLeave = () => {
|
|
26
|
-
leaveTimeout = setTimeout(() => {
|
|
27
|
-
isHovered = false;
|
|
28
|
-
}, 1000);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const addToast = helpers.addToast;
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<script lang="ts">
|
|
35
|
-
import { checkToastCookie } from './toastCookie';
|
|
36
|
-
$effect(() => {
|
|
37
|
-
if (page.url) {
|
|
38
|
-
checkToastCookie();
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
import { createToaster, melt } from '@melt-ui/svelte';
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<div
|
|
45
|
-
use:portal
|
|
46
|
-
role="alert"
|
|
47
|
-
class={['toasts', isHovered && 'toasts--isHovered']}
|
|
48
|
-
onmouseenter={handleMouseEnter}
|
|
49
|
-
onmouseleave={handleMouseLeave}
|
|
50
|
-
>
|
|
51
|
-
{#each $toasts as { id, data }, index (id)}
|
|
52
|
-
<div
|
|
53
|
-
use:melt={$content(id)}
|
|
54
|
-
animate:flip={{ duration: 500 }}
|
|
55
|
-
in:fly={{ duration: 150, y: '100%' }}
|
|
56
|
-
out:fly={{ duration: 150, y: '100%' }}
|
|
57
|
-
data-testid="toast"
|
|
58
|
-
class="toast"
|
|
59
|
-
style="z-index: index; visibility: {index > $toasts.length - 6 || isHovered
|
|
60
|
-
? 'visible'
|
|
61
|
-
: 'hidden'} ; transform: {index === $toasts.length - 1 || isHovered
|
|
62
|
-
? 'scale(1) translateY(0)'
|
|
63
|
-
: `scale(${1 - 0.05 * ($toasts.length - 1 - index)}) translateY(${-12 * ($toasts.length - 1 - index)}px)`};"
|
|
64
|
-
>
|
|
65
|
-
<div>
|
|
66
|
-
<div class="toast__title">
|
|
67
|
-
<p use:melt={$title(id)} class="toast__titleText">
|
|
68
|
-
{data.title}
|
|
69
|
-
</p>
|
|
70
|
-
{#if data.type === 'loading'}
|
|
71
|
-
<Loader />
|
|
72
|
-
{:else}
|
|
73
|
-
<div class={['toast__titleDot', `toast__titleDot--${data.type}`]}></div>
|
|
74
|
-
{/if}
|
|
75
|
-
</div>
|
|
76
|
-
{#if data.body}
|
|
77
|
-
<div use:melt={$description(id)}>
|
|
78
|
-
{data.body}
|
|
79
|
-
</div>
|
|
80
|
-
{/if}
|
|
81
|
-
</div>
|
|
82
|
-
<button use:melt={$close(id)} aria-label="Close notification"><Icon Icon={IconX} /></button>
|
|
83
|
-
</div>
|
|
84
|
-
{/each}
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<style>
|
|
88
|
-
:global(.light) {
|
|
89
|
-
--toastDotSuccess: var(--green-200);
|
|
90
|
-
--toastDotDanger: var(--yellow-200);
|
|
91
|
-
}
|
|
92
|
-
:global(.dark) {
|
|
93
|
-
--toastDotSuccess: var(--green-600);
|
|
94
|
-
--toastDotDanger: var(--yellow-600);
|
|
95
|
-
}
|
|
96
|
-
.toasts {
|
|
97
|
-
display: flex;
|
|
98
|
-
flex-direction: column;
|
|
99
|
-
gap: var(--size-2); /* Reduced gap to allow overlapping look */
|
|
100
|
-
width: 300px;
|
|
101
|
-
position: fixed;
|
|
102
|
-
right: var(--size-8);
|
|
103
|
-
bottom: var(--size-8);
|
|
104
|
-
z-index: 2;
|
|
105
|
-
}
|
|
106
|
-
.toast {
|
|
107
|
-
position: fixed;
|
|
108
|
-
right: var(--size-8);
|
|
109
|
-
bottom: var(--size-8);
|
|
110
|
-
display: flex;
|
|
111
|
-
justify-content: space-between;
|
|
112
|
-
align-items: start;
|
|
113
|
-
background: var(--fg);
|
|
114
|
-
color: var(--bg);
|
|
115
|
-
gap: var(--size-2);
|
|
116
|
-
width: 300px;
|
|
117
|
-
padding: var(--size-2);
|
|
118
|
-
border-radius: var(--radius-2);
|
|
119
|
-
box-shadow: var(--shadow-2);
|
|
120
|
-
border: 1px solid var(--bg);
|
|
121
|
-
transition:
|
|
122
|
-
transform 0.3s ease-in-out,
|
|
123
|
-
opacity 0.3s ease-in-out;
|
|
124
|
-
}
|
|
125
|
-
.toast__title {
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: start;
|
|
128
|
-
gap: var(--size-2);
|
|
129
|
-
}
|
|
130
|
-
.toast__titleText {
|
|
131
|
-
font-weight: var(--font-weight-6);
|
|
132
|
-
}
|
|
133
|
-
.toasts.toasts--isHovered .toast {
|
|
134
|
-
position: static;
|
|
135
|
-
transition: none;
|
|
136
|
-
}
|
|
137
|
-
.toast__titleDot {
|
|
138
|
-
width: var(--size-2);
|
|
139
|
-
height: var(--size-2);
|
|
140
|
-
min-width: var(--size-2);
|
|
141
|
-
min-height: var(--size-2);
|
|
142
|
-
margin-top: var(--size-1);
|
|
143
|
-
border-radius: 50%;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.toast__titleDot--info {
|
|
147
|
-
background: var(--contrastHigh);
|
|
148
|
-
}
|
|
149
|
-
.toast__titleDot--success {
|
|
150
|
-
background: var(--toastDotSuccess);
|
|
151
|
-
}
|
|
152
|
-
.toast__titleDot--danger {
|
|
153
|
-
background: var(--toastDotDanger);
|
|
154
|
-
}
|
|
155
|
-
</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { RequestEvent } from '@sveltejs/kit';
|
|
2
|
-
import { addToast } from '../';
|
|
3
|
-
|
|
4
|
-
export const setToastCookie = (
|
|
5
|
-
event: RequestEvent,
|
|
6
|
-
{ title, type, body }: { title: string; type: string; body?: string }
|
|
7
|
-
) => {
|
|
8
|
-
event.cookies.set('toast', JSON.stringify({ title, type, body }), {
|
|
9
|
-
path: '/',
|
|
10
|
-
httpOnly: false,
|
|
11
|
-
sameSite: 'lax',
|
|
12
|
-
maxAge: 5
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const checkToastCookie = () => {
|
|
17
|
-
const toastCookie = document.cookie.split('; ').find((row) => row.startsWith('toast='));
|
|
18
|
-
|
|
19
|
-
if (toastCookie) {
|
|
20
|
-
const toastData = JSON.parse(decodeURIComponent(toastCookie.split('=')[1]));
|
|
21
|
-
addToast({ data: { title: toastData.title, type: toastData.type } });
|
|
22
|
-
document.cookie = 'toast=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT';
|
|
23
|
-
}
|
|
24
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { createTooltip, melt } from '@melt-ui/svelte';
|
|
3
|
-
import { fade } from 'svelte/transition';
|
|
4
|
-
import type { ToolTipProps } from './types';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
children,
|
|
8
|
-
positioning = { placement: 'top' },
|
|
9
|
-
defaultOpen = false,
|
|
10
|
-
openDelay = 0,
|
|
11
|
-
closeDelay = 0,
|
|
12
|
-
closeOnPointerDown = false,
|
|
13
|
-
forceVisible = true,
|
|
14
|
-
disableHoverableContent = false,
|
|
15
|
-
toolTipContent
|
|
16
|
-
}: ToolTipProps = $props();
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
elements: { trigger, content, arrow },
|
|
20
|
-
states: { open }
|
|
21
|
-
} = createTooltip({
|
|
22
|
-
disableHoverableContent,
|
|
23
|
-
positioning,
|
|
24
|
-
defaultOpen,
|
|
25
|
-
openDelay,
|
|
26
|
-
closeDelay,
|
|
27
|
-
closeOnPointerDown,
|
|
28
|
-
forceVisible
|
|
29
|
-
});
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<div class="trigger" use:melt={$trigger}>
|
|
33
|
-
{@render children()}
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
{#if $open}
|
|
37
|
-
<div use:melt={$content} transition:fade={{ duration: 100 }} class="tooltip">
|
|
38
|
-
<div use:melt={$arrow}></div>
|
|
39
|
-
{@render toolTipContent()}
|
|
40
|
-
</div>
|
|
41
|
-
{/if}
|
|
42
|
-
|
|
43
|
-
<style>
|
|
44
|
-
:global(.dark) {
|
|
45
|
-
color-scheme: dark;
|
|
46
|
-
--tooltip-bg: var(--fg);
|
|
47
|
-
--tooltip-color: var(--bg);
|
|
48
|
-
}
|
|
49
|
-
:global(.light) {
|
|
50
|
-
color-scheme: light;
|
|
51
|
-
--tooltip-bg: var(--fg);
|
|
52
|
-
--tooltip-color: var(--bg);
|
|
53
|
-
}
|
|
54
|
-
.tooltip {
|
|
55
|
-
padding: var(--size-1) var(--size-2);
|
|
56
|
-
background: var(--tooltip-bg);
|
|
57
|
-
color: var(--tooltip-color);
|
|
58
|
-
border-radius: var(--radius-1);
|
|
59
|
-
box-shadow: var(--shadow-1);
|
|
60
|
-
z-index: 1000;
|
|
61
|
-
text-align: center;
|
|
62
|
-
text-wrap: balance;
|
|
63
|
-
}
|
|
64
|
-
.trigger {
|
|
65
|
-
max-width: 100px;
|
|
66
|
-
display: block;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
export type ToolTipProps = {
|
|
3
|
-
children: Snippet;
|
|
4
|
-
positioning?: {
|
|
5
|
-
placement: 'top' | 'right' | 'bottom' | 'left';
|
|
6
|
-
};
|
|
7
|
-
defaultOpen?: boolean;
|
|
8
|
-
openDelay?: number;
|
|
9
|
-
closeDelay?: number;
|
|
10
|
-
closeOnPointerDown?: boolean;
|
|
11
|
-
forceVisible?: boolean;
|
|
12
|
-
disableHoverableContent?: boolean;
|
|
13
|
-
toolTipContent: Snippet;
|
|
14
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export * from './Avatar';
|
|
2
|
-
export * from './BrushSizeSlider';
|
|
3
|
-
export * from './Button';
|
|
4
|
-
export * from './CardFan';
|
|
5
|
-
export * from './CodeBlock';
|
|
6
|
-
export * from './ColorMode';
|
|
7
|
-
export * from './ColorPicker';
|
|
8
|
-
export * from './ContextMenu';
|
|
9
|
-
export * from './DrawingSliders';
|
|
10
|
-
export * from './Editor';
|
|
11
|
-
export * from './FogSliders';
|
|
12
|
-
export * from './Hr';
|
|
13
|
-
export * from './Icon';
|
|
14
|
-
export * from './Input';
|
|
15
|
-
export * from './Link';
|
|
16
|
-
export * from './Loading';
|
|
17
|
-
export * from './Logo';
|
|
18
|
-
export * from './Menu';
|
|
19
|
-
export { default as MyCounterButton } from './MyCounterButton.svelte';
|
|
20
|
-
export * from './Panel';
|
|
21
|
-
export * from './PersistButton';
|
|
22
|
-
export * from './Popover';
|
|
23
|
-
export { default as PropsTable } from './PropsTable/PropsTable.svelte';
|
|
24
|
-
export * from './RadialMenu';
|
|
25
|
-
export * from './Select';
|
|
26
|
-
export * from './Spacer';
|
|
27
|
-
export * from './Stage';
|
|
28
|
-
export * from './Table';
|
|
29
|
-
export * from './Text';
|
|
30
|
-
export * from './Title';
|
|
31
|
-
export * from './Toast';
|
|
32
|
-
export * from './ToolTip';
|
|
File without changes
|
package/src/lib/index.ts
DELETED