@urbicon-ui/blocks 6.30.1 → 6.31.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.
Files changed (39) hide show
  1. package/dist/components/Calendar/Calendar.svelte +17 -21
  2. package/dist/components/Calendar/CalendarAgendaView.svelte +9 -3
  3. package/dist/components/Calendar/CalendarDayView.svelte +9 -3
  4. package/dist/components/Calendar/CalendarGrid.svelte +9 -3
  5. package/dist/components/Calendar/CalendarWeekGrid.svelte +9 -3
  6. package/dist/components/Calendar/CalendarYearGrid.svelte +12 -3
  7. package/dist/components/Calendar/calendar.variants.d.ts +63 -63
  8. package/dist/components/CommandPalette/commandPalette.variants.js +9 -4
  9. package/dist/i18n/index.d.ts +2 -378
  10. package/dist/primitives/Accordion/accordion.variants.d.ts +7 -7
  11. package/dist/primitives/Accordion/accordion.variants.js +4 -4
  12. package/dist/primitives/Accordion/index.d.ts +2 -2
  13. package/dist/primitives/Alert/alert.variants.d.ts +8 -8
  14. package/dist/primitives/Button/Button.svelte +23 -7
  15. package/dist/primitives/Combobox/Combobox.svelte +11 -3
  16. package/dist/primitives/Combobox/combobox.variants.d.ts +9 -0
  17. package/dist/primitives/Combobox/combobox.variants.js +22 -4
  18. package/dist/primitives/Combobox/index.d.ts +2 -2
  19. package/dist/primitives/JourneyTimeline/journey-timeline.variants.d.ts +22 -22
  20. package/dist/primitives/Menu/menu.variants.js +13 -5
  21. package/dist/primitives/SegmentGroup/SegmentGroup.svelte +4 -4
  22. package/dist/primitives/SegmentGroup/SegmentItem.svelte +1 -1
  23. package/dist/primitives/SegmentGroup/index.d.ts +1 -1
  24. package/dist/primitives/SegmentGroup/segmentgroup.variants.d.ts +4 -4
  25. package/dist/primitives/SegmentGroup/segmentgroup.variants.js +15 -15
  26. package/dist/primitives/Select/select.variants.js +21 -7
  27. package/dist/primitives/Slider/Slider.svelte +2 -2
  28. package/dist/primitives/Slider/slider.variants.d.ts +14 -14
  29. package/dist/primitives/Slider/slider.variants.js +13 -13
  30. package/dist/primitives/Spinner/spinner.variants.d.ts +16 -16
  31. package/dist/primitives/Stepper/stepper.variants.d.ts +11 -11
  32. package/dist/primitives/Toast/toast.variants.d.ts +12 -12
  33. package/dist/primitives/Toggle/Toggle.svelte +2 -2
  34. package/dist/primitives/Toggle/index.d.ts +1 -1
  35. package/dist/primitives/Toggle/toggle.variants.d.ts +7 -7
  36. package/dist/primitives/Toggle/toggle.variants.js +32 -32
  37. package/dist/primitives/Tooltip/tooltip.variants.d.ts +3 -3
  38. package/docs/MIGRATION-v5.md +7 -5
  39. package/package.json +3 -3
@@ -178,10 +178,6 @@
178
178
  view === 'year' || view === 'agenda' ? 'month' : view
179
179
  );
180
180
 
181
- // --- Uncontrolled fallback ---
182
- let internalValue = $state<CalendarProps['value']>(undefined);
183
- const effectiveValue = $derived(value !== undefined ? value : internalValue);
184
-
185
181
  // --- Extra disable predicate (min/max handled by the controller) ---
186
182
  const disabledDatesSet = $derived(new Set(disabledDates.map((d) => toIso(d))));
187
183
  function checkExtraDisabled(date: Date): boolean {
@@ -210,7 +206,7 @@
210
206
  return selectionMode;
211
207
  },
212
208
  get selection() {
213
- return effectiveValue as DateGridSelection | undefined;
209
+ return value as DateGridSelection | undefined;
214
210
  },
215
211
  get rangeStart() {
216
212
  return undefined;
@@ -255,12 +251,13 @@
255
251
  onMonthChange?.(anchor.getMonth(), anchor.getFullYear());
256
252
  }
257
253
  onDateClick?.(date);
254
+ // Always assign the $bindable — no controlled/uncontrolled split. With
255
+ // `bind:value` the write-back reaches the consumer even from the empty
256
+ // (undefined) initial, the only type-correct "no selection"; without a
257
+ // binding Svelte 5 keeps the write local until the parent passes a new
258
+ // prop value, so uncontrolled and callback-driven usage work unchanged.
258
259
  const next = selection as CalendarProps['value'];
259
- if (value !== undefined) {
260
- value = next;
261
- } else {
262
- internalValue = next;
263
- }
260
+ value = next;
264
261
  onValueChange?.(next!);
265
262
  }
266
263
 
@@ -351,10 +348,10 @@
351
348
 
352
349
  // --- Derived: selected date for event list ---
353
350
  const selectedDateForList = $derived.by(() => {
354
- if (!effectiveValue) return null;
355
- if (effectiveValue instanceof Date) return effectiveValue;
356
- if (Array.isArray(effectiveValue)) return effectiveValue[effectiveValue.length - 1] ?? null;
357
- return effectiveValue.start;
351
+ if (!value) return null;
352
+ if (value instanceof Date) return value;
353
+ if (Array.isArray(value)) return value[value.length - 1] ?? null;
354
+ return value.start;
358
355
  });
359
356
 
360
357
  // --- Event helpers ---
@@ -500,15 +497,14 @@
500
497
  return selectedDateForList;
501
498
  },
502
499
  get selectedDates() {
503
- if (!effectiveValue) return [];
504
- if (effectiveValue instanceof Date) return [effectiveValue];
505
- if (Array.isArray(effectiveValue)) return effectiveValue;
506
- return [effectiveValue.start, effectiveValue.end];
500
+ if (!value) return [];
501
+ if (value instanceof Date) return [value];
502
+ if (Array.isArray(value)) return value;
503
+ return [value.start, value.end];
507
504
  },
508
505
  get selectedRange() {
509
- if (!effectiveValue || effectiveValue instanceof Date || Array.isArray(effectiveValue))
510
- return null;
511
- return effectiveValue as DateRange;
506
+ if (!value || value instanceof Date || Array.isArray(value)) return null;
507
+ return value as DateRange;
512
508
  },
513
509
  get events() {
514
510
  return expandedEvents;
@@ -82,9 +82,15 @@
82
82
  aria-label={bt('calendar.agendaView')}
83
83
  onkeydown={handleKeydown}
84
84
  {@attach swipeable({
85
- onSwipeLeft: () => ctx.navigate(1),
86
- onSwipeRight: () => ctx.navigate(-1),
87
- enabled: ctx.swipeable
85
+ // Direction-gated like the header arrows (the DateGridScaffold pattern): a
86
+ // swipe at the bound is inert — no navDirection flip, no clamped no-op emit.
87
+ onSwipeLeft: () => {
88
+ if (ctx.canGoForward) ctx.navigate(1);
89
+ },
90
+ onSwipeRight: () => {
91
+ if (ctx.canGoBack) ctx.navigate(-1);
92
+ },
93
+ enabled: ctx.swipeable && !ctx.disabled
88
94
  })}
89
95
  style="overflow: hidden;"
90
96
  >
@@ -54,9 +54,15 @@
54
54
  aria-label={dateLabel}
55
55
  onkeydown={handleKeydown}
56
56
  {@attach swipeable({
57
- onSwipeLeft: () => ctx.navigate(1),
58
- onSwipeRight: () => ctx.navigate(-1),
59
- enabled: ctx.swipeable
57
+ // Direction-gated like the header arrows (the DateGridScaffold pattern): a
58
+ // swipe at the bound is inert — no navDirection flip, no clamped no-op emit.
59
+ onSwipeLeft: () => {
60
+ if (ctx.canGoForward) ctx.navigate(1);
61
+ },
62
+ onSwipeRight: () => {
63
+ if (ctx.canGoBack) ctx.navigate(-1);
64
+ },
65
+ enabled: ctx.swipeable && !ctx.disabled
60
66
  })}
61
67
  >
62
68
  <div class="grid [&>*]:col-start-1 [&>*]:row-start-1">
@@ -72,9 +72,15 @@
72
72
  onmouseleave={() => ctx.setHoveredDate(null)}
73
73
  style="overflow: hidden; position: relative;"
74
74
  {@attach swipeable({
75
- onSwipeLeft: () => ctx.navigate(1),
76
- onSwipeRight: () => ctx.navigate(-1),
77
- enabled: ctx.swipeable
75
+ // Direction-gated like the header arrows (the DateGridScaffold pattern): a
76
+ // swipe at the bound is inert — no navDirection flip, no clamped no-op emit.
77
+ onSwipeLeft: () => {
78
+ if (ctx.canGoForward) ctx.navigate(1);
79
+ },
80
+ onSwipeRight: () => {
81
+ if (ctx.canGoBack) ctx.navigate(-1);
82
+ },
83
+ enabled: ctx.swipeable && !ctx.disabled
78
84
  })}
79
85
  >
80
86
  <CalendarWeekdayHeader />
@@ -99,9 +99,15 @@
99
99
  onkeydown={handleKeydown}
100
100
  style="overflow: hidden;"
101
101
  {@attach swipeable({
102
- onSwipeLeft: () => ctx.navigate(1),
103
- onSwipeRight: () => ctx.navigate(-1),
104
- enabled: ctx.swipeable
102
+ // Direction-gated like the header arrows (the DateGridScaffold pattern): a
103
+ // swipe at the bound is inert — no navDirection flip, no clamped no-op emit.
104
+ onSwipeLeft: () => {
105
+ if (ctx.canGoForward) ctx.navigate(1);
106
+ },
107
+ onSwipeRight: () => {
108
+ if (ctx.canGoBack) ctx.navigate(-1);
109
+ },
110
+ enabled: ctx.swipeable && !ctx.disabled
105
111
  })}
106
112
  >
107
113
  <div class="grid [&>*]:col-start-1 [&>*]:row-start-1">
@@ -85,9 +85,18 @@
85
85
  onkeydown={handleKeydown}
86
86
  style="overflow: hidden;"
87
87
  {@attach swipeable({
88
- onSwipeLeft: () => ctx.navigate(1),
89
- onSwipeRight: () => ctx.navigate(-1),
90
- enabled: ctx.swipeable
88
+ // Direction-gated like the header arrows (the DateGridScaffold pattern): a
89
+ // swipe at the bound is inert — no navDirection flip, no clamped no-op
90
+ // emit. In year view the gate is month-granular (the controller maps year
91
+ // onto month bounds): whenever it blocks, the year step would have clamped
92
+ // back onto the displayed month/year anyway — never a real change.
93
+ onSwipeLeft: () => {
94
+ if (ctx.canGoForward) ctx.navigate(1);
95
+ },
96
+ onSwipeRight: () => {
97
+ if (ctx.canGoBack) ctx.navigate(-1);
98
+ },
99
+ enabled: ctx.swipeable && !ctx.disabled
91
100
  })}
92
101
  >
93
102
  <div class="grid [&>*]:col-start-1 [&>*]:row-start-1">