@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
package/README.md CHANGED
@@ -100,7 +100,7 @@ fix to something that did not work.
100
100
  value=""
101
101
  placeholder="Enter email"
102
102
  dataType="email"
103
- onStateChange={(state) => console.log(state)}
103
+ onstatechange={(state) => console.log(state)}
104
104
  />
105
105
 
106
106
  <!-- Toggle switch -->
@@ -5,8 +5,7 @@
5
5
  expand = $bindable(false),
6
6
  children,
7
7
  trigger,
8
- ontoggle: ontoggleLegacy,
9
- onToggle,
8
+ ontoggle,
10
9
  triggerClasses,
11
10
  classes,
12
11
  testId,
@@ -14,9 +13,6 @@
14
13
  panelId
15
14
  }: AccordionProperties = $props();
16
15
 
17
- // Event-casing phase 1: both spellings accepted, the correct one wins.
18
- const ontoggle = $derived(onToggle ?? ontoggleLegacy);
19
-
20
16
  /* The trigger and the panel are siblings, not ancestor/descendant, so nothing in the
21
17
  markup tells assistive technology which region the trigger's aria-expanded refers to.
22
18
  A generated id keeps that link automatic -- consumers pass no id and get correct
@@ -27,5 +27,4 @@ export type OptionalAccordionProperties = {
27
27
  };
28
28
  export type AccordionEventProperties = {
29
29
  ontoggle?: (expanded: boolean) => void;
30
- onToggle?: (expanded: boolean) => void;
31
30
  };
@@ -51,18 +51,12 @@
51
51
  tooltipSnippet,
52
52
  empty,
53
53
  tooltipPortal = false,
54
- onpointhover: onpointhoverLegacy,
55
- onPointHover,
56
- onpointclick: onpointclickLegacy,
57
- onPointClick,
54
+ onpointhover,
55
+ onpointclick,
58
56
  testId,
59
57
  classes
60
58
  }: AreaChartProperties = $props();
61
59
 
62
- // Event-casing phase 1: both spellings accepted, the correct one wins.
63
- const onpointclick = $derived(onPointClick ?? onpointclickLegacy);
64
- const onpointhover = $derived(onPointHover ?? onpointhoverLegacy);
65
-
66
60
  // ── State ──────────────────────────────────────────────────────
67
61
 
68
62
  let containerEl: HTMLDivElement | null = $state(null);
@@ -61,19 +61,9 @@ export type AreaChartEventProperties = {
61
61
  pointIndex: number;
62
62
  point: AreaChartDataPoint;
63
63
  } | null) => void;
64
- onPointHover?: (event: {
65
- seriesIndex: number;
66
- pointIndex: number;
67
- point: AreaChartDataPoint;
68
- } | null) => void;
69
64
  onpointclick?: (event: {
70
65
  seriesIndex: number;
71
66
  pointIndex: number;
72
67
  point: AreaChartDataPoint;
73
68
  }) => void;
74
- onPointClick?: (event: {
75
- seriesIndex: number;
76
- pointIndex: number;
77
- point: AreaChartDataPoint;
78
- }) => void;
79
69
  };
@@ -15,12 +15,12 @@
15
15
  images = [],
16
16
  files = [],
17
17
  videos = [],
18
- onRemoveImage,
19
- onRemoveFile,
20
- onRemoveVideo,
21
- onOpenImage,
22
- onOpenVideo,
23
- onOpenFile,
18
+ onremoveimage,
19
+ onremovefile,
20
+ onremovevideo,
21
+ onopenimage,
22
+ onopenvideo,
23
+ onopenfile,
24
24
  imageTooltip,
25
25
  videoTooltip,
26
26
  removeIcon,
@@ -46,15 +46,15 @@
46
46
  testID={typeof testId === 'string' ? `${testId}-image-${image.id}` : null}
47
47
  >
48
48
  <svelte:element
49
- this={typeof onOpenImage === 'function' ? 'button' : 'div'}
50
- type={typeof onOpenImage === 'function' ? 'button' : null}
51
- role={typeof onOpenImage === 'function' ? 'button' : null}
52
- aria-label={typeof onOpenImage === 'function'
49
+ this={typeof onopenimage === 'function' ? 'button' : 'div'}
50
+ type={typeof onopenimage === 'function' ? 'button' : null}
51
+ role={typeof onopenimage === 'function' ? 'button' : null}
52
+ aria-label={typeof onopenimage === 'function'
53
53
  ? `Open ${image.filename ?? 'image'}`
54
54
  : null}
55
55
  class="thumb"
56
- class:openable={typeof onOpenImage === 'function'}
57
- onclick={typeof onOpenImage === 'function' ? () => onOpenImage(image) : null}
56
+ class:openable={typeof onopenimage === 'function'}
57
+ onclick={typeof onopenimage === 'function' ? () => onopenimage(image) : null}
58
58
  use:tooltip={{
59
59
  text: typeof imageTooltip === 'function' ? imageTooltip(image) : '',
60
60
  position: 'top'
@@ -62,14 +62,14 @@
62
62
  >
63
63
  <Img src={image.thumbnailData} alt={image.filename ?? 'Uploaded image'} fallback="" />
64
64
  </svelte:element>
65
- {#if typeof onRemoveImage === 'function'}
65
+ {#if typeof onremoveimage === 'function'}
66
66
  <div class="remove-wrap">
67
67
  <Button
68
68
  variant="secondary"
69
69
  iconOnly={true}
70
70
  ariaLabel="Remove image"
71
71
  testId={testId && `${testId}-remove-image-${image.id}`}
72
- onclick={() => onRemoveImage(image.id)}
72
+ onclick={() => onremoveimage(image.id)}
73
73
  >
74
74
  {#snippet icon()}
75
75
  {#if removeIcon}
@@ -97,15 +97,15 @@
97
97
  testID={typeof testId === 'string' ? `${testId}-video-${video.id}` : null}
98
98
  >
99
99
  <svelte:element
100
- this={typeof onOpenVideo === 'function' ? 'button' : 'div'}
101
- type={typeof onOpenVideo === 'function' ? 'button' : null}
102
- role={typeof onOpenVideo === 'function' ? 'button' : null}
103
- aria-label={typeof onOpenVideo === 'function'
100
+ this={typeof onopenvideo === 'function' ? 'button' : 'div'}
101
+ type={typeof onopenvideo === 'function' ? 'button' : null}
102
+ role={typeof onopenvideo === 'function' ? 'button' : null}
103
+ aria-label={typeof onopenvideo === 'function'
104
104
  ? `Play ${video.filename ?? 'video'}`
105
105
  : null}
106
106
  class="thumb video-tile"
107
- class:openable={typeof onOpenVideo === 'function'}
108
- onclick={typeof onOpenVideo === 'function' ? () => onOpenVideo(video) : null}
107
+ class:openable={typeof onopenvideo === 'function'}
108
+ onclick={typeof onopenvideo === 'function' ? () => onopenvideo(video) : null}
109
109
  use:tooltip={{
110
110
  text: typeof videoTooltip === 'function' ? videoTooltip(video) : '',
111
111
  position: 'top'
@@ -120,14 +120,14 @@
120
120
  </svg>
121
121
  </span>
122
122
  </svelte:element>
123
- {#if typeof onRemoveVideo === 'function'}
123
+ {#if typeof onremovevideo === 'function'}
124
124
  <div class="remove-wrap">
125
125
  <Button
126
126
  variant="secondary"
127
127
  iconOnly={true}
128
128
  ariaLabel="Remove video"
129
129
  testId={testId && `${testId}-remove-video-${video.id}`}
130
- onclick={() => onRemoveVideo(video.id)}
130
+ onclick={() => onremovevideo(video.id)}
131
131
  >
132
132
  {#snippet icon()}
133
133
  {#if removeIcon}
@@ -155,13 +155,13 @@
155
155
  testID={typeof testId === 'string' ? `${testId}-file-${file.id}` : null}
156
156
  >
157
157
  <svelte:element
158
- this={typeof onOpenFile === 'function' ? 'button' : 'div'}
159
- type={typeof onOpenFile === 'function' ? 'button' : null}
160
- role={typeof onOpenFile === 'function' ? 'button' : null}
161
- aria-label={typeof onOpenFile === 'function' ? `Open ${file.filename}` : null}
158
+ this={typeof onopenfile === 'function' ? 'button' : 'div'}
159
+ type={typeof onopenfile === 'function' ? 'button' : null}
160
+ role={typeof onopenfile === 'function' ? 'button' : null}
161
+ aria-label={typeof onopenfile === 'function' ? `Open ${file.filename}` : null}
162
162
  class="thumb file-tile"
163
- class:openable={typeof onOpenFile === 'function'}
164
- onclick={typeof onOpenFile === 'function' ? () => onOpenFile(file) : null}
163
+ class:openable={typeof onopenfile === 'function'}
164
+ onclick={typeof onopenfile === 'function' ? () => onopenfile(file) : null}
165
165
  >
166
166
  {#if fileIcon}
167
167
  {@render fileIcon()}
@@ -185,14 +185,14 @@
185
185
  </span>
186
186
  </div>
187
187
  </svelte:element>
188
- {#if typeof onRemoveFile === 'function'}
188
+ {#if typeof onremovefile === 'function'}
189
189
  <div class="remove-wrap">
190
190
  <Button
191
191
  variant="secondary"
192
192
  iconOnly={true}
193
193
  ariaLabel="Remove file"
194
194
  testId={testId && `${testId}-remove-file-${file.id}`}
195
- onclick={() => onRemoveFile(file.id)}
195
+ onclick={() => onremovefile(file.id)}
196
196
  >
197
197
  {#snippet icon()}
198
198
  {#if removeIcon}
@@ -19,17 +19,17 @@ export type AttachmentChipRowProperties = OptionalAttachmentChipRowProperties &
19
19
  export type MandatoryAttachmentChipRowProperties = Record<never, never>;
20
20
  export type OptionalAttachmentChipRowProperties = {
21
21
  /** Omit to render the row read-only — chips lose their remove buttons. */
22
- onRemoveImage?: (id: string) => void;
23
- onRemoveFile?: (id: string) => void;
24
- onRemoveVideo?: (id: string) => void;
22
+ onremoveimage?: (id: string) => void;
23
+ onremovefile?: (id: string) => void;
24
+ onremovevideo?: (id: string) => void;
25
25
  /**
26
26
  * Open/preview callbacks — when provided, the chip's tile becomes a real button
27
27
  * and clicking it fires with the attachment (e.g. open a lightbox, play the
28
28
  * video). Omitted, the tile stays non-interactive.
29
29
  */
30
- onOpenImage?: (image: AttachmentChipImage) => void;
31
- onOpenVideo?: (video: AttachmentChipVideo) => void;
32
- onOpenFile?: (file: AttachmentChipFile) => void;
30
+ onopenimage?: (image: AttachmentChipImage) => void;
31
+ onopenvideo?: (video: AttachmentChipVideo) => void;
32
+ onopenfile?: (file: AttachmentChipFile) => void;
33
33
  images?: AttachmentChipImage[];
34
34
  files?: AttachmentChipFile[];
35
35
  /** Video attachments — a poster tile with a play badge (or a plain dark tile without a poster). */
@@ -14,16 +14,12 @@
14
14
  rightContent,
15
15
  dismissIcon,
16
16
  onclick,
17
- ondismiss: ondismissLegacy,
18
- onDismiss,
17
+ ondismiss,
19
18
  classes,
20
19
  title,
21
20
  role = null
22
21
  }: BannerProperties = $props();
23
22
 
24
- // Event-casing phase 1: both spellings accepted, the correct one wins.
25
- const ondismiss = $derived(onDismiss ?? ondismissLegacy);
26
-
27
23
  let interactive = $derived(typeof onclick === 'function');
28
24
 
29
25
  let rootClass = $derived(['banner', classes ?? ''].filter((c) => c.length > 0).join(' '));
@@ -18,5 +18,4 @@ export type OptionalBannerProperties = {
18
18
  export type BannerEventProperties = {
19
19
  onclick?: (event: MouseEvent) => void;
20
20
  ondismiss?: () => void;
21
- onDismiss?: () => void;
22
21
  };
@@ -82,7 +82,7 @@
82
82
  tooltipSnippet,
83
83
  empty,
84
84
  renderOverlay,
85
- onChartReady,
85
+ onchartready,
86
86
  highlightedIndex = null,
87
87
  normaliseToFirstPoint = false,
88
88
  topN,
@@ -91,18 +91,12 @@
91
91
  interactiveLegend = false,
92
92
  hideLegendBelow = 360,
93
93
  tooltipPortal = false,
94
- onbarclick: onbarclickLegacy,
95
- onBarClick,
96
- onbarhover: onbarhoverLegacy,
97
- onBarHover,
94
+ onbarclick,
95
+ onbarhover,
98
96
  testId,
99
97
  classes
100
98
  }: BarChartProperties = $props();
101
99
 
102
- // Event-casing phase 1: both spellings accepted, the correct one wins.
103
- const onbarclick = $derived(onBarClick ?? onbarclickLegacy);
104
- const onbarhover = $derived(onBarHover ?? onbarhoverLegacy);
105
-
106
100
  // ── State ──────────────────────────────────────────────────────
107
101
 
108
102
  let containerEl: HTMLDivElement | null = $state(null);
@@ -114,15 +108,15 @@
114
108
  let mouseY = $state(0);
115
109
  let anchor = $state<TooltipAnchor | null>(null);
116
110
  let valueFontSize = $state(14);
117
- /** Internal tracking for the imperative highlight API (onChartReady). */
111
+ /** Internal tracking for the imperative highlight API (onchartready). */
118
112
  let apiHighlightedIndex = $state<number | null>(null);
119
113
  const hiddenSeries = new SvelteSet<number>();
120
114
 
121
- // ── onMount: emit ChartHighlightAPI via onChartReady ──────────
115
+ // ── onMount: emit ChartHighlightAPI via onchartready ──────────
122
116
 
123
117
  onMount(() => {
124
118
  valueFontSize = readCssVarPx(containerEl, '--barchart-value-font-size', 14);
125
- if (typeof onChartReady !== 'function') {
119
+ if (typeof onchartready !== 'function') {
126
120
  return;
127
121
  }
128
122
  const api: ChartHighlightAPI = {
@@ -132,7 +126,7 @@
132
126
  getCategories: () => labels,
133
127
  type: 'bar-chart'
134
128
  };
135
- onChartReady(api);
129
+ onchartready(api);
136
130
  });
137
131
 
138
132
  // ── Layout ─────────────────────────────────────────────────────
@@ -183,7 +183,7 @@ export type OptionalBarChartProperties = {
183
183
  * position within the category axis) and dim all others. Pass `null` to clear.
184
184
  * The `type` field on the handle is always `'bar-chart'`.
185
185
  */
186
- onChartReady?: (api: ChartHighlightAPI) => void;
186
+ onchartready?: (api: ChartHighlightAPI) => void;
187
187
  /**
188
188
  * Declarative complement to `onChartReady`. When set to a non-null number the
189
189
  * bar at that zero-based category index is highlighted (full opacity) and the
@@ -231,16 +231,8 @@ export type BarChartEventProperties = {
231
231
  index: number;
232
232
  dataPoint: BarChartDataPoint;
233
233
  }) => void;
234
- onBarClick?: (event: {
235
- index: number;
236
- dataPoint: BarChartDataPoint;
237
- }) => void;
238
234
  onbarhover?: (event: {
239
235
  index: number;
240
236
  dataPoint: BarChartDataPoint;
241
237
  } | null) => void;
242
- onBarHover?: (event: {
243
- index: number;
244
- dataPoint: BarChartDataPoint;
245
- } | null) => void;
246
238
  };
@@ -14,14 +14,10 @@
14
14
  testId,
15
15
  previousIcon,
16
16
  nextIcon,
17
- onpagechange: onpagechangeLegacy,
18
- onPageChange,
17
+ onpagechange,
19
18
  classes
20
19
  }: BookProperties = $props();
21
20
 
22
- // Event-casing phase 1: both spellings accepted, the correct one wins.
23
- const onpagechange = $derived(onPageChange ?? onpagechangeLegacy);
24
-
25
21
  let startX = 0;
26
22
  let isDragging = false;
27
23
 
@@ -21,5 +21,4 @@ export type OptionalBookProperties = {
21
21
  };
22
22
  export type BookEventProperties = {
23
23
  onpagechange?: (page: number) => void;
24
- onPageChange?: (page: number) => void;
25
24
  };
@@ -19,21 +19,13 @@
19
19
  testId,
20
20
  previousMonthIcon,
21
21
  nextMonthIcon,
22
- onselect: onselectLegacy,
23
- onSelect,
24
- onrangeselect: onrangeselectLegacy,
25
- onRangeSelect,
26
- onmonthchange: onmonthchangeLegacy,
27
- onMonthChange,
22
+ onselect,
23
+ onrangeselect,
24
+ onmonthchange,
28
25
  classes,
29
26
  initialMonth = null
30
27
  }: CalendarProperties = $props();
31
28
 
32
- // Event-casing phase 1: both spellings accepted, the correct one wins.
33
- const onmonthchange = $derived(onMonthChange ?? onmonthchangeLegacy);
34
- const onrangeselect = $derived(onRangeSelect ?? onrangeselectLegacy);
35
- const onselect = $derived(onSelect ?? onselectLegacy);
36
-
37
29
  const now = new SvelteDate();
38
30
  // Intentionally read initialMonth once (untracked) — it seeds the display month at mount
39
31
  // and subsequent prop changes should not navigate the calendar (user navigates via the buttons).
@@ -21,23 +21,12 @@ export type CalendarEventProperties = {
21
21
  onselect?: (event: {
22
22
  date: Date;
23
23
  }) => void;
24
- onSelect?: (event: {
25
- date: Date;
26
- }) => void;
27
24
  onrangeselect?: (event: {
28
25
  rangeStart: Date;
29
26
  rangeEnd: Date;
30
27
  }) => void;
31
- onRangeSelect?: (event: {
32
- rangeStart: Date;
33
- rangeEnd: Date;
34
- }) => void;
35
28
  onmonthchange?: (event: {
36
29
  year: number;
37
30
  month: number;
38
31
  }) => void;
39
- onMonthChange?: (event: {
40
- year: number;
41
- month: number;
42
- }) => void;
43
32
  };
@@ -43,39 +43,19 @@
43
43
  stopIcon,
44
44
  voiceIcon,
45
45
  attachIcon,
46
- onsend: onsendLegacy,
47
- onSend,
48
- onsuggestion: onsuggestionLegacy,
49
- onSuggestion,
50
- onclose: oncloseLegacy,
51
- onClose,
52
- onstop: onstopLegacy,
53
- onStop,
54
- onvoice: onvoiceLegacy,
55
- onVoice,
56
- onattach: onattachLegacy,
57
- onAttach,
58
- onretry: onretryLegacy,
59
- onRetry,
60
- onfeedback: onfeedbackLegacy,
61
- onFeedback,
62
- onscrollstate: onscrollstateLegacy,
63
- onScrollState,
46
+ onsend,
47
+ onsuggestion,
48
+ onclose,
49
+ onstop,
50
+ onvoice,
51
+ onattach,
52
+ onretry,
53
+ onfeedback,
54
+ onscrollstate,
64
55
  testId,
65
56
  classes
66
57
  }: ChatProperties = $props();
67
58
 
68
- // Event-casing phase 1: both spellings accepted, the correct one wins.
69
- const onattach = $derived(onAttach ?? onattachLegacy);
70
- const onclose = $derived(onClose ?? oncloseLegacy);
71
- const onfeedback = $derived(onFeedback ?? onfeedbackLegacy);
72
- const onretry = $derived(onRetry ?? onretryLegacy);
73
- const onscrollstate = $derived(onScrollState ?? onscrollstateLegacy);
74
- const onsend = $derived(onSend ?? onsendLegacy);
75
- const onstop = $derived(onStop ?? onstopLegacy);
76
- const onsuggestion = $derived(onSuggestion ?? onsuggestionLegacy);
77
- const onvoice = $derived(onVoice ?? onvoiceLegacy);
78
-
79
59
  let showHeader = $derived(
80
60
  title.length > 0 ||
81
61
  subtitle.length > 0 ||
@@ -49,21 +49,12 @@ export type OptionalChatProperties = {
49
49
  };
50
50
  export type ChatEventProperties = {
51
51
  onsend?: (value: string, attachments: File[]) => void;
52
- onSend?: (value: string, attachments: File[]) => void;
53
52
  onsuggestion?: (value: string, index: number) => void;
54
- onSuggestion?: (value: string, index: number) => void;
55
53
  onclose?: () => void;
56
- onClose?: () => void;
57
54
  onstop?: () => void;
58
- onStop?: () => void;
59
55
  onvoice?: () => void;
60
- onVoice?: () => void;
61
56
  onattach?: (files: File[]) => void;
62
- onAttach?: (files: File[]) => void;
63
57
  onretry?: () => void;
64
- onRetry?: () => void;
65
58
  onfeedback?: (value: ChatMessageFeedback, message: ChatMessageData) => void;
66
- onFeedback?: (value: ChatMessageFeedback, message: ChatMessageData) => void;
67
59
  onscrollstate?: ChatMessageListProperties['onscrollstate'];
68
- onScrollState?: ChatMessageListProperties['onscrollstate'];
69
60
  };
@@ -12,6 +12,13 @@ export type ChatMessageData = {
12
12
  */
13
13
  markdown?: string;
14
14
  streaming?: boolean;
15
+ /**
16
+ * Reveal this message progressively as it grows. Opt-in per message so it cannot stack with
17
+ * `Chat`'s controller-level reveal, which drip-feeds `content` instead and never sets this.
18
+ */
19
+ typewriter?: boolean;
20
+ /** Milliseconds between characters while `typewriter` is revealing this message. */
21
+ typewriterSpeed?: number;
15
22
  status?: ChatMessageStatus;
16
23
  timestamp?: number;
17
24
  attachments?: unknown[];
@@ -27,21 +27,13 @@
27
27
  expanded = $bindable(false),
28
28
  expandedPanelWidth = $bindable(600),
29
29
  expandedPanelHeight = $bindable(760),
30
- onopen: onopenLegacy,
31
- onOpen,
32
- onclose: oncloseLegacy,
33
- onClose,
34
- ontoggle: ontoggleLegacy,
35
- onToggle,
30
+ onopen,
31
+ onclose,
32
+ ontoggle,
36
33
  testId,
37
34
  classes
38
35
  }: ChatBubbleProperties = $props();
39
36
 
40
- // Event-casing phase 1: both spellings accepted, the correct one wins.
41
- const onclose = $derived(onClose ?? oncloseLegacy);
42
- const onopen = $derived(onOpen ?? onopenLegacy);
43
- const ontoggle = $derived(onToggle ?? ontoggleLegacy);
44
-
45
37
  const DRAG_THRESHOLD = 4;
46
38
 
47
39
  function handlesFor(vertical: 'top' | 'bottom', side: 'left' | 'right'): ResizeEdge[] {
@@ -38,9 +38,6 @@ export type OptionalChatBubbleProperties = {
38
38
  };
39
39
  export type ChatBubbleEventProperties = {
40
40
  onopen?: () => void;
41
- onOpen?: () => void;
42
41
  onclose?: () => void;
43
- onClose?: () => void;
44
42
  ontoggle?: (open: boolean) => void;
45
- onToggle?: (open: boolean) => void;
46
43
  };
@@ -26,18 +26,12 @@
26
26
  richVideoTooltip,
27
27
  richRemoveIcon,
28
28
  richFileIcon,
29
- onremoverichimage: onremoverichimageLegacy,
30
- onRemoveRichImage,
31
- onremoverichfile: onremoverichfileLegacy,
32
- onRemoveRichFile,
33
- onremoverichvideo: onremoverichvideoLegacy,
34
- onRemoveRichVideo,
35
- onopenrichimage: onopenrichimageLegacy,
36
- onOpenRichImage,
37
- onopenrichvideo: onopenrichvideoLegacy,
38
- onOpenRichVideo,
39
- onopenrichfile: onopenrichfileLegacy,
40
- onOpenRichFile,
29
+ onremoverichimage,
30
+ onremoverichfile,
31
+ onremoverichvideo,
32
+ onopenrichimage,
33
+ onopenrichvideo,
34
+ onopenrichfile,
41
35
  sendable = null,
42
36
  accept = '',
43
37
  multiple = false,
@@ -52,21 +46,15 @@
52
46
  actionIcon,
53
47
  actionLabel = 'Voice conversation',
54
48
  leading,
55
- onsubmit: onsubmitLegacy,
56
- onSubmit,
49
+ onsubmit,
57
50
  oninput,
58
51
  onkeydown,
59
52
  onpaste,
60
- onstop: onstopLegacy,
61
- onStop,
62
- onvoice: onvoiceLegacy,
63
- onVoice,
64
- onattach: onattachLegacy,
65
- onAttach,
66
- onattachclick: onattachclickLegacy,
67
- onAttachClick,
68
- onaction: onactionLegacy,
69
- onAction,
53
+ onstop,
54
+ onvoice,
55
+ onattach,
56
+ onattachclick,
57
+ onaction,
70
58
  testId,
71
59
  inputTestId,
72
60
  inputAriaLabel,
@@ -79,20 +67,6 @@
79
67
  classes
80
68
  }: ChatComposerProperties = $props();
81
69
 
82
- // Event-casing phase 1: both spellings accepted, the correct one wins.
83
- const onaction = $derived(onAction ?? onactionLegacy);
84
- const onattach = $derived(onAttach ?? onattachLegacy);
85
- const onattachclick = $derived(onAttachClick ?? onattachclickLegacy);
86
- const onopenrichfile = $derived(onOpenRichFile ?? onopenrichfileLegacy);
87
- const onopenrichimage = $derived(onOpenRichImage ?? onopenrichimageLegacy);
88
- const onopenrichvideo = $derived(onOpenRichVideo ?? onopenrichvideoLegacy);
89
- const onremoverichfile = $derived(onRemoveRichFile ?? onremoverichfileLegacy);
90
- const onremoverichimage = $derived(onRemoveRichImage ?? onremoverichimageLegacy);
91
- const onremoverichvideo = $derived(onRemoveRichVideo ?? onremoverichvideoLegacy);
92
- const onstop = $derived(onStop ?? onstopLegacy);
93
- const onsubmit = $derived(onSubmit ?? onsubmitLegacy);
94
- const onvoice = $derived(onVoice ?? onvoiceLegacy);
95
-
96
70
  let fileInput: HTMLInputElement | null = $state(null);
97
71
 
98
72
  let showVoice = $derived(typeof onvoice === 'function');
@@ -170,12 +144,12 @@
170
144
  images={richImages}
171
145
  videos={richVideos}
172
146
  files={richFiles}
173
- onRemoveImage={onremoverichimage}
174
- onRemoveVideo={onremoverichvideo}
175
- onRemoveFile={onremoverichfile}
176
- onOpenImage={onopenrichimage}
177
- onOpenVideo={onopenrichvideo}
178
- onOpenFile={onopenrichfile}
147
+ onremoveimage={onremoverichimage}
148
+ onremovevideo={onremoverichvideo}
149
+ onremovefile={onremoverichfile}
150
+ onopenimage={onopenrichimage}
151
+ onopenvideo={onopenrichvideo}
152
+ onopenfile={onopenrichfile}
179
153
  imageTooltip={richImageTooltip}
180
154
  videoTooltip={richVideoTooltip}
181
155
  removeIcon={richRemoveIcon}