@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.
- package/README.md +1 -1
- package/dist/Accordion/Accordion.svelte +1 -5
- package/dist/Accordion/properties.d.ts +0 -1
- package/dist/AreaChart/AreaChart.svelte +2 -8
- package/dist/AreaChart/properties.d.ts +0 -10
- package/dist/AttachmentChipRow/AttachmentChipRow.svelte +30 -30
- package/dist/AttachmentChipRow/properties.d.ts +6 -6
- package/dist/Banner/Banner.svelte +1 -5
- package/dist/Banner/properties.d.ts +0 -1
- package/dist/BarChart/BarChart.svelte +7 -13
- package/dist/BarChart/properties.d.ts +1 -9
- package/dist/Book/Book.svelte +1 -5
- package/dist/Book/properties.d.ts +0 -1
- package/dist/Button/Button.svelte +2 -0
- package/dist/Button/properties.d.ts +5 -0
- package/dist/Calendar/Calendar.svelte +3 -11
- package/dist/Calendar/properties.d.ts +0 -11
- package/dist/Chat/Chat.svelte +9 -29
- package/dist/Chat/properties.d.ts +0 -9
- package/dist/Chat/types.d.ts +7 -0
- package/dist/ChatBubble/ChatBubble.svelte +3 -11
- package/dist/ChatBubble/properties.d.ts +0 -3
- package/dist/ChatComposer/ChatComposer.svelte +18 -44
- package/dist/ChatComposer/properties.d.ts +0 -12
- package/dist/ChatHeader/ChatHeader.svelte +1 -5
- package/dist/ChatHeader/properties.d.ts +0 -1
- package/dist/ChatMessage/ChatMessage.svelte +164 -15
- package/dist/ChatMessage/properties.d.ts +34 -3
- package/dist/ChatMessageList/ChatMessageList.svelte +5 -11
- package/dist/ChatMessageList/properties.d.ts +0 -6
- package/dist/ChatSuggestions/ChatSuggestions.svelte +1 -5
- package/dist/ChatSuggestions/properties.d.ts +0 -1
- package/dist/CheckListItem/CheckListItem.svelte +1 -5
- package/dist/CheckListItem/properties.d.ts +0 -1
- package/dist/Checkbox/Checkbox.svelte +1 -5
- package/dist/Checkbox/properties.d.ts +0 -1
- package/dist/ChipInput/ChipInput.svelte +10 -20
- package/dist/ChipInput/properties.d.ts +0 -4
- package/dist/Choicebox/Choicebox.svelte +1 -5
- package/dist/Choicebox/properties.d.ts +0 -1
- package/dist/ColorPicker/ColorPicker.svelte +4 -10
- package/dist/ColorPicker/properties.d.ts +0 -2
- package/dist/Combobox/Combobox.svelte +15 -33
- package/dist/Combobox/properties.d.ts +0 -8
- package/dist/CommandMenu/CommandMenu.svelte +2 -8
- package/dist/CommandMenu/properties.d.ts +0 -2
- package/dist/ContextMenu/ContextMenu.svelte +3 -11
- package/dist/ContextMenu/properties.d.ts +0 -3
- package/dist/DateRangePicker/DateRangePicker.svelte +6 -20
- package/dist/DateRangePicker/properties.d.ts +0 -19
- package/dist/Draggable/Draggable.svelte +7 -7
- package/dist/Draggable/properties.d.ts +3 -3
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +1 -5
- package/dist/DualAxisBarChart/properties.d.ts +0 -4
- package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -5
- package/dist/FileDropzoneTrigger/properties.d.ts +0 -1
- package/dist/FileInput/FileInput.svelte +2 -8
- package/dist/FileInput/properties.d.ts +0 -2
- package/dist/FunnelChart/FunnelChart.svelte +2 -8
- package/dist/FunnelChart/properties.d.ts +0 -8
- package/dist/Gallery/Gallery.svelte +15 -15
- package/dist/Gallery/properties.d.ts +6 -6
- package/dist/HITL/HITL.svelte +10 -8
- package/dist/HITL/properties.d.ts +2 -2
- package/dist/IframeViewer/IframeViewer.svelte +3 -2
- package/dist/IframeViewer/properties.d.ts +1 -1
- package/dist/Img/Img.svelte +119 -39
- package/dist/Img/properties.d.ts +0 -1
- package/dist/Input/Input.svelte +22 -37
- package/dist/Input/properties.d.ts +3 -10
- package/dist/InputButton/InputButton.svelte +2 -2
- package/dist/LineChart/LineChart.svelte +4 -10
- package/dist/LineChart/properties.d.ts +1 -11
- package/dist/ListItem/ListItem.svelte +10 -22
- package/dist/ListItem/properties.d.ts +5 -10
- package/dist/LottiePlayer/LottiePlayer.svelte +2 -8
- package/dist/LottiePlayer/properties.d.ts +0 -2
- package/dist/MediaPlayer/MediaPlayer.svelte +1 -5
- package/dist/MediaPlayer/properties.d.ts +0 -1
- package/dist/MediaUpload/MediaUpload.svelte +6 -6
- package/dist/MediaUpload/properties.d.ts +3 -3
- package/dist/Menu/Menu.svelte +3 -11
- package/dist/Menu/properties.d.ts +0 -3
- package/dist/Modal/Modal.svelte +15 -31
- package/dist/Modal/properties.d.ts +5 -11
- package/dist/Pagination/Pagination.svelte +3 -7
- package/dist/Pagination/properties.d.ts +1 -2
- package/dist/PieChart/PieChart.svelte +4 -10
- package/dist/PieChart/properties.d.ts +1 -9
- package/dist/Pill/Pill.svelte +1 -5
- package/dist/Pill/properties.d.ts +0 -1
- package/dist/Radio/Radio.svelte +1 -5
- package/dist/Radio/properties.d.ts +0 -1
- package/dist/Resizable/Resizable.svelte +3 -11
- package/dist/Resizable/properties.d.ts +0 -3
- package/dist/SankeyChart/SankeyChart.svelte +4 -14
- package/dist/SankeyChart/properties.d.ts +0 -12
- package/dist/Scroller/Scroller.svelte +1 -5
- package/dist/Scroller/properties.d.ts +0 -1
- package/dist/Select/Select.svelte +3 -11
- package/dist/Select/properties.d.ts +0 -3
- package/dist/Sheet/Sheet.svelte +3 -11
- package/dist/Sheet/properties.d.ts +0 -3
- package/dist/Slider/Slider.svelte +2 -8
- package/dist/Slider/properties.d.ts +0 -2
- package/dist/Snippet/Snippet.svelte +1 -5
- package/dist/Snippet/properties.d.ts +0 -1
- package/dist/SplitButton/SplitButton.svelte +1 -5
- package/dist/SplitButton/properties.d.ts +0 -1
- package/dist/SplitInput/SplitInput.svelte +6 -14
- package/dist/SplitInput/properties.d.ts +0 -3
- package/dist/StatCard/StatCard.svelte +2 -2
- package/dist/StatCard/properties.d.ts +1 -1
- package/dist/Status/Status.svelte +2 -6
- package/dist/Status/properties.d.ts +1 -2
- package/dist/Stepper/Stepper.svelte +2 -12
- package/dist/Stepper/properties.d.ts +1 -14
- package/dist/Table/BuiltinCell.svelte +1 -1
- package/dist/Table/Table.svelte +16 -17
- package/dist/Table/properties.d.ts +3 -35
- package/dist/Tabs/Tabs.svelte +2 -8
- package/dist/Tabs/properties.d.ts +0 -2
- package/dist/TaskList/TaskList.svelte +1 -4
- package/dist/TaskList/properties.d.ts +0 -1
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +1 -5
- package/dist/ThemeSwitcher/properties.d.ts +0 -1
- package/dist/ThinkingIndicator/ThinkingIndicator.svelte +4 -10
- package/dist/ThinkingIndicator/properties.d.ts +1 -3
- package/dist/Toast/Toast.svelte +2 -2
- package/dist/Toast/properties.d.ts +1 -1
- package/dist/Toggle/Toggle.svelte +1 -5
- package/dist/Toggle/properties.d.ts +0 -1
- package/dist/ToolCallLog/ToolCallLog.svelte +1 -10
- package/dist/ToolCallLog/properties.d.ts +0 -1
- package/dist/Toolbar/Toolbar.svelte +2 -6
- package/dist/Toolbar/properties.d.ts +1 -2
- package/dist/TypewriterText/TypewriterText.svelte +3 -3
- package/dist/TypewriterText/properties.d.ts +1 -1
- package/dist-codemod/bin.js +32 -0
- package/dist-codemod/cli.js +175 -0
- package/dist-codemod/legacy-pairs.js +228 -0
- package/dist-codemod/transform.js +278 -0
- package/dist-codemod/wc-children.js +66 -0
- package/dist-wc/index.js +4629 -5218
- package/package.json +9 -7
- package/scripts/postinstall.mjs +14 -12
- package/dist/deprecation.d.ts +0 -42
- package/dist/deprecation.js +0 -57
- package/scripts/codemod/README.md +0 -76
- package/scripts/codemod/cli.ts +0 -206
- package/scripts/codemod/map.ts +0 -118
- package/scripts/codemod/transform.ts +0 -549
- package/scripts/codemod/tsconfig.json +0 -15
- package/scripts/codemod/wc-children.ts +0 -75
package/README.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
expand = $bindable(false),
|
|
6
6
|
children,
|
|
7
7
|
trigger,
|
|
8
|
-
ontoggle
|
|
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
|
|
@@ -51,18 +51,12 @@
|
|
|
51
51
|
tooltipSnippet,
|
|
52
52
|
empty,
|
|
53
53
|
tooltipPortal = false,
|
|
54
|
-
onpointhover
|
|
55
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
50
|
-
type={typeof
|
|
51
|
-
role={typeof
|
|
52
|
-
aria-label={typeof
|
|
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
|
|
57
|
-
onclick={typeof
|
|
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
|
|
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={() =>
|
|
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
|
|
101
|
-
type={typeof
|
|
102
|
-
role={typeof
|
|
103
|
-
aria-label={typeof
|
|
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
|
|
108
|
-
onclick={typeof
|
|
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
|
|
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={() =>
|
|
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
|
|
159
|
-
type={typeof
|
|
160
|
-
role={typeof
|
|
161
|
-
aria-label={typeof
|
|
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
|
|
164
|
-
onclick={typeof
|
|
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
|
|
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={() =>
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
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(' '));
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
tooltipSnippet,
|
|
83
83
|
empty,
|
|
84
84
|
renderOverlay,
|
|
85
|
-
|
|
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
|
|
95
|
-
|
|
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 (
|
|
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
|
|
115
|
+
// ── onMount: emit ChartHighlightAPI via onchartready ──────────
|
|
122
116
|
|
|
123
117
|
onMount(() => {
|
|
124
118
|
valueFontSize = readCssVarPx(containerEl, '--barchart-value-font-size', 14);
|
|
125
|
-
if (typeof
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|
package/dist/Book/Book.svelte
CHANGED
|
@@ -14,14 +14,10 @@
|
|
|
14
14
|
testId,
|
|
15
15
|
previousIcon,
|
|
16
16
|
nextIcon,
|
|
17
|
-
onpagechange
|
|
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
|
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
testId,
|
|
23
23
|
ariaLabel,
|
|
24
24
|
ariaExpanded,
|
|
25
|
+
ariaControls,
|
|
25
26
|
ariaHaspopup,
|
|
26
27
|
ariaSelected,
|
|
27
28
|
ariaBusy,
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
role={role ?? null}
|
|
92
93
|
aria-label={ariaLabel ?? null}
|
|
93
94
|
aria-expanded={ariaExpanded ?? null}
|
|
95
|
+
aria-controls={ariaControls ?? null}
|
|
94
96
|
aria-haspopup={ariaHaspopup ?? null}
|
|
95
97
|
aria-selected={ariaSelected ?? null}
|
|
96
98
|
aria-busy={isBusy || ariaBusy || null}
|
|
@@ -53,6 +53,11 @@ export type OptionalButtonProperties = {
|
|
|
53
53
|
children?: Snippet;
|
|
54
54
|
ariaLabel?: string;
|
|
55
55
|
ariaExpanded?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* `aria-controls`: the id of the region this button governs. Pair with
|
|
58
|
+
* `ariaExpanded` on a disclosure button so assistive tech can reach what it opens.
|
|
59
|
+
*/
|
|
60
|
+
ariaControls?: string;
|
|
56
61
|
/**
|
|
57
62
|
* Native `aria-haspopup`. Needed when the button is the trigger for a menu, listbox or
|
|
58
63
|
* dialog — Menu hands exactly this to its `trigger` snippet.
|
|
@@ -19,21 +19,13 @@
|
|
|
19
19
|
testId,
|
|
20
20
|
previousMonthIcon,
|
|
21
21
|
nextMonthIcon,
|
|
22
|
-
onselect
|
|
23
|
-
|
|
24
|
-
|
|
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
|
};
|
package/dist/Chat/Chat.svelte
CHANGED
|
@@ -43,39 +43,19 @@
|
|
|
43
43
|
stopIcon,
|
|
44
44
|
voiceIcon,
|
|
45
45
|
attachIcon,
|
|
46
|
-
onsend
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
};
|
package/dist/Chat/types.d.ts
CHANGED
|
@@ -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
|
|
31
|
-
|
|
32
|
-
|
|
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
|
};
|