@glasshome/ui 1.38.0 → 1.40.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.
@@ -48,12 +48,15 @@ const ToggleGroup: ParentComponent<
48
48
  // discriminated union, so pulling `multiple` into a separate prop collapses the
49
49
  // union and mistypes `value`. Leave it in `rest` and just peek at it here.
50
50
  const sliding = () => !(props as { multiple?: boolean }).multiple;
51
+ // Same peek for `orientation`: a column stacks its segments instead of balancing rows.
52
+ const vertical = () => (props as { orientation?: string }).orientation === "vertical";
51
53
  let root: HTMLDivElement | undefined;
52
54
  let scope: HTMLDivElement | undefined;
53
55
  onMount(() => {
54
56
  if (!root) return;
55
57
  if (local.scroll) onCleanup(trackScroll(root, "[data-pressed]", "data-pressed"));
56
- else onCleanup(balanceRows(root, scope ?? root, '[data-slot="toggle-group-item"]'));
58
+ else if (!vertical())
59
+ onCleanup(balanceRows(root, scope ?? root, '[data-slot="toggle-group-item"]'));
57
60
  });
58
61
  return (
59
62
  <ToggleGroupPrimitive
@@ -66,9 +69,11 @@ const ToggleGroup: ParentComponent<
66
69
  `group/toggle-group w-fit max-w-full items-center gap-y-1 rounded-lg data-[wrapped]:w-full ${TRACK_SURFACE} p-1 data-[variant=outline]:shadow-xs`,
67
70
  local.scroll
68
71
  ? `flex [scrollbar-width:none] flex-nowrap overflow-x-auto ${SCROLL_TRACK_FADE}`
69
- : sliding()
70
- ? "flex"
71
- : BALANCED_ROWS,
72
+ : vertical()
73
+ ? "flex flex-col items-stretch"
74
+ : sliding()
75
+ ? "flex"
76
+ : BALANCED_ROWS,
72
77
  local.class,
73
78
  )}
74
79
  {...rest}
@@ -86,7 +91,9 @@ const ToggleGroup: ParentComponent<
86
91
  class={
87
92
  local.scroll
88
93
  ? "flex w-max flex-nowrap items-center"
89
- : `w-full items-center gap-y-1 ${BALANCED_ROWS}`
94
+ : vertical()
95
+ ? "flex w-full flex-col items-stretch gap-y-0.5"
96
+ : `w-full items-center gap-y-1 ${BALANCED_ROWS}`
90
97
  }
91
98
  >
92
99
  {local.children}
@@ -613,6 +613,8 @@ html[data-motion="live"] {
613
613
  --duration-arrive: 0ms;
614
614
  --duration-jiggle: 0ms;
615
615
  --duration-slide: 0ms;
616
+ --stagger-base: 0ms;
617
+ --stagger-step: 0ms;
616
618
  }
617
619
  /* tw-animate enter/exit classes carry their own fallback duration. */
618
620
  .animate-in,