@juspay/svelte-ui-components 3.5.0 → 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 (152) 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/Calendar/Calendar.svelte +3 -11
  15. package/dist/Calendar/properties.d.ts +0 -11
  16. package/dist/Chat/Chat.svelte +9 -29
  17. package/dist/Chat/properties.d.ts +0 -9
  18. package/dist/Chat/types.d.ts +7 -0
  19. package/dist/ChatBubble/ChatBubble.svelte +3 -11
  20. package/dist/ChatBubble/properties.d.ts +0 -3
  21. package/dist/ChatComposer/ChatComposer.svelte +18 -44
  22. package/dist/ChatComposer/properties.d.ts +0 -12
  23. package/dist/ChatHeader/ChatHeader.svelte +1 -5
  24. package/dist/ChatHeader/properties.d.ts +0 -1
  25. package/dist/ChatMessage/ChatMessage.svelte +87 -11
  26. package/dist/ChatMessage/properties.d.ts +18 -3
  27. package/dist/ChatMessageList/ChatMessageList.svelte +5 -11
  28. package/dist/ChatMessageList/properties.d.ts +0 -6
  29. package/dist/ChatSuggestions/ChatSuggestions.svelte +1 -5
  30. package/dist/ChatSuggestions/properties.d.ts +0 -1
  31. package/dist/CheckListItem/CheckListItem.svelte +1 -5
  32. package/dist/CheckListItem/properties.d.ts +0 -1
  33. package/dist/Checkbox/Checkbox.svelte +1 -5
  34. package/dist/Checkbox/properties.d.ts +0 -1
  35. package/dist/ChipInput/ChipInput.svelte +10 -20
  36. package/dist/ChipInput/properties.d.ts +0 -4
  37. package/dist/Choicebox/Choicebox.svelte +1 -5
  38. package/dist/Choicebox/properties.d.ts +0 -1
  39. package/dist/ColorPicker/ColorPicker.svelte +4 -10
  40. package/dist/ColorPicker/properties.d.ts +0 -2
  41. package/dist/Combobox/Combobox.svelte +15 -33
  42. package/dist/Combobox/properties.d.ts +0 -8
  43. package/dist/CommandMenu/CommandMenu.svelte +2 -8
  44. package/dist/CommandMenu/properties.d.ts +0 -2
  45. package/dist/ContextMenu/ContextMenu.svelte +3 -11
  46. package/dist/ContextMenu/properties.d.ts +0 -3
  47. package/dist/DateRangePicker/DateRangePicker.svelte +6 -20
  48. package/dist/DateRangePicker/properties.d.ts +0 -19
  49. package/dist/Draggable/Draggable.svelte +7 -7
  50. package/dist/Draggable/properties.d.ts +3 -3
  51. package/dist/DualAxisBarChart/DualAxisBarChart.svelte +1 -5
  52. package/dist/DualAxisBarChart/properties.d.ts +0 -4
  53. package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -5
  54. package/dist/FileDropzoneTrigger/properties.d.ts +0 -1
  55. package/dist/FileInput/FileInput.svelte +2 -8
  56. package/dist/FileInput/properties.d.ts +0 -2
  57. package/dist/FunnelChart/FunnelChart.svelte +2 -8
  58. package/dist/FunnelChart/properties.d.ts +0 -8
  59. package/dist/Gallery/Gallery.svelte +15 -15
  60. package/dist/Gallery/properties.d.ts +6 -6
  61. package/dist/HITL/HITL.svelte +10 -8
  62. package/dist/HITL/properties.d.ts +2 -2
  63. package/dist/IframeViewer/IframeViewer.svelte +3 -2
  64. package/dist/IframeViewer/properties.d.ts +1 -1
  65. package/dist/Img/Img.svelte +119 -39
  66. package/dist/Img/properties.d.ts +0 -1
  67. package/dist/Input/Input.svelte +22 -37
  68. package/dist/Input/properties.d.ts +3 -10
  69. package/dist/InputButton/InputButton.svelte +2 -2
  70. package/dist/LineChart/LineChart.svelte +4 -10
  71. package/dist/LineChart/properties.d.ts +1 -11
  72. package/dist/ListItem/ListItem.svelte +10 -22
  73. package/dist/ListItem/properties.d.ts +5 -10
  74. package/dist/LottiePlayer/LottiePlayer.svelte +2 -8
  75. package/dist/LottiePlayer/properties.d.ts +0 -2
  76. package/dist/MediaPlayer/MediaPlayer.svelte +1 -5
  77. package/dist/MediaPlayer/properties.d.ts +0 -1
  78. package/dist/MediaUpload/MediaUpload.svelte +6 -6
  79. package/dist/MediaUpload/properties.d.ts +3 -3
  80. package/dist/Menu/Menu.svelte +3 -11
  81. package/dist/Menu/properties.d.ts +0 -3
  82. package/dist/Modal/Modal.svelte +15 -31
  83. package/dist/Modal/properties.d.ts +5 -11
  84. package/dist/Pagination/Pagination.svelte +3 -7
  85. package/dist/Pagination/properties.d.ts +1 -2
  86. package/dist/PieChart/PieChart.svelte +4 -10
  87. package/dist/PieChart/properties.d.ts +1 -9
  88. package/dist/Pill/Pill.svelte +1 -5
  89. package/dist/Pill/properties.d.ts +0 -1
  90. package/dist/Radio/Radio.svelte +1 -5
  91. package/dist/Radio/properties.d.ts +0 -1
  92. package/dist/Resizable/Resizable.svelte +3 -11
  93. package/dist/Resizable/properties.d.ts +0 -3
  94. package/dist/SankeyChart/SankeyChart.svelte +4 -14
  95. package/dist/SankeyChart/properties.d.ts +0 -12
  96. package/dist/Scroller/Scroller.svelte +1 -5
  97. package/dist/Scroller/properties.d.ts +0 -1
  98. package/dist/Select/Select.svelte +3 -11
  99. package/dist/Select/properties.d.ts +0 -3
  100. package/dist/Sheet/Sheet.svelte +3 -11
  101. package/dist/Sheet/properties.d.ts +0 -3
  102. package/dist/Slider/Slider.svelte +2 -8
  103. package/dist/Slider/properties.d.ts +0 -2
  104. package/dist/Snippet/Snippet.svelte +1 -5
  105. package/dist/Snippet/properties.d.ts +0 -1
  106. package/dist/SplitButton/SplitButton.svelte +1 -5
  107. package/dist/SplitButton/properties.d.ts +0 -1
  108. package/dist/SplitInput/SplitInput.svelte +6 -14
  109. package/dist/SplitInput/properties.d.ts +0 -3
  110. package/dist/StatCard/StatCard.svelte +2 -2
  111. package/dist/StatCard/properties.d.ts +1 -1
  112. package/dist/Status/Status.svelte +2 -6
  113. package/dist/Status/properties.d.ts +1 -2
  114. package/dist/Stepper/Stepper.svelte +2 -12
  115. package/dist/Stepper/properties.d.ts +1 -14
  116. package/dist/Table/BuiltinCell.svelte +1 -1
  117. package/dist/Table/Table.svelte +16 -17
  118. package/dist/Table/properties.d.ts +3 -35
  119. package/dist/Tabs/Tabs.svelte +2 -8
  120. package/dist/Tabs/properties.d.ts +0 -2
  121. package/dist/TaskList/TaskList.svelte +1 -4
  122. package/dist/TaskList/properties.d.ts +0 -1
  123. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +1 -5
  124. package/dist/ThemeSwitcher/properties.d.ts +0 -1
  125. package/dist/ThinkingIndicator/ThinkingIndicator.svelte +4 -10
  126. package/dist/ThinkingIndicator/properties.d.ts +1 -3
  127. package/dist/Toast/Toast.svelte +2 -2
  128. package/dist/Toast/properties.d.ts +1 -1
  129. package/dist/Toggle/Toggle.svelte +1 -5
  130. package/dist/Toggle/properties.d.ts +0 -1
  131. package/dist/ToolCallLog/ToolCallLog.svelte +1 -10
  132. package/dist/ToolCallLog/properties.d.ts +0 -1
  133. package/dist/Toolbar/Toolbar.svelte +2 -6
  134. package/dist/Toolbar/properties.d.ts +1 -2
  135. package/dist/TypewriterText/TypewriterText.svelte +3 -3
  136. package/dist/TypewriterText/properties.d.ts +1 -1
  137. package/dist-codemod/bin.js +32 -0
  138. package/dist-codemod/cli.js +175 -0
  139. package/dist-codemod/legacy-pairs.js +228 -0
  140. package/dist-codemod/transform.js +278 -0
  141. package/dist-codemod/wc-children.js +66 -0
  142. package/dist-wc/index.js +4458 -5127
  143. package/package.json +9 -7
  144. package/scripts/postinstall.mjs +14 -12
  145. package/dist/deprecation.d.ts +0 -42
  146. package/dist/deprecation.js +0 -57
  147. package/scripts/codemod/README.md +0 -76
  148. package/scripts/codemod/cli.ts +0 -206
  149. package/scripts/codemod/map.ts +0 -118
  150. package/scripts/codemod/transform.ts +0 -549
  151. package/scripts/codemod/tsconfig.json +0 -15
  152. package/scripts/codemod/wc-children.ts +0 -75
@@ -73,49 +73,37 @@ export type OptionalChatComposerProperties = {
73
73
  };
74
74
  export type ChatComposerEventProperties = {
75
75
  onsubmit?: (value: string, attachments: File[]) => void;
76
- onSubmit?: (value: string, attachments: File[]) => void;
77
76
  oninput?: (value: string, event: Event) => void;
78
77
  onkeydown?: (event: KeyboardEvent) => void;
79
78
  onpaste?: (event: ClipboardEvent) => void;
80
79
  onstop?: () => void;
81
- onStop?: () => void;
82
80
  onvoice?: () => void;
83
- onVoice?: () => void;
84
81
  onattach?: (files: File[]) => void;
85
- onAttach?: (files: File[]) => void;
86
82
  /**
87
83
  * Intercepts the attach button: when provided, clicking it calls this instead of
88
84
  * opening the built-in file picker — for apps with their own chooser (camera /
89
85
  * gallery / files).
90
86
  */
91
87
  onattachclick?: () => void;
92
- onAttachClick?: () => void;
93
88
  /**
94
89
  * Removal callbacks for the rich strip's chips. Omit them to render the rich
95
90
  * chips read-only (no remove buttons), mirroring AttachmentChipRow.
96
91
  */
97
92
  onremoverichimage?: (id: string) => void;
98
- onRemoveRichImage?: (id: string) => void;
99
93
  onremoverichfile?: (id: string) => void;
100
- onRemoveRichFile?: (id: string) => void;
101
94
  onremoverichvideo?: (id: string) => void;
102
- onRemoveRichVideo?: (id: string) => void;
103
95
  /**
104
96
  * Open/preview callbacks for the rich strip's chips — when provided, a chip's
105
97
  * tile becomes a real button and clicking it fires with the attachment (e.g.
106
98
  * open a lightbox, play the video).
107
99
  */
108
100
  onopenrichimage?: (image: AttachmentChipImage) => void;
109
- onOpenRichImage?: (image: AttachmentChipImage) => void;
110
101
  onopenrichvideo?: (video: AttachmentChipVideo) => void;
111
- onOpenRichVideo?: (video: AttachmentChipVideo) => void;
112
102
  onopenrichfile?: (file: AttachmentChipFile) => void;
113
- onOpenRichFile?: (file: AttachmentChipFile) => void;
114
103
  /**
115
104
  * The composer's idle action (e.g. voice conversation mode). While the value is
116
105
  * empty, nothing is sendable and no reply is streaming, the send button gives way
117
106
  * to an action button that fires this.
118
107
  */
119
108
  onaction?: () => void;
120
- onAction?: () => void;
121
109
  };
@@ -14,16 +14,12 @@
14
14
  closeIcon,
15
15
  closeLabel = 'Close',
16
16
  showClose,
17
- onclose: oncloseLegacy,
18
- onClose,
17
+ onclose,
19
18
  children,
20
19
  testId,
21
20
  classes
22
21
  }: ChatHeaderProperties = $props();
23
22
 
24
- // Event-casing phase 1: both spellings accepted, the correct one wins.
25
- const onclose = $derived(onClose ?? oncloseLegacy);
26
-
27
23
  let displayClose = $derived(showClose ?? typeof onclose === 'function');
28
24
  </script>
29
25
 
@@ -16,5 +16,4 @@ export type OptionalChatHeaderProperties = {
16
16
  };
17
17
  export type ChatHeaderEventProperties = {
18
18
  onclose?: () => void;
19
- onClose?: () => void;
20
19
  };
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Button from '../Button/Button.svelte';
3
3
  import LoadingDots from '../LoadingDots/LoadingDots.svelte';
4
+ import TypewriterText from '../TypewriterText/TypewriterText.svelte';
4
5
  import copySvg from '../assets/copy.svg?raw';
5
6
  import checkmarkSvg from '../assets/checkmark.svg?raw';
6
7
  import retrySvg from '../assets/retry.svg?raw';
@@ -17,7 +18,10 @@
17
18
  markdown,
18
19
  body,
19
20
  streaming = false,
21
+ typewriter = false,
22
+ typewriterSpeed,
20
23
  clampLines = 0,
24
+ marker = false,
21
25
  status,
22
26
  avatar,
23
27
  header,
@@ -30,12 +34,9 @@
30
34
  collapseLabel = 'Collapse message',
31
35
  feedbackUpLabel = 'Good response',
32
36
  feedbackDownLabel = 'Bad response',
33
- onretry: onretryLegacy,
34
- onRetry,
35
- onfeedback: onfeedbackLegacy,
36
- onFeedback,
37
- oncopy: oncopyLegacy,
38
- onCopy,
37
+ onretry,
38
+ onfeedback,
39
+ oncopy,
39
40
  testId,
40
41
  classes
41
42
  }: ChatMessageProperties = $props();
@@ -71,10 +72,6 @@
71
72
  expanded = !expanded;
72
73
  }
73
74
  };
74
- // Event-casing phase 1: both spellings accepted, the correct one wins.
75
- const oncopy = $derived(onCopy ?? oncopyLegacy);
76
- const onfeedback = $derived(onFeedback ?? onfeedbackLegacy);
77
- const onretry = $derived(onRetry ?? onretryLegacy);
78
75
 
79
76
  let party = $derived(partyOf(role));
80
77
 
@@ -109,8 +106,40 @@
109
106
  hasMarkdown && renderMarkdownFn !== null ? renderMarkdownFn(markdown ?? '') : html
110
107
  );
111
108
  let hasHtml = $derived(typeof effectiveHtml === 'string' && effectiveHtml.length > 0);
109
+
112
110
  let hasBody = $derived(typeof body === 'function');
113
- let hasContent = $derived(hasBody || hasHtml || content.length > 0);
111
+
112
+ /* The typewriter reveals SOURCE text, not rendered HTML: typing a pre-rendered
113
+ `html` string character by character would put its tags on screen. So it drives
114
+ off `markdown` or `content` and leaves an `html`-only message to the normal
115
+ path. `markdown` is typed through the same pipeline the static branch uses, so
116
+ rich text reveals as rich text rather than as raw syntax that reformats at the
117
+ end. */
118
+ let typewriterSource = $derived(hasMarkdown ? (markdown ?? '') : content);
119
+ /* Gated on the pipeline for a markdown source. The renderer loads asynchronously, and
120
+ without this the typewriter starts on the SOURCE: `**bold**` is typed literally and
121
+ then reformats when the module resolves. Waiting matches what the static branch
122
+ already does — degrade to the `html`/`content` fallback until the renderer is there —
123
+ rather than showing syntax the consumer never asked to display. */
124
+ let typewriterActive = $derived(
125
+ typewriter &&
126
+ !hasBody &&
127
+ typewriterSource.length > 0 &&
128
+ (!hasMarkdown || renderMarkdownFn !== null)
129
+ );
130
+ let typewriterRenderText = $derived(
131
+ hasMarkdown && renderMarkdownFn !== null ? { renderText: renderMarkdownFn } : {}
132
+ );
133
+ // Clamped at the boundary the way LoadingDots clamps `dots`, so the prop's floor is part
134
+ // of this component's contract rather than something a consumer discovers. The finite
135
+ // check is not redundant: `typeof NaN === 'number'`, and `Math.max(1, NaN)` is `NaN`, so
136
+ // without it the documented floor is not actually enforced.
137
+ let typewriterPacing = $derived(
138
+ typeof typewriterSpeed === 'number' && Number.isFinite(typewriterSpeed)
139
+ ? { speed: Math.max(1, typewriterSpeed) }
140
+ : {}
141
+ );
142
+ let hasContent = $derived(hasBody || hasHtml || content.length > 0 || typewriterActive);
114
143
  let showTyping = $derived(streaming && !hasContent);
115
144
  let showRetry = $derived(typeof onretry === 'function');
116
145
  let showFeedback = $derived(typeof onfeedback === 'function');
@@ -177,12 +206,38 @@
177
206
  <div
178
207
  class="bubble"
179
208
  class:clampable
209
+ class:has-marker={marker}
180
210
  style={clampable ? `--chat-message-clamp-lines-prop: ${clampLines};` : null}
181
211
  data-clamped={clampActive ? 'true' : null}
182
212
  data-expanded={clampable ? String(expanded) : null}
183
213
  >
214
+ {#if marker}
215
+ <span class="marker" aria-hidden="true"></span>
216
+ {/if}
217
+
184
218
  {#if hasBody}
185
219
  <div class="body" id={bodyId}>{@render body?.()}</div>
220
+ {:else if typewriterActive}
221
+ <!-- ChatMessageList is a role="log" aria-live="polite" region, so a body whose text
222
+ grows one character at a time would be announced as it grows. Silence it only
223
+ WHILE it is growing: leaving it off once streaming ends would suppress the
224
+ settled message too, which is the announcement the live region exists for.
225
+ `aria-live="off"` is the spec answer (the innermost live setting wins), and
226
+ `aria-busy` is the purpose-built one — "being modified, wait before exposing" —
227
+ so the two together do not depend on a single behaviour being implemented. -->
228
+ <div
229
+ class="body"
230
+ id={bodyId}
231
+ aria-live={streaming ? 'off' : null}
232
+ aria-busy={streaming ? 'true' : null}
233
+ >
234
+ <TypewriterText
235
+ text={typewriterSource}
236
+ isStreaming={streaming}
237
+ {...typewriterRenderText}
238
+ {...typewriterPacing}
239
+ />
240
+ </div>
186
241
  {:else if hasHtml}
187
242
  <!-- eslint-disable-next-line svelte/no-at-html-tags -->
188
243
  <div class="body" id={bodyId}>{@html effectiveHtml}</div>
@@ -322,6 +377,27 @@
322
377
  overflow-wrap: anywhere;
323
378
  }
324
379
 
380
+ /* Only the marker variant becomes a containing block: making every bubble relative
381
+ would silently re-base any absolutely-positioned content a consumer renders in a
382
+ body snippet. */
383
+ .bubble.has-marker {
384
+ position: relative;
385
+ }
386
+
387
+ .marker {
388
+ /* Decorative and absolutely positioned, so it sits over the bubble's leading
389
+ padding — where a link at the start of a responder message also sits. Without
390
+ this it silently eats those clicks. */
391
+ pointer-events: none;
392
+ position: absolute;
393
+ inset-block: var(--chat-message-marker-inset-block, 0);
394
+ /* Logical, so the bar follows `role` alignment into RTL instead of pinning left. */
395
+ inset-inline-start: var(--chat-message-marker-offset, 0px);
396
+ width: var(--chat-message-marker-width, 2px);
397
+ border-radius: var(--chat-message-marker-border-radius, 0);
398
+ background: var(--chat-message-marker-color, #6d28d9);
399
+ }
400
+
325
401
  .chat-message.party-sender .bubble {
326
402
  color: var(--chat-message-sender-color, #ffffff);
327
403
  background: var(--chat-message-sender-background, #18181b);
@@ -37,7 +37,25 @@ export type OptionalChatMessageProperties = {
37
37
  * the line count for every message without touching each call site.
38
38
  */
39
39
  clampLines?: number;
40
+ /**
41
+ * Draw an accent bar along the bubble's leading edge — the quote-bar shape a chat
42
+ * surface uses to mark one party's turns without giving them a filled bubble.
43
+ * Decorative: it carries no text and is hidden from assistive technology, so the
44
+ * distinction it makes must also be carried by `role`, which it is.
45
+ */
46
+ marker?: boolean;
40
47
  streaming?: boolean;
48
+ /**
49
+ * Reveal the message progressively instead of all at once, using `TypewriterText`.
50
+ * Drives off `markdown` or `content` — never `html`, since typing a pre-rendered
51
+ * string would put its tags on screen — and types `markdown` through the same
52
+ * pipeline the static branch uses, so rich text reveals as rich text. `streaming`
53
+ * decides the mode: while it is true, text keeps typing as it grows; the moment it
54
+ * turns false the remainder is shown at once. Ignored when a `body` snippet is set.
55
+ */
56
+ typewriter?: boolean;
57
+ /** Milliseconds between characters while typing, clamped to a minimum of 1. A non-finite value is ignored. Defaults to `TypewriterText`'s own. */
58
+ typewriterSpeed?: number;
41
59
  status?: ChatMessageStatus;
42
60
  avatar?: Snippet;
43
61
  header?: Snippet;
@@ -59,9 +77,6 @@ export type OptionalChatMessageProperties = {
59
77
  };
60
78
  export type ChatMessageEventProperties = {
61
79
  onretry?: (() => void) | null;
62
- onRetry?: (() => void) | null;
63
80
  onfeedback?: ((value: ChatMessageFeedback) => void) | null;
64
- onFeedback?: ((value: ChatMessageFeedback) => void) | null;
65
81
  oncopy?: (text: string) => void;
66
- onCopy?: (text: string) => void;
67
82
  };
@@ -23,21 +23,13 @@
23
23
  jumpLabel = 'Jump to latest',
24
24
  jumpIcon,
25
25
  allowCopy = false,
26
- onscrollstate: onscrollstateLegacy,
27
- onScrollState,
28
- onretry: onretryLegacy,
29
- onRetry,
30
- onfeedback: onfeedbackLegacy,
31
- onFeedback,
26
+ onscrollstate,
27
+ onretry,
28
+ onfeedback,
32
29
  testId,
33
30
  classes
34
31
  }: ChatMessageListProperties = $props();
35
32
 
36
- // Event-casing phase 1: both spellings accepted, the correct one wins.
37
- const onfeedback = $derived(onFeedback ?? onfeedbackLegacy);
38
- const onretry = $derived(onRetry ?? onretryLegacy);
39
- const onscrollstate = $derived(onScrollState ?? onscrollstateLegacy);
40
-
41
33
  let listEl: HTMLElement | null = $state(null);
42
34
  let innerEl: HTMLElement | null = $state(null);
43
35
  let atBottom = $state(true);
@@ -311,6 +303,8 @@
311
303
  markdown={msg.markdown}
312
304
  body={typeof messageBody === 'function' ? bodyFor : null}
313
305
  streaming={msg.streaming}
306
+ typewriter={msg.typewriter}
307
+ typewriterSpeed={msg.typewriterSpeed}
314
308
  status={msg.status}
315
309
  allowCopy={allowCopy && partyOf(msg.role) === 'responder'}
316
310
  attachments={typeof messageAttachments === 'function' ? attachmentsFor : null}
@@ -49,12 +49,6 @@ export type ChatMessageListEventProperties = {
49
49
  atBottom: boolean;
50
50
  scrollable: boolean;
51
51
  }) => void;
52
- onScrollState?: (state: {
53
- atBottom: boolean;
54
- scrollable: boolean;
55
- }) => void;
56
52
  onretry?: () => void;
57
- onRetry?: () => void;
58
53
  onfeedback?: (value: ChatMessageFeedback, message: ChatMessageData) => void;
59
- onFeedback?: (value: ChatMessageFeedback, message: ChatMessageData) => void;
60
54
  };
@@ -13,15 +13,11 @@
13
13
  loading = false,
14
14
  icon,
15
15
  chipClasses,
16
- onselect: onselectLegacy,
17
- onSelect,
16
+ onselect,
18
17
  testId,
19
18
  classes
20
19
  }: ChatSuggestionsProperties = $props();
21
20
 
22
- // Event-casing phase 1: both spellings accepted, the correct one wins.
23
- const onselect = $derived(onSelect ?? onselectLegacy);
24
-
25
21
  const labelOf = (item: ChatSuggestion): string => (typeof item === 'string' ? item : item.label);
26
22
 
27
23
  const valueOf = (item: ChatSuggestion): string => {
@@ -55,5 +55,4 @@ export type OptionalChatSuggestionsProperties = {
55
55
  };
56
56
  export type ChatSuggestionsEventProperties = {
57
57
  onselect?: (value: string, index: number) => void;
58
- onSelect?: (value: string, index: number) => void;
59
58
  };
@@ -8,14 +8,10 @@
8
8
  disabled = false,
9
9
  checkboxLabel,
10
10
  testId,
11
- onclick: onclickLegacy,
12
- onClick,
11
+ onclick,
13
12
  classes
14
13
  }: CheckListItemProperties = $props();
15
14
 
16
- // Event-casing phase 1: both spellings accepted, the correct one wins.
17
- const onclick = $derived(onClick ?? onclickLegacy);
18
-
19
15
  function handleClick(value: boolean): void {
20
16
  checked = value;
21
17
  onclick?.(checked);
@@ -12,5 +12,4 @@ export type OptionalCheckListItemProperties = {
12
12
  };
13
13
  export type CheckListItemEventProperties = {
14
14
  onclick?: (checked: boolean) => void;
15
- onClick?: (checked: boolean) => void;
16
15
  };
@@ -11,16 +11,12 @@
11
11
  testId,
12
12
  checkedIcon,
13
13
  indeterminateIcon,
14
- onclick: onclickLegacy,
15
- onClick,
14
+ onclick,
16
15
  classes,
17
16
  ariaControls,
18
17
  ariaLabel
19
18
  }: CheckboxProperties = $props();
20
19
 
21
- // Event-casing phase 1: both spellings accepted, the correct one wins.
22
- const onclick = $derived(onClick ?? onclickLegacy);
23
-
24
20
  function handleClick(): void {
25
21
  if (disabled) {
26
22
  return;
@@ -20,5 +20,4 @@ export type OptionalCheckboxProperties = {
20
20
  };
21
21
  export type CheckboxEventProperties = {
22
22
  onclick?: (checked: boolean) => void;
23
- onClick?: (checked: boolean) => void;
24
23
  };
@@ -11,22 +11,12 @@
11
11
  editable = false,
12
12
  testId,
13
13
  classes,
14
- onadd: onaddLegacy,
15
- onAdd,
16
- ondismiss: ondismissLegacy,
17
- onDismiss,
18
- onedit: oneditLegacy,
19
- onEdit,
20
- onchange: onchangeLegacy,
21
- onChange
14
+ onadd,
15
+ ondismiss,
16
+ onedit,
17
+ onchange
22
18
  }: ChipInputProperties = $props();
23
19
 
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
-
30
20
  let draft = $state('');
31
21
 
32
22
  // The chip currently swapped for an inline edit field, held by VALUE rather than by slot
@@ -153,11 +143,11 @@
153
143
  actionInput={false}
154
144
  classes="chip-input-edit"
155
145
  bind:this={editInputRef}
156
- onInput={(nextValue) => {
146
+ oninput={(nextValue) => {
157
147
  editDraft = nextValue;
158
148
  }}
159
- onKeyDown={(event) => handleEditKeyDown(event, chip)}
160
- onBlur={() => handleEditBlur(chip)}
149
+ onkeydown={(event) => handleEditKeyDown(event, chip)}
150
+ onblur={() => handleEditBlur(chip)}
161
151
  {...typeof testId === 'string' ? { testId: `${testId}-item-${index}-edit` } : {}}
162
152
  />
163
153
  </div>
@@ -186,11 +176,11 @@
186
176
  actionInput={false}
187
177
  disable={disabled}
188
178
  classes="chip-input-draft"
189
- onInput={(nextValue) => {
179
+ oninput={(nextValue) => {
190
180
  draft = nextValue;
191
181
  }}
192
- onKeyDown={handleKeyDown}
193
- onBlur={addChip}
182
+ onkeydown={handleKeyDown}
183
+ onblur={addChip}
194
184
  {...typeof testId === 'string' ? { testId: `${testId}-add` } : {}}
195
185
  />
196
186
  </div>
@@ -34,16 +34,12 @@ export type OptionalChipInputProperties = {
34
34
  };
35
35
  export type ChipInputEventProperties = {
36
36
  onadd?: (value: string) => void;
37
- onAdd?: (value: string) => void;
38
37
  ondismiss?: (value: string) => void;
39
- onDismiss?: (value: string) => void;
40
38
  /**
41
39
  * Fires after an in-place edit (see `editable`) commits a value that actually changed. Not
42
40
  * fired when the edit is cancelled (Escape) or committed with the text unchanged.
43
41
  */
44
42
  onedit?: (value: string, previousValue: string) => void;
45
- onEdit?: (value: string, previousValue: string) => void;
46
43
  /** Fires alongside `onadd`/`ondismiss`/`onedit`, after any of them has already updated `values`. */
47
44
  onchange?: (values: string[]) => void;
48
- onChange?: (values: string[]) => void;
49
45
  };
@@ -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);