bits-ui 0.11.0 → 0.11.1

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.
@@ -49,6 +49,23 @@ type Props = Expand<WithOmission<CreateDateRangePickerProps> & {
49
49
  * This is used to apply the appropriate `aria-describedby` attribute to the input.
50
50
  */
51
51
  descriptionId?: string;
52
+ /**
53
+ * The `start` value of the date range, which can exist prior
54
+ * to the `value` being set. The `value` is only set once a `start`
55
+ * and `end` value are selected.
56
+ *
57
+ * You can `bind:startValue` to a value to receive updates outside
58
+ * this component when the user selects a `start` value.
59
+ *
60
+ * Modifying this value outside the component will have no effect.
61
+ * To programmatically control the `start` value, use `bind:value`
62
+ * and update the `start` property of the `DateRange` object.
63
+ *
64
+ * This is provided as a convenience for use cases where you want
65
+ * to display the selected `start` value outside the component before
66
+ * the `value` is set.
67
+ */
68
+ startValue?: DateValue | undefined;
52
69
  } & AsChild>;
53
70
  type InputProps = AsChild;
54
71
  type DescriptionProps = AsChild;
@@ -33,6 +33,7 @@ declare const __propDef: {
33
33
  onPlaceholderChange?: import("../../../internal/types.js").OnChangeFn<import("@internationalized/date").DateValue> | undefined;
34
34
  validationId?: string | undefined;
35
35
  descriptionId?: string | undefined;
36
+ startValue?: import("@internationalized/date").DateValue | undefined;
36
37
  asChild?: boolean | undefined;
37
38
  };
38
39
  events: {
@@ -22,12 +22,13 @@ 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 startValue = void 0;
25
26
  const {
26
27
  states: {
27
28
  value: localValue,
28
29
  placeholder: localPlaceholder,
29
30
  isInvalid: localIsInvalid,
30
- startValue,
31
+ startValue: localStartValue,
31
32
  endValue
32
33
  },
33
34
  updateOption,
@@ -172,6 +173,8 @@ $:
172
173
  if (descriptionId) {
173
174
  ids.rangeField.field.description.set(descriptionId);
174
175
  }
176
+ $:
177
+ startValue = $localStartValue;
175
178
  $:
176
179
  value !== void 0 && localValue.set(value);
177
180
  $:
@@ -212,7 +215,7 @@ $:
212
215
  slotProps = {
213
216
  isInvalid: $localIsInvalid,
214
217
  ids: $idValues,
215
- startValue: $startValue,
218
+ startValue: $localStartValue,
216
219
  endValue: $endValue
217
220
  };
218
221
  </script>
@@ -33,6 +33,7 @@ declare const __propDef: {
33
33
  onPlaceholderChange?: import("../../../internal/types.js").OnChangeFn<import("@internationalized/date").DateValue> | undefined;
34
34
  validationId?: string | undefined;
35
35
  descriptionId?: string | undefined;
36
+ startValue?: import("@internationalized/date").DateValue | undefined;
36
37
  asChild?: boolean | undefined;
37
38
  };
38
39
  events: {
@@ -41,6 +41,23 @@ type Props = Expand<Omit<CreateRangeCalendarProps, "placeholder" | "defaultPlace
41
41
  * @default false
42
42
  */
43
43
  initialFocus?: boolean;
44
+ /**
45
+ * The `start` value of the date range, which can exist prior
46
+ * to the `value` being set. The `value` is only set once a `start`
47
+ * and `end` value are selected.
48
+ *
49
+ * You can `bind:startValue` to a value to receive updates outside
50
+ * this component when the user selects a `start` value.
51
+ *
52
+ * Modifying this value outside the component will have no effect.
53
+ * To programmatically control the `start` value, use `bind:value`
54
+ * and update the `start` property of the `DateRange` object.
55
+ *
56
+ * This is provided as a convenience for use cases where you want
57
+ * to display the selected `start` value outside the component before
58
+ * the `value` is set.
59
+ */
60
+ startValue?: DateValue | undefined;
44
61
  } & AsChild>;
45
62
  type PrevButtonProps = AsChild;
46
63
  type NextButtonProps = AsChild;
@@ -23,6 +23,7 @@ export let asChild = false;
23
23
  export let id = void 0;
24
24
  export let weekdayFormat = void 0;
25
25
  export let initialFocus = false;
26
+ export let startValue = void 0;
26
27
  let el = void 0;
27
28
  onMount(() => {
28
29
  if (!initialFocus || !el)
@@ -36,7 +37,7 @@ const {
36
37
  placeholder: localPlaceholder,
37
38
  months,
38
39
  weekdays,
39
- startValue,
40
+ startValue: localStartValue,
40
41
  endValue
41
42
  },
42
43
  updateOption,
@@ -76,6 +77,8 @@ $:
76
77
  if (id) {
77
78
  ids.calendar.set(id);
78
79
  }
80
+ $:
81
+ startValue = $localStartValue;
79
82
  $:
80
83
  value !== void 0 && localValue.set(value);
81
84
  $:
@@ -117,7 +120,7 @@ $:
117
120
  builder,
118
121
  months: $months,
119
122
  weekdays: $weekdays,
120
- startValue: $startValue,
123
+ startValue: $localStartValue,
121
124
  endValue: $endValue
122
125
  };
123
126
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "exports": {