@juspay/svelte-ui-components 2.80.0 → 2.80.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge/Badge.svelte +1 -1
- package/dist/Banner/Banner.svelte +1 -1
- package/dist/Book/Book.svelte +1 -1
- package/dist/Browser/Browser.svelte +3 -3
- package/dist/Button/Button.svelte +1 -1
- package/dist/Calendar/Calendar.svelte +2 -2
- package/dist/Card/Card.svelte +1 -1
- package/dist/Checkbox/Checkbox.svelte +1 -1
- package/dist/Choicebox/Choicebox.svelte +1 -1
- package/dist/ColorPicker/ColorPicker.svelte +8 -5
- package/dist/Combobox/Combobox.svelte +2 -2
- package/dist/CommandMenu/CommandMenu.svelte +3 -3
- package/dist/ContextMenu/ContextMenu.svelte +1 -1
- package/dist/DateRangePicker/DateRangePicker.svelte +13 -9
- package/dist/FileInput/FileInput.svelte +1 -1
- package/dist/GridItem/GridItem.svelte +2 -2
- package/dist/Input/Input.svelte +5 -5
- package/dist/InputButton/InputButton.svelte +6 -3
- package/dist/KeyValue/KeyValue.svelte +129 -0
- package/dist/KeyValue/KeyValue.svelte.d.ts +4 -0
- package/dist/KeyValue/properties.d.ts +52 -0
- package/dist/KeyValue/properties.js +1 -0
- package/dist/KeyboardInput/KeyboardInput.svelte +1 -1
- package/dist/Menu/Menu.svelte +1 -1
- package/dist/Modal/Modal.svelte +3 -3
- package/dist/Pagination/Pagination.svelte +1 -1
- package/dist/PieChart/PieChart.svelte +1 -1
- package/dist/Progress/Progress.svelte +2 -2
- package/dist/ProportionBar/ProportionBar.svelte +2 -2
- package/dist/SankeyChart/SankeyChart.svelte +27 -3
- package/dist/SankeyChart/properties.d.ts +1 -0
- package/dist/Select/Select.svelte +3 -3
- package/dist/Sheet/Sheet.svelte +1 -1
- package/dist/Shimmer/Shimmer.svelte +1 -1
- package/dist/Slider/Slider.svelte +2 -2
- package/dist/Snippet/Snippet.svelte +2 -2
- package/dist/SplitButton/SplitButton.svelte +8 -2
- package/dist/StatCard/StatCard.svelte +4 -4
- package/dist/Table/Table.svelte +4 -4
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +4 -4
- package/dist/Toast/Toast.svelte +1 -1
- package/dist/Tooltip/Tooltip.svelte +2 -2
- package/dist/Tooltip/tooltip-action.js +1 -1
- package/dist/_chart/ChartContainer.svelte +5 -2
- package/dist/_chart/ChartTooltip.svelte +1 -1
- package/dist/_chart/geometry.js +6 -2
- package/dist/_chart/types.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/Badge/Badge.svelte
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.icon-img {
|
|
90
|
-
border-radius: var(--badge-img-border-radius,
|
|
90
|
+
border-radius: var(--badge-img-border-radius, var(--radius, 4px));
|
|
91
91
|
width: var(--badge-img-width, 64px);
|
|
92
92
|
height: var(--badge-img-height, 64px);
|
|
93
93
|
object-fit: var(--badge-object-fit, contain);
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
--button-color: transparent;
|
|
170
170
|
--button-border: none;
|
|
171
171
|
--button-padding: 2px;
|
|
172
|
-
--button-border-radius: var(--banner-dismiss-border-radius, 4px);
|
|
172
|
+
--button-border-radius: var(--banner-dismiss-border-radius, var(--radius, 4px));
|
|
173
173
|
--button-text-color: var(--banner-dismiss-color, currentColor);
|
|
174
174
|
--button-hover-color: var(--banner-dismiss-hover-background, rgba(0, 0, 0, 0.1));
|
|
175
175
|
--cursor: inherit;
|
package/dist/Book/Book.svelte
CHANGED
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
.book {
|
|
180
180
|
width: var(--book-width, 100%);
|
|
181
181
|
background-color: var(--book-background, #ffffff);
|
|
182
|
-
border-radius: var(--book-border-radius,
|
|
182
|
+
border-radius: var(--book-border-radius, var(--radius, 4px));
|
|
183
183
|
border: var(--book-border, 1px solid #e0e0e0);
|
|
184
184
|
outline: none;
|
|
185
185
|
}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.browser.rounded {
|
|
68
|
-
border-radius: var(--browser-border-radius,
|
|
68
|
+
border-radius: var(--browser-border-radius, var(--radius, 4px));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.browser.shadow {
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
|
|
149
149
|
.tab {
|
|
150
150
|
padding: var(--browser-tab-padding, 6px 16px);
|
|
151
|
-
border-radius: var(--browser-tab-border-radius,
|
|
151
|
+
border-radius: var(--browser-tab-border-radius, var(--radius, 4px) var(--radius, 4px) 0 0);
|
|
152
152
|
font-size: var(--browser-tab-font-size, 13px);
|
|
153
153
|
font-family: var(--browser-tab-font-family, inherit);
|
|
154
154
|
white-space: nowrap;
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
gap: 8px;
|
|
168
168
|
padding: 0 12px;
|
|
169
169
|
height: var(--browser-addressbar-height, 32px);
|
|
170
|
-
border-radius: var(--browser-addressbar-border-radius,
|
|
170
|
+
border-radius: var(--browser-addressbar-border-radius, var(--radius, 4px));
|
|
171
171
|
font-size: var(--browser-addressbar-font-size, 13px);
|
|
172
172
|
font-family: var(--browser-addressbar-font-family, inherit);
|
|
173
173
|
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
height: var(--button-height, fit-content);
|
|
97
97
|
padding: var(--button-padding, 16px);
|
|
98
98
|
margin: var(--button-margin);
|
|
99
|
-
border-radius: var(--button-border-radius,
|
|
99
|
+
border-radius: var(--button-border-radius, var(--radius, 4px));
|
|
100
100
|
width: var(--button-width, fit-content);
|
|
101
101
|
cursor: var(--cursor, pointer);
|
|
102
102
|
opacity: var(--opacity, 1);
|
|
@@ -358,7 +358,7 @@
|
|
|
358
358
|
padding: var(--calendar-padding, 16px);
|
|
359
359
|
background-color: var(--calendar-background, #ffffff);
|
|
360
360
|
border: var(--calendar-border, 1px solid #e0e0e0);
|
|
361
|
-
border-radius: var(--calendar-border-radius,
|
|
361
|
+
border-radius: var(--calendar-border-radius, var(--radius, 4px));
|
|
362
362
|
box-shadow: var(--calendar-box-shadow, none);
|
|
363
363
|
box-sizing: border-box;
|
|
364
364
|
user-select: none;
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
--button-height: var(--calendar-nav-button-size, 32px);
|
|
388
388
|
--button-border: none;
|
|
389
389
|
--button-color: transparent;
|
|
390
|
-
--button-border-radius: var(--calendar-nav-button-border-radius, 4px);
|
|
390
|
+
--button-border-radius: var(--calendar-nav-button-border-radius, var(--radius, 4px));
|
|
391
391
|
--button-text-color: var(--calendar-nav-button-color, #666666);
|
|
392
392
|
--button-padding: 0;
|
|
393
393
|
--button-hover-color: var(--calendar-nav-button-hover-background, #f0f0f0);
|
package/dist/Card/Card.svelte
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
.card {
|
|
91
91
|
background: var(--card-background, inherit);
|
|
92
92
|
border: var(--card-border, 1px solid currentColor);
|
|
93
|
-
border-radius: var(--card-border-radius,
|
|
93
|
+
border-radius: var(--card-border-radius, var(--radius, 4px));
|
|
94
94
|
overflow: var(--card-overflow, hidden);
|
|
95
95
|
color: inherit;
|
|
96
96
|
cursor: var(--card-cursor, inherit);
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
width: var(--checkbox-size, 20px);
|
|
107
107
|
height: var(--checkbox-size, 20px);
|
|
108
108
|
border: var(--checkbox-border, 2px solid #757575);
|
|
109
|
-
border-radius: var(--checkbox-border-radius,
|
|
109
|
+
border-radius: var(--checkbox-border-radius, var(--radius, 4px));
|
|
110
110
|
background-color: var(--checkbox-background, transparent);
|
|
111
111
|
transition:
|
|
112
112
|
background-color var(--checkbox-transition, 0.2s),
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
align-items: var(--choicebox-align-items, center);
|
|
55
55
|
padding: var(--choicebox-padding, 16px);
|
|
56
56
|
border: var(--choicebox-border, 2px solid #d0d0d0);
|
|
57
|
-
border-radius: var(--choicebox-border-radius,
|
|
57
|
+
border-radius: var(--choicebox-border-radius, var(--radius, 4px));
|
|
58
58
|
background: var(--choicebox-background, #ffffff);
|
|
59
59
|
gap: var(--choicebox-gap, 12px);
|
|
60
60
|
cursor: var(--choicebox-cursor, pointer);
|
|
@@ -336,7 +336,10 @@
|
|
|
336
336
|
.color-picker-swatch-btn {
|
|
337
337
|
--button-color: var(--color-picker-swatch-btn-background, #f9fafb);
|
|
338
338
|
--button-border: var(--color-picker-swatch-btn-border, 1px solid #d1d5db);
|
|
339
|
-
--button-border-radius: var(
|
|
339
|
+
--button-border-radius: var(
|
|
340
|
+
--color-picker-swatch-btn-border-radius,
|
|
341
|
+
var(--radius, 4px) 0 0 var(--radius, 4px)
|
|
342
|
+
);
|
|
340
343
|
--button-hover-color: var(--color-picker-swatch-btn-hover-background, #f3f4f6);
|
|
341
344
|
--button-padding: var(--color-picker-swatch-padding, 5px);
|
|
342
345
|
--button-width: fit-content;
|
|
@@ -344,14 +347,14 @@
|
|
|
344
347
|
}
|
|
345
348
|
|
|
346
349
|
.color-picker-swatch-btn.standalone {
|
|
347
|
-
--button-border-radius: var(--color-picker-swatch-btn-border-radius,
|
|
350
|
+
--button-border-radius: var(--color-picker-swatch-btn-border-radius, var(--radius, 4px));
|
|
348
351
|
}
|
|
349
352
|
|
|
350
353
|
.color-picker-checkerboard {
|
|
351
354
|
display: block;
|
|
352
355
|
width: var(--color-picker-swatch-size, 26px);
|
|
353
356
|
height: var(--color-picker-swatch-size, 26px);
|
|
354
|
-
border-radius: var(--color-picker-swatch-border-radius,
|
|
357
|
+
border-radius: var(--color-picker-swatch-border-radius, var(--radius, 4px));
|
|
355
358
|
overflow: hidden;
|
|
356
359
|
background-image:
|
|
357
360
|
linear-gradient(45deg, #ccc 25%, transparent 25%),
|
|
@@ -414,7 +417,7 @@
|
|
|
414
417
|
padding: var(--color-picker-popover-padding, 12px);
|
|
415
418
|
background: var(--color-picker-popover-background, #ffffff);
|
|
416
419
|
border: var(--color-picker-popover-border, 1px solid #e5e7eb);
|
|
417
|
-
border-radius: var(--color-picker-popover-border-radius,
|
|
420
|
+
border-radius: var(--color-picker-popover-border-radius, var(--radius, 4px));
|
|
418
421
|
box-shadow: var(
|
|
419
422
|
--color-picker-popover-shadow,
|
|
420
423
|
0 4px 24px rgba(0, 0, 0, 0.12),
|
|
@@ -432,7 +435,7 @@
|
|
|
432
435
|
position: relative;
|
|
433
436
|
width: 100%;
|
|
434
437
|
aspect-ratio: 1 / 0.7;
|
|
435
|
-
border-radius: var(--color-picker-panel-border-radius,
|
|
438
|
+
border-radius: var(--color-picker-panel-border-radius, var(--radius, 4px));
|
|
436
439
|
cursor: crosshair;
|
|
437
440
|
overflow: hidden;
|
|
438
441
|
user-select: none;
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
align-items: center;
|
|
314
314
|
background: var(--combobox-input-background, #ffffff);
|
|
315
315
|
border: var(--combobox-input-border, 1px solid #cccccc);
|
|
316
|
-
border-radius: var(--combobox-input-border-radius,
|
|
316
|
+
border-radius: var(--combobox-input-border-radius, var(--radius, 4px));
|
|
317
317
|
transition: var(--combobox-input-transition, border-color 0.15s, box-shadow 0.15s);
|
|
318
318
|
}
|
|
319
319
|
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
margin-top: var(--combobox-dropdown-gap, 4px);
|
|
370
370
|
background: var(--combobox-dropdown-background, #ffffff);
|
|
371
371
|
border: var(--combobox-dropdown-border, 1px solid #cccccc);
|
|
372
|
-
border-radius: var(--combobox-dropdown-border-radius,
|
|
372
|
+
border-radius: var(--combobox-dropdown-border-radius, var(--radius, 4px));
|
|
373
373
|
box-shadow: var(--combobox-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
|
|
374
374
|
max-height: var(--combobox-dropdown-max-height, 200px);
|
|
375
375
|
overflow-y: auto;
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
|
|
299
299
|
.command-menu-dialog {
|
|
300
300
|
background-color: var(--command-menu-background, #ffffff);
|
|
301
|
-
border-radius: var(--command-menu-border-radius,
|
|
301
|
+
border-radius: var(--command-menu-border-radius, var(--radius, 4px));
|
|
302
302
|
box-shadow: var(--command-menu-box-shadow, 0 16px 70px rgba(0, 0, 0, 0.2));
|
|
303
303
|
width: var(--command-menu-width, 560px);
|
|
304
304
|
max-width: var(--command-menu-max-width, 90vw);
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
display: flex;
|
|
381
381
|
align-items: center;
|
|
382
382
|
padding: var(--command-menu-item-padding, 10px 12px);
|
|
383
|
-
border-radius: var(--command-menu-item-border-radius,
|
|
383
|
+
border-radius: var(--command-menu-item-border-radius, var(--radius, 4px));
|
|
384
384
|
cursor: pointer;
|
|
385
385
|
gap: var(--command-menu-item-gap, 10px);
|
|
386
386
|
font-size: var(--command-menu-item-font-size, 14px);
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
min-width: var(--command-menu-kbd-min-width, 24px);
|
|
441
441
|
height: var(--command-menu-kbd-height, 22px);
|
|
442
442
|
padding: var(--command-menu-kbd-padding, 0 6px);
|
|
443
|
-
border-radius: var(--command-menu-kbd-border-radius, 4px);
|
|
443
|
+
border-radius: var(--command-menu-kbd-border-radius, var(--radius, 4px));
|
|
444
444
|
background-color: var(--command-menu-kbd-background, #f1f5f9);
|
|
445
445
|
border: var(--command-menu-kbd-border, 1px solid #e2e8f0);
|
|
446
446
|
color: var(--command-menu-kbd-color, #64748b);
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
z-index: var(--context-menu-z-index, 1000);
|
|
228
228
|
background-color: var(--context-menu-background-color, #ffffff);
|
|
229
229
|
border: var(--context-menu-border, 1px solid #e0e0e0);
|
|
230
|
-
border-radius: var(--context-menu-border-radius,
|
|
230
|
+
border-radius: var(--context-menu-border-radius, var(--radius, 4px));
|
|
231
231
|
box-shadow: var(--context-menu-box-shadow, 0px 4px 16px rgba(0, 0, 0, 0.12));
|
|
232
232
|
min-width: var(--context-menu-min-width, 160px);
|
|
233
233
|
max-height: var(--context-menu-max-height, 240px);
|
|
@@ -443,6 +443,10 @@
|
|
|
443
443
|
draftEnd = event.rangeEnd;
|
|
444
444
|
// A direct calendar click is not a preset selection.
|
|
445
445
|
selectedPresetLabel = null;
|
|
446
|
+
if (showTimeSelection) {
|
|
447
|
+
startTimeDisplay = '12:00 AM';
|
|
448
|
+
endTimeDisplay = isSameDay(event.rangeEnd, now) ? formatTimeDisplay(now) : '11:59 PM';
|
|
449
|
+
}
|
|
446
450
|
}
|
|
447
451
|
|
|
448
452
|
function handleSingleSelect(event: { date: Date }): void {
|
|
@@ -929,7 +933,7 @@
|
|
|
929
933
|
.drp-trigger-wrapper {
|
|
930
934
|
--button-color: var(--drp-trigger-background, inherit);
|
|
931
935
|
--button-border: var(--drp-trigger-border, 1px solid currentColor);
|
|
932
|
-
--button-border-radius: var(--drp-trigger-border-radius,
|
|
936
|
+
--button-border-radius: var(--drp-trigger-border-radius, var(--radius, 4px));
|
|
933
937
|
--button-text-color: var(--drp-trigger-color, inherit);
|
|
934
938
|
--button-padding: var(--drp-trigger-padding, 8px 12px);
|
|
935
939
|
--button-min-width: var(--drp-trigger-min-width, 200px);
|
|
@@ -972,7 +976,7 @@
|
|
|
972
976
|
z-index: var(--drp-panel-z-index, 1000);
|
|
973
977
|
background: var(--drp-panel-background, inherit);
|
|
974
978
|
border: var(--drp-panel-border, 1px solid #e0e0e0);
|
|
975
|
-
border-radius: var(--drp-panel-border-radius,
|
|
979
|
+
border-radius: var(--drp-panel-border-radius, var(--radius, 4px));
|
|
976
980
|
box-shadow: var(--drp-panel-shadow, 0 8px 24px rgba(0, 0, 0, 0.12));
|
|
977
981
|
display: flex;
|
|
978
982
|
flex-direction: column;
|
|
@@ -1015,7 +1019,7 @@
|
|
|
1015
1019
|
padding: var(--drp-preset-padding, 7px 12px);
|
|
1016
1020
|
background: none;
|
|
1017
1021
|
border: none;
|
|
1018
|
-
border-radius: var(--drp-preset-border-radius,
|
|
1022
|
+
border-radius: var(--drp-preset-border-radius, var(--radius, 4px));
|
|
1019
1023
|
color: var(--drp-preset-color, inherit);
|
|
1020
1024
|
cursor: pointer;
|
|
1021
1025
|
white-space: nowrap;
|
|
@@ -1094,7 +1098,7 @@
|
|
|
1094
1098
|
height: var(--drp-nav-btn-size, 32px);
|
|
1095
1099
|
background: none;
|
|
1096
1100
|
border: none;
|
|
1097
|
-
border-radius: var(--drp-nav-btn-border-radius, 4px);
|
|
1101
|
+
border-radius: var(--drp-nav-btn-border-radius, var(--radius, 4px));
|
|
1098
1102
|
cursor: pointer;
|
|
1099
1103
|
color: var(--drp-nav-btn-color, inherit);
|
|
1100
1104
|
transition: background 0.12s ease;
|
|
@@ -1171,7 +1175,7 @@
|
|
|
1171
1175
|
min-width: 0;
|
|
1172
1176
|
padding: var(--drp-date-input-padding, 10px 14px);
|
|
1173
1177
|
border: var(--drp-date-input-border, 1px solid #d4d4d4);
|
|
1174
|
-
border-radius: var(--drp-date-input-radius,
|
|
1178
|
+
border-radius: var(--drp-date-input-radius, var(--radius, 4px));
|
|
1175
1179
|
background: var(--drp-date-input-background, #ffffff);
|
|
1176
1180
|
}
|
|
1177
1181
|
|
|
@@ -1206,7 +1210,7 @@
|
|
|
1206
1210
|
height: var(--drp-time-toggle-size, 40px);
|
|
1207
1211
|
padding: 0;
|
|
1208
1212
|
border: var(--drp-time-toggle-border, 1px solid #d4d4d4);
|
|
1209
|
-
border-radius: var(--drp-time-toggle-radius,
|
|
1213
|
+
border-radius: var(--drp-time-toggle-radius, var(--radius, 4px));
|
|
1210
1214
|
background: var(--drp-time-toggle-background, #f6f7f9);
|
|
1211
1215
|
color: var(--drp-time-toggle-color, #555555);
|
|
1212
1216
|
cursor: pointer;
|
|
@@ -1235,7 +1239,7 @@
|
|
|
1235
1239
|
display: flex;
|
|
1236
1240
|
align-items: center;
|
|
1237
1241
|
border: var(--drp-time-input-border, 1px solid #d4d4d4);
|
|
1238
|
-
border-radius: var(--drp-time-input-radius,
|
|
1242
|
+
border-radius: var(--drp-time-input-radius, var(--radius, 4px));
|
|
1239
1243
|
background: var(--drp-time-input-background, #ffffff);
|
|
1240
1244
|
}
|
|
1241
1245
|
|
|
@@ -1384,7 +1388,7 @@
|
|
|
1384
1388
|
position: relative;
|
|
1385
1389
|
--button-color: var(--drp-compare-trigger-background, inherit);
|
|
1386
1390
|
--button-border: var(--drp-compare-trigger-border, 1px solid currentColor);
|
|
1387
|
-
--button-border-radius: var(--drp-compare-trigger-border-radius,
|
|
1391
|
+
--button-border-radius: var(--drp-compare-trigger-border-radius, var(--radius, 4px));
|
|
1388
1392
|
--button-text-color: var(--drp-compare-trigger-color, inherit);
|
|
1389
1393
|
--button-padding: var(--drp-compare-trigger-padding, 8px 12px);
|
|
1390
1394
|
--button-min-width: var(--drp-compare-trigger-min-width, 160px);
|
|
@@ -1403,7 +1407,7 @@
|
|
|
1403
1407
|
z-index: var(--drp-panel-z-index, 1000);
|
|
1404
1408
|
background: var(--drp-panel-background, inherit);
|
|
1405
1409
|
border: var(--drp-panel-border, 1px solid #e0e0e0);
|
|
1406
|
-
border-radius: var(--drp-panel-border-radius,
|
|
1410
|
+
border-radius: var(--drp-panel-border-radius, var(--radius, 4px));
|
|
1407
1411
|
box-shadow: var(--drp-panel-shadow, 0 8px 24px rgba(0, 0, 0, 0.12));
|
|
1408
1412
|
display: flex;
|
|
1409
1413
|
flex-direction: column;
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
justify-content: var(--file-input-justify-content, center);
|
|
147
147
|
padding: var(--file-input-padding);
|
|
148
148
|
border: var(--file-input-border);
|
|
149
|
-
border-radius: var(--file-input-radius);
|
|
149
|
+
border-radius: var(--file-input-radius, var(--radius, 4px));
|
|
150
150
|
background: var(--file-input-background);
|
|
151
151
|
gap: var(--file-input-gap);
|
|
152
152
|
text-align: var(--file-input-text-align, center);
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
width: var(--grid-item-body-width, 64px);
|
|
66
66
|
background-color: var(--grid-item-background-color, #faf9f9);
|
|
67
67
|
border: var(--grid-item-border, 1px solid #eaeaea);
|
|
68
|
-
border-radius: var(--grid-item-border-radius, 4px);
|
|
68
|
+
border-radius: var(--grid-item-border-radius, var(--radius, 4px));
|
|
69
69
|
margin: var(--grid-item-margin, 8px 0 0 0);
|
|
70
70
|
display: flex;
|
|
71
71
|
justify-content: center;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
position: absolute;
|
|
102
102
|
inset: 0px;
|
|
103
103
|
margin: var(--grid-item-margin, 8px 0 0 0);
|
|
104
|
-
border-radius: var(--grid-item-border-radius, 4px);
|
|
104
|
+
border-radius: var(--grid-item-border-radius, var(--radius, 4px));
|
|
105
105
|
border: var(--animation-version, 32px solid #cbcccf66);
|
|
106
106
|
animation: clipperAnimation var(--loader-animation-duration, 3s) infinite linear;
|
|
107
107
|
}
|
package/dist/Input/Input.svelte
CHANGED
|
@@ -331,12 +331,12 @@
|
|
|
331
331
|
background-color: var(--input-background, white);
|
|
332
332
|
font-size: var(--input-font-size, 16px) !important;
|
|
333
333
|
font-family: var(--input-font-family, inherit);
|
|
334
|
-
border-radius: var(--input-radius, 4px);
|
|
334
|
+
border-radius: var(--input-radius, var(--radius, 4px));
|
|
335
335
|
outline: none;
|
|
336
336
|
padding: var(--input-padding, 16px);
|
|
337
337
|
font-weight: var(--input-font-weight, 500);
|
|
338
338
|
width: var(--input-width, fit-content);
|
|
339
|
-
margin: var(--input-margin,
|
|
339
|
+
margin: var(--input-margin, 0);
|
|
340
340
|
appearance: none !important;
|
|
341
341
|
-webkit-appearance: none !important; /* For Safari MWeb */
|
|
342
342
|
box-shadow: var(--input-box-shadow, 0px 1px 8px #2f537733);
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
.action-input {
|
|
367
|
-
border-radius: var(--input-radius, 4px
|
|
367
|
+
border-radius: var(--input-radius, var(--radius, 4px) 0 0 var(--radius, 4px));
|
|
368
368
|
box-shadow: var(--input-box-shadow, 0px 0px 0px #ffffff);
|
|
369
369
|
margin-bottom: 0;
|
|
370
370
|
}
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
.input-field-wrap {
|
|
397
397
|
position: relative;
|
|
398
398
|
display: block;
|
|
399
|
-
margin: var(--input-margin,
|
|
399
|
+
margin: var(--input-margin, 0);
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
.input-field-wrap > :global(textarea),
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
.input-icon-button:focus-visible {
|
|
430
430
|
outline: var(--input-icon-focus-outline, 2px solid var(--input-focus-border-color, #005fcc));
|
|
431
431
|
outline-offset: var(--input-icon-focus-outline-offset, 2px);
|
|
432
|
-
border-radius: var(--input-icon-focus-radius,
|
|
432
|
+
border-radius: var(--input-icon-focus-radius, var(--radius, 4px));
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
.input-icon-left {
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
font-size: var(--input-font-size, 16px) !important;
|
|
137
137
|
font-weight: var(--input-button-font-weight, 500);
|
|
138
138
|
margin: var(--input-button-margin);
|
|
139
|
-
border-radius: var(--input-button-radius, 4px);
|
|
139
|
+
border-radius: var(--input-button-radius, var(--radius, 4px));
|
|
140
140
|
border: var(--input-button-container-border);
|
|
141
141
|
background: var(--input-button-container-background);
|
|
142
142
|
padding: var(--input-button-container-padding);
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
.input-button {
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
|
-
border-radius: var(--input-button-radius, 4px);
|
|
148
|
+
border-radius: var(--input-button-radius, var(--radius, 4px));
|
|
149
149
|
border: var(--input-button-border);
|
|
150
150
|
box-shadow: var(--input-button-box-shadow, 0px 1px 8px #2f537733);
|
|
151
151
|
background: var(--input-button-background);
|
|
@@ -262,7 +262,10 @@
|
|
|
262
262
|
--button-font-size: var(--right-button-font-size);
|
|
263
263
|
--button-height: var(--right-button-height, 54px);
|
|
264
264
|
--button-padding: var(--right-button-padding);
|
|
265
|
-
--button-border-radius: var(
|
|
265
|
+
--button-border-radius: var(
|
|
266
|
+
--right-button-border-radius,
|
|
267
|
+
0 var(--radius, 4px) var(--radius, 4px) 0
|
|
268
|
+
);
|
|
266
269
|
--button-width: var(--right-button-width, 100%);
|
|
267
270
|
--cursor: var(--right-button-cursor);
|
|
268
271
|
--opacity: var(--right-button-opacity);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { KeyValueProperties, KeyValueItem } from './properties';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
items,
|
|
6
|
+
columns = 2,
|
|
7
|
+
layout = 'vertical',
|
|
8
|
+
size = 'md',
|
|
9
|
+
hideEmpty = true,
|
|
10
|
+
emptyText = '—',
|
|
11
|
+
valueSnippet,
|
|
12
|
+
labelSnippet,
|
|
13
|
+
testId,
|
|
14
|
+
classes = ''
|
|
15
|
+
}: KeyValueProperties = $props();
|
|
16
|
+
|
|
17
|
+
const isEmptyValue = (value: KeyValueItem['value']): boolean =>
|
|
18
|
+
value == null || (typeof value === 'string' && value.trim() === '');
|
|
19
|
+
|
|
20
|
+
let visibleItems = $derived(
|
|
21
|
+
hideEmpty ? items.filter((item) => !isEmptyValue(item.value)) : items
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const displayValue = (item: KeyValueItem): string =>
|
|
25
|
+
isEmptyValue(item.value) ? emptyText : String(item.value);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<dl
|
|
29
|
+
class="key-value key-value--{layout} key-value--{size} {classes}"
|
|
30
|
+
style="--keyvalue-columns: {columns};"
|
|
31
|
+
data-pw={testId}
|
|
32
|
+
>
|
|
33
|
+
{#each visibleItems as item, index (item.label + '-' + index)}
|
|
34
|
+
<div class="key-value-item" data-pw={item.testId}>
|
|
35
|
+
<dt class="key-value-label">
|
|
36
|
+
{#if labelSnippet}
|
|
37
|
+
{@render labelSnippet(item, index)}
|
|
38
|
+
{:else}
|
|
39
|
+
{item.label}
|
|
40
|
+
{/if}
|
|
41
|
+
</dt>
|
|
42
|
+
<dd class="key-value-value">
|
|
43
|
+
{#if valueSnippet}
|
|
44
|
+
{@render valueSnippet(item, index)}
|
|
45
|
+
{:else}
|
|
46
|
+
{displayValue(item)}
|
|
47
|
+
{/if}
|
|
48
|
+
</dd>
|
|
49
|
+
</div>
|
|
50
|
+
{/each}
|
|
51
|
+
</dl>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.key-value {
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: repeat(var(--keyvalue-columns, 2), minmax(0, 1fr));
|
|
57
|
+
column-gap: var(--keyvalue-column-gap, 32px);
|
|
58
|
+
row-gap: var(--keyvalue-row-gap, 16px);
|
|
59
|
+
margin: 0;
|
|
60
|
+
width: 100%;
|
|
61
|
+
/* Size-preset defaults (overridable by --keyvalue-label-size / --keyvalue-value-size).
|
|
62
|
+
The value sits 2px below the label, so the key always reads as the heavier, larger element. */
|
|
63
|
+
--_kv-label-size: 16px;
|
|
64
|
+
--_kv-value-size: 14px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.key-value--sm {
|
|
68
|
+
--_kv-label-size: 14px;
|
|
69
|
+
--_kv-value-size: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.key-value--md {
|
|
73
|
+
--_kv-label-size: 16px;
|
|
74
|
+
--_kv-value-size: 14px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.key-value--lg {
|
|
78
|
+
--_kv-label-size: 18px;
|
|
79
|
+
--_kv-value-size: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.key-value-item {
|
|
83
|
+
display: flex;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.key-value--vertical .key-value-item {
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: var(--keyvalue-pair-gap, 4px);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.key-value--horizontal .key-value-item {
|
|
93
|
+
flex-direction: row;
|
|
94
|
+
align-items: baseline;
|
|
95
|
+
gap: var(--keyvalue-pair-gap, 12px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.key-value-label {
|
|
99
|
+
margin: 0;
|
|
100
|
+
color: var(--keyvalue-label-color, #1a1a1a);
|
|
101
|
+
font-size: var(--keyvalue-label-size, var(--_kv-label-size, 13px));
|
|
102
|
+
font-weight: var(--keyvalue-label-weight, 600);
|
|
103
|
+
line-height: var(--keyvalue-label-line-height, 1.4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.key-value--horizontal .key-value-label {
|
|
107
|
+
flex: 0 0 var(--keyvalue-label-width, 140px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.key-value-value {
|
|
111
|
+
margin: 0;
|
|
112
|
+
color: var(--keyvalue-value-color, #555);
|
|
113
|
+
font-size: var(--keyvalue-value-size, var(--_kv-value-size, 16px));
|
|
114
|
+
font-weight: var(--keyvalue-value-weight, 400);
|
|
115
|
+
line-height: var(--keyvalue-value-line-height, 1.4);
|
|
116
|
+
overflow-wrap: anywhere;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.key-value--horizontal .key-value-value {
|
|
120
|
+
flex: 1 1 auto;
|
|
121
|
+
min-width: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (max-width: 600px) {
|
|
125
|
+
.key-value {
|
|
126
|
+
grid-template-columns: 1fr;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type KeyValueProperties = MandatoryKeyValueProperties & OptionalKeyValueProperties;
|
|
3
|
+
export type KeyValueItem = {
|
|
4
|
+
/** The field label (the "key"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* The field value. May be `null`/`undefined`/empty — such items are skipped when
|
|
8
|
+
* `hideEmpty` is `true` (the default), or rendered as `emptyText` otherwise.
|
|
9
|
+
*/
|
|
10
|
+
value?: string | number | null;
|
|
11
|
+
/** Optional per-item test id, emitted as `data-pw` on the item wrapper. */
|
|
12
|
+
testId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type KeyValueLayout = 'vertical' | 'horizontal';
|
|
15
|
+
/** Size preset scaling the label/value typography. Mirrors Blend's KeyValuePair sizes. */
|
|
16
|
+
export type KeyValueSize = 'sm' | 'md' | 'lg';
|
|
17
|
+
export type MandatoryKeyValueProperties = {
|
|
18
|
+
items: KeyValueItem[];
|
|
19
|
+
};
|
|
20
|
+
export type OptionalKeyValueProperties = {
|
|
21
|
+
/**
|
|
22
|
+
* Number of columns the pairs flow across (row-major). Defaults to `2`. The grid
|
|
23
|
+
* collapses to a single column below the `--keyvalue-collapse-width` breakpoint.
|
|
24
|
+
*/
|
|
25
|
+
columns?: number;
|
|
26
|
+
/**
|
|
27
|
+
* `'vertical'` (default) stacks the value beneath the label; `'horizontal'` places the
|
|
28
|
+
* label and value side-by-side (label width set by `--keyvalue-label-width`).
|
|
29
|
+
*/
|
|
30
|
+
layout?: KeyValueLayout;
|
|
31
|
+
/**
|
|
32
|
+
* Typography size preset. `'sm'` (12/14px), `'md'` (13/16px, default), `'lg'` (14/18px) —
|
|
33
|
+
* label/value font sizes respectively. Individual `--keyvalue-label-size` /
|
|
34
|
+
* `--keyvalue-value-size` overrides always take precedence over the preset.
|
|
35
|
+
*/
|
|
36
|
+
size?: KeyValueSize;
|
|
37
|
+
/**
|
|
38
|
+
* When `true` (default), items whose value is `null`, `undefined`, or an empty/whitespace
|
|
39
|
+
* string are omitted. Set `false` to render them as `emptyText` instead.
|
|
40
|
+
*/
|
|
41
|
+
hideEmpty?: boolean;
|
|
42
|
+
/** Placeholder rendered for empty values when `hideEmpty` is `false`. Defaults to `'—'`. */
|
|
43
|
+
emptyText?: string;
|
|
44
|
+
/** Custom renderer for the value cell, receiving `(item, index)`. Falls back to plain text. */
|
|
45
|
+
valueSnippet?: Snippet<[KeyValueItem, number]>;
|
|
46
|
+
/** Custom renderer for the label cell, receiving `(item, index)`. Falls back to plain text. */
|
|
47
|
+
labelSnippet?: Snippet<[KeyValueItem, number]>;
|
|
48
|
+
/** Test selector applied as the `data-pw` attribute on the root grid. */
|
|
49
|
+
testId?: string;
|
|
50
|
+
/** Additional CSS classes for theming the root grid. */
|
|
51
|
+
classes?: string;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
color: var(--keyboard-input-key-color, #333333);
|
|
83
83
|
background-color: var(--keyboard-input-key-background, #f5f5f5);
|
|
84
84
|
border: var(--keyboard-input-key-border, 1px solid #d1d1d1);
|
|
85
|
-
border-radius: var(--keyboard-input-key-border-radius, 4px);
|
|
85
|
+
border-radius: var(--keyboard-input-key-border-radius, var(--radius, 4px));
|
|
86
86
|
box-shadow: var(--keyboard-input-key-box-shadow, 0 1px 0 #c4c4c4);
|
|
87
87
|
min-width: var(--keyboard-input-key-min-width, 1.6em);
|
|
88
88
|
padding: var(--keyboard-input-key-padding, 2px 6px);
|
package/dist/Menu/Menu.svelte
CHANGED
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
left: var(--menu-dropdown-left, 0);
|
|
285
285
|
background-color: var(--menu-background-color, #ffffff);
|
|
286
286
|
border: var(--menu-border, 1px solid #e0e0e0);
|
|
287
|
-
border-radius: var(--menu-border-radius,
|
|
287
|
+
border-radius: var(--menu-border-radius, var(--radius, 4px));
|
|
288
288
|
box-shadow: var(--menu-box-shadow, 0px 4px 16px rgba(0, 0, 0, 0.12));
|
|
289
289
|
min-width: var(--menu-min-width, 160px);
|
|
290
290
|
max-height: var(--menu-max-height, 240px);
|
package/dist/Modal/Modal.svelte
CHANGED
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
cursor: auto;
|
|
246
246
|
display: flex;
|
|
247
247
|
flex-direction: column;
|
|
248
|
-
border-radius: var(--modal-border-radius,
|
|
248
|
+
border-radius: var(--modal-border-radius, var(--radius, 4px));
|
|
249
249
|
overflow: var(--modal-content-overflow, auto);
|
|
250
250
|
border-top: var(--modal-content-border-top);
|
|
251
251
|
}
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
--button-height: var(--modal-footer-secondary-button-height, fit-content);
|
|
332
332
|
--button-padding: var(--modal-footer-secondary-button-padding, 16px);
|
|
333
333
|
--button-margin: var(--modal-footer-secondary-button-margin);
|
|
334
|
-
--button-border-radius: var(--modal-footer-secondary-button-border-radius,
|
|
334
|
+
--button-border-radius: var(--modal-footer-secondary-button-border-radius, var(--radius, 4px));
|
|
335
335
|
--button-width: var(--modal-footer-secondary-button-width, fit-content);
|
|
336
336
|
--cursor: var(--modal-footer-secondary-button-cursor, pointer);
|
|
337
337
|
--opacity: var(--modal-footer-secondary-button-opacity, 1);
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
--button-height: var(--modal-footer-primary-button-height, fit-content);
|
|
373
373
|
--button-padding: var(--modal-footer-primary-button-padding, 16px);
|
|
374
374
|
--button-margin: var(--modal-footer-primary-button-margin);
|
|
375
|
-
--button-border-radius: var(--modal-footer-primary-button-border-radius,
|
|
375
|
+
--button-border-radius: var(--modal-footer-primary-button-border-radius, var(--radius, 4px));
|
|
376
376
|
--button-width: var(--modal-footer-primary-button-width, fit-content);
|
|
377
377
|
--cursor: var(--modal-footer-primary-button-cursor, pointer);
|
|
378
378
|
--opacity: var(--modal-footer-primary-button-opacity, 1);
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
color: var(--pagination-button-color, #3a4550);
|
|
142
142
|
background: var(--pagination-button-background, transparent);
|
|
143
143
|
border: var(--pagination-button-border, 1px solid #d1d5db);
|
|
144
|
-
border-radius: var(--pagination-button-border-radius, 4px);
|
|
144
|
+
border-radius: var(--pagination-button-border-radius, var(--radius, 4px));
|
|
145
145
|
cursor: var(--pagination-button-cursor, pointer);
|
|
146
146
|
min-width: var(--pagination-button-min-width, 36px);
|
|
147
147
|
height: var(--pagination-button-height, 36px);
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
display: inline-block;
|
|
373
373
|
width: var(--chart-legend-swatch-size, 12px);
|
|
374
374
|
height: var(--chart-legend-swatch-size, 12px);
|
|
375
|
-
border-radius: var(--piechart-legend-swatch-radius,
|
|
375
|
+
border-radius: var(--piechart-legend-swatch-radius, var(--radius, 4px));
|
|
376
376
|
flex-shrink: 0;
|
|
377
377
|
}
|
|
378
378
|
.pie-legend-label {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
flex: 1;
|
|
34
34
|
height: var(--progress-track-height, 8px);
|
|
35
35
|
background: var(--progress-track-background, #e0e0e0);
|
|
36
|
-
border-radius: var(--progress-track-border-radius, 4px);
|
|
36
|
+
border-radius: var(--progress-track-border-radius, var(--radius, 4px));
|
|
37
37
|
overflow: hidden;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.bar {
|
|
41
41
|
height: 100%;
|
|
42
42
|
background: var(--progress-bar-background, #2196f3);
|
|
43
|
-
border-radius: var(--progress-bar-border-radius, 4px);
|
|
43
|
+
border-radius: var(--progress-bar-border-radius, var(--radius, 4px));
|
|
44
44
|
transition: var(--progress-bar-transition, width 0.3s ease);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
.proportion-bar-track {
|
|
160
160
|
width: 100%;
|
|
161
161
|
height: var(--proportion-bar-track-height, 10px);
|
|
162
|
-
border-radius: var(--proportion-bar-track-border-radius, 4px);
|
|
162
|
+
border-radius: var(--proportion-bar-track-border-radius, var(--radius, 4px));
|
|
163
163
|
overflow: hidden;
|
|
164
164
|
background: var(--proportion-bar-track-bg, #f0f0f0);
|
|
165
165
|
}
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
display: inline-block;
|
|
190
190
|
width: var(--proportion-bar-swatch-size, 10px);
|
|
191
191
|
height: var(--proportion-bar-swatch-size, 10px);
|
|
192
|
-
border-radius: var(--proportion-bar-swatch-border-radius,
|
|
192
|
+
border-radius: var(--proportion-bar-swatch-border-radius, var(--radius, 4px));
|
|
193
193
|
flex-shrink: 0;
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
showValues = false,
|
|
19
19
|
showLabels = true,
|
|
20
20
|
aspectRatio = 16 / 9,
|
|
21
|
+
maxHeight = Infinity,
|
|
21
22
|
valueFormat,
|
|
22
23
|
tooltipSnippet,
|
|
23
24
|
empty,
|
|
@@ -89,6 +90,26 @@
|
|
|
89
90
|
: (Math.max(0, chartWidth - MARGIN * 2) - nodeWidth) / (columnCount - 1)
|
|
90
91
|
);
|
|
91
92
|
|
|
93
|
+
// Node labels render alongside their bar; long labels used to overflow into the
|
|
94
|
+
// next column and collide. Clip each to the horizontal room its column actually
|
|
95
|
+
// has and append an ellipsis (the full text stays available via the node tooltip).
|
|
96
|
+
const LABEL_CHAR_PX = 7.2; // ≈ 0.6em at the 12px default label size
|
|
97
|
+
const truncateLabel = (text: string, column: number): string => {
|
|
98
|
+
const available =
|
|
99
|
+
column === 0
|
|
100
|
+
? MARGIN + 16
|
|
101
|
+
: column === columnCount - 1
|
|
102
|
+
? Math.max(colWidth, MARGIN + 24)
|
|
103
|
+
: Math.max(0, colWidth - nodeWidth - 12);
|
|
104
|
+
const maxChars = Math.floor(available / LABEL_CHAR_PX);
|
|
105
|
+
// No usable room — hide the label rather than force text that would overflow;
|
|
106
|
+
// the full text is still reachable via the node's <title> on hover.
|
|
107
|
+
if (maxChars < 3) {
|
|
108
|
+
return '';
|
|
109
|
+
}
|
|
110
|
+
return text.length > maxChars ? text.slice(0, maxChars - 1) + '…' : text;
|
|
111
|
+
};
|
|
112
|
+
|
|
92
113
|
// ── Helpers ────────────────────────────────────────────────────
|
|
93
114
|
|
|
94
115
|
/** Percentage of source node's total value carried by a link (0–100, 2 dp). */
|
|
@@ -276,7 +297,7 @@
|
|
|
276
297
|
{#if isEmpty && typeof empty === 'function'}
|
|
277
298
|
<div class="chart-empty">{@render empty()}</div>
|
|
278
299
|
{:else}
|
|
279
|
-
<ChartContainer bind:width={chartWidth} bind:height={chartHeight} {aspectRatio}>
|
|
300
|
+
<ChartContainer bind:width={chartWidth} bind:height={chartHeight} {aspectRatio} {maxHeight}>
|
|
280
301
|
<g transform="translate({MARGIN}, {MARGIN})">
|
|
281
302
|
{#if columnLabels != null && columnLabels.length > 0}
|
|
282
303
|
{#each columnLabels.slice(0, columnCount) as label, ci (ci)}
|
|
@@ -340,8 +361,11 @@
|
|
|
340
361
|
y={node.y + node.height / 2}
|
|
341
362
|
text-anchor={node.column === 0 ? 'end' : 'start'}
|
|
342
363
|
dominant-baseline="middle"
|
|
343
|
-
>{
|
|
344
|
-
({format(node.value)})
|
|
364
|
+
>{truncateLabel(
|
|
365
|
+
showValues ? `${node.label} (${format(node.value)})` : node.label,
|
|
366
|
+
node.column
|
|
367
|
+
)}<title>{showValues ? `${node.label} (${format(node.value)})` : node.label}</title
|
|
368
|
+
></text
|
|
345
369
|
>
|
|
346
370
|
{/if}
|
|
347
371
|
{/each}
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
padding: var(--select-trigger-padding, 8px 12px);
|
|
517
517
|
background: var(--select-trigger-background, #ffffff);
|
|
518
518
|
border: var(--select-trigger-border, 1px solid #cccccc);
|
|
519
|
-
border-radius: var(--select-trigger-border-radius,
|
|
519
|
+
border-radius: var(--select-trigger-border-radius, var(--radius, 4px));
|
|
520
520
|
cursor: pointer;
|
|
521
521
|
outline: none;
|
|
522
522
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
margin-top: var(--select-dropdown-gap, 4px);
|
|
604
604
|
background: var(--select-dropdown-background, #ffffff);
|
|
605
605
|
border: var(--select-dropdown-border, 1px solid #cccccc);
|
|
606
|
-
border-radius: var(--select-dropdown-border-radius,
|
|
606
|
+
border-radius: var(--select-dropdown-border-radius, var(--radius, 4px));
|
|
607
607
|
box-shadow: var(--select-dropdown-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
|
|
608
608
|
max-height: var(--select-dropdown-max-height, 200px);
|
|
609
609
|
overflow-y: auto;
|
|
@@ -659,7 +659,7 @@
|
|
|
659
659
|
width: var(--select-option-indicator-size, 18px);
|
|
660
660
|
height: var(--select-option-indicator-size, 18px);
|
|
661
661
|
border: var(--select-option-indicator-border, 2px solid #757575);
|
|
662
|
-
border-radius: var(--select-option-indicator-border-radius,
|
|
662
|
+
border-radius: var(--select-option-indicator-border-radius, var(--radius, 4px));
|
|
663
663
|
background-color: var(--select-option-indicator-background, transparent);
|
|
664
664
|
color: var(--select-option-indicator-color, currentColor);
|
|
665
665
|
transition:
|
package/dist/Sheet/Sheet.svelte
CHANGED
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
--button-width: var(--sheet-close-button-size, 32px);
|
|
249
249
|
--button-height: var(--sheet-close-button-size, 32px);
|
|
250
250
|
--button-border: none;
|
|
251
|
-
--button-border-radius: var(--sheet-close-button-border-radius, 4px);
|
|
251
|
+
--button-border-radius: var(--sheet-close-button-border-radius, var(--radius, 4px));
|
|
252
252
|
--button-color: var(--sheet-close-button-background, transparent);
|
|
253
253
|
--button-text-color: var(--sheet-close-button-color, #666666);
|
|
254
254
|
--button-font-size: var(--sheet-close-button-font-size, 16px);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
.shimmer {
|
|
11
11
|
width: var(--shimmer-width, 100%);
|
|
12
12
|
height: var(--shimmer-height, 16px);
|
|
13
|
-
border-radius: var(--shimmer-border-radius, 4px);
|
|
13
|
+
border-radius: var(--shimmer-border-radius, var(--radius, 4px));
|
|
14
14
|
background-color: var(--shimmer-background, #e0e0e0);
|
|
15
15
|
opacity: var(--shimmer-opacity, 1);
|
|
16
16
|
overflow: hidden;
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
appearance: none;
|
|
72
72
|
width: 100%;
|
|
73
73
|
height: var(--slider-track-height, 6px);
|
|
74
|
-
border-radius: var(--slider-track-border-radius,
|
|
74
|
+
border-radius: var(--slider-track-border-radius, var(--radius, 4px));
|
|
75
75
|
background: var(
|
|
76
76
|
--slider-track,
|
|
77
77
|
linear-gradient(
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
|
|
145
145
|
.slider-input::-moz-range-track {
|
|
146
146
|
height: var(--slider-track-height, 6px);
|
|
147
|
-
border-radius: var(--slider-track-border-radius,
|
|
147
|
+
border-radius: var(--slider-track-border-radius, var(--radius, 4px));
|
|
148
148
|
background: transparent;
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
gap: var(--snippet-gap, 8px);
|
|
59
59
|
background: var(--snippet-background, #1e1e1e);
|
|
60
60
|
border: var(--snippet-border, 1px solid #333);
|
|
61
|
-
border-radius: var(--snippet-border-radius,
|
|
61
|
+
border-radius: var(--snippet-border-radius, var(--radius, 4px));
|
|
62
62
|
padding: var(--snippet-padding, 12px 16px);
|
|
63
63
|
font-family: var(--snippet-font-family, monospace);
|
|
64
64
|
font-size: var(--snippet-font-size, 14px);
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
--button-text-color: var(--snippet-copy-color, #888);
|
|
94
94
|
--button-border: var(--snippet-copy-border, none);
|
|
95
95
|
--button-padding: var(--snippet-copy-padding, 4px);
|
|
96
|
-
--button-border-radius: var(--snippet-copy-border-radius, 4px);
|
|
96
|
+
--button-border-radius: var(--snippet-copy-border-radius, var(--radius, 4px));
|
|
97
97
|
--cursor: var(--snippet-copy-cursor, pointer);
|
|
98
98
|
--button-hover-color: var(--snippet-copy-hover-background, #333);
|
|
99
99
|
display: flex;
|
|
@@ -73,7 +73,10 @@
|
|
|
73
73
|
--button-font-weight: var(--split-button-primary-font-weight, 500);
|
|
74
74
|
--button-font-family: var(--split-button-primary-font-family);
|
|
75
75
|
--button-border: var(--split-button-primary-border, none);
|
|
76
|
-
--button-border-radius: var(
|
|
76
|
+
--button-border-radius: var(
|
|
77
|
+
--split-button-primary-border-radius,
|
|
78
|
+
var(--radius, 4px) 0 0 var(--radius, 4px)
|
|
79
|
+
);
|
|
77
80
|
--button-hover-color: var(
|
|
78
81
|
--split-button-primary-hover-background,
|
|
79
82
|
var(--split-button-primary-background, #3a4550)
|
|
@@ -97,7 +100,10 @@
|
|
|
97
100
|
display: flex;
|
|
98
101
|
align-items: stretch;
|
|
99
102
|
background-color: var(--split-button-trigger-background, #3a4550);
|
|
100
|
-
border-radius: var(
|
|
103
|
+
border-radius: var(
|
|
104
|
+
--split-button-trigger-border-radius,
|
|
105
|
+
0 var(--radius, 4px) var(--radius, 4px) 0
|
|
106
|
+
);
|
|
101
107
|
color: var(--split-button-trigger-color, white);
|
|
102
108
|
cursor: pointer;
|
|
103
109
|
}
|
|
@@ -198,10 +198,10 @@
|
|
|
198
198
|
</div>
|
|
199
199
|
{/if}
|
|
200
200
|
</div>
|
|
201
|
+
{/if}
|
|
201
202
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
{/if}
|
|
203
|
+
{#if typeof subtitle === 'string' && subtitle.length > 0}
|
|
204
|
+
<div class="statcard-subtitle">{subtitle}</div>
|
|
205
205
|
{/if}
|
|
206
206
|
|
|
207
207
|
{#if children}
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
padding: var(--statcard-padding, 16px);
|
|
222
222
|
background: var(--statcard-background, #ffffff);
|
|
223
223
|
border: var(--statcard-border, 1px solid #e5e7eb);
|
|
224
|
-
border-radius: var(--statcard-border-radius,
|
|
224
|
+
border-radius: var(--statcard-border-radius, var(--radius, 4px));
|
|
225
225
|
box-shadow: var(--statcard-box-shadow, none);
|
|
226
226
|
width: var(--statcard-width, auto);
|
|
227
227
|
min-width: var(--statcard-min-width, 0);
|
package/dist/Table/Table.svelte
CHANGED
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
gap: var(--table-search-gap, 8px);
|
|
521
521
|
padding: var(--table-search-padding, 8px 12px);
|
|
522
522
|
border: var(--table-search-border, 1px solid #e5e7eb);
|
|
523
|
-
border-radius: var(--table-search-border-radius,
|
|
523
|
+
border-radius: var(--table-search-border-radius, var(--radius, 4px));
|
|
524
524
|
background-color: var(--table-search-background, #ffffff);
|
|
525
525
|
margin-bottom: var(--table-search-margin-bottom, 8px);
|
|
526
526
|
}
|
|
@@ -550,7 +550,7 @@
|
|
|
550
550
|
.table-search-input:focus-visible {
|
|
551
551
|
outline: 2px solid var(--table-focus-outline-color, #3b82f6);
|
|
552
552
|
outline-offset: 2px;
|
|
553
|
-
border-radius: var(--table-search-focus-border-radius,
|
|
553
|
+
border-radius: var(--table-search-focus-border-radius, var(--radius, 4px));
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
.table-search-input::placeholder {
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
/* ── Container ──────────────────────────────────────────────────────────── */
|
|
588
588
|
.table-container {
|
|
589
589
|
border: var(--table-border, 1px solid #e5e7eb);
|
|
590
|
-
border-radius: var(--table-border-radius,
|
|
590
|
+
border-radius: var(--table-border-radius, var(--radius, 4px));
|
|
591
591
|
width: var(--table-container-width, 100%);
|
|
592
592
|
overflow: hidden;
|
|
593
593
|
}
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
width: var(--table-checkbox-size, 18px);
|
|
701
701
|
height: var(--table-checkbox-size, 18px);
|
|
702
702
|
border: var(--table-checkbox-border, 2px solid #9ca3af);
|
|
703
|
-
border-radius: var(--table-checkbox-border-radius,
|
|
703
|
+
border-radius: var(--table-checkbox-border-radius, var(--radius, 4px));
|
|
704
704
|
background-color: var(--table-checkbox-background, transparent);
|
|
705
705
|
cursor: pointer;
|
|
706
706
|
flex-shrink: 0;
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
height: var(--theme-switcher-size, 36px);
|
|
163
163
|
padding: 0;
|
|
164
164
|
border: none;
|
|
165
|
-
border-radius: var(--theme-switcher-border-radius,
|
|
165
|
+
border-radius: var(--theme-switcher-border-radius, var(--radius, 4px));
|
|
166
166
|
background-color: var(--theme-switcher-bg, transparent);
|
|
167
167
|
cursor: pointer;
|
|
168
168
|
color: var(--theme-switcher-icon-color, #374151);
|
|
@@ -211,14 +211,14 @@
|
|
|
211
211
|
gap: var(--theme-switcher-segment-gap, 2px);
|
|
212
212
|
padding: var(--theme-switcher-segment-padding, 4px);
|
|
213
213
|
background-color: var(--theme-switcher-segment-bg, #f3f4f6);
|
|
214
|
-
border-radius: var(--theme-switcher-border-radius,
|
|
214
|
+
border-radius: var(--theme-switcher-border-radius, var(--radius, 4px));
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
.segment-indicator {
|
|
218
218
|
position: absolute;
|
|
219
219
|
top: var(--theme-switcher-segment-padding, 4px);
|
|
220
220
|
bottom: var(--theme-switcher-segment-padding, 4px);
|
|
221
|
-
border-radius: var(--theme-switcher-segment-border-radius,
|
|
221
|
+
border-radius: var(--theme-switcher-segment-border-radius, var(--radius, 4px));
|
|
222
222
|
background-color: var(--theme-switcher-segment-active-bg, #ffffff);
|
|
223
223
|
box-shadow: var(--theme-switcher-segment-shadow, 0 1px 2px rgba(0, 0, 0, 0.1));
|
|
224
224
|
transition:
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
justify-content: center;
|
|
236
236
|
padding: var(--theme-switcher-segment-button-padding, 6px 10px);
|
|
237
237
|
border: none;
|
|
238
|
-
border-radius: var(--theme-switcher-segment-border-radius,
|
|
238
|
+
border-radius: var(--theme-switcher-segment-border-radius, var(--radius, 4px));
|
|
239
239
|
background: transparent;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
color: var(--theme-switcher-icon-color, #374151);
|
package/dist/Toast/Toast.svelte
CHANGED
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
font-family: var(--toast-font-family, inherit);
|
|
163
163
|
font-weight: var(--toast-font-weight);
|
|
164
164
|
height: var(--toast-height, fit-content);
|
|
165
|
-
border-radius: var(--toast-border-radius,
|
|
165
|
+
border-radius: var(--toast-border-radius, var(--radius, 4px));
|
|
166
166
|
border: var(--toast-border, none);
|
|
167
167
|
border-style: var(--toast-border-style);
|
|
168
168
|
width: var(--toast-width, fit-content);
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
`font-weight:var(--tooltip-font-weight,400)`,
|
|
108
108
|
`font-family:var(--tooltip-font-family,inherit)`,
|
|
109
109
|
`padding:var(--tooltip-padding,6px 10px)`,
|
|
110
|
-
`border-radius:var(--tooltip-border-radius,4px)`,
|
|
110
|
+
`border-radius: var(--tooltip-border-radius, var(--radius, 4px))`,
|
|
111
111
|
`border:var(--tooltip-border,none)`,
|
|
112
112
|
`box-shadow:var(--tooltip-box-shadow,0 2px 6px rgba(0,0,0,0.15))`,
|
|
113
113
|
`white-space:normal`,
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
font-weight: var(--tooltip-font-weight, 400);
|
|
250
250
|
font-family: var(--tooltip-font-family);
|
|
251
251
|
padding: var(--tooltip-padding, 6px 10px);
|
|
252
|
-
border-radius: var(--tooltip-border-radius, 4px);
|
|
252
|
+
border-radius: var(--tooltip-border-radius, var(--radius, 4px));
|
|
253
253
|
border: var(--tooltip-border, none);
|
|
254
254
|
box-shadow: var(--tooltip-box-shadow, 0 2px 6px rgba(0, 0, 0, 0.15));
|
|
255
255
|
white-space: normal;
|
|
@@ -104,7 +104,7 @@ export const tooltip = (node, options) => {
|
|
|
104
104
|
`font-weight:var(--tooltip-font-weight,400)`,
|
|
105
105
|
`font-family:var(--tooltip-font-family,inherit)`,
|
|
106
106
|
`padding:var(--tooltip-padding,6px 10px)`,
|
|
107
|
-
`border-radius:var(--tooltip-border-radius,4px)`,
|
|
107
|
+
`border-radius: var(--tooltip-border-radius, var(--radius, 4px))`,
|
|
108
108
|
`border:var(--tooltip-border,none)`,
|
|
109
109
|
`box-shadow:var(--tooltip-box-shadow,0 2px 6px rgba(0,0,0,0.15))`,
|
|
110
110
|
'white-space:normal',
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
height = $bindable(0),
|
|
8
8
|
aspectRatio = 16 / 9,
|
|
9
9
|
minHeight = 0,
|
|
10
|
+
maxHeight = Infinity,
|
|
10
11
|
testId,
|
|
11
12
|
classes,
|
|
12
13
|
children
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
const rect = containerEl.getBoundingClientRect();
|
|
23
24
|
const w = Math.round(rect.width);
|
|
24
25
|
width = w;
|
|
25
|
-
height = Math.max(minHeight, Math.round(w / aspectRatio));
|
|
26
|
+
height = Math.min(maxHeight, Math.max(minHeight, Math.round(w / aspectRatio)));
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
// Re-measure whenever aspectRatio changes at runtime (e.g. semiCircle toggled).
|
|
@@ -30,8 +31,10 @@
|
|
|
30
31
|
// the ResizeObserver and the component is being torn down.
|
|
31
32
|
// eslint-disable-next-line no-restricted-syntax
|
|
32
33
|
$effect(() => {
|
|
33
|
-
// Reading aspectRatio here makes this effect re-run whenever
|
|
34
|
+
// Reading aspectRatio/maxHeight here makes this effect re-run whenever either
|
|
35
|
+
// changes, so the computed height stays current without waiting for a resize.
|
|
34
36
|
void aspectRatio;
|
|
37
|
+
void maxHeight;
|
|
35
38
|
if (isMounted) {
|
|
36
39
|
measure();
|
|
37
40
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
font-size: var(--chart-tooltip-font-size, 12px);
|
|
35
35
|
font-family: var(--chart-font-family, inherit);
|
|
36
36
|
padding: var(--chart-tooltip-padding, 8px 12px);
|
|
37
|
-
border-radius: var(--chart-tooltip-border-radius, 4px);
|
|
37
|
+
border-radius: var(--chart-tooltip-border-radius, var(--radius, 4px));
|
|
38
38
|
box-shadow: var(--chart-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.2));
|
|
39
39
|
pointer-events: none;
|
|
40
40
|
max-width: var(--chart-tooltip-max-width, 280px);
|
package/dist/_chart/geometry.js
CHANGED
|
@@ -115,12 +115,16 @@ export function computeSankeyLayout(nodes, links, width, height, nodeWidth = 16,
|
|
|
115
115
|
for (const [, ids] of columnGroups) {
|
|
116
116
|
for (const id of ids) {
|
|
117
117
|
const deps = incoming.get(id) ?? [];
|
|
118
|
-
|
|
118
|
+
const totalDepValue = deps.reduce((s, d) => s + d.value, 0);
|
|
119
|
+
// Only re-centre against incoming links when they carry positive volume.
|
|
120
|
+
// With all-zero weights the division yielded NaN, which propagated to
|
|
121
|
+
// every node position and collapsed the chart; keep the initial y instead.
|
|
122
|
+
if (totalDepValue > 0) {
|
|
119
123
|
const weightedY = deps.reduce((s, d) => {
|
|
120
124
|
const sy = nodeY.get(d.source) ?? 0;
|
|
121
125
|
const sh = nodeH.get(d.source) ?? 0;
|
|
122
126
|
return s + (sy + sh / 2) * d.value;
|
|
123
|
-
}, 0) /
|
|
127
|
+
}, 0) / totalDepValue;
|
|
124
128
|
nodeY.set(id, Math.max(0, weightedY - (nodeH.get(id) ?? 0) / 2));
|
|
125
129
|
}
|
|
126
130
|
}
|
package/dist/_chart/types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Button } from './Button/Button.svelte';
|
|
|
4
4
|
export { default as Input } from './Input/Input.svelte';
|
|
5
5
|
export { default as InputButton } from './InputButton/InputButton.svelte';
|
|
6
6
|
export { default as ListItem } from './ListItem/ListItem.svelte';
|
|
7
|
+
export { default as KeyValue } from './KeyValue/KeyValue.svelte';
|
|
7
8
|
export { default as Loader } from './Loader/Loader.svelte';
|
|
8
9
|
export { default as Toolbar } from './Toolbar/Toolbar.svelte';
|
|
9
10
|
export { default as Icon } from './Icon/Icon.svelte';
|
|
@@ -77,6 +78,7 @@ export type * from './Modal/properties';
|
|
|
77
78
|
export type * from './Input/properties';
|
|
78
79
|
export type * from './InputButton/properties';
|
|
79
80
|
export type * from './ListItem/properties';
|
|
81
|
+
export type * from './KeyValue/properties';
|
|
80
82
|
export type * from './types';
|
|
81
83
|
export type * from './Icon/properties';
|
|
82
84
|
export type * from './BrandLoader/properties';
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Button } from './Button/Button.svelte';
|
|
|
4
4
|
export { default as Input } from './Input/Input.svelte';
|
|
5
5
|
export { default as InputButton } from './InputButton/InputButton.svelte';
|
|
6
6
|
export { default as ListItem } from './ListItem/ListItem.svelte';
|
|
7
|
+
export { default as KeyValue } from './KeyValue/KeyValue.svelte';
|
|
7
8
|
export { default as Loader } from './Loader/Loader.svelte';
|
|
8
9
|
export { default as Toolbar } from './Toolbar/Toolbar.svelte';
|
|
9
10
|
export { default as Icon } from './Icon/Icon.svelte';
|