fluid-ui-svelte 0.2.4 → 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/LICENSE +22 -0
- package/README.md +16 -5
- package/dist/base/Button.svelte +35 -0
- package/dist/base/Button.svelte.d.ts +14 -0
- package/dist/base/Container.svelte +34 -0
- package/dist/base/Container.svelte.d.ts +14 -0
- package/dist/base/Image.svelte +21 -0
- package/dist/base/Image.svelte.d.ts +8 -0
- package/dist/base/InputField.svelte +33 -0
- package/dist/base/InputField.svelte.d.ts +10 -0
- package/dist/base/Link.svelte +23 -0
- package/dist/base/Link.svelte.d.ts +10 -0
- package/dist/base/List.svelte +39 -0
- package/dist/base/List.svelte.d.ts +33 -0
- package/dist/base/Table.svelte +80 -0
- package/dist/base/Table.svelte.d.ts +42 -0
- package/dist/base/Text.svelte +45 -0
- package/dist/base/Text.svelte.d.ts +11 -0
- package/dist/base/index.d.ts +8 -0
- package/dist/base/index.js +8 -0
- package/dist/components/Accordion.svelte +45 -1
- package/dist/components/Accordion.svelte.d.ts +14 -25
- package/dist/components/Calendar.svelte +63 -0
- package/dist/components/Calendar.svelte.d.ts +9 -25
- package/dist/components/{Badge.svelte.d.ts → Carousel.svelte.d.ts} +3 -3
- package/dist/components/CodeBlock.svelte +27 -0
- package/dist/components/CodeBlock.svelte.d.ts +8 -0
- package/dist/components/ImageCrop.svelte +65 -0
- package/dist/components/ImageCrop.svelte.d.ts +7 -0
- package/dist/components/Page.svelte +26 -0
- package/dist/components/Page.svelte.d.ts +11 -0
- package/dist/components/Switch.svelte +22 -20
- package/dist/components/Switch.svelte.d.ts +9 -4
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +6 -0
- package/dist/index.d.ts +2 -33
- package/dist/index.js +2 -36
- package/dist/utilities/applyCharacterFilter.d.ts +1 -0
- package/dist/utilities/applyCharacterFilter.js +6 -0
- package/dist/utilities/calendar.d.ts +10 -0
- package/dist/utilities/calendar.js +112 -0
- package/dist/utilities/imageCrop.d.ts +33 -0
- package/dist/utilities/imageCrop.js +217 -0
- package/dist/utilities/mergeClasses.d.ts +1 -0
- package/dist/utilities/mergeClasses.js +3 -0
- package/package.json +50 -33
- package/dist/community/components/index.d.ts +0 -1
- package/dist/community/components/index.js +0 -1
- package/dist/community/prebuilt/index.d.ts +0 -1
- package/dist/community/prebuilt/index.js +0 -1
- package/dist/components/Breadcrumb.svelte +0 -1
- package/dist/components/Breadcrumb.svelte.d.ts +0 -26
- package/dist/components/Drawer.svelte +0 -33
- package/dist/components/Drawer.svelte.d.ts +0 -9
- package/dist/components/Dropdown.svelte +0 -59
- package/dist/components/Dropdown.svelte.d.ts +0 -20
- package/dist/components/Dropzone.svelte +0 -1
- package/dist/components/Dropzone.svelte.d.ts +0 -26
- package/dist/components/InteractiveScrollArea.svelte +0 -1
- package/dist/components/InteractiveScrollArea.svelte.d.ts +0 -26
- package/dist/components/Pagination.svelte +0 -1
- package/dist/components/Pagination.svelte.d.ts +0 -26
- package/dist/components/Progress.svelte +0 -1
- package/dist/components/Progress.svelte.d.ts +0 -26
- package/dist/components/Tabs.svelte +0 -1
- package/dist/components/Tabs.svelte.d.ts +0 -26
- package/dist/components/Tooltip.svelte +0 -1
- package/dist/components/Tooltip.svelte.d.ts +0 -26
- package/dist/components/charts/BatteryChart.svelte +0 -0
- package/dist/components/charts/BatteryChart.svelte.d.ts +0 -26
- package/dist/components/charts/LineChart.svelte +0 -0
- package/dist/components/charts/LineChart.svelte.d.ts +0 -26
- package/dist/components/charts/PieChart.svelte +0 -0
- package/dist/components/charts/PieChart.svelte.d.ts +0 -26
- package/dist/components/notification/NotificationArea.svelte +0 -21
- package/dist/components/notification/NotificationArea.svelte.d.ts +0 -7
- package/dist/prebuilt/FormBuilder.svelte +0 -1
- package/dist/prebuilt/FormBuilder.svelte.d.ts +0 -26
- package/dist/prebuilt/document/Document.svelte +0 -1
- package/dist/prebuilt/document/Document.svelte.d.ts +0 -26
- package/dist/prebuilt/document/DocumentBlock.svelte +0 -1
- package/dist/prebuilt/document/DocumentBlock.svelte.d.ts +0 -26
- package/dist/prebuilt/document/DocumentPage.svelte +0 -1
- package/dist/prebuilt/document/DocumentPage.svelte.d.ts +0 -26
- package/dist/prebuilt/timeline/Timeline.svelte +0 -0
- package/dist/prebuilt/timeline/Timeline.svelte.d.ts +0 -26
- package/dist/prebuilt/timeline/TimelineItem.svelte +0 -0
- package/dist/prebuilt/timeline/TimelineItem.svelte.d.ts +0 -26
- package/dist/primitives/Button.svelte +0 -53
- package/dist/primitives/Button.svelte.d.ts +0 -13
- package/dist/primitives/Container.svelte +0 -51
- package/dist/primitives/Container.svelte.d.ts +0 -10
- package/dist/primitives/Dialog.svelte +0 -39
- package/dist/primitives/Dialog.svelte.d.ts +0 -10
- package/dist/primitives/Divider.svelte +0 -14
- package/dist/primitives/Divider.svelte.d.ts +0 -6
- package/dist/primitives/Form.svelte +0 -18
- package/dist/primitives/Form.svelte.d.ts +0 -8
- package/dist/primitives/Image.svelte +0 -57
- package/dist/primitives/Image.svelte.d.ts +0 -12
- package/dist/primitives/Input.svelte +0 -23
- package/dist/primitives/Input.svelte.d.ts +0 -9
- package/dist/primitives/Label.svelte +0 -18
- package/dist/primitives/Label.svelte.d.ts +0 -8
- package/dist/primitives/Link.svelte +0 -18
- package/dist/primitives/Link.svelte.d.ts +0 -8
- package/dist/primitives/Table.svelte +0 -18
- package/dist/primitives/Table.svelte.d.ts +0 -8
- package/dist/primitives/TableBody.svelte +0 -17
- package/dist/primitives/TableBody.svelte.d.ts +0 -7
- package/dist/primitives/TableData.svelte +0 -18
- package/dist/primitives/TableData.svelte.d.ts +0 -8
- package/dist/primitives/TableFooter.svelte +0 -17
- package/dist/primitives/TableFooter.svelte.d.ts +0 -7
- package/dist/primitives/TableHead.svelte +0 -18
- package/dist/primitives/TableHead.svelte.d.ts +0 -8
- package/dist/primitives/TableHeader.svelte +0 -17
- package/dist/primitives/TableHeader.svelte.d.ts +0 -7
- package/dist/primitives/TableRow.svelte +0 -18
- package/dist/primitives/TableRow.svelte.d.ts +0 -8
- package/dist/primitives/Text.svelte +0 -46
- package/dist/primitives/Text.svelte.d.ts +0 -8
- package/dist/primitives/TextArea.svelte +0 -15
- package/dist/primitives/TextArea.svelte.d.ts +0 -7
- package/dist/types.d.ts +0 -4
- package/dist/types.js +0 -1
- /package/dist/components/{Badge.svelte → Carousel.svelte} +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
export function generateCropAreaState(shape = 'rectangle', aspectRatio = { w: 1, h: 1 }) {
|
|
2
|
+
return {
|
|
3
|
+
cropArea: { x: 0, y: 0, width: 0, height: 0 },
|
|
4
|
+
shape,
|
|
5
|
+
aspectRatio,
|
|
6
|
+
activeAction: 'idle',
|
|
7
|
+
lastMousePosition: { x: 0, y: 0 }
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function draw(canvasElement, image, cropAreaState) {
|
|
11
|
+
if (!image || !canvasElement)
|
|
12
|
+
return;
|
|
13
|
+
const context = canvasElement.getContext('2d');
|
|
14
|
+
// 1. Draw the base image
|
|
15
|
+
context.drawImage(image, 0, 0);
|
|
16
|
+
// 2. Draw the semi-transparent mask
|
|
17
|
+
context.fillStyle = 'rgba(0, 0, 0, 0.2)';
|
|
18
|
+
context.fillRect(0, 0, canvasElement.width, canvasElement.height);
|
|
19
|
+
// 3. Cut a "hole" for the crop area
|
|
20
|
+
drawCropArea(context, cropAreaState);
|
|
21
|
+
// 4. Draw the resize handles
|
|
22
|
+
drawHandles(context, cropAreaState);
|
|
23
|
+
}
|
|
24
|
+
function drawCropArea(context, cropAreaState) {
|
|
25
|
+
context.save(); // Save the current state
|
|
26
|
+
context.globalCompositeOperation = 'destination-out';
|
|
27
|
+
if (cropAreaState.shape === 'circle') {
|
|
28
|
+
const { x, y, width, height } = cropAreaState.cropArea;
|
|
29
|
+
// Use the smaller dimension so the circle always fits inside the bounding box
|
|
30
|
+
const radius = Math.min(width, height) / 2;
|
|
31
|
+
const centerX = x + width / 2;
|
|
32
|
+
const centerY = y + height / 2;
|
|
33
|
+
context.beginPath();
|
|
34
|
+
context.arc(centerX, centerY, radius, 0, Math.PI * 2);
|
|
35
|
+
context.fill();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// Default to square/rectangle
|
|
39
|
+
context.fillRect(cropAreaState.cropArea.x, cropAreaState.cropArea.y, cropAreaState.cropArea.width, cropAreaState.cropArea.height);
|
|
40
|
+
}
|
|
41
|
+
context.restore(); // Restore to the previous state (resets globalCompositeOperation)
|
|
42
|
+
}
|
|
43
|
+
const HANDLE_SIZE = 24;
|
|
44
|
+
function getHandles(cropAreaState) {
|
|
45
|
+
const { x, y, width, height } = cropAreaState.cropArea;
|
|
46
|
+
// If the crop shape is a circle, place handles around the actual circle (inscribed),
|
|
47
|
+
// with a small padding so they sit slightly outside the circle's edge.
|
|
48
|
+
if (cropAreaState.shape === 'circle') {
|
|
49
|
+
const centerX = x + width / 2;
|
|
50
|
+
const centerY = y + height / 2;
|
|
51
|
+
const radius = Math.min(width, height) / 2;
|
|
52
|
+
const padding = radius * 0.05; // 5% padding
|
|
53
|
+
const r = radius + padding;
|
|
54
|
+
const diagOffset = r / Math.sqrt(2); // 45° corner offset
|
|
55
|
+
return [
|
|
56
|
+
// corners (45° around circle)
|
|
57
|
+
{ x: centerX - diagOffset, y: centerY - diagOffset, name: 'tl' },
|
|
58
|
+
{ x: centerX + diagOffset, y: centerY - diagOffset, name: 'tr' },
|
|
59
|
+
{ x: centerX + diagOffset, y: centerY + diagOffset, name: 'br' },
|
|
60
|
+
{ x: centerX - diagOffset, y: centerY + diagOffset, name: 'bl' },
|
|
61
|
+
// sides (cardinal points on circle)
|
|
62
|
+
{ x: centerX, y: centerY - r, name: 't' },
|
|
63
|
+
{ x: centerX + r, y: centerY, name: 'r' },
|
|
64
|
+
{ x: centerX, y: centerY + r, name: 'b' },
|
|
65
|
+
{ x: centerX - r, y: centerY, name: 'l' }
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
// Default rectangle handles (unchanged)
|
|
69
|
+
return [
|
|
70
|
+
// corners
|
|
71
|
+
{ x: x, y: y, name: 'tl' }, // top-left
|
|
72
|
+
{ x: x + width, y: y, name: 'tr' }, // top-right
|
|
73
|
+
{ x: x + width, y: y + height, name: 'br' }, // bottom-right
|
|
74
|
+
{ x: x, y: y + height, name: 'bl' }, // bottom-left
|
|
75
|
+
// sides
|
|
76
|
+
{ x: x + width / 2, y: y, name: 't' }, // top
|
|
77
|
+
{ x: x + width, y: y + height / 2, name: 'r' }, // right
|
|
78
|
+
{ x: x + width / 2, y: y + height, name: 'b' }, // bottom
|
|
79
|
+
{ x: x, y: y + height / 2, name: 'l' } // left
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
function drawHandles(context, cropAreaState) {
|
|
83
|
+
context.fillStyle = 'white';
|
|
84
|
+
const handles = getHandles(cropAreaState);
|
|
85
|
+
for (const handle of handles) {
|
|
86
|
+
context.fillRect(handle.x - HANDLE_SIZE / 2, handle.y - HANDLE_SIZE / 2, HANDLE_SIZE, HANDLE_SIZE);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Map a PointerEvent/MouseEvent to canvas coordinate space (accounts for CSS scaling).
|
|
91
|
+
*/
|
|
92
|
+
function getCanvasCoords(event, canvas) {
|
|
93
|
+
// Use client coordinates and canvas bounding box to map to drawing buffer pixels
|
|
94
|
+
const rect = canvas.getBoundingClientRect();
|
|
95
|
+
const clientX = event.clientX ?? event.clientX;
|
|
96
|
+
const clientY = event.clientY ?? event.clientY;
|
|
97
|
+
const scaleX = canvas.width / rect.width;
|
|
98
|
+
const scaleY = canvas.height / rect.height;
|
|
99
|
+
return {
|
|
100
|
+
x: (clientX - rect.left) * scaleX,
|
|
101
|
+
y: (clientY - rect.top) * scaleY
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function clampCropToCanvas(cropArea, canvas, shape = 'rectangle', minSize = 20) {
|
|
105
|
+
// Ensure positive sizes
|
|
106
|
+
cropArea.width = Math.max(minSize, cropArea.width);
|
|
107
|
+
cropArea.height = Math.max(minSize, cropArea.height);
|
|
108
|
+
if (shape === 'circle') {
|
|
109
|
+
// Force a square bounding box that stays centered on the current center.
|
|
110
|
+
const centerX = cropArea.x + cropArea.width / 2;
|
|
111
|
+
const centerY = cropArea.y + cropArea.height / 2;
|
|
112
|
+
const size = Math.max(minSize, Math.min(cropArea.width, cropArea.height));
|
|
113
|
+
cropArea.width = size;
|
|
114
|
+
cropArea.height = size;
|
|
115
|
+
cropArea.x = centerX - size / 2;
|
|
116
|
+
cropArea.y = centerY - size / 2;
|
|
117
|
+
}
|
|
118
|
+
// Keep position inside canvas
|
|
119
|
+
cropArea.x = Math.max(0, Math.min(cropArea.x, canvas.width - cropArea.width));
|
|
120
|
+
cropArea.y = Math.max(0, Math.min(cropArea.y, canvas.height - cropArea.height));
|
|
121
|
+
}
|
|
122
|
+
export function handleMouseDown(event, cropAreaState, canvasElement) {
|
|
123
|
+
if (!canvasElement)
|
|
124
|
+
return;
|
|
125
|
+
const { x: offsetX, y: offsetY } = getCanvasCoords(event, canvasElement);
|
|
126
|
+
const handles = getHandles(cropAreaState);
|
|
127
|
+
// Check if a handle was clicked (handles are in canvas coordinates)
|
|
128
|
+
for (const handle of handles) {
|
|
129
|
+
const handleX = handle.x - HANDLE_SIZE / 2;
|
|
130
|
+
const handleY = handle.y - HANDLE_SIZE / 2;
|
|
131
|
+
if (offsetX >= handleX &&
|
|
132
|
+
offsetX <= handleX + HANDLE_SIZE &&
|
|
133
|
+
offsetY >= handleY &&
|
|
134
|
+
offsetY <= handleY + HANDLE_SIZE) {
|
|
135
|
+
cropAreaState.activeAction = `resizing-${handle.name}`;
|
|
136
|
+
cropAreaState.lastMousePosition = { x: offsetX, y: offsetY };
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// If no handle was clicked, check if the main rectangle was clicked
|
|
141
|
+
const { x, y, width, height } = cropAreaState.cropArea;
|
|
142
|
+
if (offsetX >= x && offsetX <= x + width && offsetY >= y && offsetY <= y + height) {
|
|
143
|
+
cropAreaState.activeAction = 'moving';
|
|
144
|
+
cropAreaState.lastMousePosition = { x: offsetX, y: offsetY };
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export function handleMouseMove(event, cropAreaState, canvasElement) {
|
|
149
|
+
if (cropAreaState.activeAction === 'idle')
|
|
150
|
+
return;
|
|
151
|
+
if (!canvasElement)
|
|
152
|
+
return;
|
|
153
|
+
const { x: offsetX, y: offsetY } = getCanvasCoords(event, canvasElement);
|
|
154
|
+
const deltaX = offsetX - cropAreaState.lastMousePosition.x;
|
|
155
|
+
const deltaY = offsetY - cropAreaState.lastMousePosition.y;
|
|
156
|
+
const { cropArea } = cropAreaState;
|
|
157
|
+
if (cropAreaState.activeAction === 'moving') {
|
|
158
|
+
cropArea.x += deltaX;
|
|
159
|
+
cropArea.y += deltaY;
|
|
160
|
+
}
|
|
161
|
+
else if (cropAreaState.activeAction.startsWith('resizing-')) {
|
|
162
|
+
const handleName = cropAreaState.activeAction.split('-')[1];
|
|
163
|
+
if (handleName.includes('r'))
|
|
164
|
+
cropArea.width += deltaX;
|
|
165
|
+
if (handleName.includes('l')) {
|
|
166
|
+
cropArea.x += deltaX;
|
|
167
|
+
cropArea.width -= deltaX;
|
|
168
|
+
}
|
|
169
|
+
if (handleName.includes('b'))
|
|
170
|
+
cropArea.height += deltaY;
|
|
171
|
+
if (handleName.includes('t')) {
|
|
172
|
+
cropArea.y += deltaY;
|
|
173
|
+
cropArea.height -= deltaY;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Prevent negative/too-small sizes and keep crop within canvas
|
|
177
|
+
// pass the current shape so a circle forces a square bounding box
|
|
178
|
+
clampCropToCanvas(cropArea, canvasElement, cropAreaState.shape, 20);
|
|
179
|
+
cropAreaState.lastMousePosition = { x: offsetX, y: offsetY };
|
|
180
|
+
}
|
|
181
|
+
export function handleMouseUp(cropAreaState) {
|
|
182
|
+
cropAreaState.activeAction = 'idle';
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Export the currently selected crop as a PNG Blob.
|
|
186
|
+
* - If shape === 'rectangle' exports the rectangular region.
|
|
187
|
+
* - If shape === 'circle' exports a square canvas with a circular alpha mask (transparent outside circle).
|
|
188
|
+
*
|
|
189
|
+
* Returns Promise<Blob | null>.
|
|
190
|
+
*/
|
|
191
|
+
export async function exportSelectionAsPNG(canvasElement, image, cropAreaState) {
|
|
192
|
+
if (!canvasElement || !image)
|
|
193
|
+
return null;
|
|
194
|
+
const { x, y, width, height } = cropAreaState.cropArea;
|
|
195
|
+
if (width <= 0 || height <= 0)
|
|
196
|
+
return null;
|
|
197
|
+
// Create an offscreen canvas sized to the crop bounding box (square for circle)
|
|
198
|
+
const outCanvas = document.createElement('canvas');
|
|
199
|
+
outCanvas.width = Math.round(width);
|
|
200
|
+
outCanvas.height = Math.round(height);
|
|
201
|
+
const ctx = outCanvas.getContext('2d');
|
|
202
|
+
if (!ctx)
|
|
203
|
+
return null;
|
|
204
|
+
// Draw the corresponding portion of the source image
|
|
205
|
+
// coords are in canvas/image pixel space because the component sets canvas size to image.naturalWidth/Height
|
|
206
|
+
ctx.drawImage(image, x, y, width, height, 0, 0, outCanvas.width, outCanvas.height);
|
|
207
|
+
if (cropAreaState.shape === 'circle') {
|
|
208
|
+
// Mask to a circle (destination-in keeps the circular area)
|
|
209
|
+
ctx.globalCompositeOperation = 'destination-in';
|
|
210
|
+
ctx.beginPath();
|
|
211
|
+
const r = Math.min(outCanvas.width, outCanvas.height) / 2;
|
|
212
|
+
ctx.arc(outCanvas.width / 2, outCanvas.height / 2, r, 0, Math.PI * 2);
|
|
213
|
+
ctx.fill();
|
|
214
|
+
}
|
|
215
|
+
// Return a PNG Blob
|
|
216
|
+
return await new Promise((resolve) => outCanvas.toBlob((b) => resolve(b), 'image/png'));
|
|
217
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergeClasses(classA: string, classB: string): string;
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-ui-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Emre Ayaz",
|
|
6
|
-
"email": "
|
|
7
|
-
"url": "https://emreayaz.com"
|
|
6
|
+
"email": "ayazthemre@gmail.com"
|
|
8
7
|
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"homepage": "https://github.com/ayazemre/fluid-ui-svelte",
|
|
9
10
|
"repository": {
|
|
10
|
-
"url": "https://github.com/ayazemre/fluid-ui"
|
|
11
|
+
"url": "git+https://github.com/ayazemre/fluid-ui-svelte.git"
|
|
11
12
|
},
|
|
12
13
|
"scripts": {
|
|
13
14
|
"dev": "vite dev",
|
|
14
|
-
"build": "vite build && npm run
|
|
15
|
+
"build": "vite build && npm run prepack",
|
|
15
16
|
"preview": "vite preview",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
17
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
18
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
18
19
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
19
20
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
20
21
|
"format": "prettier --write .",
|
|
21
22
|
"lint": "prettier --check . && eslint .",
|
|
22
23
|
"test:unit": "vitest",
|
|
23
|
-
"test": "npm run test:unit -- --run
|
|
24
|
-
"test:e2e": "playwright test"
|
|
24
|
+
"test": "npm run test:unit -- --run"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
@@ -38,34 +38,51 @@
|
|
|
38
38
|
".": {
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
40
|
"svelte": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./base": {
|
|
43
|
+
"types": "./dist/base/index.d.ts",
|
|
44
|
+
"svelte": "./dist/base/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./components": {
|
|
47
|
+
"types": "./dist/components/index.d.ts",
|
|
48
|
+
"svelte": "./dist/components/index.js"
|
|
41
49
|
}
|
|
42
50
|
},
|
|
43
51
|
"peerDependencies": {
|
|
44
52
|
"svelte": "^5.0.0"
|
|
45
53
|
},
|
|
46
54
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@sveltejs/
|
|
51
|
-
"@sveltejs/
|
|
52
|
-
"@
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"svelte
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
55
|
+
"@eslint/compat": "^1.4.0",
|
|
56
|
+
"@eslint/js": "^9.38.0",
|
|
57
|
+
"@iconify/svelte": "^5.1.0",
|
|
58
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
59
|
+
"@sveltejs/adapter-node": "^5.4.0",
|
|
60
|
+
"@sveltejs/kit": "^2.47.1",
|
|
61
|
+
"@sveltejs/package": "^2.5.4",
|
|
62
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
63
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
64
|
+
"@types/node": "^22",
|
|
65
|
+
"@vitest/browser": "^3.2.4",
|
|
66
|
+
"@vitest/ui": "^3.2.4",
|
|
67
|
+
"eslint": "^9.38.0",
|
|
68
|
+
"eslint-config-prettier": "^10.1.8",
|
|
69
|
+
"eslint-plugin-svelte": "^3.12.4",
|
|
70
|
+
"globals": "^16.4.0",
|
|
71
|
+
"playwright": "^1.56.1",
|
|
72
|
+
"prettier": "^3.6.2",
|
|
73
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
74
|
+
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
75
|
+
"publint": "^0.3.14",
|
|
76
|
+
"svelte": "^5.41.0",
|
|
77
|
+
"svelte-check": "^4.3.3",
|
|
78
|
+
"tailwindcss": "^4.1.14",
|
|
79
|
+
"typescript": "^5.9.3",
|
|
80
|
+
"typescript-eslint": "^8.46.1",
|
|
81
|
+
"vite": "^7.1.10",
|
|
82
|
+
"vitest": "^3.2.4",
|
|
83
|
+
"vitest-browser-svelte": "^1.1.0"
|
|
66
84
|
},
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
85
|
+
"keywords": [
|
|
86
|
+
"svelte"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Breadcrumb;
|
|
2
|
-
type Breadcrumb = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Breadcrumb: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
|
-
import Container from "../primitives/Container.svelte";
|
|
4
|
-
import Button from "../primitives/Button.svelte";
|
|
5
|
-
let {
|
|
6
|
-
class: className,
|
|
7
|
-
contentClass,
|
|
8
|
-
isOpen = $bindable(false),
|
|
9
|
-
children,
|
|
10
|
-
overrideDefaultStyling = false,
|
|
11
|
-
}: {
|
|
12
|
-
class?: string;
|
|
13
|
-
contentClass?: string;
|
|
14
|
-
isOpen?: boolean;
|
|
15
|
-
overrideDefaultStyling?: boolean;
|
|
16
|
-
children: Snippet;
|
|
17
|
-
} = $props();
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<Container overrideDefaultStyling={true} class={overrideDefaultStyling ? "" + (className ? className : "") : "fluid-drawer" + (className ? ` ${className}` : "")}>
|
|
21
|
-
<Container class={overrideDefaultStyling ? "" + (contentClass ? `${contentClass}` : "") : "fluid-drawer-body" + (contentClass ? ` ${contentClass}` : "")}>
|
|
22
|
-
{@render children()}
|
|
23
|
-
</Container>
|
|
24
|
-
<Button
|
|
25
|
-
overrideDefaultStyling
|
|
26
|
-
class="fluid-drawer-backdrop"
|
|
27
|
-
onclick={(e: Event) => {
|
|
28
|
-
isOpen = false;
|
|
29
|
-
}}
|
|
30
|
-
>
|
|
31
|
-
<Container></Container>
|
|
32
|
-
</Button>
|
|
33
|
-
</Container>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Container from "../primitives/Container.svelte";
|
|
3
|
-
import Button from "../primitives/Button.svelte";
|
|
4
|
-
import { onMount, type Snippet } from "svelte";
|
|
5
|
-
import type { DropdownOptions } from "../types.js";
|
|
6
|
-
let {
|
|
7
|
-
class: className,
|
|
8
|
-
triggerClass,
|
|
9
|
-
contentClass,
|
|
10
|
-
overrideDefaultStyling = false,
|
|
11
|
-
isOpen = $bindable(false),
|
|
12
|
-
shouldCloseOnClickOutside = true,
|
|
13
|
-
dropdownTrigger,
|
|
14
|
-
dropdownContent,
|
|
15
|
-
triggerRawElement,
|
|
16
|
-
contentRawElement,
|
|
17
|
-
}: {
|
|
18
|
-
class?: string;
|
|
19
|
-
triggerClass?: string;
|
|
20
|
-
contentClass?: string;
|
|
21
|
-
overrideDefaultStyling?: boolean;
|
|
22
|
-
isOpen?: boolean;
|
|
23
|
-
shouldCloseOnClickOutside?: boolean;
|
|
24
|
-
dropdownTrigger: Snippet<[options: { isOpen: boolean; toggleDropdown: Function }]>;
|
|
25
|
-
dropdownContent: Snippet<[options: { isOpen: boolean; toggleDropdown: Function }]>;
|
|
26
|
-
triggerRawElement?: HTMLElement;
|
|
27
|
-
contentRawElement?: HTMLElement;
|
|
28
|
-
} = $props();
|
|
29
|
-
|
|
30
|
-
const componentOptions: DropdownOptions = {
|
|
31
|
-
isOpen,
|
|
32
|
-
toggleDropdown: () => {
|
|
33
|
-
isOpen = !isOpen;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
onMount(() => {
|
|
38
|
-
if (shouldCloseOnClickOutside) {
|
|
39
|
-
document.addEventListener("click", (e) => {
|
|
40
|
-
if (isOpen && contentRawElement && triggerRawElement) {
|
|
41
|
-
if (!triggerRawElement!.contains(e.target as HTMLElement) && !contentRawElement!.contains(e.target as HTMLElement)) {
|
|
42
|
-
isOpen = false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<Container bind:rawElement={triggerRawElement} class={(overrideDefaultStyling ? "" : "fluid-dropdown") + (className ? ` ${className}` : "")} overrideDefaultStyling={true}>
|
|
51
|
-
<Container class={(overrideDefaultStyling ? "" : "fluid-dropdown-trigger") + (triggerClass ? ` ${triggerClass}` : "")} overrideDefaultStyling>
|
|
52
|
-
{@render dropdownTrigger(componentOptions)}
|
|
53
|
-
</Container>
|
|
54
|
-
<Container bind:rawElement={contentRawElement} overrideDefaultStyling class={(overrideDefaultStyling ? "" : "fluid-dropdown-content") + (contentClass ? ` ${contentClass}` : "")}>
|
|
55
|
-
{#if isOpen}
|
|
56
|
-
{@render dropdownContent(componentOptions)}
|
|
57
|
-
{/if}
|
|
58
|
-
</Container>
|
|
59
|
-
</Container>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Snippet } from "svelte";
|
|
2
|
-
declare const Dropdown: import("svelte").Component<{
|
|
3
|
-
class?: string;
|
|
4
|
-
triggerClass?: string;
|
|
5
|
-
contentClass?: string;
|
|
6
|
-
overrideDefaultStyling?: boolean;
|
|
7
|
-
isOpen?: boolean;
|
|
8
|
-
shouldCloseOnClickOutside?: boolean;
|
|
9
|
-
dropdownTrigger: Snippet<[options: {
|
|
10
|
-
isOpen: boolean;
|
|
11
|
-
toggleDropdown: Function;
|
|
12
|
-
}]>;
|
|
13
|
-
dropdownContent: Snippet<[options: {
|
|
14
|
-
isOpen: boolean;
|
|
15
|
-
toggleDropdown: Function;
|
|
16
|
-
}]>;
|
|
17
|
-
triggerRawElement?: HTMLElement;
|
|
18
|
-
contentRawElement?: HTMLElement;
|
|
19
|
-
}, {}, "isOpen">;
|
|
20
|
-
export default Dropdown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Dropzone;
|
|
2
|
-
type Dropzone = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Dropzone: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default InteractiveScrollArea;
|
|
2
|
-
type InteractiveScrollArea = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const InteractiveScrollArea: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Pagination;
|
|
2
|
-
type Pagination = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Pagination: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Progress;
|
|
2
|
-
type Progress = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Progress: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default Tabs;
|
|
2
|
-
type Tabs = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Tabs: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!-- TODO -->
|