@glasshome/ui 1.34.2 → 1.35.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.
@@ -2,6 +2,7 @@ import { Dialog as DialogPrimitive, useDialogContext } from "@kobalte/core/dialo
2
2
  import { usePortalMount } from "./portal-mount.js";
3
3
  import type { VariantProps } from "cva";
4
4
  import {
5
+ children,
5
6
  type Component,
6
7
  type ComponentProps,
7
8
  type JSX,
@@ -97,13 +98,16 @@ type SheetContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
97
98
  ariaLabel?: string;
98
99
  };
99
100
 
100
- const SheetAbove: Component<{ above?: JSX.Element }> = (props) => (
101
- <Show when={props.above}>
102
- <div data-slot="sheet-content-above" class="flex w-full shrink-0 items-end justify-center">
103
- {props.above}
104
- </div>
105
- </Show>
106
- );
101
+ const SheetAbove: Component<{ above?: JSX.Element }> = (props) => {
102
+ const above = children(() => props.above);
103
+ return (
104
+ <Show when={above()}>
105
+ <div data-slot="sheet-content-above" class="flex w-full shrink-0 items-end justify-center">
106
+ {above()}
107
+ </div>
108
+ </Show>
109
+ );
110
+ };
107
111
 
108
112
  const SheetContent: ParentComponent<SheetContentProps> = (props) => {
109
113
  const [local, rest] = splitProps(props, [
@@ -1,4 +1,11 @@
1
- import { type Component, type ComponentProps, type JSX, mergeProps, Show } from "solid-js";
1
+ import {
2
+ children,
3
+ type Component,
4
+ type ComponentProps,
5
+ type JSX,
6
+ mergeProps,
7
+ Show,
8
+ } from "solid-js";
2
9
  import { type ExternalToast, Toaster as SolidSonner, toast as sonnerToast } from "solid-sonner";
3
10
  import {
4
11
  ALERT_CLASS,
@@ -59,6 +66,9 @@ const GlassToast: Component<GlassToastProps> = (props) => {
59
66
  const toneIcon = KIND_ICON[props.kind];
60
67
  const watermarkGlyph: JSX.Element | null =
61
68
  props.icon ?? (toneIcon ? <Icon icon={toneIcon} width={112} height={112} /> : null);
69
+ const title = children(() => props.title);
70
+ const description = children(() => props.description);
71
+ const action = children(() => props.action);
62
72
 
63
73
  return (
64
74
  <div
@@ -92,17 +102,17 @@ const GlassToast: Component<GlassToastProps> = (props) => {
92
102
  </span>
93
103
  </Show>
94
104
  <div class={ALERT_CONTENT_CLASS}>
95
- <Show when={props.title}>
105
+ <Show when={title()}>
96
106
  <p class={ALERT_TITLE_CLASS} style={tone ? { color: glassToneText(tone) } : undefined}>
97
- {props.title}
107
+ {title()}
98
108
  </p>
99
109
  </Show>
100
- <Show when={props.description}>
101
- <div class={ALERT_DESCRIPTION_CLASS}>{props.description}</div>
110
+ <Show when={description()}>
111
+ <div class={ALERT_DESCRIPTION_CLASS}>{description()}</div>
102
112
  </Show>
103
113
  </div>
104
- <Show when={props.action}>
105
- <div class="flex shrink-0 items-center">{props.action}</div>
114
+ <Show when={action()}>
115
+ <div class="flex shrink-0 items-center">{action()}</div>
106
116
  </Show>
107
117
  </div>
108
118
  );
@@ -1,4 +1,4 @@
1
- import { type JSX, mergeProps, Show } from "solid-js";
1
+ import { children, type JSX, mergeProps, Show } from "solid-js";
2
2
  import { cn } from "../lib/utils.js";
3
3
  import { Card } from "./card.js";
4
4
  import { Icon } from "./icon.js";
@@ -52,7 +52,8 @@ type InternalProps = WidgetCardProps & { interactive: boolean };
52
52
  function WidgetCardRow(props: InternalProps) {
53
53
  const hasMeta = () =>
54
54
  props.widget.downloadCount != null || (props.showVersions && props.widget.versionCount != null);
55
- const showTrailing = () => props.trailing !== undefined || props.interactive;
55
+ const trailing = children(() => props.trailing);
56
+ const showTrailing = () => trailing() !== undefined || props.interactive;
56
57
 
57
58
  return (
58
59
  <Card
@@ -74,7 +75,7 @@ function WidgetCardRow(props: InternalProps) {
74
75
  </Show>
75
76
  <Show when={showTrailing()} fallback={null}>
76
77
  <Show
77
- when={props.trailing !== undefined}
78
+ when={trailing() !== undefined}
78
79
  fallback={
79
80
  <Icon
80
81
  icon="lucide:chevron-right"
@@ -84,7 +85,7 @@ function WidgetCardRow(props: InternalProps) {
84
85
  />
85
86
  }
86
87
  >
87
- {props.trailing}
88
+ {trailing()}
88
89
  </Show>
89
90
  </Show>
90
91
  </Card>
@@ -596,8 +596,8 @@ html[data-motion="live"] {
596
596
  .reduce-blur,
597
597
  .reduce-blur * {
598
598
  --tw-backdrop-blur: initial !important;
599
+ /* Unprefixed only: the minifier folds a pair into the -webkit- form alone, which Chromium ignores. */
599
600
  backdrop-filter: none !important;
600
- -webkit-backdrop-filter: none !important;
601
601
  }
602
602
  /* A control that cannot blur takes the opaque card fill, never bare see-through. */
603
603
  .reduce-blur .glass-control {