@juspay/svelte-ui-components 2.1.0 → 2.2.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.
@@ -9,7 +9,7 @@
9
9
  showDots = false,
10
10
  isScrollableLast = false,
11
11
  onkeydown
12
- }: CarouselProperties = $props();
12
+ }: CarouselProperties<Record<string, unknown>> = $props();
13
13
 
14
14
  let slidesDiv: HTMLDivElement | undefined = $state();
15
15
  let intervalId: number;
@@ -1,4 +1,4 @@
1
1
  import type { CarouselProperties } from './properties';
2
- declare const Carousel: import("svelte").Component<CarouselProperties, {}, "">;
2
+ declare const Carousel: import("svelte").Component<CarouselProperties<Record<string, unknown>>, {}, "">;
3
3
  type Carousel = ReturnType<typeof Carousel>;
4
4
  export default Carousel;
@@ -1,9 +1,10 @@
1
- import type { SvelteComponent } from 'svelte';
2
- export type CarouselProperties = {
3
- views: {
4
- properties?: Record<string, unknown>;
5
- component: typeof SvelteComponent;
6
- }[];
1
+ import type { Component } from 'svelte';
2
+ export type CarouselView<TProps extends Record<string, unknown> = Record<string, unknown>> = {
3
+ properties?: TProps;
4
+ component: Component<TProps>;
5
+ };
6
+ export type CarouselProperties<TProps extends Record<string, unknown> = Record<string, unknown>> = {
7
+ views: CarouselView<TProps>[];
7
8
  autoplay?: boolean;
8
9
  autoplayInterval?: number;
9
10
  showDots?: boolean;
@@ -1,8 +1,10 @@
1
1
  import type { ButtonProperties } from '../Button/properties';
2
2
  import type { InputProperties } from '../Input/properties';
3
3
  import type { Snippet } from 'svelte';
4
- export type InputButtonProperties = {
4
+ export type InputButtonProperties = OptionalInputButtonProperties & {
5
5
  value: string;
6
+ };
7
+ export type OptionalInputButtonProperties = {
6
8
  inputProperties: Omit<InputProperties, 'value'>;
7
9
  rightButtonProperties?: ButtonProperties | null;
8
10
  leftButtonProperties?: ButtonProperties | null;
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ export { default as IconStack } from './IconStack/IconStack.svelte';
26
26
  export type { ButtonProperties } from './Button/properties';
27
27
  export type { ModalProperties, ModalAlign, ModalSize } from './Modal/properties';
28
28
  export type { InputProperties, OptionalInputProps } from './Input/properties';
29
- export type { InputButtonProperties } from './InputButton/properties';
29
+ export type { InputButtonProperties, OptionalInputButtonProperties } from './InputButton/properties';
30
30
  export type { ListItemProperties } from './ListItem/properties';
31
31
  export type { InputDataType } from './types';
32
32
  export type { AutoCompleteType } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev --host",
6
6
  "build": "vite build && npm run package",