bits-ui 0.11.4 → 0.11.5

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.
@@ -36,7 +36,7 @@ const {
36
36
  states: {
37
37
  value: localValue,
38
38
  placeholder: localPlaceholder,
39
- months,
39
+ months: localMonths,
40
40
  weekdays
41
41
  },
42
42
  updateOption,
@@ -126,10 +126,13 @@ $:
126
126
  $:
127
127
  Object.assign(builder, attrs);
128
128
  const dispatch = createDispatcher();
129
+ let months = $localMonths;
130
+ $:
131
+ months = $localMonths;
129
132
  </script>
130
133
 
131
134
  {#if asChild}
132
- <slot months={$months} weekdays={$weekdays} {builder} />
135
+ <slot {months} weekdays={$weekdays} {builder} />
133
136
  {:else}
134
137
  <div
135
138
  {...builder} use:builder.action
@@ -137,6 +140,6 @@ const dispatch = createDispatcher();
137
140
  on:m-keydown={dispatch}
138
141
  bind:this={el}
139
142
  >
140
- <slot months={$months} weekdays={$weekdays} {builder} />
143
+ <slot {months} weekdays={$weekdays} {builder} />
141
144
  </div>
142
145
  {/if}
@@ -1,4 +1,6 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import type { DateValue } from "@internationalized/date";
3
+ import { type Month } from "@melt-ui/svelte";
2
4
  import type { Props } from "../types.js";
3
5
  declare class __sveltets_Render<Multiple extends boolean> {
4
6
  props(): Props<Multiple>;
@@ -7,7 +9,7 @@ declare class __sveltets_Render<Multiple extends boolean> {
7
9
  };
8
10
  slots(): {
9
11
  default: {
10
- months: import("@melt-ui/svelte/index.js").Month<import("@internationalized/date").DateValue>[];
12
+ months: Month<DateValue>[];
11
13
  weekdays: string[];
12
14
  builder: {
13
15
  id: string;
@@ -5,7 +5,7 @@ export let asChild = false;
5
5
  export let id = void 0;
6
6
  const {
7
7
  elements: { calendar },
8
- states: { months, weekdays },
8
+ states: { months: localMonths, weekdays },
9
9
  ids
10
10
  } = getCtx();
11
11
  $:
@@ -18,12 +18,15 @@ $:
18
18
  builder = $calendar;
19
19
  $:
20
20
  Object.assign(builder, attrs);
21
+ let months = $localMonths;
22
+ $:
23
+ months = $localMonths;
21
24
  </script>
22
25
 
23
26
  {#if asChild}
24
- <slot {builder} months={$months} weekdays={$weekdays} />
27
+ <slot {builder} {months} weekdays={$weekdays} />
25
28
  {:else}
26
29
  <div {...builder} use:builder.action {...$$restProps} on:m-keydown={dispatch}>
27
- <slot {builder} months={$months} weekdays={$weekdays} />
30
+ <slot {builder} {months} weekdays={$weekdays} />
28
31
  </div>
29
32
  {/if}
@@ -1,5 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { type Month } from "@melt-ui/svelte";
2
3
  import type { CalendarEvents, CalendarProps } from "../types.js";
4
+ import type { DateValue } from "@internationalized/date";
3
5
  declare const __propDef: {
4
6
  props: CalendarProps;
5
7
  slots: {
@@ -16,7 +18,7 @@ declare const __propDef: {
16
18
  } & {
17
19
  action: (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">;
18
20
  };
19
- months: import("@melt-ui/svelte/index.js").Month<import("@internationalized/date").DateValue>[];
21
+ months: Month<DateValue>[];
20
22
  weekdays: string[];
21
23
  };
22
24
  };
@@ -22,6 +22,7 @@ export let isDateDisabled = void 0;
22
22
  export let fixedWeeks = void 0;
23
23
  export let calendarLabel = void 0;
24
24
  export let weekdayFormat = void 0;
25
+ export let numberOfMonths = void 0;
25
26
  const {
26
27
  states: {
27
28
  value: localValue,
@@ -48,6 +49,7 @@ const {
48
49
  minValue,
49
50
  readonly,
50
51
  weekdayFormat,
52
+ numberOfMonths,
51
53
  isDateUnavailable,
52
54
  onValueChange: ({ next }) => {
53
55
  if (value !== next) {
@@ -158,6 +160,8 @@ $:
158
160
  updateOption("calendarLabel", calendarLabel);
159
161
  $:
160
162
  updateOption("weekdayFormat", weekdayFormat);
163
+ $:
164
+ updateOption("numberOfMonths", numberOfMonths);
161
165
  </script>
162
166
 
163
167
  <slot ids={$idValues} isInvalid={$localIsInvalid} />
@@ -4,7 +4,7 @@ export let asChild = false;
4
4
  export let id = void 0;
5
5
  const {
6
6
  elements: { calendar },
7
- states: { months, weekdays },
7
+ states: { months: localMonths, weekdays },
8
8
  ids
9
9
  } = getCtx();
10
10
  $:
@@ -16,12 +16,15 @@ $:
16
16
  builder = $calendar;
17
17
  $:
18
18
  Object.assign(builder, attrs);
19
+ let months = $localMonths;
20
+ $:
21
+ months = $localMonths;
19
22
  </script>
20
23
 
21
24
  {#if asChild}
22
- <slot {builder} months={$months} weekdays={$weekdays} />
25
+ <slot {builder} {months} weekdays={$weekdays} />
23
26
  {:else}
24
27
  <div {...builder} use:builder.action {...$$restProps}>
25
- <slot {builder} months={$months} weekdays={$weekdays} />
28
+ <slot {builder} {months} weekdays={$weekdays} />
26
29
  </div>
27
30
  {/if}
@@ -1,5 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { type Month } from "@melt-ui/svelte";
2
3
  import type { CalendarProps } from "../types.js";
4
+ import type { DateValue } from "@internationalized/date";
3
5
  declare const __propDef: {
4
6
  props: CalendarProps;
5
7
  events: {
@@ -19,7 +21,7 @@ declare const __propDef: {
19
21
  } & {
20
22
  action: (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">;
21
23
  };
22
- months: import("@melt-ui/svelte/index.js").Month<import("@internationalized/date").DateValue>[];
24
+ months: Month<DateValue>[];
23
25
  weekdays: string[];
24
26
  };
25
27
  };
@@ -23,6 +23,7 @@ export let fixedWeeks = void 0;
23
23
  export let calendarLabel = void 0;
24
24
  export let weekdayFormat = void 0;
25
25
  export let startValue = void 0;
26
+ export let numberOfMonths = void 0;
26
27
  const {
27
28
  states: {
28
29
  value: localValue,
@@ -51,6 +52,7 @@ const {
51
52
  minValue,
52
53
  readonly,
53
54
  weekdayFormat,
55
+ numberOfMonths,
54
56
  isDateUnavailable,
55
57
  onValueChange: ({ next }) => {
56
58
  if (value !== next) {
@@ -211,6 +213,8 @@ $:
211
213
  updateOption("calendarLabel", calendarLabel);
212
214
  $:
213
215
  updateOption("weekdayFormat", weekdayFormat);
216
+ $:
217
+ updateOption("numberOfMonths", numberOfMonths);
214
218
  </script>
215
219
 
216
220
  <slot
@@ -24,6 +24,7 @@ export let id = void 0;
24
24
  export let weekdayFormat = void 0;
25
25
  export let initialFocus = false;
26
26
  export let startValue = void 0;
27
+ export let numberOfMonths = void 0;
27
28
  let el = void 0;
28
29
  onMount(() => {
29
30
  if (!initialFocus || !el)
@@ -35,7 +36,7 @@ const {
35
36
  states: {
36
37
  value: localValue,
37
38
  placeholder: localPlaceholder,
38
- months,
39
+ months: localMonths,
39
40
  weekdays,
40
41
  startValue: localStartValue,
41
42
  endValue
@@ -58,6 +59,7 @@ const {
58
59
  fixedWeeks,
59
60
  calendarLabel,
60
61
  weekdayFormat,
62
+ numberOfMonths,
61
63
  onPlaceholderChange: ({ next }) => {
62
64
  if (placeholder !== next) {
63
65
  onPlaceholderChange?.(next);
@@ -109,18 +111,23 @@ $:
109
111
  updateOption("calendarLabel", calendarLabel);
110
112
  $:
111
113
  updateOption("weekdayFormat", weekdayFormat);
114
+ $:
115
+ updateOption("numberOfMonths", numberOfMonths);
112
116
  const attrs = getAttrs("root");
113
117
  const dispatch = createDispatcher();
114
118
  $:
115
119
  builder = $calendar;
116
120
  $:
117
121
  Object.assign(builder, attrs);
122
+ let months = $localMonths;
123
+ $:
124
+ months = $localMonths;
118
125
  </script>
119
126
 
120
127
  {#if asChild}
121
128
  <slot
122
129
  {builder}
123
- months={$months}
130
+ {months}
124
131
  weekdays={$weekdays}
125
132
  startValue={$localStartValue}
126
133
  endValue={$endValue}
@@ -134,7 +141,7 @@ $:
134
141
  >
135
142
  <slot
136
143
  {builder}
137
- months={$months}
144
+ {months}
138
145
  weekdays={$weekdays}
139
146
  startValue={$localStartValue}
140
147
  endValue={$endValue}
@@ -1,5 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
+ import { type Month } from "@melt-ui/svelte";
2
3
  import type { Events, Props } from "../types.js";
4
+ import type { DateValue } from "@internationalized/date";
3
5
  declare const __propDef: {
4
6
  props: Props;
5
7
  slots: {
@@ -16,10 +18,10 @@ declare const __propDef: {
16
18
  } & {
17
19
  action: (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">;
18
20
  };
19
- months: import("@melt-ui/svelte/index.js").Month<import("@internationalized/date").DateValue>[];
21
+ months: Month<DateValue>[];
20
22
  weekdays: string[];
21
- startValue: import("@internationalized/date").DateValue | undefined;
22
- endValue: import("@internationalized/date").DateValue | undefined;
23
+ startValue: DateValue | undefined;
24
+ endValue: DateValue | undefined;
23
25
  };
24
26
  };
25
27
  events: Events;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "0.11.4",
3
+ "version": "0.11.5",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "exports": {