@juspay/svelte-ui-components 3.1.6 → 3.2.1

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 (122) hide show
  1. package/README.md +55 -2
  2. package/dist/Accordion/Accordion.svelte +5 -1
  3. package/dist/Accordion/properties.d.ts +1 -0
  4. package/dist/AreaChart/AreaChart.svelte +8 -2
  5. package/dist/AreaChart/properties.d.ts +10 -0
  6. package/dist/Banner/Banner.svelte +5 -1
  7. package/dist/Banner/properties.d.ts +1 -0
  8. package/dist/BarChart/BarChart.svelte +8 -2
  9. package/dist/BarChart/properties.d.ts +8 -0
  10. package/dist/Book/Book.svelte +5 -1
  11. package/dist/Book/properties.d.ts +1 -0
  12. package/dist/Calendar/Calendar.svelte +11 -3
  13. package/dist/Calendar/properties.d.ts +11 -0
  14. package/dist/Chat/Chat.svelte +29 -9
  15. package/dist/Chat/properties.d.ts +9 -0
  16. package/dist/ChatBubble/ChatBubble.svelte +11 -3
  17. package/dist/ChatBubble/properties.d.ts +3 -0
  18. package/dist/ChatComposer/ChatComposer.svelte +38 -12
  19. package/dist/ChatComposer/properties.d.ts +12 -0
  20. package/dist/ChatHeader/ChatHeader.svelte +5 -1
  21. package/dist/ChatHeader/properties.d.ts +1 -0
  22. package/dist/ChatMessage/ChatMessage.svelte +11 -3
  23. package/dist/ChatMessage/properties.d.ts +3 -0
  24. package/dist/ChatMessageList/ChatMessageList.svelte +11 -3
  25. package/dist/ChatMessageList/properties.d.ts +6 -0
  26. package/dist/ChatSuggestions/ChatSuggestions.svelte +5 -1
  27. package/dist/ChatSuggestions/properties.d.ts +1 -0
  28. package/dist/CheckListItem/CheckListItem.svelte +5 -1
  29. package/dist/CheckListItem/properties.d.ts +1 -0
  30. package/dist/Checkbox/Checkbox.svelte +5 -1
  31. package/dist/Checkbox/properties.d.ts +1 -0
  32. package/dist/ChipInput/ChipInput.svelte +14 -4
  33. package/dist/ChipInput/properties.d.ts +4 -0
  34. package/dist/Choicebox/Choicebox.svelte +5 -1
  35. package/dist/Choicebox/properties.d.ts +1 -0
  36. package/dist/ColorPicker/ColorPicker.svelte +8 -2
  37. package/dist/ColorPicker/properties.d.ts +2 -0
  38. package/dist/Combobox/Combobox.svelte +26 -8
  39. package/dist/Combobox/properties.d.ts +8 -0
  40. package/dist/CommandMenu/CommandMenu.svelte +8 -2
  41. package/dist/CommandMenu/properties.d.ts +2 -0
  42. package/dist/ContextMenu/ContextMenu.svelte +11 -3
  43. package/dist/ContextMenu/properties.d.ts +3 -0
  44. package/dist/DateRangePicker/DateRangePicker.svelte +20 -6
  45. package/dist/DateRangePicker/properties.d.ts +19 -0
  46. package/dist/DualAxisBarChart/DualAxisBarChart.svelte +5 -1
  47. package/dist/DualAxisBarChart/properties.d.ts +4 -0
  48. package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +5 -1
  49. package/dist/FileDropzoneTrigger/properties.d.ts +1 -0
  50. package/dist/FileInput/FileInput.svelte +8 -2
  51. package/dist/FileInput/properties.d.ts +2 -0
  52. package/dist/FunnelChart/FunnelChart.svelte +8 -2
  53. package/dist/FunnelChart/properties.d.ts +8 -0
  54. package/dist/Img/Img.svelte +14 -2
  55. package/dist/Img/properties.d.ts +1 -0
  56. package/dist/Input/Input.svelte +23 -7
  57. package/dist/Input/properties.d.ts +7 -0
  58. package/dist/LineChart/LineChart.svelte +8 -2
  59. package/dist/LineChart/properties.d.ts +10 -0
  60. package/dist/ListItem/ListItem.svelte +17 -5
  61. package/dist/ListItem/properties.d.ts +5 -0
  62. package/dist/LottiePlayer/LottiePlayer.svelte +8 -2
  63. package/dist/LottiePlayer/properties.d.ts +2 -0
  64. package/dist/MediaPlayer/MediaPlayer.svelte +5 -1
  65. package/dist/MediaPlayer/properties.d.ts +1 -0
  66. package/dist/Menu/Menu.svelte +11 -3
  67. package/dist/Menu/properties.d.ts +3 -0
  68. package/dist/Modal/Modal.svelte +22 -6
  69. package/dist/Modal/properties.d.ts +6 -0
  70. package/dist/Pagination/Pagination.svelte +5 -1
  71. package/dist/Pagination/properties.d.ts +1 -0
  72. package/dist/PieChart/PieChart.svelte +8 -2
  73. package/dist/PieChart/properties.d.ts +8 -0
  74. package/dist/Pill/Pill.svelte +5 -1
  75. package/dist/Pill/properties.d.ts +1 -0
  76. package/dist/Radio/Radio.svelte +5 -1
  77. package/dist/Radio/properties.d.ts +1 -0
  78. package/dist/Resizable/Resizable.svelte +11 -3
  79. package/dist/Resizable/properties.d.ts +3 -0
  80. package/dist/SankeyChart/SankeyChart.svelte +14 -4
  81. package/dist/SankeyChart/properties.d.ts +12 -0
  82. package/dist/Scroller/Scroller.svelte +5 -1
  83. package/dist/Scroller/properties.d.ts +1 -0
  84. package/dist/Select/Select.svelte +11 -3
  85. package/dist/Select/properties.d.ts +3 -0
  86. package/dist/Sheet/Sheet.svelte +11 -3
  87. package/dist/Sheet/properties.d.ts +3 -0
  88. package/dist/Slider/Slider.svelte +8 -2
  89. package/dist/Slider/properties.d.ts +2 -0
  90. package/dist/Snippet/Snippet.svelte +5 -1
  91. package/dist/Snippet/properties.d.ts +1 -0
  92. package/dist/SplitButton/SplitButton.svelte +5 -1
  93. package/dist/SplitButton/properties.d.ts +1 -0
  94. package/dist/SplitInput/SplitInput.svelte +11 -3
  95. package/dist/SplitInput/properties.d.ts +3 -0
  96. package/dist/Status/Status.svelte +5 -1
  97. package/dist/Status/properties.d.ts +1 -0
  98. package/dist/Stepper/Stepper.svelte +8 -2
  99. package/dist/Stepper/properties.d.ts +9 -0
  100. package/dist/Tabs/Tabs.svelte +8 -2
  101. package/dist/Tabs/properties.d.ts +2 -0
  102. package/dist/TaskList/TaskList.svelte +4 -1
  103. package/dist/TaskList/properties.d.ts +1 -0
  104. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +9 -1
  105. package/dist/ThemeSwitcher/properties.d.ts +1 -0
  106. package/dist/ThinkingIndicator/ThinkingIndicator.svelte +8 -2
  107. package/dist/ThinkingIndicator/properties.d.ts +2 -0
  108. package/dist/Toggle/Toggle.svelte +5 -1
  109. package/dist/Toggle/properties.d.ts +1 -0
  110. package/dist/ToolCallLog/ToolCallLog.svelte +10 -1
  111. package/dist/ToolCallLog/properties.d.ts +1 -0
  112. package/dist/Toolbar/Toolbar.svelte +5 -1
  113. package/dist/Toolbar/properties.d.ts +1 -0
  114. package/dist-wc/index.js +5542 -3454
  115. package/package.json +20 -5
  116. package/scripts/codemod/README.md +76 -0
  117. package/scripts/codemod/cli.ts +206 -0
  118. package/scripts/codemod/map.ts +118 -0
  119. package/scripts/codemod/transform.ts +549 -0
  120. package/scripts/codemod/tsconfig.json +15 -0
  121. package/scripts/codemod/wc-children.ts +75 -0
  122. package/scripts/postinstall.mjs +56 -0
@@ -18,10 +18,16 @@
18
18
  scrollRightIcon,
19
19
  tab,
20
20
  classes,
21
- onchange,
22
- onkeychange
21
+ onchange: onchangeLegacy,
22
+ onChange,
23
+ onkeychange: onkeychangeLegacy,
24
+ onKeyChange
23
25
  }: TabsProperties = $props();
24
26
 
27
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
28
+ const onchange = $derived(onChange ?? onchangeLegacy);
29
+ const onkeychange = $derived(onKeyChange ?? onkeychangeLegacy);
30
+
25
31
  const isVertical = $derived(orientation === 'vertical');
26
32
 
27
33
  const isObjectMode = $derived(items.length > 0 && typeof items.at(0) === 'object');
@@ -55,5 +55,7 @@ export type OptionalTabsProperties = {
55
55
  };
56
56
  export type TabsEventProperties = {
57
57
  onchange?: (index: number, label: string) => void;
58
+ onChange?: (index: number, label: string) => void;
58
59
  onkeychange?: (key: string) => void;
60
+ onKeyChange?: (key: string) => void;
59
61
  };
@@ -4,7 +4,10 @@
4
4
  import Button from '../Button/Button.svelte';
5
5
  import type { TaskListProperties } from './properties';
6
6
 
7
- let { rows, onretry, testId, classes }: TaskListProperties = $props();
7
+ let { rows, onretry: onretryLegacy, onRetry, testId, classes }: TaskListProperties = $props();
8
+
9
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
10
+ const onretry = $derived(onRetry ?? onretryLegacy);
8
11
 
9
12
  // Rows appended in one update stagger relative to the batch, not the list start —
10
13
  // mirrors ThinkingTrace's growthWatcher so a host that streams rows in gets the
@@ -19,6 +19,7 @@ export type MandatoryTaskListProperties = {
19
19
  export type OptionalTaskListProperties = {
20
20
  /** Fires when a failed row's retry button is clicked, with that row's index. */
21
21
  onretry?: (index: number) => void;
22
+ onRetry?: (index: number) => void;
22
23
  testId?: string;
23
24
  classes?: string;
24
25
  };
@@ -30,9 +30,13 @@
30
30
  storageKey = 'theme-preference',
31
31
  testId,
32
32
  classes,
33
- onchange
33
+ onchange: onchangeLegacy,
34
+ onChange
34
35
  }: ThemeSwitcherProperties = $props();
35
36
 
37
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
38
+ const onchange = $derived(onChange ?? onchangeLegacy);
39
+
36
40
  let currentValue: string = $state(value ?? 'system');
37
41
  let systemPreference: string = $state('light');
38
42
 
@@ -179,6 +183,10 @@
179
183
  background-color: var(--theme-switcher-bg-hover, #f3f4f6);
180
184
  }
181
185
 
186
+ .toggle-button:active {
187
+ background-color: var(--theme-switcher-bg-pressed, #e5e7eb);
188
+ }
189
+
182
190
  .icon {
183
191
  display: inline-flex;
184
192
  align-items: center;
@@ -16,4 +16,5 @@ export type OptionalThemeSwitcherProperties = {
16
16
  };
17
17
  export type ThemeSwitcherEventProperties = {
18
18
  onchange?: (value: string, resolvedValue: string) => void;
19
+ onChange?: (value: string, resolvedValue: string) => void;
19
20
  };
@@ -27,11 +27,17 @@
27
27
  moreLabel,
28
28
  selectable = false,
29
29
  selected = $bindable(null),
30
- onrowselect,
31
- onsettled,
30
+ onrowselect: onrowselectLegacy,
31
+ onRowSelect,
32
+ onsettled: onsettledLegacy,
33
+ onSettled,
32
34
  collapseDelayMs = 2600
33
35
  }: ThinkingIndicatorProperties = $props();
34
36
 
37
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
38
+ const onrowselect = $derived(onRowSelect ?? onrowselectLegacy);
39
+ const onsettled = $derived(onSettled ?? onsettledLegacy);
40
+
35
41
  // `rows` being present at all (even `[]`) puts the indicator into trace mode: the
36
42
  // Accordion body renders the kind-aware trace instead of the `detail` paragraph,
37
43
  // and that alone is enough to make the indicator expandable.
@@ -83,8 +83,10 @@ export type OptionalThinkingIndicatorProperties = {
83
83
  /** Bindable index of the selected coding row (`null` = none). */
84
84
  selected?: number | null;
85
85
  onrowselect?: (index: number | null) => void;
86
+ onRowSelect?: (index: number | null) => void;
86
87
  /** Fires exactly once, the moment `busy` flips false. No effect while `busy` is never set. */
87
88
  onsettled?: () => void;
89
+ onSettled?: () => void;
88
90
  /**
89
91
  * Delay (ms) before the automatic post-settle collapse fires once `busy` flips
90
92
  * false. `null` disables the automatic collapse. Has no effect while `busy` is
@@ -7,9 +7,13 @@
7
7
  disabled = false,
8
8
  testId,
9
9
  classes,
10
- onclick
10
+ onclick: onclickLegacy,
11
+ onClick
11
12
  }: ToggleProperties = $props();
12
13
 
14
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
15
+ const onclick = $derived(onClick ?? onclickLegacy);
16
+
13
17
  const handleCheckboxClick = (e: MouseEvent): void => {
14
18
  if (e.target instanceof HTMLInputElement && typeof e.target.checked === 'boolean') {
15
19
  checked = e.target.checked;
@@ -8,4 +8,5 @@ export type OptionalToggleProperties = {
8
8
  };
9
9
  export type ToggleEventProperties = {
10
10
  onclick?: (checked: boolean) => void;
11
+ onClick?: (checked: boolean) => void;
11
12
  };
@@ -6,7 +6,16 @@
6
6
  import { computeMenuDropdownPosition } from '../Menu/dropdownPosition';
7
7
  import type { ToolCallChip, ToolCallLogProperties } from './properties';
8
8
 
9
- let { chips, onchipclick, testId, classes }: ToolCallLogProperties = $props();
9
+ let {
10
+ chips,
11
+ onchipclick: onchipclickLegacy,
12
+ onChipClick,
13
+ testId,
14
+ classes
15
+ }: ToolCallLogProperties = $props();
16
+
17
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
18
+ const onchipclick = $derived(onChipClick ?? onchipclickLegacy);
10
19
 
11
20
  // Exactly one popover open at a time, component-local.
12
21
  let openIndex = $state<number | null>(null);
@@ -22,6 +22,7 @@ export type MandatoryToolCallLogProperties = {
22
22
  };
23
23
  export type OptionalToolCallLogProperties = {
24
24
  onchipclick?: (index: number, chip: ToolCallChip) => void;
25
+ onChipClick?: (index: number, chip: ToolCallChip) => void;
25
26
  testId?: string;
26
27
  classes?: string;
27
28
  };
@@ -11,12 +11,16 @@
11
11
  rightContent,
12
12
  additionalContent,
13
13
  classes,
14
- onbackClick,
14
+ onbackClick: onbackClickLegacy,
15
+ onBackClick,
15
16
  onkeydown,
16
17
  testId,
17
18
  headingTestId
18
19
  }: ToolbarProperties = $props();
19
20
 
21
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
22
+ const onbackClick = $derived(onBackClick ?? onbackClickLegacy);
23
+
20
24
  // `backIcon={null}` (or '') has always meant "render no back control at all", and consumers
21
25
  // rely on it; only the DEFAULT changes, from a CDN image to the inline icon.
22
26
  const showBackControl = $derived(showBackButton && backIcon !== null && backIcon !== '');
@@ -14,5 +14,6 @@ export type ToolbarProperties = ToolbarEventProperties & {
14
14
  };
15
15
  export type ToolbarEventProperties = {
16
16
  onbackClick?: () => void;
17
+ onBackClick?: () => void;
17
18
  onkeydown?: (event: KeyboardEvent) => void;
18
19
  };