@glasshome/ui 1.19.0 → 1.20.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 (43) hide show
  1. package/SPEC.md +2 -1
  2. package/dist/index.js +2 -2
  3. package/dist/lib/anchor-placement.d.ts +5 -0
  4. package/dist/lib/button-variants.d.ts +1 -1
  5. package/dist/lib/motion-classes.d.ts +1 -0
  6. package/dist/solid/color-disc.d.ts +33 -0
  7. package/dist/solid/dashboard-preview.d.ts +24 -0
  8. package/dist/solid/dialog-parts.d.ts +1 -0
  9. package/dist/solid/dialog.d.ts +3 -0
  10. package/dist/solid/image-picker.d.ts +3 -0
  11. package/dist/solid/index.d.ts +3 -1
  12. package/dist/solid/index.js +5952 -5538
  13. package/dist/solid/media-store.d.ts +10 -0
  14. package/dist/solid/option-card.d.ts +1 -0
  15. package/dist/solid/page-header.d.ts +2 -2
  16. package/dist/solid/preview-tile.d.ts +2 -0
  17. package/dist/solid/responsive-dialog.d.ts +2 -0
  18. package/dist/solid/schema-form.d.ts +6 -1
  19. package/dist/solid/sliding-indicator.d.ts +2 -0
  20. package/dist/solid/toggle-group.d.ts +4 -1
  21. package/dist/{utils-CV6G6fr8.js → utils-CMk7R3zM.js} +413 -413
  22. package/package.json +1 -1
  23. package/scripts/check-ui-drift.mjs +5 -0
  24. package/src/lib/anchor-placement.ts +30 -0
  25. package/src/lib/button-variants.ts +12 -12
  26. package/src/lib/motion-classes.ts +5 -0
  27. package/src/solid/bottom-sheet/bottom-sheet.tsx +8 -1
  28. package/src/solid/color-disc.tsx +253 -0
  29. package/src/solid/dashboard-preview.tsx +128 -0
  30. package/src/solid/dialog-parts.tsx +5 -1
  31. package/src/solid/dialog.tsx +47 -5
  32. package/src/solid/entity-selector.tsx +2 -2
  33. package/src/solid/image-picker.tsx +232 -147
  34. package/src/solid/index.ts +9 -0
  35. package/src/solid/media-store.ts +20 -1
  36. package/src/solid/option-card.tsx +2 -0
  37. package/src/solid/page-header.tsx +9 -16
  38. package/src/solid/preview-tile.tsx +10 -0
  39. package/src/solid/responsive-dialog.tsx +10 -2
  40. package/src/solid/schema-form.tsx +30 -4
  41. package/src/solid/sliding-indicator.tsx +21 -5
  42. package/src/solid/toggle-group.tsx +43 -5
  43. package/src/styles/theme.css +12 -3
@@ -50,6 +50,16 @@ export interface BrokenMedia {
50
50
  }
51
51
  /** Keyed by the url that failed, so a re-uploaded id (new url) starts unbroken again. */
52
52
  export declare function createBrokenMedia(thumbUrl: (id: string) => string): BrokenMedia;
53
+ /** A built-in picture a widget offers beside the household's own uploads. */
54
+ export interface ImagePreset {
55
+ label: string;
56
+ /** Small image for the picker; the widget keeps the full picture. */
57
+ thumb: string;
58
+ }
59
+ /** The stored value that picks a built-in picture. */
60
+ export declare function presetValue(key: string): string;
61
+ /** The built-in picture a stored image value names, or undefined for an upload. */
62
+ export declare function imagePreset(value: string | null | undefined): string | undefined;
53
63
  export declare function mediaUrl(id: string | null | undefined): string | undefined;
54
64
  /** Reads better than mediaUrl in an image widget's source. */
55
65
  export declare const imageUrl: typeof mediaUrl;
@@ -10,6 +10,7 @@ export declare function OptionCardGroup(props: {
10
10
  value: string | null;
11
11
  onChange: (value: string) => void;
12
12
  "aria-label"?: string;
13
+ "aria-labelledby"?: string;
13
14
  class?: string;
14
15
  children: JSX.Element;
15
16
  }): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { type JSX } from "solid-js";
2
2
  import { type GlassSurface } from "./section-card.js";
3
3
  /**
4
- * Page banner header, shared by dash and hub: the card surface with a primary
5
- * glow and an optional logo watermark. Content is a superset API: icon/iconNode
4
+ * Page banner header, shared by dash and hub: the card surface with a display
5
+ * title and an optional logo watermark. Content is a superset API: icon/iconNode
6
6
  * + title + count pill + subtitle on the left, actions on the right. The caller
7
7
  * owns the space around it.
8
8
  *
@@ -20,6 +20,8 @@ export declare function PreviewTileGroup(props: {
20
20
  export declare function PreviewTile(props: {
21
21
  value: string;
22
22
  label: string;
23
+ /** A quieter second line under the caption. */
24
+ meta?: string;
23
25
  /** Off for pictures that name themselves; the label still reaches assistive tech. */
24
26
  caption?: boolean;
25
27
  icon?: string;
@@ -19,6 +19,8 @@ type ResponsiveDialogContentProps = ComponentProps<"div"> & {
19
19
  size?: ModalSize;
20
20
  /** Names a panel that has no `ResponsiveDialogTitle`. */
21
21
  ariaLabel?: string;
22
+ /** Desktop only: opens the panel beside this element instead of centred. The mobile sheet ignores it. */
23
+ anchor?: HTMLElement;
22
24
  };
23
25
  declare const ResponsiveDialogContent: ParentComponent<ResponsiveDialogContentProps>;
24
26
  declare const ResponsiveDialogHeader: Component<import("./dialog-parts.js").ModalHeaderProps>, ResponsiveDialogBody: Component<import("./dialog-parts.js").ModalBodyProps>, ResponsiveDialogFooter: Component<JSX.HTMLAttributes<HTMLDivElement>>;
@@ -1,5 +1,6 @@
1
1
  import type { JSONSchema7 } from "json-schema";
2
2
  import { type IconPickerProps } from "./icon-picker.js";
3
+ import { type ImagePreset } from "./media-store.js";
3
4
  export interface ExtendedJSONSchema extends JSONSchema7 {
4
5
  properties?: {
5
6
  [key: string]: ExtendedJSONSchema | boolean;
@@ -12,8 +13,12 @@ export interface ExtendedJSONSchema extends JSONSchema7 {
12
13
  deviceClass?: string;
13
14
  /** formType "variants": the property that selects the active branch. */
14
15
  discriminator?: string;
15
- /** formType "variants": kind → display name for the discriminator Select. */
16
+ /** Enum value → display name (field.choice, field.choices, the variants selector). */
16
17
  labels?: Record<string, string>;
18
+ /** field.choice: enum value → icon name; set, the choice renders as icon cards. */
19
+ icons?: Record<string, string>;
20
+ /** formType "image-picker": built-in pictures offered beside the uploads. */
21
+ presets?: Record<string, ImagePreset>;
17
22
  /** formType "list": add-button caption. */
18
23
  addLabel?: string;
19
24
  /** formType "list": item field whose value captions the collapsed row. */
@@ -26,6 +26,8 @@ interface SlidingIndicatorProps extends ComponentProps<"div"> {
26
26
  indicatorTone?: string;
27
27
  /** Selector for the measurable items. Default: direct children (minus the indicator). */
28
28
  itemSelector?: string;
29
+ /** Items wrap onto rows: the indicator follows the active item's row as well as its place in it. */
30
+ wrapped?: boolean;
29
31
  children: JSX.Element;
30
32
  }
31
33
  export declare function SlidingIndicator(props: SlidingIndicatorProps): JSX.Element;
@@ -2,6 +2,9 @@ import { ToggleGroup as ToggleGroupPrimitive } from "@kobalte/core/toggle-group"
2
2
  import type { VariantProps } from "cva";
3
3
  import { type Component, type ComponentProps, type ParentComponent } from "solid-js";
4
4
  import { toggleVariants } from "./toggle.js";
5
- declare const ToggleGroup: ParentComponent<ComponentProps<typeof ToggleGroupPrimitive> & VariantProps<typeof toggleVariants>>;
5
+ declare const ToggleGroup: ParentComponent<ComponentProps<typeof ToggleGroupPrimitive> & VariantProps<typeof toggleVariants> & {
6
+ /** CSS colour for the selected segment's glass. Default `var(--primary)`. */
7
+ tone?: string;
8
+ }>;
6
9
  declare const ToggleGroupItem: Component<ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>>;
7
10
  export { ToggleGroup, ToggleGroupItem };