@juspay/svelte-ui-components 3.4.1 → 3.5.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 (154) hide show
  1. package/README.md +1 -1
  2. package/dist/Accordion/Accordion.svelte +1 -5
  3. package/dist/Accordion/properties.d.ts +0 -1
  4. package/dist/AreaChart/AreaChart.svelte +2 -8
  5. package/dist/AreaChart/properties.d.ts +0 -10
  6. package/dist/AttachmentChipRow/AttachmentChipRow.svelte +30 -30
  7. package/dist/AttachmentChipRow/properties.d.ts +6 -6
  8. package/dist/Banner/Banner.svelte +1 -5
  9. package/dist/Banner/properties.d.ts +0 -1
  10. package/dist/BarChart/BarChart.svelte +7 -13
  11. package/dist/BarChart/properties.d.ts +1 -9
  12. package/dist/Book/Book.svelte +1 -5
  13. package/dist/Book/properties.d.ts +0 -1
  14. package/dist/Button/Button.svelte +2 -0
  15. package/dist/Button/properties.d.ts +5 -0
  16. package/dist/Calendar/Calendar.svelte +3 -11
  17. package/dist/Calendar/properties.d.ts +0 -11
  18. package/dist/Chat/Chat.svelte +9 -29
  19. package/dist/Chat/properties.d.ts +0 -9
  20. package/dist/Chat/types.d.ts +7 -0
  21. package/dist/ChatBubble/ChatBubble.svelte +3 -11
  22. package/dist/ChatBubble/properties.d.ts +0 -3
  23. package/dist/ChatComposer/ChatComposer.svelte +18 -44
  24. package/dist/ChatComposer/properties.d.ts +0 -12
  25. package/dist/ChatHeader/ChatHeader.svelte +1 -5
  26. package/dist/ChatHeader/properties.d.ts +0 -1
  27. package/dist/ChatMessage/ChatMessage.svelte +164 -15
  28. package/dist/ChatMessage/properties.d.ts +34 -3
  29. package/dist/ChatMessageList/ChatMessageList.svelte +5 -11
  30. package/dist/ChatMessageList/properties.d.ts +0 -6
  31. package/dist/ChatSuggestions/ChatSuggestions.svelte +1 -5
  32. package/dist/ChatSuggestions/properties.d.ts +0 -1
  33. package/dist/CheckListItem/CheckListItem.svelte +1 -5
  34. package/dist/CheckListItem/properties.d.ts +0 -1
  35. package/dist/Checkbox/Checkbox.svelte +1 -5
  36. package/dist/Checkbox/properties.d.ts +0 -1
  37. package/dist/ChipInput/ChipInput.svelte +10 -20
  38. package/dist/ChipInput/properties.d.ts +0 -4
  39. package/dist/Choicebox/Choicebox.svelte +1 -5
  40. package/dist/Choicebox/properties.d.ts +0 -1
  41. package/dist/ColorPicker/ColorPicker.svelte +4 -10
  42. package/dist/ColorPicker/properties.d.ts +0 -2
  43. package/dist/Combobox/Combobox.svelte +15 -33
  44. package/dist/Combobox/properties.d.ts +0 -8
  45. package/dist/CommandMenu/CommandMenu.svelte +2 -8
  46. package/dist/CommandMenu/properties.d.ts +0 -2
  47. package/dist/ContextMenu/ContextMenu.svelte +3 -11
  48. package/dist/ContextMenu/properties.d.ts +0 -3
  49. package/dist/DateRangePicker/DateRangePicker.svelte +6 -20
  50. package/dist/DateRangePicker/properties.d.ts +0 -19
  51. package/dist/Draggable/Draggable.svelte +7 -7
  52. package/dist/Draggable/properties.d.ts +3 -3
  53. package/dist/DualAxisBarChart/DualAxisBarChart.svelte +1 -5
  54. package/dist/DualAxisBarChart/properties.d.ts +0 -4
  55. package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -5
  56. package/dist/FileDropzoneTrigger/properties.d.ts +0 -1
  57. package/dist/FileInput/FileInput.svelte +2 -8
  58. package/dist/FileInput/properties.d.ts +0 -2
  59. package/dist/FunnelChart/FunnelChart.svelte +2 -8
  60. package/dist/FunnelChart/properties.d.ts +0 -8
  61. package/dist/Gallery/Gallery.svelte +15 -15
  62. package/dist/Gallery/properties.d.ts +6 -6
  63. package/dist/HITL/HITL.svelte +10 -8
  64. package/dist/HITL/properties.d.ts +2 -2
  65. package/dist/IframeViewer/IframeViewer.svelte +3 -2
  66. package/dist/IframeViewer/properties.d.ts +1 -1
  67. package/dist/Img/Img.svelte +119 -39
  68. package/dist/Img/properties.d.ts +0 -1
  69. package/dist/Input/Input.svelte +22 -37
  70. package/dist/Input/properties.d.ts +3 -10
  71. package/dist/InputButton/InputButton.svelte +2 -2
  72. package/dist/LineChart/LineChart.svelte +4 -10
  73. package/dist/LineChart/properties.d.ts +1 -11
  74. package/dist/ListItem/ListItem.svelte +10 -22
  75. package/dist/ListItem/properties.d.ts +5 -10
  76. package/dist/LottiePlayer/LottiePlayer.svelte +2 -8
  77. package/dist/LottiePlayer/properties.d.ts +0 -2
  78. package/dist/MediaPlayer/MediaPlayer.svelte +1 -5
  79. package/dist/MediaPlayer/properties.d.ts +0 -1
  80. package/dist/MediaUpload/MediaUpload.svelte +6 -6
  81. package/dist/MediaUpload/properties.d.ts +3 -3
  82. package/dist/Menu/Menu.svelte +3 -11
  83. package/dist/Menu/properties.d.ts +0 -3
  84. package/dist/Modal/Modal.svelte +15 -31
  85. package/dist/Modal/properties.d.ts +5 -11
  86. package/dist/Pagination/Pagination.svelte +3 -7
  87. package/dist/Pagination/properties.d.ts +1 -2
  88. package/dist/PieChart/PieChart.svelte +4 -10
  89. package/dist/PieChart/properties.d.ts +1 -9
  90. package/dist/Pill/Pill.svelte +1 -5
  91. package/dist/Pill/properties.d.ts +0 -1
  92. package/dist/Radio/Radio.svelte +1 -5
  93. package/dist/Radio/properties.d.ts +0 -1
  94. package/dist/Resizable/Resizable.svelte +3 -11
  95. package/dist/Resizable/properties.d.ts +0 -3
  96. package/dist/SankeyChart/SankeyChart.svelte +4 -14
  97. package/dist/SankeyChart/properties.d.ts +0 -12
  98. package/dist/Scroller/Scroller.svelte +1 -5
  99. package/dist/Scroller/properties.d.ts +0 -1
  100. package/dist/Select/Select.svelte +3 -11
  101. package/dist/Select/properties.d.ts +0 -3
  102. package/dist/Sheet/Sheet.svelte +3 -11
  103. package/dist/Sheet/properties.d.ts +0 -3
  104. package/dist/Slider/Slider.svelte +2 -8
  105. package/dist/Slider/properties.d.ts +0 -2
  106. package/dist/Snippet/Snippet.svelte +1 -5
  107. package/dist/Snippet/properties.d.ts +0 -1
  108. package/dist/SplitButton/SplitButton.svelte +1 -5
  109. package/dist/SplitButton/properties.d.ts +0 -1
  110. package/dist/SplitInput/SplitInput.svelte +6 -14
  111. package/dist/SplitInput/properties.d.ts +0 -3
  112. package/dist/StatCard/StatCard.svelte +2 -2
  113. package/dist/StatCard/properties.d.ts +1 -1
  114. package/dist/Status/Status.svelte +2 -6
  115. package/dist/Status/properties.d.ts +1 -2
  116. package/dist/Stepper/Stepper.svelte +2 -12
  117. package/dist/Stepper/properties.d.ts +1 -14
  118. package/dist/Table/BuiltinCell.svelte +1 -1
  119. package/dist/Table/Table.svelte +16 -17
  120. package/dist/Table/properties.d.ts +3 -35
  121. package/dist/Tabs/Tabs.svelte +2 -8
  122. package/dist/Tabs/properties.d.ts +0 -2
  123. package/dist/TaskList/TaskList.svelte +1 -4
  124. package/dist/TaskList/properties.d.ts +0 -1
  125. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +1 -5
  126. package/dist/ThemeSwitcher/properties.d.ts +0 -1
  127. package/dist/ThinkingIndicator/ThinkingIndicator.svelte +4 -10
  128. package/dist/ThinkingIndicator/properties.d.ts +1 -3
  129. package/dist/Toast/Toast.svelte +2 -2
  130. package/dist/Toast/properties.d.ts +1 -1
  131. package/dist/Toggle/Toggle.svelte +1 -5
  132. package/dist/Toggle/properties.d.ts +0 -1
  133. package/dist/ToolCallLog/ToolCallLog.svelte +1 -10
  134. package/dist/ToolCallLog/properties.d.ts +0 -1
  135. package/dist/Toolbar/Toolbar.svelte +2 -6
  136. package/dist/Toolbar/properties.d.ts +1 -2
  137. package/dist/TypewriterText/TypewriterText.svelte +3 -3
  138. package/dist/TypewriterText/properties.d.ts +1 -1
  139. package/dist-codemod/bin.js +32 -0
  140. package/dist-codemod/cli.js +175 -0
  141. package/dist-codemod/legacy-pairs.js +228 -0
  142. package/dist-codemod/transform.js +278 -0
  143. package/dist-codemod/wc-children.js +66 -0
  144. package/dist-wc/index.js +4629 -5218
  145. package/package.json +9 -7
  146. package/scripts/postinstall.mjs +14 -12
  147. package/dist/deprecation.d.ts +0 -42
  148. package/dist/deprecation.js +0 -57
  149. package/scripts/codemod/README.md +0 -76
  150. package/scripts/codemod/cli.ts +0 -206
  151. package/scripts/codemod/map.ts +0 -118
  152. package/scripts/codemod/transform.ts +0 -549
  153. package/scripts/codemod/tsconfig.json +0 -15
  154. package/scripts/codemod/wc-children.ts +0 -75
@@ -9,14 +9,10 @@
9
9
  disabled = false,
10
10
  showIndicator = true,
11
11
  testId,
12
- onclick: onclickLegacy,
13
- onClick,
12
+ onclick,
14
13
  classes
15
14
  }: ChoiceboxProperties = $props();
16
15
 
17
- // Event-casing phase 1: both spellings accepted, the correct one wins.
18
- const onclick = $derived(onClick ?? onclickLegacy);
19
-
20
16
  function handleClick(): void {
21
17
  if (disabled) {
22
18
  return;
@@ -12,5 +12,4 @@ export type OptionalChoiceboxProperties = {
12
12
  };
13
13
  export type ChoiceboxEventProperties = {
14
14
  onclick?: (selected: boolean) => void;
15
- onClick?: (selected: boolean) => void;
16
15
  };
@@ -22,17 +22,11 @@
22
22
  disabled = false,
23
23
  showValue = false,
24
24
  testId,
25
- onchange: onchangeLegacy,
26
- onChange,
27
- oninput: oninputLegacy,
28
- onInput,
25
+ onchange,
26
+ oninput,
29
27
  classes
30
28
  }: ColorPickerProperties = $props();
31
29
 
32
- // Event-casing phase 1: both spellings accepted, the correct one wins.
33
- const onchange = $derived(onChange ?? onchangeLegacy);
34
- const oninput = $derived(onInput ?? oninputLegacy);
35
-
36
30
  // ── Internal state ──────────────────────────────────────────────
37
31
 
38
32
  let open = $state(false);
@@ -217,7 +211,7 @@
217
211
  disable={disabled}
218
212
  maxLength={7}
219
213
  classes="color-picker-text-input"
220
- onInput={handleTextInput}
214
+ oninput={handleTextInput}
221
215
  />
222
216
  </div>
223
217
  {/if}
@@ -268,7 +262,7 @@
268
262
  value={hexInputValue}
269
263
  maxLength={7}
270
264
  classes="cp-field-input"
271
- onInput={handleHexFieldInput}
265
+ oninput={handleHexFieldInput}
272
266
  />
273
267
  <span class="cp-field-label">HEX</span>
274
268
  </div>
@@ -11,7 +11,5 @@ export type OptionalColorPickerProperties = {
11
11
  };
12
12
  export type ColorPickerEventProperties = {
13
13
  onchange?: (value: string) => void;
14
- onChange?: (value: string) => void;
15
14
  oninput?: (value: string) => void;
16
- onInput?: (value: string) => void;
17
15
  };
@@ -40,37 +40,19 @@
40
40
  createLabel = (query: string) => `Create "${query}"`,
41
41
  action,
42
42
  actionIcon,
43
- onselect: onselectLegacy,
44
- onSelect,
45
- oninput: oninputLegacy,
46
- onInput,
47
- onopen: onopenLegacy,
48
- onOpen,
49
- onclose: oncloseLegacy,
50
- onClose,
43
+ onselect,
44
+ oninput,
45
+ onopen,
46
+ onclose,
51
47
  onkeydown,
52
48
  onfocus,
53
49
  onblur,
54
- onchange: onchangeLegacy,
55
- onChange,
56
- onadd: onaddLegacy,
57
- onAdd,
58
- onremove: onremoveLegacy,
59
- onRemove,
60
- oncreate: oncreateLegacy,
61
- onCreate
50
+ onchange,
51
+ onadd,
52
+ onremove,
53
+ oncreate
62
54
  }: ComboboxProperties = $props();
63
55
 
64
- // Event-casing phase 1: both spellings accepted, the correct one wins.
65
- const onadd = $derived(onAdd ?? onaddLegacy);
66
- const onchange = $derived(onChange ?? onchangeLegacy);
67
- const onclose = $derived(onClose ?? oncloseLegacy);
68
- const oncreate = $derived(onCreate ?? oncreateLegacy);
69
- const oninput = $derived(onInput ?? oninputLegacy);
70
- const onopen = $derived(onOpen ?? onopenLegacy);
71
- const onremove = $derived(onRemove ?? onremoveLegacy);
72
- const onselect = $derived(onSelect ?? onselectLegacy);
73
-
74
56
  let containerEl: HTMLDivElement | null = $state(null);
75
57
  let inputRef: ReturnType<typeof Input> | null = $state(null);
76
58
 
@@ -266,7 +248,7 @@
266
248
  function handleInput(val: string, event: Event) {
267
249
  inputValue = val;
268
250
  oninput?.(val);
269
- inputEventProperties?.onInput?.(val, event);
251
+ inputEventProperties?.oninput?.(val, event);
270
252
  if (!open) {
271
253
  openDropdown();
272
254
  }
@@ -330,12 +312,12 @@
330
312
  function handleFocus(event: FocusEvent) {
331
313
  openDropdown();
332
314
  onfocus?.(event);
333
- inputEventProperties?.onFocus?.(event);
315
+ inputEventProperties?.onfocus?.(event);
334
316
  }
335
317
 
336
318
  function handleBlur(event: FocusEvent) {
337
319
  onblur?.(event);
338
- inputEventProperties?.onBlur?.(event);
320
+ inputEventProperties?.onblur?.(event);
339
321
  }
340
322
 
341
323
  function handleControlClick() {
@@ -400,10 +382,10 @@
400
382
  ariaAutocomplete="list"
401
383
  ariaControls={open ? listboxId : null}
402
384
  ariaActivedescendant={highlightedOptionId ?? null}
403
- onInput={handleInput}
404
- onKeyDown={handleKeydown}
405
- onFocus={handleFocus}
406
- onBlur={handleBlur}
385
+ oninput={handleInput}
386
+ onkeydown={handleKeydown}
387
+ onfocus={handleFocus}
388
+ onblur={handleBlur}
407
389
  />
408
390
  </div>
409
391
  {#if typeof inputSuffix === 'function'}
@@ -61,26 +61,18 @@ export type OptionalComboboxProperties = {
61
61
  };
62
62
  export type ComboboxEventProperties = {
63
63
  onselect?: (item: ComboboxItem) => void;
64
- onSelect?: (item: ComboboxItem) => void;
65
64
  oninput?: (value: string) => void;
66
- onInput?: (value: string) => void;
67
65
  onopen?: () => void;
68
- onOpen?: () => void;
69
66
  onclose?: () => void;
70
- onClose?: () => void;
71
67
  onkeydown?: (event: KeyboardEvent) => void;
72
68
  onfocus?: (event: FocusEvent) => void;
73
69
  onblur?: (event: FocusEvent) => void;
74
70
  /** Multi-select: fires whenever the selection changes (add, remove, or create). */
75
71
  onchange?: (selected: string[]) => void;
76
- onChange?: (selected: string[]) => void;
77
72
  /** Multi-select: fires when a value is added. */
78
73
  onadd?: (value: string) => void;
79
- onAdd?: (value: string) => void;
80
74
  /** Multi-select: fires when a value is removed. */
81
75
  onremove?: (value: string) => void;
82
- onRemove?: (value: string) => void;
83
76
  /** Fires when the create row is chosen, with the trimmed query. */
84
77
  oncreate?: (value: string) => void;
85
- onCreate?: (value: string) => void;
86
78
  };
@@ -14,17 +14,11 @@
14
14
  testId,
15
15
  itemIcon,
16
16
  searchIcon,
17
- onselect: onselectLegacy,
18
- onSelect,
19
- onclose: oncloseLegacy,
20
- onClose,
17
+ onselect,
18
+ onclose,
21
19
  classes
22
20
  }: CommandMenuProperties = $props();
23
21
 
24
- // Event-casing phase 1: both spellings accepted, the correct one wins.
25
- const onclose = $derived(onClose ?? oncloseLegacy);
26
- const onselect = $derived(onSelect ?? onselectLegacy);
27
-
28
22
  let query = $state('');
29
23
  let activeIndex = $state(0);
30
24
  let inputElement: HTMLInputElement | null = $state(null);
@@ -22,7 +22,5 @@ export type OptionalCommandMenuProperties = {
22
22
  };
23
23
  export type CommandMenuEventProperties = {
24
24
  onselect?: (item: CommandItem) => void;
25
- onSelect?: (item: CommandItem) => void;
26
25
  onclose?: () => void;
27
- onClose?: () => void;
28
26
  };
@@ -8,20 +8,12 @@
8
8
  maxHeight = '240px',
9
9
  testId,
10
10
  children,
11
- onselect: onselectLegacy,
12
- onSelect,
13
- onopen: onopenLegacy,
14
- onOpen,
15
- onclose: oncloseLegacy,
16
- onClose,
11
+ onselect,
12
+ onopen,
13
+ onclose,
17
14
  classes
18
15
  }: ContextMenuProperties = $props();
19
16
 
20
- // Event-casing phase 1: both spellings accepted, the correct one wins.
21
- const onclose = $derived(onClose ?? oncloseLegacy);
22
- const onopen = $derived(onOpen ?? onopenLegacy);
23
- const onselect = $derived(onSelect ?? onselectLegacy);
24
-
25
17
  let menuEl: HTMLDivElement | null = $state(null);
26
18
  let containerEl: HTMLDivElement | null = $state(null);
27
19
  let focusedIndex: number = $state(-1);
@@ -21,9 +21,6 @@ export type OptionalContextMenuProperties = {
21
21
  };
22
22
  export type ContextMenuEventProperties = {
23
23
  onselect?: (item: ContextMenuItem) => void;
24
- onSelect?: (item: ContextMenuItem) => void;
25
24
  onopen?: () => void;
26
- onOpen?: () => void;
27
25
  onclose?: () => void;
28
- onClose?: () => void;
29
26
  };
@@ -54,28 +54,14 @@
54
54
  initialPresetLabel,
55
55
  compareTrigger,
56
56
  openCompare = $bindable(false),
57
- onapply: onapplyLegacy,
58
- onApply,
59
- onapplysingle: onapplysingleLegacy,
60
- onApplySingle,
61
- onapplycompare: onapplycompareLegacy,
62
- onApplyCompare,
63
- oncancel: oncancelLegacy,
64
- onCancel,
65
- onopentoggle: onopentoggleLegacy,
66
- onOpenToggle,
67
- onclear: onclearLegacy,
68
- onClear
57
+ onapply,
58
+ onapplysingle,
59
+ onapplycompare,
60
+ oncancel,
61
+ onopentoggle,
62
+ onclear
69
63
  }: DateRangePickerProperties = $props();
70
64
 
71
- // Event-casing phase 1: both spellings accepted, the correct one wins.
72
- const onapply = $derived(onApply ?? onapplyLegacy);
73
- const onapplycompare = $derived(onApplyCompare ?? onapplycompareLegacy);
74
- const onapplysingle = $derived(onApplySingle ?? onapplysingleLegacy);
75
- const oncancel = $derived(onCancel ?? oncancelLegacy);
76
- const onclear = $derived(onClear ?? onclearLegacy);
77
- const onopentoggle = $derived(onOpenToggle ?? onopentoggleLegacy);
78
-
79
65
  const isDualMonth: boolean = $derived(
80
66
  typeof dualMonth === 'boolean' ? dualMonth : mode === 'range'
81
67
  );
@@ -138,46 +138,27 @@ export type DateRangePickerEventProperties = {
138
138
  rangeEnd: Date;
139
139
  presetLabel: string | null;
140
140
  }) => void;
141
- onApply?: (event: {
142
- rangeStart: Date;
143
- rangeEnd: Date;
144
- presetLabel: string | null;
145
- }) => void;
146
141
  /** Fired when the user clicks Apply in single mode. presetLabel is the sidebar preset name if one was active, or null for a custom calendar selection. */
147
142
  onapplysingle?: (event: {
148
143
  date: Date;
149
144
  presetLabel: string | null;
150
145
  }) => void;
151
- onApplySingle?: (event: {
152
- date: Date;
153
- presetLabel: string | null;
154
- }) => void;
155
146
  /** Fired when the compare range is applied. presetLabel is the sidebar preset name if one was active, or null for a custom calendar selection. */
156
147
  onapplycompare?: (event: {
157
148
  compareStart: Date;
158
149
  compareEnd: Date;
159
150
  presetLabel: string | null;
160
151
  }) => void;
161
- onApplyCompare?: (event: {
162
- compareStart: Date;
163
- compareEnd: Date;
164
- presetLabel: string | null;
165
- }) => void;
166
152
  /** Fired when the user dismisses without applying. */
167
153
  oncancel?: () => void;
168
- onCancel?: () => void;
169
154
  /** Fired whenever the picker opens or closes. */
170
155
  onopentoggle?: (event: {
171
156
  open: boolean;
172
157
  }) => void;
173
- onOpenToggle?: (event: {
174
- open: boolean;
175
- }) => void;
176
158
  /**
177
159
  * Fired when the user clicks the Clear button in single mode (requires clearable=true).
178
160
  * value is reset to null before this callback is invoked.
179
161
  */
180
162
  onclear?: () => void;
181
- onClear?: () => void;
182
163
  };
183
164
  export type DateRangePickerProperties = OptionalDateRangePickerProperties & DateRangePickerEventProperties;
@@ -11,9 +11,9 @@
11
11
  step = 16,
12
12
  dragLabel = 'Drag to move',
13
13
  children,
14
- onMoveStart,
15
- onMove,
16
- onMoveEnd,
14
+ onmovestart,
15
+ onmove,
16
+ onmoveend,
17
17
  testId,
18
18
  classes
19
19
  }: DraggableProperties = $props();
@@ -73,7 +73,7 @@
73
73
  baseY: y
74
74
  };
75
75
  event.currentTarget.setPointerCapture(event.pointerId);
76
- onMoveStart?.({ x, y });
76
+ onmovestart?.({ x, y });
77
77
  }
78
78
 
79
79
  function moveDrag(event: PointerEvent & { currentTarget: HTMLElement }): void {
@@ -85,7 +85,7 @@
85
85
  const clamped = clamp(event.currentTarget, nextX, nextY);
86
86
  x = clamped.x;
87
87
  y = clamped.y;
88
- onMove?.({ x, y });
88
+ onmove?.({ x, y });
89
89
  }
90
90
 
91
91
  function endDrag(event: PointerEvent & { currentTarget: HTMLElement }): void {
@@ -96,7 +96,7 @@
96
96
  event.currentTarget.releasePointerCapture(event.pointerId);
97
97
  }
98
98
  active = null;
99
- onMoveEnd?.({ x, y });
99
+ onmoveend?.({ x, y });
100
100
  }
101
101
 
102
102
  function keyDrag(event: KeyboardEvent & { currentTarget: HTMLElement }): void {
@@ -124,7 +124,7 @@
124
124
  const clamped = clamp(event.currentTarget, nextX, nextY);
125
125
  x = clamped.x;
126
126
  y = clamped.y;
127
- onMove?.({ x, y });
127
+ onmove?.({ x, y });
128
128
  }
129
129
  }
130
130
  </script>
@@ -20,7 +20,7 @@ export type OptionalDraggableProperties = {
20
20
  classes?: string;
21
21
  };
22
22
  export type DraggableEventProperties = {
23
- onMoveStart?: (position: DragPosition) => void;
24
- onMove?: (position: DragPosition) => void;
25
- onMoveEnd?: (position: DragPosition) => void;
23
+ onmovestart?: (position: DragPosition) => void;
24
+ onmove?: (position: DragPosition) => void;
25
+ onmoveend?: (position: DragPosition) => void;
26
26
  };
@@ -53,15 +53,11 @@
53
53
  interactiveLegend = false,
54
54
  hideLegendBelow = 360,
55
55
  tooltipSnippet,
56
- onbarclick: onbarclickLegacy,
57
- onBarClick,
56
+ onbarclick,
58
57
  testId,
59
58
  classes
60
59
  }: DualAxisBarChartProperties = $props();
61
60
 
62
- // Event-casing phase 1: both spellings accepted, the correct one wins.
63
- const onbarclick = $derived(onBarClick ?? onbarclickLegacy);
64
-
65
61
  // ── State ──────────────────────────────────────────────────────
66
62
 
67
63
  let containerEl: HTMLDivElement | null = $state(null);
@@ -147,8 +147,4 @@ export type DualAxisBarChartEventProperties = {
147
147
  categoryIndex: number;
148
148
  context: DualAxisTooltipContext;
149
149
  }) => void;
150
- onBarClick?: (event: {
151
- categoryIndex: number;
152
- context: DualAxisTooltipContext;
153
- }) => void;
154
150
  };
@@ -8,14 +8,10 @@
8
8
  heading,
9
9
  caption,
10
10
  compact = false,
11
- onclick: onclickLegacy,
12
- onClick,
11
+ onclick,
13
12
  testId,
14
13
  classes
15
14
  }: FileDropzoneTriggerProperties = $props();
16
-
17
- // Event-casing phase 1: both spellings accepted, the correct one wins.
18
- const onclick = $derived(onClick ?? onclickLegacy);
19
15
  </script>
20
16
 
21
17
  {#if compact}
@@ -21,5 +21,4 @@ export type OptionalFileDropzoneTriggerProperties = {
21
21
  export type FileDropzoneTriggerEventProperties = {
22
22
  /** Wire to `FileInput`'s `openFilePicker`. Non-compact only — compact relies on `FileInput`'s own whole-area click/drop handling. */
23
23
  onclick?: () => void;
24
- onClick?: () => void;
25
24
  };
@@ -9,16 +9,10 @@
9
9
  disabled = false,
10
10
  testId,
11
11
  classes,
12
- onfiles: onfilesLegacy,
13
- onFiles,
14
- onerror: onerrorLegacy,
15
- onError
12
+ onfiles,
13
+ onerror
16
14
  }: FileInputProperties = $props();
17
15
 
18
- // Event-casing phase 1: both spellings accepted, the correct one wins.
19
- const onerror = $derived(onError ?? onerrorLegacy);
20
- const onfiles = $derived(onFiles ?? onfilesLegacy);
21
-
22
16
  let dragOver = $state(false);
23
17
  let inputEl: HTMLInputElement | null = $state(null);
24
18
  let pickerBusy = false;
@@ -14,7 +14,5 @@ export type FileInputProperties = {
14
14
  testId?: string;
15
15
  classes?: string;
16
16
  onfiles?: (files: File[]) => void;
17
- onFiles?: (files: File[]) => void;
18
17
  onerror?: (message: string) => void;
19
- onError?: (message: string) => void;
20
18
  };
@@ -28,16 +28,10 @@
28
28
  testId,
29
29
  classes,
30
30
  empty,
31
- onstageclick: onstageclickLegacy,
32
- onStageClick,
33
- onstagehover: onstagehoverLegacy,
34
- onStageHover
31
+ onstageclick,
32
+ onstagehover
35
33
  }: FunnelChartProperties = $props();
36
34
 
37
- // Event-casing phase 1: both spellings accepted, the correct one wins.
38
- const onstageclick = $derived(onStageClick ?? onstageclickLegacy);
39
- const onstagehover = $derived(onStageHover ?? onstagehoverLegacy);
40
-
41
35
  // ── State ──────────────────────────────────────────────────────
42
36
 
43
37
  let containerEl: HTMLDivElement | null = $state(null);
@@ -78,17 +78,9 @@ export type FunnelChartEventProperties = {
78
78
  index: number;
79
79
  stage: FunnelStage;
80
80
  }) => void;
81
- onStageClick?: (event: {
82
- index: number;
83
- stage: FunnelStage;
84
- }) => void;
85
81
  /** Fires when the user hovers over or leaves a stage bar. `null` on leave. */
86
82
  onstagehover?: (event: {
87
83
  index: number;
88
84
  stage: FunnelStage;
89
85
  } | null) => void;
90
- onStageHover?: (event: {
91
- index: number;
92
- stage: FunnelStage;
93
- } | null) => void;
94
86
  };
@@ -28,12 +28,12 @@
28
28
  deleteIcon,
29
29
  itemFooter,
30
30
  testId,
31
- onImageClick,
32
- onEditClick,
33
- onDeleteClick,
34
- onOpen,
35
- onDismiss,
36
- onIndexChange,
31
+ onimageclick,
32
+ oneditclick,
33
+ ondeleteclick,
34
+ onopen,
35
+ onclose,
36
+ onchange,
37
37
  onkeydown,
38
38
  classes
39
39
  }: GalleryProperties = $props();
@@ -47,10 +47,10 @@
47
47
  let activeImage = $derived(images.at(activeIndex));
48
48
  let hasPrevious = $derived(loop ? images.length > 1 : activeIndex > 0);
49
49
  let hasNext = $derived(loop ? images.length > 1 : activeIndex < images.length - 1);
50
- let itemsAreInteractive = $derived(enableLightbox || typeof onImageClick === 'function');
50
+ let itemsAreInteractive = $derived(enableLightbox || typeof onimageclick === 'function');
51
51
  let hasItemFooter = $derived(view === 'grid' && typeof itemFooter === 'function');
52
- let showEditButton = $derived(typeof onEditClick === 'function');
53
- let showDeleteButton = $derived(typeof onDeleteClick === 'function');
52
+ let showEditButton = $derived(typeof oneditclick === 'function');
53
+ let showDeleteButton = $derived(typeof ondeleteclick === 'function');
54
54
  let showItemActions = $derived(showEditButton || showDeleteButton);
55
55
 
56
56
  function lightboxAction(node: HTMLElement) {
@@ -78,12 +78,12 @@
78
78
  }
79
79
  activeIndex = index;
80
80
  open = true;
81
- onOpen?.(index);
81
+ onopen?.(index);
82
82
  }
83
83
 
84
84
  function closeLightbox(): void {
85
85
  open = false;
86
- onDismiss?.();
86
+ onclose?.();
87
87
  }
88
88
 
89
89
  async function goToIndex(index: number): Promise<void> {
@@ -91,7 +91,7 @@
91
91
  return;
92
92
  }
93
93
  activeIndex = index;
94
- onIndexChange?.(activeIndex);
94
+ onchange?.(activeIndex);
95
95
  await tick();
96
96
  if (lightboxDiv !== null && !lightboxDiv.contains(document.activeElement)) {
97
97
  lightboxDiv.focus();
@@ -115,18 +115,18 @@
115
115
  }
116
116
 
117
117
  function handleImageClick(index: number, event: MouseEvent): void {
118
- onImageClick?.(index, event);
118
+ onimageclick?.(index, event);
119
119
  if (enableLightbox) {
120
120
  openLightbox(index, event.currentTarget);
121
121
  }
122
122
  }
123
123
 
124
124
  function handleEditClick(index: number, event: MouseEvent): void {
125
- onEditClick?.(index, event);
125
+ oneditclick?.(index, event);
126
126
  }
127
127
 
128
128
  function handleDeleteClick(index: number, event: MouseEvent): void {
129
- onDeleteClick?.(index, event);
129
+ ondeleteclick?.(index, event);
130
130
  }
131
131
 
132
132
  function trapFocus(event: KeyboardEvent): void {
@@ -29,11 +29,11 @@ export type OptionalGalleryProperties = {
29
29
  classes?: string;
30
30
  };
31
31
  export type GalleryEventProperties = {
32
- onImageClick?: (index: number, event: MouseEvent) => void;
33
- onEditClick?: (index: number, event: MouseEvent) => void;
34
- onDeleteClick?: (index: number, event: MouseEvent) => void;
35
- onOpen?: (index: number) => void;
36
- onDismiss?: () => void;
37
- onIndexChange?: (index: number) => void;
32
+ onimageclick?: (index: number, event: MouseEvent) => void;
33
+ oneditclick?: (index: number, event: MouseEvent) => void;
34
+ ondeleteclick?: (index: number, event: MouseEvent) => void;
35
+ onopen?: (index: number) => void;
36
+ onclose?: () => void;
37
+ onchange?: (index: number) => void;
38
38
  onkeydown?: (event: KeyboardEvent) => void;
39
39
  };
@@ -20,13 +20,15 @@
20
20
  sections,
21
21
  functionArguments,
22
22
  hiddenKeys,
23
- onConfirm,
23
+ onconfirm,
24
24
  confirmLabel = 'Confirm',
25
25
  cancelLabel = 'Cancel',
26
26
  countdownSeconds = 10,
27
27
  autoCancelSeconds = 0,
28
28
  isMicMuted = false,
29
- onMicToggle = null,
29
+ // The resolver this replaced defaulted to null, and the call sites test for
30
+ // exactly null before awaiting it.
31
+ onmictoggle = null,
30
32
  isHistoryMode = false,
31
33
  initialState = null,
32
34
  approvedIcon,
@@ -66,7 +68,7 @@
66
68
  // History mode renders the settled state from props; live mode from local state.
67
69
  // A history card with no initialState renders as expired rather than falling
68
70
  // through to the pending interactive card — a replayed card must never be able
69
- // to fire onConfirm.
71
+ // to fire onconfirm.
70
72
  const userResponse = $derived.by((): HITLResponse | null => {
71
73
  if (isHistoryMode) {
72
74
  if (initialState === null) {
@@ -109,9 +111,9 @@
109
111
  };
110
112
 
111
113
  const restoreMicState = async (): Promise<void> => {
112
- if (onMicToggle !== null && originalMicState !== null && isMicMuted !== originalMicState) {
114
+ if (onmictoggle !== null && originalMicState !== null && isMicMuted !== originalMicState) {
113
115
  try {
114
- await onMicToggle();
116
+ await onmictoggle();
115
117
  } catch {
116
118
  // Mic restoration is best-effort; a failure must not block the decision.
117
119
  }
@@ -131,7 +133,7 @@
131
133
  localResponse = action;
132
134
  isProcessing = true;
133
135
  try {
134
- onConfirm?.({
136
+ onconfirm?.({
135
137
  confirmationId,
136
138
  action,
137
139
  approved: action !== 'rejected'
@@ -182,10 +184,10 @@
182
184
  if (isHistoryMode) {
183
185
  return;
184
186
  }
185
- if (onMicToggle !== null) {
187
+ if (onmictoggle !== null) {
186
188
  originalMicState = isMicMuted;
187
189
  if (!isMicMuted) {
188
- void Promise.resolve(onMicToggle()).catch(() => {
190
+ void Promise.resolve(onmictoggle()).catch(() => {
189
191
  // Auto-mute is best-effort.
190
192
  });
191
193
  }