@juspay/svelte-ui-components 2.80.1 → 2.80.3

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 (53) hide show
  1. package/dist/Badge/Badge.svelte +1 -1
  2. package/dist/Banner/Banner.svelte +1 -1
  3. package/dist/Book/Book.svelte +1 -1
  4. package/dist/Browser/Browser.svelte +3 -3
  5. package/dist/Button/Button.svelte +150 -34
  6. package/dist/Button/properties.d.ts +40 -1
  7. package/dist/Calendar/Calendar.svelte +2 -2
  8. package/dist/Card/Card.svelte +1 -1
  9. package/dist/Checkbox/Checkbox.svelte +1 -1
  10. package/dist/Choicebox/Choicebox.svelte +1 -1
  11. package/dist/ColorPicker/ColorPicker.svelte +8 -5
  12. package/dist/Combobox/Combobox.svelte +2 -2
  13. package/dist/CommandMenu/CommandMenu.svelte +3 -3
  14. package/dist/ContextMenu/ContextMenu.svelte +1 -1
  15. package/dist/DateRangePicker/DateRangePicker.svelte +9 -9
  16. package/dist/DualAxisBarChart/DualAxisBarChart.svelte +60 -8
  17. package/dist/DualAxisBarChart/properties.d.ts +26 -0
  18. package/dist/FileInput/FileInput.svelte +1 -1
  19. package/dist/GridItem/GridItem.svelte +2 -2
  20. package/dist/Input/Input.svelte +5 -5
  21. package/dist/InputButton/InputButton.svelte +6 -3
  22. package/dist/KeyValue/KeyValue.svelte +129 -0
  23. package/dist/KeyValue/KeyValue.svelte.d.ts +4 -0
  24. package/dist/KeyValue/properties.d.ts +52 -0
  25. package/dist/KeyValue/properties.js +1 -0
  26. package/dist/KeyboardInput/KeyboardInput.svelte +1 -1
  27. package/dist/Menu/Menu.svelte +1 -1
  28. package/dist/Modal/Modal.svelte +3 -3
  29. package/dist/Pagination/Pagination.svelte +1 -1
  30. package/dist/PieChart/PieChart.svelte +1 -1
  31. package/dist/Progress/Progress.svelte +2 -2
  32. package/dist/ProportionBar/ProportionBar.svelte +2 -2
  33. package/dist/SankeyChart/SankeyChart.svelte +27 -3
  34. package/dist/SankeyChart/properties.d.ts +1 -0
  35. package/dist/Select/Select.svelte +3 -3
  36. package/dist/Sheet/Sheet.svelte +1 -1
  37. package/dist/Shimmer/Shimmer.svelte +1 -1
  38. package/dist/Slider/Slider.svelte +2 -2
  39. package/dist/Snippet/Snippet.svelte +2 -2
  40. package/dist/SplitButton/SplitButton.svelte +8 -2
  41. package/dist/StatCard/StatCard.svelte +4 -4
  42. package/dist/Table/Table.svelte +4 -4
  43. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +4 -4
  44. package/dist/Toast/Toast.svelte +1 -1
  45. package/dist/Tooltip/Tooltip.svelte +2 -2
  46. package/dist/Tooltip/tooltip-action.js +1 -1
  47. package/dist/_chart/ChartContainer.svelte +5 -2
  48. package/dist/_chart/ChartTooltip.svelte +1 -1
  49. package/dist/_chart/geometry.js +6 -2
  50. package/dist/_chart/types.d.ts +1 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +1 -0
  53. package/package.json +1 -1
@@ -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, 3px);
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, 3px);
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, 6px);
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(--split-button-primary-border-radius, 4px 0 0 4px);
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(--split-button-trigger-border-radius, 0 4px 4px 0);
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
- {#if typeof subtitle === 'string' && subtitle.length > 0}
203
- <div class="statcard-subtitle">{subtitle}</div>
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, 8px);
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);
@@ -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, 8px);
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, 2px);
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, 8px);
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, 3px);
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, 8px);
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, 8px);
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, 6px);
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, 6px);
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);
@@ -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, 0px);
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 it changes.
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);
@@ -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
- if (deps.length > 0) {
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) / deps.reduce((s, d) => s + d.value, 0);
127
+ }, 0) / totalDepValue;
124
128
  nodeY.set(id, Math.max(0, weightedY - (nodeH.get(id) ?? 0) / 2));
125
129
  }
126
130
  }
@@ -112,6 +112,7 @@ export type ChartContainerProperties = {
112
112
  height?: number;
113
113
  aspectRatio?: number;
114
114
  minHeight?: number;
115
+ maxHeight?: number;
115
116
  testId?: string;
116
117
  classes?: string;
117
118
  children: Snippet;
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.80.1",
3
+ "version": "2.80.3",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",