@juspay/svelte-ui-components 4.27.6 → 4.28.0
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 +140 -36
- package/dist/Animations/ModalAnimation.svelte +15 -1
- package/dist/Animations/OverlayAnimation.svelte +7 -1
- package/dist/AreaChart/AreaChart.svelte +366 -85
- package/dist/AspectRatio/AspectRatio.svelte +51 -0
- package/dist/AspectRatio/AspectRatio.svelte.d.ts +3 -0
- package/dist/AspectRatio/properties.d.ts +27 -0
- package/dist/AspectRatio/properties.js +1 -0
- package/dist/Banner/Banner.svelte +10 -4
- package/dist/Banner/properties.d.ts +8 -0
- package/dist/BarChart/BarChart.svelte +156 -49
- package/dist/Book/Book.svelte +14 -1
- package/dist/BrandLoader/BrandLoader.svelte +76 -12
- package/dist/Button/Button.svelte +56 -11
- package/dist/Calendar/Calendar.svelte +88 -61
- package/dist/Card/Card.svelte +1 -1
- package/dist/Carousel/Carousel.svelte +6 -3
- package/dist/ChatComposer/ChatComposer.svelte +54 -4
- package/dist/ChatComposer/dictationState.d.ts +15 -0
- package/dist/ChatComposer/dictationState.js +9 -0
- package/dist/ChatComposer/properties.d.ts +28 -1
- package/dist/ChatMessage/ChatMessage.svelte +27 -1
- package/dist/CheckListItem/CheckListItem.svelte +3 -3
- package/dist/Checkbox/Checkbox.svelte +84 -3
- package/dist/Checkbox/properties.d.ts +45 -13
- package/dist/ChipInput/ChipInput.svelte +70 -3
- package/dist/ChipInput/properties.d.ts +16 -0
- package/dist/Choicebox/Choicebox.svelte +156 -1
- package/dist/Choicebox/group.d.ts +63 -0
- package/dist/Choicebox/group.js +127 -0
- package/dist/Choicebox/properties.d.ts +46 -0
- package/dist/ColorPicker/ColorPicker.svelte +169 -20
- package/dist/ColorPicker/properties.d.ts +16 -0
- package/dist/Combobox/Combobox.svelte +87 -25
- package/dist/Combobox/properties.d.ts +23 -0
- package/dist/CommandMenu/CommandMenu.svelte +27 -11
- package/dist/ContextMenu/ContextMenu.svelte +31 -37
- package/dist/DateRangePicker/DateRangePicker.svelte +171 -73
- package/dist/DeltaIndicator/DeltaIndicator.svelte +3 -3
- package/dist/Draggable/Draggable.svelte +12 -7
- package/dist/DualAxisBarChart/DualAxisBarChart.svelte +11 -4
- package/dist/EmptyState/EmptyState.svelte +1 -1
- package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -1
- package/dist/FileInput/FileInput.svelte +50 -1
- package/dist/FileInput/properties.d.ts +7 -0
- package/dist/FunnelChart/FunnelChart.svelte +40 -12
- package/dist/FunnelChart/properties.d.ts +7 -1
- package/dist/Gallery/Gallery.svelte +20 -13
- package/dist/Gallery/properties.d.ts +8 -0
- package/dist/GridItem/GridItem.svelte +31 -1
- package/dist/HITL/HITL.svelte +35 -9
- package/dist/Icon/Icon.svelte +19 -3
- package/dist/Input/Input.svelte +24 -10
- package/dist/Input/properties.d.ts +37 -1
- package/dist/InputButton/InputButton.svelte +86 -11
- package/dist/InputButton/properties.d.ts +10 -1
- package/dist/Label/Label.svelte +54 -0
- package/dist/Label/Label.svelte.d.ts +3 -0
- package/dist/Label/properties.d.ts +26 -0
- package/dist/Label/properties.js +1 -0
- package/dist/LineChart/LineChart.svelte +385 -94
- package/dist/ListItem/ListItem.svelte +121 -15
- package/dist/Loader/Loader.svelte +22 -2
- package/dist/LoadingDots/LoadingDots.svelte +21 -0
- package/dist/MediaUpload/MediaUpload.svelte +13 -3
- package/dist/Menu/Menu.svelte +56 -28
- package/dist/Modal/Modal.svelte +77 -42
- package/dist/Pagination/Pagination.svelte +9 -2
- package/dist/Phone/Phone.svelte +4 -0
- package/dist/PieChart/PieChart.svelte +282 -38
- package/dist/PieChart/properties.d.ts +9 -0
- package/dist/Pill/Pill.svelte +14 -5
- package/dist/Progress/Progress.svelte +20 -0
- package/dist/Radio/Radio.svelte +58 -1
- package/dist/Radio/properties.d.ts +23 -0
- package/dist/RatingGroup/RatingGroup.svelte +283 -0
- package/dist/RatingGroup/RatingGroup.svelte.d.ts +4 -0
- package/dist/RatingGroup/properties.d.ts +73 -0
- package/dist/RatingGroup/properties.js +1 -0
- package/dist/RelativeTime/RelativeTime.svelte +1 -1
- package/dist/SankeyChart/SankeyChart.svelte +272 -50
- package/dist/SankeyChart/properties.d.ts +9 -0
- package/dist/Scroller/Scroller.svelte +37 -2
- package/dist/Select/Select.svelte +166 -46
- package/dist/Select/properties.d.ts +7 -0
- package/dist/Separator/Separator.svelte +48 -0
- package/dist/Separator/Separator.svelte.d.ts +3 -0
- package/dist/Separator/properties.d.ts +22 -0
- package/dist/Separator/properties.js +1 -0
- package/dist/Sheet/Sheet.svelte +60 -21
- package/dist/Shimmer/Shimmer.svelte +15 -0
- package/dist/Slider/Slider.svelte +87 -6
- package/dist/Slider/properties.d.ts +26 -0
- package/dist/Snippet/Snippet.svelte +4 -0
- package/dist/Snippet/copyState.svelte.d.ts +13 -1
- package/dist/Snippet/copyState.svelte.js +27 -1
- package/dist/Snippet/properties.d.ts +7 -0
- package/dist/SoundKit/SoundKit.js +9 -8
- package/dist/SplitInput/SplitInput.svelte +68 -2
- package/dist/SplitInput/properties.d.ts +23 -0
- package/dist/StatCard/StatCard.svelte +6 -6
- package/dist/Status/Status.svelte +2 -2
- package/dist/Stepper/Step.svelte +19 -6
- package/dist/Stepper/Stepper.svelte +108 -35
- package/dist/Table/BuiltinCell.svelte +2 -2
- package/dist/Table/Table.svelte +373 -55
- package/dist/Table/properties.d.ts +134 -3
- package/dist/Tabs/Tabs.svelte +263 -65
- package/dist/Tabs/properties.d.ts +23 -0
- package/dist/TaskList/TaskList.svelte +14 -5
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +23 -0
- package/dist/ThinkingIndicator/ThinkingIndicator.svelte +13 -5
- package/dist/Toast/Toast.svelte +27 -2
- package/dist/Toggle/Toggle.svelte +79 -7
- package/dist/Toggle/Toggle.svelte.d.ts +1 -1
- package/dist/Toggle/properties.d.ts +30 -7
- package/dist/ToolCallLog/ToolCallLog.svelte +59 -21
- package/dist/ToolCallLog/properties.d.ts +10 -0
- package/dist/Toolbar/Toolbar.svelte +1 -1
- package/dist/Tooltip/Tooltip.svelte +20 -2
- package/dist/Tooltip/tooltip-action.js +39 -4
- package/dist/TypewriterText/TypewriterText.svelte +34 -2
- package/dist/TypewriterText/properties.d.ts +18 -5
- package/dist/_chart/ChartContainer.svelte +12 -0
- package/dist/_chart/ChartTooltip.svelte +18 -4
- package/dist/_chart/Legend.svelte +21 -0
- package/dist/_chart/Legend.svelte.d.ts +15 -0
- package/dist/_chart/geometry.d.ts +54 -1
- package/dist/_chart/geometry.js +122 -14
- package/dist/_chart/interactions.d.ts +5 -1
- package/dist/_chart/interactions.js +9 -5
- package/dist/_chart/scales.js +16 -0
- package/dist/_chart/temporal.d.ts +45 -0
- package/dist/_chart/temporal.js +116 -0
- package/dist/_field/description.d.ts +50 -0
- package/dist/_field/description.js +51 -0
- package/dist/_interaction/dismissal.d.ts +67 -0
- package/dist/_interaction/dismissal.js +137 -0
- package/dist/_interaction/focus.d.ts +73 -0
- package/dist/_interaction/focus.js +143 -0
- package/dist/assets/star.svg +5 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +21 -1
- package/dist/reduced-motion.svelte.d.ts +37 -0
- package/dist/reduced-motion.svelte.js +44 -0
- package/dist/styles/theme-dark.css +778 -0
- package/dist/types.d.ts +4 -2
- package/dist/utils.d.ts +62 -1
- package/dist/utils.js +80 -21
- package/dist-codemod/{bin.js → codemod/bin.js} +13 -2
- package/dist-codemod/{cli.js → codemod/cli.js} +48 -3
- package/dist-codemod/codemod/migrate-audit.js +395 -0
- package/dist-codemod/codemod/migration-assets/legacy-display.css +120 -0
- package/dist-codemod/codemod/migration-assets/legacy-palette.css +106 -0
- package/dist-codemod/codemod/migration-assets/wc-display.json +492 -0
- package/dist-codemod/migrate/analyze.js +804 -0
- package/dist-codemod/migrate/chart-tooltip-selector.js +301 -0
- package/dist-wc/index.js +13992 -4323
- package/package.json +13 -6
- package/dist/Modal/focus-trap.d.ts +0 -42
- package/dist/Modal/focus-trap.js +0 -57
- /package/dist-codemod/{legacy-pairs.js → codemod/legacy-pairs.js} +0 -0
- /package/dist-codemod/{transform.js → codemod/transform.js} +0 -0
- /package/dist-codemod/{wc-children.js → codemod/wc-children.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,10 @@ export { default as FunnelChart } from './FunnelChart/FunnelChart.svelte';
|
|
|
83
83
|
export { default as ProportionBar } from './ProportionBar/ProportionBar.svelte';
|
|
84
84
|
export { default as ChipInput } from './ChipInput/ChipInput.svelte';
|
|
85
85
|
export { default as FileDropzoneTrigger } from './FileDropzoneTrigger/FileDropzoneTrigger.svelte';
|
|
86
|
+
export { default as Separator } from './Separator/Separator.svelte';
|
|
87
|
+
export { default as Label } from './Label/Label.svelte';
|
|
88
|
+
export { default as AspectRatio } from './AspectRatio/AspectRatio.svelte';
|
|
89
|
+
export { default as RatingGroup } from './RatingGroup/RatingGroup.svelte';
|
|
86
90
|
export { default as Chat } from './Chat/Chat.svelte';
|
|
87
91
|
export { default as ChatHeader } from './ChatHeader/ChatHeader.svelte';
|
|
88
92
|
export { default as ChatMessage } from './ChatMessage/ChatMessage.svelte';
|
|
@@ -147,6 +151,10 @@ export type * from './Gauge/properties';
|
|
|
147
151
|
export type * from './SplitButton/properties';
|
|
148
152
|
export type * from './KeyboardInput/properties';
|
|
149
153
|
export type * from './LoadingDots/properties';
|
|
154
|
+
export type * from './Separator/properties';
|
|
155
|
+
export type * from './Label/properties';
|
|
156
|
+
export type * from './AspectRatio/properties';
|
|
157
|
+
export type * from './RatingGroup/properties';
|
|
150
158
|
export type * from './Menu/properties';
|
|
151
159
|
export type * from './Sheet/properties';
|
|
152
160
|
export type * from './Scroller/properties';
|
|
@@ -208,6 +216,10 @@ export type * from './MediaPlayer/properties';
|
|
|
208
216
|
export type * from './MediaUpload/properties';
|
|
209
217
|
export type * from './Gallery/properties';
|
|
210
218
|
export { createSoundKit } from './SoundKit/SoundKit';
|
|
211
|
-
export { validateInput, lockBodyScroll, unlockBodyScroll } from './utils';
|
|
219
|
+
export { validateInput, lockBodyScroll, unlockBodyScroll, prefersReducedMotion } from './utils';
|
|
220
|
+
export { reducedMotion } from './reduced-motion.svelte';
|
|
221
|
+
export type { ReducedMotionPreference } from './reduced-motion.svelte';
|
|
222
|
+
export { TEL_PRESETS, TEL_PRESET_IN_MOBILE } from './utils';
|
|
223
|
+
export type { TelPreset, ValidateInputOptions } from './utils';
|
|
212
224
|
export { formatNumberIndian } from './_chart/format';
|
|
213
225
|
export { createNarrationHighlighter } from './_chart/narrationHighlighter';
|
package/dist/index.js
CHANGED
|
@@ -83,6 +83,10 @@ export { default as FunnelChart } from './FunnelChart/FunnelChart.svelte';
|
|
|
83
83
|
export { default as ProportionBar } from './ProportionBar/ProportionBar.svelte';
|
|
84
84
|
export { default as ChipInput } from './ChipInput/ChipInput.svelte';
|
|
85
85
|
export { default as FileDropzoneTrigger } from './FileDropzoneTrigger/FileDropzoneTrigger.svelte';
|
|
86
|
+
export { default as Separator } from './Separator/Separator.svelte';
|
|
87
|
+
export { default as Label } from './Label/Label.svelte';
|
|
88
|
+
export { default as AspectRatio } from './AspectRatio/AspectRatio.svelte';
|
|
89
|
+
export { default as RatingGroup } from './RatingGroup/RatingGroup.svelte';
|
|
86
90
|
export { default as Chat } from './Chat/Chat.svelte';
|
|
87
91
|
export { default as ChatHeader } from './ChatHeader/ChatHeader.svelte';
|
|
88
92
|
export { default as ChatMessage } from './ChatMessage/ChatMessage.svelte';
|
|
@@ -106,6 +110,22 @@ export { SpeechToTextController } from './SpeechToText/controller.svelte';
|
|
|
106
110
|
export { SpeechSynthesisController } from './SpeechSynthesis/controller.svelte';
|
|
107
111
|
export { createCopyState } from './Snippet/copyState.svelte';
|
|
108
112
|
export { createSoundKit } from './SoundKit/SoundKit';
|
|
109
|
-
|
|
113
|
+
// `prefersReducedMotion` reads the OS preference, and its own comment in utils.ts
|
|
114
|
+
// explains why it is shared rather than reimplemented per component: two
|
|
115
|
+
// character-reveal implementations ship here, and honouring the preference in one
|
|
116
|
+
// silences a chat bubble while the message body inside it keeps typing. That argument
|
|
117
|
+
// applies just as much across the boundary. A consumer driving motion from JavaScript
|
|
118
|
+
// -- a canvas, a chart, an imperative animation -- cannot reach the preference through
|
|
119
|
+
// a stylesheet, so leaving this unexported made every such consumer write it again.
|
|
120
|
+
export { validateInput, lockBodyScroll, unlockBodyScroll, prefersReducedMotion } from './utils';
|
|
121
|
+
// The reactive counterpart to `prefersReducedMotion()` above: a consumer
|
|
122
|
+
// building their own component with runes needs a value that stays current
|
|
123
|
+
// inside a `$derived`, which a plain function call cannot give them, for the
|
|
124
|
+
// same reason Sheet itself needed one (see reduced-motion.svelte.ts).
|
|
125
|
+
export { reducedMotion } from './reduced-motion.svelte';
|
|
126
|
+
// `dataType="tel"` no longer assumes a market. A consumer who WANTS the old
|
|
127
|
+
// Indian-mobile rule has to be able to name it, so the presets and the options
|
|
128
|
+
// type ship alongside the validator they configure.
|
|
129
|
+
export { TEL_PRESETS, TEL_PRESET_IN_MOBILE } from './utils';
|
|
110
130
|
export { formatNumberIndian } from './_chart/format';
|
|
111
131
|
export { createNarrationHighlighter } from './_chart/narrationHighlighter';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A live, reactive mirror of the OS `prefers-reduced-motion` preference.
|
|
3
|
+
*
|
|
4
|
+
* `prefersReducedMotion()` in `utils.ts` is a plain, un-reactive read -- exactly
|
|
5
|
+
* right for the call sites that invoke it fresh on every interaction (Tabs,
|
|
6
|
+
* Input, Scroller, ChatController, TypewriterText), but useless inside a
|
|
7
|
+
* `$derived`/`$derived.by` that only recomputes when a *tracked* dependency
|
|
8
|
+
* changes. A derived that calls it and returns early on the reduced-motion
|
|
9
|
+
* branch -- Sheet's `flyParams` is the case that surfaced this -- reads no
|
|
10
|
+
* Svelte state at all along that path, so it latches whatever the preference
|
|
11
|
+
* happened to be on its first evaluation and never revisits it, in either
|
|
12
|
+
* direction, for the life of the component instance.
|
|
13
|
+
*
|
|
14
|
+
* `current` below is real `$state`, so reading `reducedMotion.current` inside
|
|
15
|
+
* a derived registers a tracked dependency wherever in the function body the
|
|
16
|
+
* read happens -- an early `return` right after it still leaves the derived
|
|
17
|
+
* subscribed, which is exactly the property a plain boolean lacks.
|
|
18
|
+
*
|
|
19
|
+
* One module-level `MediaQueryList` subscription for the whole page, rather
|
|
20
|
+
* than one per consumer: the preference is a single global fact about the
|
|
21
|
+
* browser tab, not something scoped to any particular mounted component, so
|
|
22
|
+
* every reader shares this one listener instead of each taking out (and
|
|
23
|
+
* needing to release) its own. It is intentionally never removed -- there is
|
|
24
|
+
* no "stop caring about the OS setting" moment short of the page unloading,
|
|
25
|
+
* at which point the browser reclaims it along with everything else. This
|
|
26
|
+
* differs from VoiceOrb.svelte's own subscription, which is taken out and torn
|
|
27
|
+
* down inside its `onMount`: that one has to seed a field before the first
|
|
28
|
+
* animation frame and already owns an `onMount`/`onDestroy` pair for its
|
|
29
|
+
* `ResizeObserver`, so pairing the listener with the same lifecycle costs it
|
|
30
|
+
* nothing extra. A shared source has neither constraint, and no owning
|
|
31
|
+
* component to pair teardown with in the first place.
|
|
32
|
+
*/
|
|
33
|
+
export type ReducedMotionPreference = {
|
|
34
|
+
/** The live OS preference. Read it inside a `$derived` to stay subscribed. */
|
|
35
|
+
readonly current: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare const reducedMotion: ReducedMotionPreference;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A live, reactive mirror of the OS `prefers-reduced-motion` preference.
|
|
3
|
+
*
|
|
4
|
+
* `prefersReducedMotion()` in `utils.ts` is a plain, un-reactive read -- exactly
|
|
5
|
+
* right for the call sites that invoke it fresh on every interaction (Tabs,
|
|
6
|
+
* Input, Scroller, ChatController, TypewriterText), but useless inside a
|
|
7
|
+
* `$derived`/`$derived.by` that only recomputes when a *tracked* dependency
|
|
8
|
+
* changes. A derived that calls it and returns early on the reduced-motion
|
|
9
|
+
* branch -- Sheet's `flyParams` is the case that surfaced this -- reads no
|
|
10
|
+
* Svelte state at all along that path, so it latches whatever the preference
|
|
11
|
+
* happened to be on its first evaluation and never revisits it, in either
|
|
12
|
+
* direction, for the life of the component instance.
|
|
13
|
+
*
|
|
14
|
+
* `current` below is real `$state`, so reading `reducedMotion.current` inside
|
|
15
|
+
* a derived registers a tracked dependency wherever in the function body the
|
|
16
|
+
* read happens -- an early `return` right after it still leaves the derived
|
|
17
|
+
* subscribed, which is exactly the property a plain boolean lacks.
|
|
18
|
+
*
|
|
19
|
+
* One module-level `MediaQueryList` subscription for the whole page, rather
|
|
20
|
+
* than one per consumer: the preference is a single global fact about the
|
|
21
|
+
* browser tab, not something scoped to any particular mounted component, so
|
|
22
|
+
* every reader shares this one listener instead of each taking out (and
|
|
23
|
+
* needing to release) its own. It is intentionally never removed -- there is
|
|
24
|
+
* no "stop caring about the OS setting" moment short of the page unloading,
|
|
25
|
+
* at which point the browser reclaims it along with everything else. This
|
|
26
|
+
* differs from VoiceOrb.svelte's own subscription, which is taken out and torn
|
|
27
|
+
* down inside its `onMount`: that one has to seed a field before the first
|
|
28
|
+
* animation frame and already owns an `onMount`/`onDestroy` pair for its
|
|
29
|
+
* `ResizeObserver`, so pairing the listener with the same lifecycle costs it
|
|
30
|
+
* nothing extra. A shared source has neither constraint, and no owning
|
|
31
|
+
* component to pair teardown with in the first place.
|
|
32
|
+
*/
|
|
33
|
+
const query = typeof window !== 'undefined' && typeof window.matchMedia === 'function'
|
|
34
|
+
? window.matchMedia('(prefers-reduced-motion: reduce)')
|
|
35
|
+
: null;
|
|
36
|
+
let current = $state(query?.matches ?? false);
|
|
37
|
+
query?.addEventListener('change', (event) => {
|
|
38
|
+
current = event.matches;
|
|
39
|
+
});
|
|
40
|
+
export const reducedMotion = {
|
|
41
|
+
get current() {
|
|
42
|
+
return current;
|
|
43
|
+
}
|
|
44
|
+
};
|