ui-ingredients 0.22.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,32 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+
4
+ export interface CarouselAutoplayTriggerProps
5
+ extends HtmlIngredientProps<'button', HTMLButtonElement> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '../merge-props.js';
10
+ import {getCarouselContext} from './carousel-context.svelte.js';
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ asChild,
15
+ children,
16
+ ...props
17
+ }: CarouselAutoplayTriggerProps = $props();
18
+
19
+ let carousel = getCarouselContext();
20
+
21
+ let mergedProps = $derived(
22
+ mergeProps(carousel.getAutoplayTriggerProps(), props),
23
+ );
24
+ </script>
25
+
26
+ {#if asChild}
27
+ {@render asChild(mergedProps)}
28
+ {:else}
29
+ <button bind:this={ref} {...mergedProps}>
30
+ {@render children?.()}
31
+ </button>
32
+ {/if}
@@ -0,0 +1,21 @@
1
+ import type { HtmlIngredientProps } from '../types.js';
2
+ export interface CarouselAutoplayTriggerProps extends HtmlIngredientProps<'button', HTMLButtonElement> {
3
+ }
4
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
6
+ $$bindings?: Bindings;
7
+ } & Exports;
8
+ (internal: unknown, props: Props & {
9
+ $$events?: Events;
10
+ $$slots?: Slots;
11
+ }): Exports & {
12
+ $set?: any;
13
+ $on?: any;
14
+ };
15
+ z_$$bindings?: Bindings;
16
+ }
17
+ declare const CarouselAutoplayTrigger: $$__sveltets_2_IsomorphicComponent<CarouselAutoplayTriggerProps, {
18
+ [evt: string]: CustomEvent<any>;
19
+ }, {}, {}, "ref">;
20
+ type CarouselAutoplayTrigger = InstanceType<typeof CarouselAutoplayTrigger>;
21
+ export default CarouselAutoplayTrigger;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" module>
2
2
  import type {HtmlIngredientProps} from '../types.js';
3
3
 
4
- export interface CarouselViewportProps
4
+ export interface CarouselControlProps
5
5
  extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
6
  </script>
7
7
 
@@ -14,11 +14,11 @@
14
14
  asChild,
15
15
  children,
16
16
  ...props
17
- }: CarouselViewportProps = $props();
17
+ }: CarouselControlProps = $props();
18
18
 
19
19
  let carousel = getCarouselContext();
20
20
 
21
- let mergedProps = $derived(mergeProps(carousel.getViewportProps(), props));
21
+ let mergedProps = $derived(mergeProps(carousel.getControlProps(), props));
22
22
  </script>
23
23
 
24
24
  {#if asChild}
@@ -1,5 +1,5 @@
1
1
  import type { HtmlIngredientProps } from '../types.js';
2
- export interface CarouselViewportProps extends HtmlIngredientProps<'div', HTMLDivElement> {
2
+ export interface CarouselControlProps extends HtmlIngredientProps<'div', HTMLDivElement> {
3
3
  }
4
4
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
5
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
@@ -14,8 +14,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
14
14
  };
15
15
  z_$$bindings?: Bindings;
16
16
  }
17
- declare const CarouselViewport: $$__sveltets_2_IsomorphicComponent<CarouselViewportProps, {
17
+ declare const CarouselControl: $$__sveltets_2_IsomorphicComponent<CarouselControlProps, {
18
18
  [evt: string]: CustomEvent<any>;
19
19
  }, {}, {}, "ref">;
20
- type CarouselViewport = InstanceType<typeof CarouselViewport>;
21
- export default CarouselViewport;
20
+ type CarouselControl = InstanceType<typeof CarouselControl>;
21
+ export default CarouselControl;
@@ -1,12 +1,9 @@
1
1
  <script lang="ts" module>
2
2
  import type {Assign, HtmlIngredientProps} from '../types.js';
3
- import type {ItemProps, ItemState} from '@zag-js/carousel';
3
+ import type {ItemProps} from '@zag-js/carousel';
4
4
 
5
5
  export interface CarouselItemProps
6
- extends Assign<
7
- HtmlIngredientProps<'div', HTMLDivElement, ItemState>,
8
- ItemProps
9
- > {}
6
+ extends Assign<HtmlIngredientProps<'div', HTMLDivElement>, ItemProps> {}
10
7
  </script>
11
8
 
12
9
  <script lang="ts">
@@ -27,16 +24,15 @@
27
24
  createSplitProps<ItemProps>(['index'])(props),
28
25
  );
29
26
 
30
- let itemState = $derived(carousel.getItemState(itemProps));
31
27
  let mergedProps = $derived(
32
28
  mergeProps(carousel.getItemProps(itemProps), localProps),
33
29
  );
34
30
  </script>
35
31
 
36
32
  {#if asChild}
37
- {@render asChild(mergedProps, itemState)}
33
+ {@render asChild(mergedProps)}
38
34
  {:else}
39
35
  <div bind:this={ref} {...mergedProps}>
40
- {@render children?.(itemState)}
36
+ {@render children?.()}
41
37
  </div>
42
38
  {/if}
@@ -1,6 +1,6 @@
1
1
  import type { Assign, HtmlIngredientProps } from '../types.js';
2
- import type { ItemProps, ItemState } from '@zag-js/carousel';
3
- export interface CarouselItemProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, ItemState>, ItemProps> {
2
+ import type { ItemProps } from '@zag-js/carousel';
3
+ export interface CarouselItemProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement>, ItemProps> {
4
4
  }
5
5
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
6
6
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
@@ -28,15 +28,24 @@
28
28
 
29
29
  let [createCarouselProps, localProps] = $derived(
30
30
  createSplitProps<CreateCarouselProps>([
31
+ 'allowMouseDrag',
32
+ 'autoplay',
31
33
  'id',
32
34
  'ids',
35
+ 'inViewThreshold',
33
36
  'loop',
34
- 'align',
35
- 'index',
36
- 'spacing',
37
+ 'onAutoplayStatusChange',
38
+ 'onDragStatusChange',
39
+ 'onPageChange',
37
40
  'orientation',
38
- 'slidesPerView',
39
- 'onIndexChange',
41
+ 'padding',
42
+ 'page',
43
+ 'slideCount',
44
+ 'slidesPerMove',
45
+ 'slidesPerPage',
46
+ 'snapType',
47
+ 'spacing',
48
+ 'translations',
40
49
  ])(props),
41
50
  );
42
51
 
@@ -1,3 +1,5 @@
1
+ export { default as AutoplayTrigger } from './carousel-autoplay-trigger.svelte';
2
+ export { default as Control } from './carousel-control.svelte';
1
3
  export { default as IndicatorGroup } from './carousel-indicator-group.svelte';
2
4
  export { default as Indicator } from './carousel-indicator.svelte';
3
5
  export { default as ItemGroup } from './carousel-item-group.svelte';
@@ -5,4 +7,3 @@ export { default as Item } from './carousel-item.svelte';
5
7
  export { default as NextTrigger } from './carousel-next-trigger.svelte';
6
8
  export { default as PrevTrigger } from './carousel-prev-trigger.svelte';
7
9
  export { default as Root } from './carousel-root.svelte';
8
- export { default as Viewport } from './carousel-viewport.svelte';
@@ -1,3 +1,5 @@
1
+ export { default as AutoplayTrigger } from './carousel-autoplay-trigger.svelte';
2
+ export { default as Control } from './carousel-control.svelte';
1
3
  export { default as IndicatorGroup } from './carousel-indicator-group.svelte';
2
4
  export { default as Indicator } from './carousel-indicator.svelte';
3
5
  export { default as ItemGroup } from './carousel-item-group.svelte';
@@ -5,4 +7,3 @@ export { default as Item } from './carousel-item.svelte';
5
7
  export { default as NextTrigger } from './carousel-next-trigger.svelte';
6
8
  export { default as PrevTrigger } from './carousel-prev-trigger.svelte';
7
9
  export { default as Root } from './carousel-root.svelte';
8
- export { default as Viewport } from './carousel-viewport.svelte';
@@ -1,4 +1,6 @@
1
1
  export * as Carousel from './carousel.js';
2
+ export type { CarouselAutoplayTriggerProps } from './carousel-autoplay-trigger.svelte';
3
+ export type { CarouselControlProps } from './carousel-control.svelte';
2
4
  export type { CarouselIndicatorGroupProps } from './carousel-indicator-group.svelte';
3
5
  export type { CarouselIndicatorProps } from './carousel-indicator.svelte';
4
6
  export type { CarouselItemGroupProps } from './carousel-item-group.svelte';
@@ -6,7 +8,6 @@ export type { CarouselItemProps } from './carousel-item.svelte';
6
8
  export type { CarouselNextTriggerProps } from './carousel-next-trigger.svelte';
7
9
  export type { CarouselPrevTriggerProps } from './carousel-prev-trigger.svelte';
8
10
  export type { CarouselProps } from './carousel-root.svelte';
9
- export type { CarouselViewportProps } from './carousel-viewport.svelte';
10
11
  export { anatomy as carouselAnatomy } from './carousel-anatomy.js';
11
12
  export { getCarouselContext, setCarouselContext, } from './carousel-context.svelte.js';
12
13
  export { createCarousel, type CreateCarouselProps, type CreateCarouselReturn, } from './create-carousel.svelte.js';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
4
  "license": "MIT",
5
- "version": "0.22.1",
5
+ "version": "0.23.0",
6
6
  "packageManager": "pnpm@9.15.1",
7
7
  "svelte": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -308,53 +308,53 @@
308
308
  "release": "release-it"
309
309
  },
310
310
  "dependencies": {
311
- "@zag-js/accordion": "^0.78.3",
312
- "@zag-js/anatomy": "^0.78.3",
313
- "@zag-js/angle-slider": "^0.78.3",
314
- "@zag-js/auto-resize": "^0.78.3",
315
- "@zag-js/avatar": "^0.78.3",
316
- "@zag-js/carousel": "^0.78.3",
317
- "@zag-js/checkbox": "^0.78.3",
318
- "@zag-js/clipboard": "^0.78.3",
319
- "@zag-js/collapsible": "^0.78.3",
320
- "@zag-js/color-picker": "^0.78.3",
321
- "@zag-js/combobox": "^0.78.3",
322
- "@zag-js/core": "^0.78.3",
323
- "@zag-js/date-picker": "^0.78.3",
324
- "@zag-js/dialog": "^0.78.3",
325
- "@zag-js/dom-query": "^0.78.3",
326
- "@zag-js/editable": "^0.78.3",
327
- "@zag-js/file-upload": "^0.78.3",
328
- "@zag-js/floating-panel": "^0.78.3",
329
- "@zag-js/highlight-word": "^0.78.3",
330
- "@zag-js/hover-card": "^0.78.3",
331
- "@zag-js/i18n-utils": "^0.78.3",
332
- "@zag-js/menu": "^0.78.3",
333
- "@zag-js/number-input": "^0.78.3",
334
- "@zag-js/pagination": "^0.78.3",
335
- "@zag-js/pin-input": "^0.78.3",
336
- "@zag-js/popover": "^0.78.3",
337
- "@zag-js/presence": "^0.78.3",
338
- "@zag-js/progress": "^0.78.3",
339
- "@zag-js/qr-code": "^0.78.3",
340
- "@zag-js/radio-group": "^0.78.3",
341
- "@zag-js/rating-group": "^0.78.3",
342
- "@zag-js/select": "^0.78.3",
343
- "@zag-js/signature-pad": "^0.78.3",
344
- "@zag-js/slider": "^0.78.3",
345
- "@zag-js/splitter": "^0.78.3",
346
- "@zag-js/steps": "^0.78.3",
347
- "@zag-js/svelte": "^0.78.3",
348
- "@zag-js/switch": "^0.78.3",
349
- "@zag-js/tabs": "^0.78.3",
350
- "@zag-js/tags-input": "^0.78.3",
351
- "@zag-js/time-picker": "^0.78.3",
352
- "@zag-js/timer": "^0.78.3",
353
- "@zag-js/toast": "^0.78.3",
354
- "@zag-js/toggle-group": "^0.78.3",
355
- "@zag-js/tooltip": "^0.78.3",
356
- "@zag-js/tour": "^0.78.3",
357
- "@zag-js/tree-view": "^0.78.3",
311
+ "@zag-js/accordion": "^0.79.0",
312
+ "@zag-js/anatomy": "^0.79.0",
313
+ "@zag-js/angle-slider": "^0.79.0",
314
+ "@zag-js/auto-resize": "^0.79.0",
315
+ "@zag-js/avatar": "^0.79.0",
316
+ "@zag-js/carousel": "^0.79.0",
317
+ "@zag-js/checkbox": "^0.79.0",
318
+ "@zag-js/clipboard": "^0.79.0",
319
+ "@zag-js/collapsible": "^0.79.0",
320
+ "@zag-js/color-picker": "^0.79.0",
321
+ "@zag-js/combobox": "^0.79.0",
322
+ "@zag-js/core": "^0.79.0",
323
+ "@zag-js/date-picker": "^0.79.0",
324
+ "@zag-js/dialog": "^0.79.0",
325
+ "@zag-js/dom-query": "^0.79.0",
326
+ "@zag-js/editable": "^0.79.0",
327
+ "@zag-js/file-upload": "^0.79.0",
328
+ "@zag-js/floating-panel": "^0.79.0",
329
+ "@zag-js/highlight-word": "^0.79.0",
330
+ "@zag-js/hover-card": "^0.79.0",
331
+ "@zag-js/i18n-utils": "^0.79.0",
332
+ "@zag-js/menu": "^0.79.0",
333
+ "@zag-js/number-input": "^0.79.0",
334
+ "@zag-js/pagination": "^0.79.0",
335
+ "@zag-js/pin-input": "^0.79.0",
336
+ "@zag-js/popover": "^0.79.0",
337
+ "@zag-js/presence": "^0.79.0",
338
+ "@zag-js/progress": "^0.79.0",
339
+ "@zag-js/qr-code": "^0.79.0",
340
+ "@zag-js/radio-group": "^0.79.0",
341
+ "@zag-js/rating-group": "^0.79.0",
342
+ "@zag-js/select": "^0.79.0",
343
+ "@zag-js/signature-pad": "^0.79.0",
344
+ "@zag-js/slider": "^0.79.0",
345
+ "@zag-js/splitter": "^0.79.0",
346
+ "@zag-js/steps": "^0.79.0",
347
+ "@zag-js/svelte": "^0.79.0",
348
+ "@zag-js/switch": "^0.79.0",
349
+ "@zag-js/tabs": "^0.79.0",
350
+ "@zag-js/tags-input": "^0.79.0",
351
+ "@zag-js/time-picker": "^0.79.0",
352
+ "@zag-js/timer": "^0.79.0",
353
+ "@zag-js/toast": "^0.79.0",
354
+ "@zag-js/toggle-group": "^0.79.0",
355
+ "@zag-js/tooltip": "^0.79.0",
356
+ "@zag-js/tour": "^0.79.0",
357
+ "@zag-js/tree-view": "^0.79.0",
358
358
  "zagjs-legacy-svelte": "npm:@zag-js/svelte@0.77.1",
359
359
  "zagjs-legacy-toast": "npm:@zag-js/toast@0.77.1"
360
360
  },
@@ -364,24 +364,24 @@
364
364
  "devDependencies": {
365
365
  "@faker-js/faker": "^9.3.0",
366
366
  "@sveltejs/adapter-vercel": "^5.5.2",
367
- "@sveltejs/kit": "^2.13.0",
367
+ "@sveltejs/kit": "^2.15.0",
368
368
  "@sveltejs/package": "^2.3.7",
369
369
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
370
370
  "@testing-library/jest-dom": "^6.6.3",
371
371
  "@testing-library/svelte": "^5.2.6",
372
372
  "@testing-library/user-event": "^14.5.2",
373
373
  "@types/jsdom": "^21.1.7",
374
- "@untitled-theme/icons-svelte": "^0.12.0",
374
+ "@untitled-theme/icons-svelte": "^0.13.0",
375
375
  "autoprefixer": "^10.4.20",
376
376
  "globals": "^15.14.0",
377
377
  "jsdom": "^25.0.1",
378
378
  "postcss": "^8.4.49",
379
379
  "publint": "^0.2.12",
380
- "release-it": "^17.10.0",
380
+ "release-it": "^17.11.0",
381
381
  "resize-observer-polyfill": "^1.5.1",
382
382
  "svelte": "^5.15.0",
383
383
  "svelte-check": "^4.1.1",
384
- "tailwind-merge": "^2.5.5",
384
+ "tailwind-merge": "^2.6.0",
385
385
  "tailwind-variants": "^0.3.0",
386
386
  "tailwindcss": "^3.4.17",
387
387
  "typescript": "^5.7.2",