bits-ui 1.0.0-next.35 → 1.0.0-next.37

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.
@@ -56,7 +56,7 @@ declare class PaginationPageState {
56
56
  constructor(props: PaginationPageStateProps, root: PaginationRootState);
57
57
  props: {
58
58
  readonly id: string;
59
- readonly "aria-label": `Page ${string}`;
59
+ readonly "aria-label": `Page ${number}`;
60
60
  readonly "data-value": `${number}`;
61
61
  readonly "data-selected": "" | undefined;
62
62
  readonly "data-pagination-page": "";
@@ -119,7 +119,7 @@ class PaginationPageState {
119
119
  };
120
120
  props = $derived.by(() => ({
121
121
  id: this.#id.current,
122
- "aria-label": `Page ${this.page.current}`,
122
+ "aria-label": `Page ${this.page.current.value}`,
123
123
  "data-value": `${this.page.current.value}`,
124
124
  "data-selected": this.#isSelected ? "" : undefined,
125
125
  [PAGE_ATTR]: "",
@@ -63,8 +63,6 @@
63
63
  }
64
64
  }
65
65
 
66
- value === undefined && (value = { start: undefined, end: undefined });
67
-
68
66
  const rootState = useRangeCalendarRoot({
69
67
  id: box.with(() => id),
70
68
  ref: box.with(
@@ -114,6 +114,23 @@ export class RangeCalendarRootState {
114
114
  return;
115
115
  node.textContent = this.fullCalendarLabel;
116
116
  });
117
+ /**
118
+ * Synchronize the start and end values with the `value` in case
119
+ * it is updated externally.
120
+ */
121
+ $effect(() => {
122
+ const value = this.value.current;
123
+ untrack(() => {
124
+ if (value.start && value.end) {
125
+ this.startValue.current = value.start;
126
+ this.endValue.current = value.end;
127
+ }
128
+ else if (value.start) {
129
+ this.startValue.current = value.start;
130
+ this.endValue.current = undefined;
131
+ }
132
+ });
133
+ });
117
134
  /**
118
135
  * Synchronize the placeholder value with the current start value
119
136
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "1.0.0-next.35",
3
+ "version": "1.0.0-next.37",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",