@glasshome/ui 1.29.0 → 1.29.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.
@@ -3484,7 +3484,7 @@ var fs = /*#__PURE__*/ K("<div class=\"flex shrink-0 items-center\">"), ps = /*#
3484
3484
  lg: vs,
3485
3485
  xl: ys,
3486
3486
  full: ys
3487
- }, xs = `${ne} ${x} fixed left-1/2 flex ${gs} w-[calc(100%-2rem)] -translate-x-1/2 flex-col overflow-hidden rounded-lg outline-none ${qe.overlay}`, Ss = `${ne} ${Le} fixed flex ${gs} flex-col overflow-hidden rounded-lg outline-none ${qe.overlay}`, Cs = `${y} fixed inset-0 ${qe.overlay} ${c}`, ws = "flex shrink-0 items-start gap-4 px-6 pt-6 pb-3 in-data-[slot=bottom-sheet-content]:px-4 [[data-slot=bottom-sheet-handle]+&]:pt-1", Ts = "gh-scroll gh-stagger flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain [touch-action:pan-y_pinch-zoom] [scrollbar-gutter:stable] pl-6 pr-[calc(var(--spacing)*6-var(--scrollbar-w))] pt-6 pb-6 [[data-slot$='-header']~&]:pt-3 [&:has(~[data-slot$='-footer'])]:pb-3 in-data-[slot=bottom-sheet-content]:pl-4 in-data-[slot=bottom-sheet-content]:pr-[calc(var(--spacing)*4-var(--scrollbar-w))] [[data-slot=bottom-sheet-handle]+&]:pt-1", Es = "gh-stagger flex shrink-0 flex-col-reverse gap-2 px-6 pt-3 pb-6 sm:flex-row sm:justify-end in-data-[slot=bottom-sheet-content]:px-4", Ds = "font-semibold text-foreground text-lg leading-none tracking-tight", Os = "text-muted-foreground text-sm";
3487
+ }, xs = `${ne} ${x} fixed left-1/2 flex ${gs} w-[calc(100%-2rem)] -translate-x-1/2 flex-col overflow-hidden rounded-lg outline-none ${qe.overlay}`, Ss = `${ne} ${Le} fixed flex ${gs} flex-col overflow-hidden rounded-lg outline-none ${qe.overlay}`, Cs = `${y} fixed inset-0 ${qe.overlay} ${c}`, ws = "flex shrink-0 items-start gap-4 px-6 pt-6 pb-3 in-data-[slot=bottom-sheet-content]:px-4 [[data-slot=bottom-sheet-handle]+&]:pt-1", Ts = "gh-scroll gh-stagger flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain [touch-action:pan-y_pinch-zoom] [scrollbar-gutter:stable] pl-6 pr-[calc(var(--spacing)*6-var(--scrollbar-gutter,var(--scrollbar-w)))] pt-6 pb-6 [[data-slot$='-header']~&]:pt-3 [&:has(~[data-slot$='-footer'])]:pb-3 in-data-[slot=bottom-sheet-content]:pl-4 in-data-[slot=bottom-sheet-content]:pr-[calc(var(--spacing)*4-var(--scrollbar-gutter,var(--scrollbar-w)))] [[data-slot=bottom-sheet-handle]+&]:pt-1", Es = "gh-stagger flex shrink-0 flex-col-reverse gap-2 px-6 pt-3 pb-6 sm:flex-row sm:justify-end in-data-[slot=bottom-sheet-content]:px-4", Ds = "font-semibold text-foreground text-lg leading-none tracking-tight", Os = "text-muted-foreground text-sm";
3488
3488
  function ks(e) {
3489
3489
  return {
3490
3490
  Header: (t) => {
@@ -3519,11 +3519,20 @@ function ks(e) {
3519
3519
  })();
3520
3520
  },
3521
3521
  Body: (t) => {
3522
- let [n, r] = I(t, ["class", "as"]);
3523
- return z(At, U({
3522
+ let [n, r] = I(t, [
3523
+ "class",
3524
+ "as",
3525
+ "ref"
3526
+ ]), i;
3527
+ return Ot(() => {
3528
+ i && i.style.setProperty("--scrollbar-gutter", `${i.offsetWidth - i.clientWidth}px`);
3529
+ }), z(At, U({
3524
3530
  get component() {
3525
3531
  return n.as ?? "div";
3526
3532
  },
3533
+ ref: (e) => {
3534
+ i = e, typeof n.ref == "function" && n.ref(e);
3535
+ },
3527
3536
  "data-slot": `${e}-body`,
3528
3537
  "data-sheet-scroll": "",
3529
3538
  get class() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/ui",
3
- "version": "1.29.0",
3
+ "version": "1.29.1",
4
4
  "description": "SolidJS component library for GlassHome, built on Kobalte",
5
5
  "keywords": [
6
6
  "components",
@@ -86,7 +86,7 @@ const MODAL_HEADER_ACTION = "flex shrink-0 items-center gap-2";
86
86
  * - The reserved scrollbar lives inside the right inset, so the content column
87
87
  * ends where the Header's and Footer's do. */
88
88
  const MODAL_BODY =
89
- "gh-scroll gh-stagger flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain [touch-action:pan-y_pinch-zoom] [scrollbar-gutter:stable] pl-6 pr-[calc(var(--spacing)*6-var(--scrollbar-w))] pt-6 pb-6 [[data-slot$='-header']~&]:pt-3 [&:has(~[data-slot$='-footer'])]:pb-3 in-data-[slot=bottom-sheet-content]:pl-4 in-data-[slot=bottom-sheet-content]:pr-[calc(var(--spacing)*4-var(--scrollbar-w))] [[data-slot=bottom-sheet-handle]+&]:pt-1";
89
+ "gh-scroll gh-stagger flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain [touch-action:pan-y_pinch-zoom] [scrollbar-gutter:stable] pl-6 pr-[calc(var(--spacing)*6-var(--scrollbar-gutter,var(--scrollbar-w)))] pt-6 pb-6 [[data-slot$='-header']~&]:pt-3 [&:has(~[data-slot$='-footer'])]:pb-3 in-data-[slot=bottom-sheet-content]:pl-4 in-data-[slot=bottom-sheet-content]:pr-[calc(var(--spacing)*4-var(--scrollbar-gutter,var(--scrollbar-w)))] [[data-slot=bottom-sheet-handle]+&]:pt-1";
90
90
 
91
91
  const MODAL_FOOTER =
92
92
  "gh-stagger flex shrink-0 flex-col-reverse gap-2 px-6 pt-3 pb-6 sm:flex-row sm:justify-end in-data-[slot=bottom-sheet-content]:px-4";
@@ -143,10 +143,19 @@ export function createModalParts(slot: string): ModalParts {
143
143
  * inside a sheet must yield the gesture to its own scroll, whichever family
144
144
  * rendered it. */
145
145
  const Body: Component<ModalBodyProps> = (props) => {
146
- const [local, rest] = splitProps(props, ["class", "as"]);
146
+ const [local, rest] = splitProps(props, ["class", "as", "ref"]);
147
+ let el: HTMLElement | undefined;
148
+ // Overlay scrollbars reserve no gutter, so the right inset subtracts what the platform actually reserved.
149
+ onMount(() => {
150
+ if (el) el.style.setProperty("--scrollbar-gutter", `${el.offsetWidth - el.clientWidth}px`);
151
+ });
147
152
  return (
148
153
  <Dynamic
149
154
  component={local.as ?? "div"}
155
+ ref={(node: HTMLElement) => {
156
+ el = node;
157
+ if (typeof local.ref === "function") local.ref(node as HTMLDivElement);
158
+ }}
150
159
  data-slot={`${slot}-body`}
151
160
  data-sheet-scroll=""
152
161
  class={cn(MODAL_BODY, local.class)}