@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
@@ -11,12 +11,16 @@
11
11
  testId,
12
12
  checkedIcon,
13
13
  indeterminateIcon,
14
- onclick,
14
+ onclick: onclickLegacy,
15
+ onClick,
15
16
  classes,
16
17
  ariaControls,
17
18
  ariaLabel
18
19
  }: CheckboxProperties = $props();
19
20
 
21
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
22
+ const onclick = $derived(onClick ?? onclickLegacy);
23
+
20
24
  function handleClick(): void {
21
25
  if (disabled) {
22
26
  return;
@@ -20,4 +20,5 @@ export type OptionalCheckboxProperties = {
20
20
  };
21
21
  export type CheckboxEventProperties = {
22
22
  onclick?: (checked: boolean) => void;
23
+ onClick?: (checked: boolean) => void;
23
24
  };
@@ -11,12 +11,22 @@
11
11
  editable = false,
12
12
  testId,
13
13
  classes,
14
- onadd,
15
- ondismiss,
16
- onedit,
17
- onchange
14
+ onadd: onaddLegacy,
15
+ onAdd,
16
+ ondismiss: ondismissLegacy,
17
+ onDismiss,
18
+ onedit: oneditLegacy,
19
+ onEdit,
20
+ onchange: onchangeLegacy,
21
+ onChange
18
22
  }: ChipInputProperties = $props();
19
23
 
24
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
25
+ const onadd = $derived(onAdd ?? onaddLegacy);
26
+ const onchange = $derived(onChange ?? onchangeLegacy);
27
+ const ondismiss = $derived(onDismiss ?? ondismissLegacy);
28
+ const onedit = $derived(onEdit ?? oneditLegacy);
29
+
20
30
  let draft = $state('');
21
31
 
22
32
  // The chip currently swapped for an inline edit field, held by VALUE rather than by slot
@@ -34,12 +34,16 @@ export type OptionalChipInputProperties = {
34
34
  };
35
35
  export type ChipInputEventProperties = {
36
36
  onadd?: (value: string) => void;
37
+ onAdd?: (value: string) => void;
37
38
  ondismiss?: (value: string) => void;
39
+ onDismiss?: (value: string) => void;
38
40
  /**
39
41
  * Fires after an in-place edit (see `editable`) commits a value that actually changed. Not
40
42
  * fired when the edit is cancelled (Escape) or committed with the text unchanged.
41
43
  */
42
44
  onedit?: (value: string, previousValue: string) => void;
45
+ onEdit?: (value: string, previousValue: string) => void;
43
46
  /** Fires alongside `onadd`/`ondismiss`/`onedit`, after any of them has already updated `values`. */
44
47
  onchange?: (values: string[]) => void;
48
+ onChange?: (values: string[]) => void;
45
49
  };
@@ -9,10 +9,14 @@
9
9
  disabled = false,
10
10
  showIndicator = true,
11
11
  testId,
12
- onclick,
12
+ onclick: onclickLegacy,
13
+ onClick,
13
14
  classes
14
15
  }: ChoiceboxProperties = $props();
15
16
 
17
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
18
+ const onclick = $derived(onClick ?? onclickLegacy);
19
+
16
20
  function handleClick(): void {
17
21
  if (disabled) {
18
22
  return;
@@ -12,4 +12,5 @@ export type OptionalChoiceboxProperties = {
12
12
  };
13
13
  export type ChoiceboxEventProperties = {
14
14
  onclick?: (selected: boolean) => void;
15
+ onClick?: (selected: boolean) => void;
15
16
  };
@@ -22,11 +22,17 @@
22
22
  disabled = false,
23
23
  showValue = false,
24
24
  testId,
25
- onchange,
26
- oninput,
25
+ onchange: onchangeLegacy,
26
+ onChange,
27
+ oninput: oninputLegacy,
28
+ onInput,
27
29
  classes
28
30
  }: ColorPickerProperties = $props();
29
31
 
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
+
30
36
  // ── Internal state ──────────────────────────────────────────────
31
37
 
32
38
  let open = $state(false);
@@ -11,5 +11,7 @@ export type OptionalColorPickerProperties = {
11
11
  };
12
12
  export type ColorPickerEventProperties = {
13
13
  onchange?: (value: string) => void;
14
+ onChange?: (value: string) => void;
14
15
  oninput?: (value: string) => void;
16
+ onInput?: (value: string) => void;
15
17
  };
@@ -40,19 +40,37 @@
40
40
  createLabel = (query: string) => `Create "${query}"`,
41
41
  action,
42
42
  actionIcon,
43
- onselect,
44
- oninput,
45
- onopen,
46
- onclose,
43
+ onselect: onselectLegacy,
44
+ onSelect,
45
+ oninput: oninputLegacy,
46
+ onInput,
47
+ onopen: onopenLegacy,
48
+ onOpen,
49
+ onclose: oncloseLegacy,
50
+ onClose,
47
51
  onkeydown,
48
52
  onfocus,
49
53
  onblur,
50
- onchange,
51
- onadd,
52
- onremove,
53
- oncreate
54
+ onchange: onchangeLegacy,
55
+ onChange,
56
+ onadd: onaddLegacy,
57
+ onAdd,
58
+ onremove: onremoveLegacy,
59
+ onRemove,
60
+ oncreate: oncreateLegacy,
61
+ onCreate
54
62
  }: ComboboxProperties = $props();
55
63
 
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
+
56
74
  let containerEl: HTMLDivElement | null = $state(null);
57
75
  let inputRef: ReturnType<typeof Input> | null = $state(null);
58
76
 
@@ -61,18 +61,26 @@ export type OptionalComboboxProperties = {
61
61
  };
62
62
  export type ComboboxEventProperties = {
63
63
  onselect?: (item: ComboboxItem) => void;
64
+ onSelect?: (item: ComboboxItem) => void;
64
65
  oninput?: (value: string) => void;
66
+ onInput?: (value: string) => void;
65
67
  onopen?: () => void;
68
+ onOpen?: () => void;
66
69
  onclose?: () => void;
70
+ onClose?: () => void;
67
71
  onkeydown?: (event: KeyboardEvent) => void;
68
72
  onfocus?: (event: FocusEvent) => void;
69
73
  onblur?: (event: FocusEvent) => void;
70
74
  /** Multi-select: fires whenever the selection changes (add, remove, or create). */
71
75
  onchange?: (selected: string[]) => void;
76
+ onChange?: (selected: string[]) => void;
72
77
  /** Multi-select: fires when a value is added. */
73
78
  onadd?: (value: string) => void;
79
+ onAdd?: (value: string) => void;
74
80
  /** Multi-select: fires when a value is removed. */
75
81
  onremove?: (value: string) => void;
82
+ onRemove?: (value: string) => void;
76
83
  /** Fires when the create row is chosen, with the trimmed query. */
77
84
  oncreate?: (value: string) => void;
85
+ onCreate?: (value: string) => void;
78
86
  };
@@ -14,11 +14,17 @@
14
14
  testId,
15
15
  itemIcon,
16
16
  searchIcon,
17
- onselect,
18
- onclose,
17
+ onselect: onselectLegacy,
18
+ onSelect,
19
+ onclose: oncloseLegacy,
20
+ onClose,
19
21
  classes
20
22
  }: CommandMenuProperties = $props();
21
23
 
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
+
22
28
  let query = $state('');
23
29
  let activeIndex = $state(0);
24
30
  let inputElement: HTMLInputElement | null = $state(null);
@@ -22,5 +22,7 @@ export type OptionalCommandMenuProperties = {
22
22
  };
23
23
  export type CommandMenuEventProperties = {
24
24
  onselect?: (item: CommandItem) => void;
25
+ onSelect?: (item: CommandItem) => void;
25
26
  onclose?: () => void;
27
+ onClose?: () => void;
26
28
  };
@@ -8,12 +8,20 @@
8
8
  maxHeight = '240px',
9
9
  testId,
10
10
  children,
11
- onselect,
12
- onopen,
13
- onclose,
11
+ onselect: onselectLegacy,
12
+ onSelect,
13
+ onopen: onopenLegacy,
14
+ onOpen,
15
+ onclose: oncloseLegacy,
16
+ onClose,
14
17
  classes
15
18
  }: ContextMenuProperties = $props();
16
19
 
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
+
17
25
  let menuEl: HTMLDivElement | null = $state(null);
18
26
  let containerEl: HTMLDivElement | null = $state(null);
19
27
  let focusedIndex: number = $state(-1);
@@ -21,6 +21,9 @@ export type OptionalContextMenuProperties = {
21
21
  };
22
22
  export type ContextMenuEventProperties = {
23
23
  onselect?: (item: ContextMenuItem) => void;
24
+ onSelect?: (item: ContextMenuItem) => void;
24
25
  onopen?: () => void;
26
+ onOpen?: () => void;
25
27
  onclose?: () => void;
28
+ onClose?: () => void;
26
29
  };
@@ -54,14 +54,28 @@
54
54
  initialPresetLabel,
55
55
  compareTrigger,
56
56
  openCompare = $bindable(false),
57
- onapply,
58
- onapplysingle,
59
- onapplycompare,
60
- oncancel,
61
- onopentoggle,
62
- onclear
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
63
69
  }: DateRangePickerProperties = $props();
64
70
 
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
+
65
79
  const isDualMonth: boolean = $derived(
66
80
  typeof dualMonth === 'boolean' ? dualMonth : mode === 'range'
67
81
  );
@@ -138,27 +138,46 @@ 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;
141
146
  /** 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. */
142
147
  onapplysingle?: (event: {
143
148
  date: Date;
144
149
  presetLabel: string | null;
145
150
  }) => void;
151
+ onApplySingle?: (event: {
152
+ date: Date;
153
+ presetLabel: string | null;
154
+ }) => void;
146
155
  /** Fired when the compare range is applied. presetLabel is the sidebar preset name if one was active, or null for a custom calendar selection. */
147
156
  onapplycompare?: (event: {
148
157
  compareStart: Date;
149
158
  compareEnd: Date;
150
159
  presetLabel: string | null;
151
160
  }) => void;
161
+ onApplyCompare?: (event: {
162
+ compareStart: Date;
163
+ compareEnd: Date;
164
+ presetLabel: string | null;
165
+ }) => void;
152
166
  /** Fired when the user dismisses without applying. */
153
167
  oncancel?: () => void;
168
+ onCancel?: () => void;
154
169
  /** Fired whenever the picker opens or closes. */
155
170
  onopentoggle?: (event: {
156
171
  open: boolean;
157
172
  }) => void;
173
+ onOpenToggle?: (event: {
174
+ open: boolean;
175
+ }) => void;
158
176
  /**
159
177
  * Fired when the user clicks the Clear button in single mode (requires clearable=true).
160
178
  * value is reset to null before this callback is invoked.
161
179
  */
162
180
  onclear?: () => void;
181
+ onClear?: () => void;
163
182
  };
164
183
  export type DateRangePickerProperties = OptionalDateRangePickerProperties & DateRangePickerEventProperties;
@@ -53,11 +53,15 @@
53
53
  interactiveLegend = false,
54
54
  hideLegendBelow = 360,
55
55
  tooltipSnippet,
56
- onbarclick,
56
+ onbarclick: onbarclickLegacy,
57
+ onBarClick,
57
58
  testId,
58
59
  classes
59
60
  }: DualAxisBarChartProperties = $props();
60
61
 
62
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
63
+ const onbarclick = $derived(onBarClick ?? onbarclickLegacy);
64
+
61
65
  // ── State ──────────────────────────────────────────────────────
62
66
 
63
67
  let containerEl: HTMLDivElement | null = $state(null);
@@ -147,4 +147,8 @@ 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;
150
154
  };
@@ -8,10 +8,14 @@
8
8
  heading,
9
9
  caption,
10
10
  compact = false,
11
- onclick,
11
+ onclick: onclickLegacy,
12
+ onClick,
12
13
  testId,
13
14
  classes
14
15
  }: FileDropzoneTriggerProperties = $props();
16
+
17
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
18
+ const onclick = $derived(onClick ?? onclickLegacy);
15
19
  </script>
16
20
 
17
21
  {#if compact}
@@ -21,4 +21,5 @@ 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;
24
25
  };
@@ -9,10 +9,16 @@
9
9
  disabled = false,
10
10
  testId,
11
11
  classes,
12
- onfiles,
13
- onerror
12
+ onfiles: onfilesLegacy,
13
+ onFiles,
14
+ onerror: onerrorLegacy,
15
+ onError
14
16
  }: FileInputProperties = $props();
15
17
 
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
+
16
22
  let dragOver = $state(false);
17
23
  let inputEl: HTMLInputElement | null = $state(null);
18
24
  let pickerBusy = false;
@@ -14,5 +14,7 @@ export type FileInputProperties = {
14
14
  testId?: string;
15
15
  classes?: string;
16
16
  onfiles?: (files: File[]) => void;
17
+ onFiles?: (files: File[]) => void;
17
18
  onerror?: (message: string) => void;
19
+ onError?: (message: string) => void;
18
20
  };
@@ -28,10 +28,16 @@
28
28
  testId,
29
29
  classes,
30
30
  empty,
31
- onstageclick,
32
- onstagehover
31
+ onstageclick: onstageclickLegacy,
32
+ onStageClick,
33
+ onstagehover: onstagehoverLegacy,
34
+ onStageHover
33
35
  }: FunnelChartProperties = $props();
34
36
 
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
+
35
41
  // ── State ──────────────────────────────────────────────────────
36
42
 
37
43
  let containerEl: HTMLDivElement | null = $state(null);
@@ -78,9 +78,17 @@ 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;
81
85
  /** Fires when the user hovers over or leaves a stage bar. `null` on leave. */
82
86
  onstagehover?: (event: {
83
87
  index: number;
84
88
  stage: FunnelStage;
85
89
  } | null) => void;
90
+ onStageHover?: (event: {
91
+ index: number;
92
+ stage: FunnelStage;
93
+ } | null) => void;
86
94
  };
@@ -1,8 +1,20 @@
1
1
  <script lang="ts">
2
2
  import type { ImgProperties } from './properties';
3
3
 
4
- let { src, alt, fallback, onerror, classes, inlineSvg, transformSvg, testId }: ImgProperties =
5
- $props();
4
+ let {
5
+ src,
6
+ alt,
7
+ fallback,
8
+ onerror: onerrorLegacy,
9
+ onError,
10
+ classes,
11
+ inlineSvg,
12
+ transformSvg,
13
+ testId
14
+ }: ImgProperties = $props();
15
+
16
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
17
+ const onerror = $derived(onError ?? onerrorLegacy);
6
18
 
7
19
  let currentSrc = $derived(src);
8
20
  // Per-source failure marker: when inlining a given URL fails we fall back to
@@ -26,4 +26,5 @@ export type OptionalImgProperties = {
26
26
  };
27
27
  export type ImgEventProperties = {
28
28
  onerror?: () => void;
29
+ onError?: () => void;
29
30
  };
@@ -30,14 +30,21 @@
30
30
  testId = '',
31
31
  textTransformers = [],
32
32
  textViewPresentation = [],
33
- onFocus = () => {},
34
- onFocusout = () => {},
35
- onBlur = () => {},
36
- onInput = () => {},
37
- onPaste = () => {},
33
+ onFocus: onFocusLegacy = () => {},
34
+ onfocus,
35
+ onFocusout: onFocusoutLegacy = () => {},
36
+ onfocusout,
37
+ onBlur: onBlurLegacy = () => {},
38
+ onblur,
39
+ onInput: onInputLegacy = () => {},
40
+ oninput,
41
+ onPaste: onPasteLegacy = () => {},
42
+ onpaste,
38
43
  onStateChange = () => {},
39
- onClick = () => {},
40
- onKeyDown = () => {},
44
+ onClick: onClickLegacy = () => {},
45
+ onclick,
46
+ onKeyDown: onKeyDownLegacy = () => {},
47
+ onkeydown,
41
48
  classes,
42
49
  role,
43
50
  ariaLabel,
@@ -61,6 +68,15 @@
61
68
  showCount = false
62
69
  }: InputProperties = $props();
63
70
 
71
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
72
+ const onBlur = $derived(onblur ?? onBlurLegacy);
73
+ const onClick = $derived(onclick ?? onClickLegacy);
74
+ const onFocus = $derived(onfocus ?? onFocusLegacy);
75
+ const onFocusout = $derived(onfocusout ?? onFocusoutLegacy);
76
+ const onInput = $derived(oninput ?? onInputLegacy);
77
+ const onKeyDown = $derived(onkeydown ?? onKeyDownLegacy);
78
+ const onPaste = $derived(onpaste ?? onPasteLegacy);
79
+
64
80
  /* `for` on a <label> resolves against an element's id, never its name. The label
65
81
  was emitted with for={name} while the field itself carried only name={name},
66
82
  so the association never completed for any caller. Derive the id from name so
@@ -101,11 +101,18 @@ export type OptionalInputProperties = {
101
101
  };
102
102
  export type InputEventProperties = {
103
103
  onInput?: (value: string, event: Event) => void;
104
+ oninput?: (value: string, event: Event) => void;
104
105
  onFocus?: (event: FocusEvent) => void;
106
+ onfocus?: (event: FocusEvent) => void;
105
107
  onFocusout?: (event: FocusEvent) => void;
108
+ onfocusout?: (event: FocusEvent) => void;
106
109
  onBlur?: (event: FocusEvent) => void;
110
+ onblur?: (event: FocusEvent) => void;
107
111
  onPaste?: (event: ClipboardEvent) => void;
112
+ onpaste?: (event: ClipboardEvent) => void;
108
113
  onClick?: (event: MouseEvent) => void;
114
+ onclick?: (event: MouseEvent) => void;
109
115
  onStateChange?: (state: ValidationState) => void;
110
116
  onKeyDown?: (event: KeyboardEvent) => void;
117
+ onkeydown?: (event: KeyboardEvent) => void;
111
118
  };
@@ -60,12 +60,18 @@
60
60
  tooltipPortal = false,
61
61
  highlightedIndex = null,
62
62
  onChartReady,
63
- onpointclick,
64
- onpointhover,
63
+ onpointclick: onpointclickLegacy,
64
+ onPointClick,
65
+ onpointhover: onpointhoverLegacy,
66
+ onPointHover,
65
67
  testId,
66
68
  classes
67
69
  }: LineChartProperties = $props();
68
70
 
71
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
72
+ const onpointclick = $derived(onPointClick ?? onpointclickLegacy);
73
+ const onpointhover = $derived(onPointHover ?? onpointhoverLegacy);
74
+
69
75
  // ── State ──────────────────────────────────────────────────────
70
76
 
71
77
  let containerEl: HTMLDivElement | null = $state(null);
@@ -142,11 +142,21 @@ export type LineChartEventProperties = {
142
142
  pointIndex: number;
143
143
  point: LineChartDataPoint;
144
144
  }) => void;
145
+ onPointClick?: (event: {
146
+ seriesIndex: number;
147
+ pointIndex: number;
148
+ point: LineChartDataPoint;
149
+ }) => void;
145
150
  onpointhover?: (event: {
146
151
  seriesIndex: number;
147
152
  pointIndex: number;
148
153
  point: LineChartDataPoint;
149
154
  } | null) => void;
155
+ onPointHover?: (event: {
156
+ seriesIndex: number;
157
+ pointIndex: number;
158
+ point: LineChartDataPoint;
159
+ } | null) => void;
150
160
  /**
151
161
  * Called once after the chart mounts, handing back a `ChartHighlightAPI`
152
162
  * so an external orchestrator (e.g. voice narration sync) can drive point
@@ -25,11 +25,16 @@
25
25
  centerContent,
26
26
  rightContent,
27
27
  bottomContent,
28
- onleftImageClick,
29
- onrightImageClick,
30
- oncenterTextClick,
31
- onitemClick,
32
- ontopSectionClick,
28
+ onleftImageClick: onleftImageClickLegacy,
29
+ onLeftImageClick,
30
+ onrightImageClick: onrightImageClickLegacy,
31
+ onRightImageClick,
32
+ oncenterTextClick: oncenterTextClickLegacy,
33
+ onCenterTextClick,
34
+ onitemClick: onitemClickLegacy,
35
+ onItemClick,
36
+ ontopSectionClick: ontopSectionClickLegacy,
37
+ onTopSectionClick,
33
38
  onkeydown,
34
39
  classes,
35
40
  transformSvg,
@@ -38,6 +43,13 @@
38
43
  id
39
44
  }: ListItemProperties = $props();
40
45
 
46
+ // Event-casing phase 1: both spellings accepted, the correct one wins.
47
+ const oncenterTextClick = $derived(onCenterTextClick ?? oncenterTextClickLegacy);
48
+ const onitemClick = $derived(onItemClick ?? onitemClickLegacy);
49
+ const onleftImageClick = $derived(onLeftImageClick ?? onleftImageClickLegacy);
50
+ const onrightImageClick = $derived(onRightImageClick ?? onrightImageClickLegacy);
51
+ const ontopSectionClick = $derived(onTopSectionClick ?? ontopSectionClickLegacy);
52
+
41
53
  function handleLeftImageClick(event: MouseEvent): void {
42
54
  onleftImageClick?.(event);
43
55
  }
@@ -33,9 +33,14 @@ export type ListItemProperties = ListItemEventProperties & {
33
33
  };
34
34
  export type ListItemEventProperties = {
35
35
  onleftImageClick?: (event: MouseEvent) => void;
36
+ onLeftImageClick?: (event: MouseEvent) => void;
36
37
  onrightImageClick?: (event: MouseEvent) => void;
38
+ onRightImageClick?: (event: MouseEvent) => void;
37
39
  oncenterTextClick?: (event: MouseEvent) => void;
40
+ onCenterTextClick?: (event: MouseEvent) => void;
38
41
  onitemClick?: (event: MouseEvent) => void;
42
+ onItemClick?: (event: MouseEvent) => void;
39
43
  ontopSectionClick?: (event: MouseEvent) => void;
44
+ onTopSectionClick?: (event: MouseEvent) => void;
40
45
  onkeydown?: (event: KeyboardEvent) => void;
41
46
  };