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.
Files changed (127) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +16 -5
  3. package/dist/base/Button.svelte +35 -0
  4. package/dist/base/Button.svelte.d.ts +14 -0
  5. package/dist/base/Container.svelte +34 -0
  6. package/dist/base/Container.svelte.d.ts +14 -0
  7. package/dist/base/Image.svelte +21 -0
  8. package/dist/base/Image.svelte.d.ts +8 -0
  9. package/dist/base/InputField.svelte +33 -0
  10. package/dist/base/InputField.svelte.d.ts +10 -0
  11. package/dist/base/Link.svelte +23 -0
  12. package/dist/base/Link.svelte.d.ts +10 -0
  13. package/dist/base/List.svelte +39 -0
  14. package/dist/base/List.svelte.d.ts +33 -0
  15. package/dist/base/Table.svelte +80 -0
  16. package/dist/base/Table.svelte.d.ts +42 -0
  17. package/dist/base/Text.svelte +45 -0
  18. package/dist/base/Text.svelte.d.ts +11 -0
  19. package/dist/base/index.d.ts +8 -0
  20. package/dist/base/index.js +8 -0
  21. package/dist/components/Accordion.svelte +45 -1
  22. package/dist/components/Accordion.svelte.d.ts +14 -25
  23. package/dist/components/Calendar.svelte +63 -0
  24. package/dist/components/Calendar.svelte.d.ts +9 -25
  25. package/dist/components/{Badge.svelte.d.ts → Carousel.svelte.d.ts} +3 -3
  26. package/dist/components/CodeBlock.svelte +27 -0
  27. package/dist/components/CodeBlock.svelte.d.ts +8 -0
  28. package/dist/components/ImageCrop.svelte +65 -0
  29. package/dist/components/ImageCrop.svelte.d.ts +7 -0
  30. package/dist/components/Page.svelte +26 -0
  31. package/dist/components/Page.svelte.d.ts +11 -0
  32. package/dist/components/Switch.svelte +22 -20
  33. package/dist/components/Switch.svelte.d.ts +9 -4
  34. package/dist/components/index.d.ts +6 -0
  35. package/dist/components/index.js +6 -0
  36. package/dist/index.d.ts +2 -33
  37. package/dist/index.js +2 -36
  38. package/dist/utilities/applyCharacterFilter.d.ts +1 -0
  39. package/dist/utilities/applyCharacterFilter.js +6 -0
  40. package/dist/utilities/calendar.d.ts +10 -0
  41. package/dist/utilities/calendar.js +112 -0
  42. package/dist/utilities/imageCrop.d.ts +33 -0
  43. package/dist/utilities/imageCrop.js +217 -0
  44. package/dist/utilities/mergeClasses.d.ts +1 -0
  45. package/dist/utilities/mergeClasses.js +3 -0
  46. package/package.json +50 -33
  47. package/dist/community/components/index.d.ts +0 -1
  48. package/dist/community/components/index.js +0 -1
  49. package/dist/community/prebuilt/index.d.ts +0 -1
  50. package/dist/community/prebuilt/index.js +0 -1
  51. package/dist/components/Breadcrumb.svelte +0 -1
  52. package/dist/components/Breadcrumb.svelte.d.ts +0 -26
  53. package/dist/components/Drawer.svelte +0 -33
  54. package/dist/components/Drawer.svelte.d.ts +0 -9
  55. package/dist/components/Dropdown.svelte +0 -59
  56. package/dist/components/Dropdown.svelte.d.ts +0 -20
  57. package/dist/components/Dropzone.svelte +0 -1
  58. package/dist/components/Dropzone.svelte.d.ts +0 -26
  59. package/dist/components/InteractiveScrollArea.svelte +0 -1
  60. package/dist/components/InteractiveScrollArea.svelte.d.ts +0 -26
  61. package/dist/components/Pagination.svelte +0 -1
  62. package/dist/components/Pagination.svelte.d.ts +0 -26
  63. package/dist/components/Progress.svelte +0 -1
  64. package/dist/components/Progress.svelte.d.ts +0 -26
  65. package/dist/components/Tabs.svelte +0 -1
  66. package/dist/components/Tabs.svelte.d.ts +0 -26
  67. package/dist/components/Tooltip.svelte +0 -1
  68. package/dist/components/Tooltip.svelte.d.ts +0 -26
  69. package/dist/components/charts/BatteryChart.svelte +0 -0
  70. package/dist/components/charts/BatteryChart.svelte.d.ts +0 -26
  71. package/dist/components/charts/LineChart.svelte +0 -0
  72. package/dist/components/charts/LineChart.svelte.d.ts +0 -26
  73. package/dist/components/charts/PieChart.svelte +0 -0
  74. package/dist/components/charts/PieChart.svelte.d.ts +0 -26
  75. package/dist/components/notification/NotificationArea.svelte +0 -21
  76. package/dist/components/notification/NotificationArea.svelte.d.ts +0 -7
  77. package/dist/prebuilt/FormBuilder.svelte +0 -1
  78. package/dist/prebuilt/FormBuilder.svelte.d.ts +0 -26
  79. package/dist/prebuilt/document/Document.svelte +0 -1
  80. package/dist/prebuilt/document/Document.svelte.d.ts +0 -26
  81. package/dist/prebuilt/document/DocumentBlock.svelte +0 -1
  82. package/dist/prebuilt/document/DocumentBlock.svelte.d.ts +0 -26
  83. package/dist/prebuilt/document/DocumentPage.svelte +0 -1
  84. package/dist/prebuilt/document/DocumentPage.svelte.d.ts +0 -26
  85. package/dist/prebuilt/timeline/Timeline.svelte +0 -0
  86. package/dist/prebuilt/timeline/Timeline.svelte.d.ts +0 -26
  87. package/dist/prebuilt/timeline/TimelineItem.svelte +0 -0
  88. package/dist/prebuilt/timeline/TimelineItem.svelte.d.ts +0 -26
  89. package/dist/primitives/Button.svelte +0 -53
  90. package/dist/primitives/Button.svelte.d.ts +0 -13
  91. package/dist/primitives/Container.svelte +0 -51
  92. package/dist/primitives/Container.svelte.d.ts +0 -10
  93. package/dist/primitives/Dialog.svelte +0 -39
  94. package/dist/primitives/Dialog.svelte.d.ts +0 -10
  95. package/dist/primitives/Divider.svelte +0 -14
  96. package/dist/primitives/Divider.svelte.d.ts +0 -6
  97. package/dist/primitives/Form.svelte +0 -18
  98. package/dist/primitives/Form.svelte.d.ts +0 -8
  99. package/dist/primitives/Image.svelte +0 -57
  100. package/dist/primitives/Image.svelte.d.ts +0 -12
  101. package/dist/primitives/Input.svelte +0 -23
  102. package/dist/primitives/Input.svelte.d.ts +0 -9
  103. package/dist/primitives/Label.svelte +0 -18
  104. package/dist/primitives/Label.svelte.d.ts +0 -8
  105. package/dist/primitives/Link.svelte +0 -18
  106. package/dist/primitives/Link.svelte.d.ts +0 -8
  107. package/dist/primitives/Table.svelte +0 -18
  108. package/dist/primitives/Table.svelte.d.ts +0 -8
  109. package/dist/primitives/TableBody.svelte +0 -17
  110. package/dist/primitives/TableBody.svelte.d.ts +0 -7
  111. package/dist/primitives/TableData.svelte +0 -18
  112. package/dist/primitives/TableData.svelte.d.ts +0 -8
  113. package/dist/primitives/TableFooter.svelte +0 -17
  114. package/dist/primitives/TableFooter.svelte.d.ts +0 -7
  115. package/dist/primitives/TableHead.svelte +0 -18
  116. package/dist/primitives/TableHead.svelte.d.ts +0 -8
  117. package/dist/primitives/TableHeader.svelte +0 -17
  118. package/dist/primitives/TableHeader.svelte.d.ts +0 -7
  119. package/dist/primitives/TableRow.svelte +0 -18
  120. package/dist/primitives/TableRow.svelte.d.ts +0 -8
  121. package/dist/primitives/Text.svelte +0 -46
  122. package/dist/primitives/Text.svelte.d.ts +0 -8
  123. package/dist/primitives/TextArea.svelte +0 -15
  124. package/dist/primitives/TextArea.svelte.d.ts +0 -7
  125. package/dist/types.d.ts +0 -4
  126. package/dist/types.js +0 -1
  127. /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;
@@ -0,0 +1,3 @@
1
+ export function mergeClasses(classA, classB) {
2
+ return [...new Set([...classA.split(' '), ...classB.split(' ')])].join(' ').trim();
3
+ }
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "fluid-ui-svelte",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "author": {
5
5
  "name": "Emre Ayaz",
6
- "email": "emreayaz@frostium.io",
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 package",
15
+ "build": "vite build && npm run prepack",
15
16
  "preview": "vite preview",
16
- "package": "svelte-kit sync && svelte-package && publint",
17
- "prepublishOnly": "npm run package",
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 && npm run test:e2e",
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
- "@playwright/test": "^1.45.3",
48
- "@sveltejs/adapter-auto": "^3.0.0",
49
- "@sveltejs/kit": "^2.0.0",
50
- "@sveltejs/package": "^2.0.0",
51
- "@sveltejs/vite-plugin-svelte": "^4.0.0",
52
- "@types/eslint": "^9.6.0",
53
- "eslint": "^9.7.0",
54
- "eslint-config-prettier": "^9.1.0",
55
- "eslint-plugin-svelte": "^2.36.0",
56
- "globals": "^15.0.0",
57
- "prettier": "^3.3.2",
58
- "prettier-plugin-svelte": "^3.2.6",
59
- "publint": "^0.2.0",
60
- "svelte": "^5.0.0",
61
- "svelte-check": "^4.0.0",
62
- "typescript": "^5.0.0",
63
- "typescript-eslint": "^8.0.0",
64
- "vite": "^5.0.11",
65
- "vitest": "^2.0.4"
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
- "dependencies": {
68
- "@tailwindcss/vite": "^4.0.0-alpha.31",
69
- "tailwindcss": "^4.0.0-alpha.31"
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,9 +0,0 @@
1
- import type { Snippet } from "svelte";
2
- declare const Drawer: import("svelte").Component<{
3
- class?: string;
4
- contentClass?: string;
5
- isOpen?: boolean;
6
- overrideDefaultStyling?: boolean;
7
- children: Snippet;
8
- }, {}, "isOpen">;
9
- export default Drawer;
@@ -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 -->