lutra 0.0.19 → 0.0.33

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 (192) hide show
  1. package/dist/color.css +0 -0
  2. package/dist/display/Avatar.svelte +1 -1
  3. package/dist/display/Avatar.svelte.d.ts +18 -22
  4. package/dist/display/Badge.svelte +2 -4
  5. package/dist/display/Badge.svelte.d.ts +28 -32
  6. package/dist/display/Callout.svelte +8 -8
  7. package/dist/display/Callout.svelte.d.ts +27 -35
  8. package/dist/display/Close.svelte.d.ts +17 -20
  9. package/dist/display/Code.svelte +26 -31
  10. package/dist/display/Code.svelte.d.ts +31 -30
  11. package/dist/display/ContextTip.svelte +2 -5
  12. package/dist/display/ContextTip.svelte.d.ts +16 -20
  13. package/dist/display/DataList.svelte +16 -0
  14. package/dist/display/DataList.svelte.d.ts +21 -0
  15. package/dist/display/Details.svelte.d.ts +25 -30
  16. package/dist/display/Hero.svelte.d.ts +24 -28
  17. package/dist/display/Icon.svelte +3 -4
  18. package/dist/display/Icon.svelte.d.ts +18 -23
  19. package/dist/display/IconButton.svelte +12 -5
  20. package/dist/display/IconButton.svelte.d.ts +26 -29
  21. package/dist/display/Image.svelte.d.ts +25 -36
  22. package/dist/display/Indicator.svelte.d.ts +21 -22
  23. package/dist/display/Inset.svelte.d.ts +16 -20
  24. package/dist/display/LineChart.svelte +385 -0
  25. package/dist/display/LineChart.svelte.d.ts +24 -0
  26. package/dist/display/LoadingIndicator.svelte +33 -0
  27. package/dist/display/LoadingIndicator.svelte.d.ts +15 -0
  28. package/dist/display/Modal.svelte +116 -0
  29. package/dist/display/Modal.svelte.d.ts +27 -0
  30. package/dist/display/Notification.svelte.d.ts +22 -41
  31. package/dist/display/Panel.svelte +23 -0
  32. package/dist/display/Panel.svelte.d.ts +19 -0
  33. package/dist/display/Popup.svelte.d.ts +23 -28
  34. package/dist/{data → display}/Stat.svelte +9 -17
  35. package/dist/display/Stat.svelte.d.ts +30 -0
  36. package/dist/display/Table.svelte +14 -10
  37. package/dist/display/Table.svelte.d.ts +22 -32
  38. package/dist/display/TablePaginator.svelte +51 -0
  39. package/dist/display/TablePaginator.svelte.d.ts +21 -0
  40. package/dist/display/Tag.svelte.d.ts +29 -32
  41. package/dist/display/Tooltip.svelte +5 -4
  42. package/dist/display/Tooltip.svelte.d.ts +21 -26
  43. package/dist/display/chart.d.ts +78 -0
  44. package/dist/display/chart.js +212 -0
  45. package/dist/display/index.d.ts +11 -1
  46. package/dist/display/index.js +11 -1
  47. package/dist/display/notifications.svelte.d.ts +3 -3
  48. package/dist/display/notifications.svelte.js +2 -2
  49. package/dist/form/Button.svelte +7 -2
  50. package/dist/form/Button.svelte.d.ts +25 -35
  51. package/dist/form/FieldActions.svelte +25 -3
  52. package/dist/form/FieldActions.svelte.d.ts +18 -22
  53. package/dist/form/FieldContainer.svelte +1 -1
  54. package/dist/form/FieldContainer.svelte.d.ts +17 -22
  55. package/dist/form/FieldContent.svelte +52 -33
  56. package/dist/form/FieldContent.svelte.d.ts +28 -56
  57. package/dist/form/FieldError.svelte.d.ts +17 -20
  58. package/dist/form/FieldSection.svelte.d.ts +18 -32
  59. package/dist/form/Fieldset.svelte.d.ts +29 -40
  60. package/dist/form/Form.svelte +55 -16
  61. package/dist/form/Form.svelte.d.ts +36 -31
  62. package/dist/form/ImageUpload.svelte +259 -0
  63. package/dist/form/ImageUpload.svelte.d.ts +31 -0
  64. package/dist/form/Input.svelte +192 -153
  65. package/dist/form/Input.svelte.d.ts +115 -140
  66. package/dist/form/InputLength.svelte.d.ts +19 -20
  67. package/dist/form/Label.svelte +21 -4
  68. package/dist/form/Label.svelte.d.ts +24 -30
  69. package/dist/form/LogoUpload.svelte +100 -0
  70. package/dist/form/LogoUpload.svelte.d.ts +29 -0
  71. package/dist/form/Select.svelte +84 -36
  72. package/dist/form/Select.svelte.d.ts +69 -96
  73. package/dist/form/Textarea.svelte +163 -0
  74. package/dist/form/Textarea.svelte.d.ts +108 -0
  75. package/dist/form/Toggle.svelte +2 -0
  76. package/dist/form/Toggle.svelte.d.ts +15 -0
  77. package/dist/form/client.svelte.d.ts +8 -9
  78. package/dist/form/client.svelte.js +18 -10
  79. package/dist/form/form.d.ts +6 -4
  80. package/dist/form/form.js +23 -9
  81. package/dist/form/index.d.ts +6 -3
  82. package/dist/form/index.js +6 -3
  83. package/dist/form/types.d.ts +11 -1
  84. package/dist/icons/IconAlert.svelte.d.ts +23 -0
  85. package/dist/icons/{Copy.svelte → IconCopy.svelte} +1 -1
  86. package/dist/icons/IconCopy.svelte.d.ts +23 -0
  87. package/dist/icons/IconDone.svelte.d.ts +23 -0
  88. package/dist/icons/IconError.svelte.d.ts +23 -0
  89. package/dist/icons/IconHelp.svelte.d.ts +23 -0
  90. package/dist/icons/IconHide.svelte.d.ts +23 -0
  91. package/dist/icons/IconInfo.svelte.d.ts +23 -0
  92. package/dist/icons/IconLink.svelte.d.ts +23 -0
  93. package/dist/icons/IconMenuBurger.svelte.d.ts +23 -0
  94. package/dist/icons/IconMenuDots.svelte.d.ts +23 -0
  95. package/dist/icons/IconSearch.svelte +3 -0
  96. package/dist/icons/IconSearch.svelte.d.ts +23 -0
  97. package/dist/icons/IconShow.svelte.d.ts +23 -0
  98. package/dist/icons/IconSuccess.svelte.d.ts +23 -0
  99. package/dist/icons/IconWarning.svelte.d.ts +23 -0
  100. package/dist/icons/index.d.ts +14 -11
  101. package/dist/icons/index.js +14 -11
  102. package/dist/layout/Layout.svelte +7 -5
  103. package/dist/layout/Layout.svelte.d.ts +19 -22
  104. package/dist/layout/LayoutFooter.svelte.d.ts +17 -18
  105. package/dist/layout/LayoutGrid.svelte.d.ts +25 -36
  106. package/dist/layout/LayoutHeader.svelte +3 -0
  107. package/dist/layout/LayoutHeader.svelte.d.ts +33 -38
  108. package/dist/layout/LayoutSideMenu.svelte +18 -17
  109. package/dist/layout/LayoutSideMenu.svelte.d.ts +18 -22
  110. package/dist/layout/Overlay.svelte.d.ts +22 -32
  111. package/dist/layout/OverlayContainer.svelte.d.ts +14 -15
  112. package/dist/layout/OverlayLayer.svelte +6 -11
  113. package/dist/layout/OverlayLayer.svelte.d.ts +17 -20
  114. package/dist/layout/PageContent.svelte +9 -24
  115. package/dist/layout/PageContent.svelte.d.ts +23 -26
  116. package/dist/layout/Theme.svelte +19 -4
  117. package/dist/layout/Theme.svelte.d.ts +17 -22
  118. package/dist/layout/UIContent.svelte.d.ts +16 -20
  119. package/dist/layout/index.d.ts +5 -1
  120. package/dist/layout/index.js +5 -1
  121. package/dist/layout/overlays.svelte.d.ts +2 -2
  122. package/dist/nav/Breadcrumb.svelte +1 -1
  123. package/dist/nav/Breadcrumb.svelte.d.ts +26 -31
  124. package/dist/nav/Menu.svelte +6 -13
  125. package/dist/nav/Menu.svelte.d.ts +25 -31
  126. package/dist/nav/MenuItem.svelte +15 -8
  127. package/dist/nav/MenuItem.svelte.d.ts +20 -24
  128. package/dist/nav/MenuTypes.d.ts +7 -7
  129. package/dist/nav/NavMenu.svelte +7 -9
  130. package/dist/nav/NavMenu.svelte.d.ts +17 -18
  131. package/dist/nav/TabbedContent.svelte +1 -1
  132. package/dist/nav/TabbedContent.svelte.d.ts +21 -22
  133. package/dist/nav/Tabs.svelte +53 -13
  134. package/dist/nav/Tabs.svelte.d.ts +24 -25
  135. package/dist/nav/index.d.ts +2 -1
  136. package/dist/nav/index.js +2 -1
  137. package/dist/style.css +176 -79
  138. package/dist/typo/Clamp.svelte.d.ts +22 -26
  139. package/dist/typo/H.svelte.d.ts +26 -30
  140. package/dist/typo/H1.svelte.d.ts +24 -28
  141. package/dist/typo/H2.svelte.d.ts +24 -28
  142. package/dist/typo/H3.svelte.d.ts +24 -28
  143. package/dist/typo/H4.svelte.d.ts +24 -28
  144. package/dist/typo/H5.svelte.d.ts +24 -28
  145. package/dist/typo/H6.svelte.d.ts +24 -28
  146. package/dist/typo/P.svelte.d.ts +24 -28
  147. package/dist/utils/StringOrComponent.svelte +14 -0
  148. package/dist/utils/StringOrComponent.svelte.d.ts +19 -0
  149. package/dist/utils/StringOrSnippet.svelte +11 -0
  150. package/dist/utils/StringOrSnippet.svelte.d.ts +19 -0
  151. package/dist/utils/color.d.ts +1 -1
  152. package/dist/utils/index.d.ts +2 -1
  153. package/dist/utils/index.js +2 -1
  154. package/dist/utils/isSnippet.d.ts +3 -5
  155. package/dist/utils/isSnippet.js +9 -4
  156. package/package.json +32 -25
  157. package/dist/data/Stat.svelte.d.ts +0 -39
  158. package/dist/data/index.d.ts +0 -1
  159. package/dist/data/index.js +0 -1
  160. package/dist/grid/Column.svelte +0 -11
  161. package/dist/grid/Column.svelte.d.ts +0 -22
  162. package/dist/grid/Grid.svelte +0 -19
  163. package/dist/grid/Grid.svelte.d.ts +0 -24
  164. package/dist/grid/Row.svelte +0 -44
  165. package/dist/grid/Row.svelte.d.ts +0 -24
  166. package/dist/icons/Alert.svelte.d.ts +0 -23
  167. package/dist/icons/Copy.svelte.d.ts +0 -23
  168. package/dist/icons/Done.svelte.d.ts +0 -23
  169. package/dist/icons/Error.svelte.d.ts +0 -23
  170. package/dist/icons/Help.svelte.d.ts +0 -23
  171. package/dist/icons/Hide.svelte.d.ts +0 -23
  172. package/dist/icons/Info.svelte.d.ts +0 -23
  173. package/dist/icons/Link.svelte.d.ts +0 -23
  174. package/dist/icons/MenuBurger.svelte.d.ts +0 -23
  175. package/dist/icons/MenuDots.svelte.d.ts +0 -23
  176. package/dist/icons/Show.svelte.d.ts +0 -23
  177. package/dist/icons/Success.svelte.d.ts +0 -23
  178. package/dist/icons/Warning.svelte.d.ts +0 -23
  179. package/dist/utils/StringOrComponentOrSnippet.svelte +0 -14
  180. package/dist/utils/StringOrComponentOrSnippet.svelte.d.ts +0 -24
  181. /package/dist/icons/{Alert.svelte → IconAlert.svelte} +0 -0
  182. /package/dist/icons/{Done.svelte → IconDone.svelte} +0 -0
  183. /package/dist/icons/{Error.svelte → IconError.svelte} +0 -0
  184. /package/dist/icons/{Help.svelte → IconHelp.svelte} +0 -0
  185. /package/dist/icons/{Hide.svelte → IconHide.svelte} +0 -0
  186. /package/dist/icons/{Info.svelte → IconInfo.svelte} +0 -0
  187. /package/dist/icons/{Link.svelte → IconLink.svelte} +0 -0
  188. /package/dist/icons/{MenuBurger.svelte → IconMenuBurger.svelte} +0 -0
  189. /package/dist/icons/{MenuDots.svelte → IconMenuDots.svelte} +0 -0
  190. /package/dist/icons/{Show.svelte → IconShow.svelte} +0 -0
  191. /package/dist/icons/{Success.svelte → IconSuccess.svelte} +0 -0
  192. /package/dist/icons/{Warning.svelte → IconWarning.svelte} +0 -0
@@ -0,0 +1,212 @@
1
+ export function scale(domain, range) {
2
+ const m = (range[1] - range[0]) / (domain[1] - domain[0]);
3
+ return (num) => range[0] + m * (num - domain[0]);
4
+ }
5
+ export function makeScale(numbers, itemsToReturn) {
6
+ const min = 0;
7
+ const max = Math.max(...numbers);
8
+ const interval = Math.ceil(max / itemsToReturn);
9
+ const getRoundedInterval = (value) => {
10
+ const power = Math.floor(Math.log10(value));
11
+ const factor = Math.pow(10, power);
12
+ if (value / factor <= 2) {
13
+ return 2 * factor;
14
+ }
15
+ else if (value / factor <= 5) {
16
+ return 5 * factor;
17
+ }
18
+ else {
19
+ return 10 * factor;
20
+ }
21
+ };
22
+ const roundedInterval = getRoundedInterval(interval);
23
+ const maxOutputValue = Math.ceil(max / roundedInterval) * roundedInterval;
24
+ const outputLength = maxOutputValue / roundedInterval + 1;
25
+ const output = new Array(outputLength)
26
+ .fill(0)
27
+ .map((_, index) => index * roundedInterval);
28
+ return output;
29
+ }
30
+ export function getShortKValue(num) {
31
+ if (num >= 1000000) {
32
+ const shortMValue = (num / 1000000).toFixed(1);
33
+ if (shortMValue.endsWith('.0')) {
34
+ return shortMValue.slice(0, -2) + 'M';
35
+ }
36
+ else {
37
+ return shortMValue + 'M';
38
+ }
39
+ }
40
+ else if (num >= 1000) {
41
+ const shortKValue = (num / 1000).toFixed(1);
42
+ if (shortKValue.endsWith('.0')) {
43
+ return shortKValue.slice(0, -2) + 'K';
44
+ }
45
+ else {
46
+ return shortKValue + 'K';
47
+ }
48
+ }
49
+ else {
50
+ return num.toString();
51
+ }
52
+ }
53
+ /**
54
+ * Interpolates a Catmull-Rom Spline through a series of x/y points
55
+ * Converts the CR Spline to Cubic Beziers for use with SVG items
56
+ *
57
+ * If 'alpha' is 0.5 then the 'Centripetal' variant is used
58
+ * If 'alpha' is 1 then the 'Chordal' variant is used
59
+ *
60
+ * @param {Array} data - Array of points, each point in object literal holding x/y values
61
+ * @return {String} d - SVG string with cubic bezier curves representing the Catmull-Rom Spline
62
+ */
63
+ export function catmullRomBase(data, alpha) {
64
+ if (alpha == 0 || alpha === undefined) {
65
+ throw new Error('Alpha value must be greater than 0');
66
+ }
67
+ else {
68
+ let pointsData = [];
69
+ var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;
70
+ var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;
71
+ var d = Math.round(data[0].x) + ',' + Math.round(data[0].y) + ' ';
72
+ var length = data.length;
73
+ for (var i = 0; i < length - 1; i++) {
74
+ p0 = i == 0 ? data[0] : data[i - 1];
75
+ p1 = data[i];
76
+ p2 = data[i + 1];
77
+ p3 = i + 2 < length ? data[i + 2] : p2;
78
+ d1 = Math.sqrt(Math.pow(p0.x - p1.x, 2) + Math.pow(p0.y - p1.y, 2));
79
+ d2 = Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
80
+ d3 = Math.sqrt(Math.pow(p2.x - p3.x, 2) + Math.pow(p2.y - p3.y, 2));
81
+ // Catmull-Rom to Cubic Bezier conversion matrix
82
+ // A = 2d1^2a + 3d1^a * d2^a + d3^2a
83
+ // B = 2d3^2a + 3d3^a * d2^a + d2^2a
84
+ // [ 0 1 0 0 ]
85
+ // [ -d2^2a /N A/N d1^2a /N 0 ]
86
+ // [ 0 d3^2a /M B/M -d2^2a /M ]
87
+ // [ 0 0 1 0 ]
88
+ d3powA = Math.pow(d3, alpha);
89
+ d3pow2A = Math.pow(d3, 2 * alpha);
90
+ d2powA = Math.pow(d2, alpha);
91
+ d2pow2A = Math.pow(d2, 2 * alpha);
92
+ d1powA = Math.pow(d1, alpha);
93
+ d1pow2A = Math.pow(d1, 2 * alpha);
94
+ A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;
95
+ B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;
96
+ N = 3 * d1powA * (d1powA + d2powA);
97
+ if (N > 0) {
98
+ N = 1 / N;
99
+ }
100
+ M = 3 * d3powA * (d3powA + d2powA);
101
+ if (M > 0) {
102
+ M = 1 / M;
103
+ }
104
+ bp1 = {
105
+ x: (-d2pow2A * p0.x + A * p1.x + d1pow2A * p2.x) * N,
106
+ y: (-d2pow2A * p0.y + A * p1.y + d1pow2A * p2.y) * N
107
+ };
108
+ bp2 = {
109
+ x: (d3pow2A * p1.x + B * p2.x - d2pow2A * p3.x) * M,
110
+ y: (d3pow2A * p1.y + B * p2.y - d2pow2A * p3.y) * M
111
+ };
112
+ if (bp1.x == 0 && bp1.y == 0) {
113
+ bp1 = p1;
114
+ }
115
+ if (bp2.x == 0 && bp2.y == 0) {
116
+ bp2 = p2;
117
+ }
118
+ //d += 'C' + bp1.x + ',' + bp1.y + ' ' + bp2.x + ',' + bp2.y + ' ' + p2.x + ',' + p2.y + ' ';
119
+ pointsData.push({
120
+ p1: p1,
121
+ p2: p2,
122
+ bp1: bp1,
123
+ bp2: bp2
124
+ });
125
+ }
126
+ return pointsData;
127
+ }
128
+ }
129
+ ;
130
+ /**
131
+ * Returns the SVG path for Catmull-Rom spline interpolation
132
+ */
133
+ export function catmullRomToSVG(pointsData, alpha, firstValue) {
134
+ //const pointsData = catmullRomBase(data, alpha);
135
+ if (!pointsData)
136
+ return false;
137
+ let d = Math.round(firstValue.x) + ',' + Math.round(firstValue.y) + ' ';
138
+ //let d = '';
139
+ pointsData.forEach(({ p1, p2, bp1, bp2 }) => {
140
+ d += 'C' + bp1.x + ',' + bp1.y + ' ' + bp2.x + ',' + bp2.y + ' ' + p2.x + ',' + p2.y + ' ';
141
+ });
142
+ return d;
143
+ }
144
+ /**
145
+ * Returns the Y coordinate for the given X value on the Catmull-Rom spline
146
+ */
147
+ export function catmullRomGetY(pointsData, alpha, xValue, yPadding) {
148
+ if (!pointsData)
149
+ return false;
150
+ // Find the minimum and maximum Y values
151
+ let minY = pointsData[0].p1.y;
152
+ let maxY = pointsData[0].p1.y;
153
+ for (const { p1, p2, bp1, bp2 } of pointsData) {
154
+ minY = Math.min(minY, p1.y, p2.y, bp1.y, bp2.y);
155
+ maxY = Math.max(maxY, p1.y, p2.y, bp1.y, bp2.y);
156
+ }
157
+ // Calculate the range and padding for Y values
158
+ const yRange = maxY - minY;
159
+ const yOffset = minY + yPadding * yRange / 2;
160
+ const yScale = 1 - yPadding;
161
+ let resultY;
162
+ for (let i = 0; i < pointsData.length; i++) {
163
+ const { p1, p2, bp1, bp2 } = pointsData[i];
164
+ // Scale Y coordinates of the points based on the yPadding
165
+ const scaledP1 = { ...p1, y: yOffset + (p1.y - minY) * yScale };
166
+ const scaledP2 = { ...p2, y: yOffset + (p2.y - minY) * yScale };
167
+ const scaledBp1 = { ...bp1, y: yOffset + (bp1.y - minY) * yScale };
168
+ const scaledBp2 = { ...bp2, y: yOffset + (bp2.y - minY) * yScale };
169
+ if (xValue >= p1.x && xValue <= p2.x) {
170
+ // Use the de Casteljau's algorithm to find the Y coordinate for the given X value
171
+ const t = (xValue - p1.x) / (p2.x - p1.x);
172
+ const q0 = lerp(scaledP1, scaledBp1, t);
173
+ const q1 = lerp(scaledBp1, scaledBp2, t);
174
+ const q2 = lerp(scaledBp2, scaledP2, t);
175
+ const r0 = lerp(q0, q1, t);
176
+ const r1 = lerp(q1, q2, t);
177
+ const resultPoint = lerp(r0, r1, t);
178
+ // Rescale the resulting Y coordinate back to its original range
179
+ resultY = minY + (resultPoint.y - yOffset) / yScale;
180
+ break;
181
+ }
182
+ }
183
+ return resultY;
184
+ }
185
+ /**
186
+ * Linear interpolation helper function
187
+ */
188
+ export function lerp(point1, point2, t) {
189
+ return {
190
+ x: point1.x + (point2.x - point1.x) * t,
191
+ y: point1.y + (point2.y - point1.y) * t,
192
+ };
193
+ }
194
+ export function getSVGSize(svg) {
195
+ const rect = svg.getBoundingClientRect();
196
+ const styles = window.getComputedStyle(svg);
197
+ const padding = {
198
+ left: parseFloat(styles.paddingLeft),
199
+ right: parseFloat(styles.paddingRight),
200
+ top: parseFloat(styles.paddingTop),
201
+ bottom: parseFloat(styles.paddingBottom),
202
+ };
203
+ const innerWidth = rect.width - padding.left - padding.right;
204
+ const innerHeight = rect.height - padding.top - padding.bottom;
205
+ return {
206
+ innerWidth: innerWidth,
207
+ innerHeight: innerHeight,
208
+ width: rect.width,
209
+ height: rect.height,
210
+ padding: padding,
211
+ };
212
+ }
@@ -1,14 +1,24 @@
1
1
  export { default as Avatar } from './Avatar.svelte';
2
2
  export { default as Badge } from './Badge.svelte';
3
3
  export { default as Callout } from './Callout.svelte';
4
+ export { default as Close } from './Close.svelte';
4
5
  export { default as Code } from './Code.svelte';
5
6
  export { default as ContextTip } from './ContextTip.svelte';
6
7
  export { default as Details } from './Details.svelte';
7
8
  export { default as Hero } from './Hero.svelte';
8
9
  export { default as Icon } from './Icon.svelte';
9
10
  export { default as IconButton } from './IconButton.svelte';
11
+ export { default as Image } from './Image.svelte';
10
12
  export { default as Indicator } from './Indicator.svelte';
13
+ export { default as Inset } from './Inset.svelte';
14
+ export { default as Notification } from './Notification.svelte';
11
15
  export { default as Popup } from './Popup.svelte';
12
- export { default as Tag } from './Tag.svelte';
16
+ export { default as Stat } from './Stat.svelte';
17
+ export { default as LineChart } from './LineChart.svelte';
18
+ export { default as LoadingIndicator } from './LoadingIndicator.svelte';
19
+ export { default as Modal } from './Modal.svelte';
13
20
  export { default as Table } from './Table.svelte';
21
+ export { default as Tag } from './Tag.svelte';
14
22
  export { default as Tooltip } from './Tooltip.svelte';
23
+ export * from './chart.js';
24
+ export * from './notifications.svelte.js';
@@ -1,14 +1,24 @@
1
1
  export { default as Avatar } from './Avatar.svelte';
2
2
  export { default as Badge } from './Badge.svelte';
3
3
  export { default as Callout } from './Callout.svelte';
4
+ export { default as Close } from './Close.svelte';
4
5
  export { default as Code } from './Code.svelte';
5
6
  export { default as ContextTip } from './ContextTip.svelte';
6
7
  export { default as Details } from './Details.svelte';
7
8
  export { default as Hero } from './Hero.svelte';
8
9
  export { default as Icon } from './Icon.svelte';
9
10
  export { default as IconButton } from './IconButton.svelte';
11
+ export { default as Image } from './Image.svelte';
10
12
  export { default as Indicator } from './Indicator.svelte';
13
+ export { default as Inset } from './Inset.svelte';
14
+ export { default as Notification } from './Notification.svelte';
11
15
  export { default as Popup } from './Popup.svelte';
12
- export { default as Tag } from './Tag.svelte';
16
+ export { default as Stat } from './Stat.svelte';
17
+ export { default as LineChart } from './LineChart.svelte';
18
+ export { default as LoadingIndicator } from './LoadingIndicator.svelte';
19
+ export { default as Modal } from './Modal.svelte';
13
20
  export { default as Table } from './Table.svelte';
21
+ export { default as Tag } from './Tag.svelte';
14
22
  export { default as Tooltip } from './Tooltip.svelte';
23
+ export * from './chart.js';
24
+ export * from './notifications.svelte.js';
@@ -1,11 +1,11 @@
1
1
  import { type OverlayPosition } from "../layout/overlays.svelte.js";
2
- import type { ComponentType, Snippet } from "svelte";
2
+ import type { Component, Snippet } from "svelte";
3
3
  /**
4
4
  * Add a notification to the screen.
5
5
  * @param {object} opts - The options for the notification.
6
6
  * @param {string} opts.content - The content of the notification.
7
7
  * @param {OverlayPosition} opts.position - The position of the notification.
8
- * @param {Snippet | ComponentType} opts.icon - The icon of the notification.
8
+ * @param {Snippet | Component} opts.icon - The icon of the notification.
9
9
  * @param {string} opts.title - The title of the notification.
10
10
  * @param {string} opts.stack - Group notifications together by named stacks.
11
11
  * @param {number} opts.autoClose - The time in milliseconds before the notification closes.
@@ -14,7 +14,7 @@ import type { ComponentType, Snippet } from "svelte";
14
14
  export declare function addNotification(opts: {
15
15
  content: string;
16
16
  position?: OverlayPosition;
17
- icon?: Snippet | ComponentType;
17
+ icon?: Snippet | Component;
18
18
  title?: string;
19
19
  stack?: string;
20
20
  autoClose?: number;
@@ -6,7 +6,7 @@ import NotificationSvelte from "./Notification.svelte";
6
6
  * @param {object} opts - The options for the notification.
7
7
  * @param {string} opts.content - The content of the notification.
8
8
  * @param {OverlayPosition} opts.position - The position of the notification.
9
- * @param {Snippet | ComponentType} opts.icon - The icon of the notification.
9
+ * @param {Snippet | Component} opts.icon - The icon of the notification.
10
10
  * @param {string} opts.title - The title of the notification.
11
11
  * @param {string} opts.stack - Group notifications together by named stacks.
12
12
  * @param {number} opts.autoClose - The time in milliseconds before the notification closes.
@@ -20,7 +20,7 @@ export function addNotification(opts) {
20
20
  content: NotificationSvelte,
21
21
  props: { id, ...opts },
22
22
  stack: opts.stack,
23
- position: opts.position || "top right",
23
+ position: opts.position || "bottom right",
24
24
  layer: "notifications",
25
25
  });
26
26
  if (opts.autoClose) {
@@ -1,23 +1,28 @@
1
1
  <script lang="ts">import Icon from "../display/Icon.svelte";
2
+ import { getContext } from "svelte";
2
3
  let {
3
4
  href,
4
5
  type = "button",
6
+ class: className,
7
+ size = "md",
8
+ kind = "default",
5
9
  disabled = false,
6
10
  icon,
7
11
  onclick,
8
12
  children
9
13
  } = $props();
14
+ const form = getContext("form");
10
15
  </script>
11
16
 
12
17
  {#if href}
13
- <a class="Button Link button" {href} {onclick}>
18
+ <a class="Button Link button {size} {kind} {className}" {href} {onclick}>
14
19
  {#if icon}
15
20
  <Icon {icon} />
16
21
  {/if}
17
22
  {@render children()}
18
23
  </a>
19
24
  {:else}
20
- <button class="Button button" type={type} disabled={disabled} {onclick}>
25
+ <button class="Button button {size} {kind} {className}" type={type} disabled={disabled || form?.state === 'loading'} {onclick}>
21
26
  {#if icon}
22
27
  <Icon {icon} />
23
28
  {/if}
@@ -1,36 +1,26 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { ComponentType, Snippet } from 'svelte';
3
- declare const __propDef: {
4
- props: {
5
- href?: string | undefined;
6
- type?: "button" | "submit" | "reset" | undefined;
7
- disabled?: boolean | undefined;
8
- icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
9
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
10
- }) | ComponentType | undefined;
11
- onclick?: ((event: MouseEvent) => void) | undefined;
12
- children: Snippet;
13
- };
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export type ButtonProps = typeof __propDef.props;
20
- export type ButtonEvents = typeof __propDef.events;
21
- export type ButtonSlots = typeof __propDef.slots;
22
- export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
23
- constructor(options?: import("svelte").ComponentConstructorOptions<{
24
- href?: string | undefined;
25
- type?: "button" | "submit" | "reset" | undefined;
26
- disabled?: boolean | undefined;
27
- icon?: string | ((this: void) => typeof import("svelte").SnippetReturn & {
28
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
29
- }) | ComponentType | undefined;
30
- onclick?: ((event: MouseEvent) => void) | undefined;
31
- children: (this: void) => typeof import("svelte").SnippetReturn & {
32
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
33
- };
34
- }>);
1
+ import { type Component, type Snippet } from 'svelte';
2
+ 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> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports;
10
+ z_$$bindings?: Bindings;
35
11
  }
36
- export {};
12
+ declare const Button: $$__sveltets_2_IsomorphicComponent<{
13
+ href?: string;
14
+ type?: "button" | "submit" | "reset";
15
+ kind?: "default" | "outlined" | "secondary" | "warn";
16
+ size?: "sm" | "md" | "lg" | "xl";
17
+ class?: string;
18
+ disabled?: boolean;
19
+ icon?: string | Snippet | Component;
20
+ onclick?: (event: MouseEvent) => void;
21
+ children: Snippet;
22
+ }, {
23
+ [evt: string]: CustomEvent<any>;
24
+ }, {}, {}, "">;
25
+ type Button = InstanceType<typeof Button>;
26
+ export default Button;
@@ -1,10 +1,17 @@
1
- <script lang="ts">let {
1
+ <script lang="ts">import StringOrSnippet from "../utils/StringOrSnippet.svelte";
2
+ let {
2
3
  align = "end",
3
- children
4
+ children,
5
+ info
4
6
  } = $props();
5
7
  </script>
6
8
 
7
- <div class="FieldActions {align}">
9
+ <div class="FieldActions {align}" class:hasInfo={!!info}>
10
+ {#if info}
11
+ <div class="Info">
12
+ <StringOrSnippet content={info} />
13
+ </div>
14
+ {/if}
8
15
  <div class="Actions">
9
16
  {@render children()}
10
17
  </div>
@@ -17,6 +24,9 @@
17
24
  padding: calc(1.5em * var(--fcc)) calc(3em * var(--fcc));
18
25
  grid-column: 1 / -1;
19
26
  grid-template-columns: subgrid;
27
+ border-bottom-left-radius: inherit;
28
+ border-bottom-right-radius: inherit;
29
+ align-items: center;
20
30
  }
21
31
  .Actions {
22
32
  display: flex;
@@ -38,8 +48,20 @@
38
48
  justify-content: end;
39
49
  grid-column: 1 / -1;
40
50
  }
51
+ .FieldActions.hasInfo .Actions {
52
+ grid-column: 2 / -1;
53
+ }
41
54
  @container (max-width: 480px) {
55
+ .FieldActions {
56
+ justify-content: center;
57
+ gap: 1rem;
58
+ }
59
+ .Info {
60
+ order: 1;
61
+ text-align: center;
62
+ }
42
63
  .Actions {
64
+ order: -1;
43
65
  flex-direction: column;
44
66
  }
45
67
  }
@@ -1,24 +1,20 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- align?: "middle" | "justified" | "start" | "end" | undefined;
6
- children: Snippet;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type FieldActionsProps = typeof __propDef.props;
14
- export type FieldActionsEvents = typeof __propDef.events;
15
- export type FieldActionsSlots = typeof __propDef.slots;
16
- export default class FieldActions extends SvelteComponent<FieldActionsProps, FieldActionsEvents, FieldActionsSlots> {
17
- constructor(options?: import("svelte").ComponentConstructorOptions<{
18
- align?: "middle" | "justified" | "start" | "end" | undefined;
19
- children: (this: void) => typeof import("svelte").SnippetReturn & {
20
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
21
- };
22
- }>);
2
+ 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> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports;
10
+ z_$$bindings?: Bindings;
23
11
  }
24
- export {};
12
+ declare const FieldActions: $$__sveltets_2_IsomorphicComponent<{
13
+ align?: "justified" | "start" | "middle" | "end";
14
+ children: Snippet;
15
+ info?: string | Snippet;
16
+ }, {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, "">;
19
+ type FieldActions = InstanceType<typeof FieldActions>;
20
+ export default FieldActions;
@@ -16,11 +16,11 @@
16
16
  column-gap: 3em;
17
17
  grid-template-columns: minmax(25ch, 35%) minmax(min-content, 1fr);
18
18
  border-radius: var(--border-radius);
19
+ background: var(--bg, var(--form-bg));
19
20
  }
20
21
  .FieldContainer.contained {
21
22
  border: var(--border);
22
23
  gap: 0;
23
- overflow: clip;
24
24
  }
25
25
  .FieldContainer :global(.FieldSection:has(+ .FieldActions)) {
26
26
  margin-bottom: 0;
@@ -1,24 +1,19 @@
1
- import { SvelteComponent } from "svelte";
2
1
  import type { Snippet } from "svelte";
3
- declare const __propDef: {
4
- props: {
5
- contained?: boolean | undefined;
6
- children: Snippet;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- };
13
- export type FieldContainerProps = typeof __propDef.props;
14
- export type FieldContainerEvents = typeof __propDef.events;
15
- export type FieldContainerSlots = typeof __propDef.slots;
16
- export default class FieldContainer extends SvelteComponent<FieldContainerProps, FieldContainerEvents, FieldContainerSlots> {
17
- constructor(options?: import("svelte").ComponentConstructorOptions<{
18
- contained?: boolean | undefined;
19
- children: (this: void) => typeof import("svelte").SnippetReturn & {
20
- _: "functions passed to {@render ...} tags must use the `Snippet` type imported from \"svelte\"";
21
- };
22
- }>);
2
+ 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> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports;
10
+ z_$$bindings?: Bindings;
23
11
  }
24
- export {};
12
+ declare const FieldContainer: $$__sveltets_2_IsomorphicComponent<{
13
+ contained?: boolean;
14
+ children: Snippet;
15
+ }, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, "">;
18
+ type FieldContainer = InstanceType<typeof FieldContainer>;
19
+ export default FieldContainer;