@glasshome/ui 1.18.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.
- package/SPEC.md +84 -2
- package/dist/index.js +2 -2
- package/dist/lib/anchor-placement.d.ts +5 -0
- package/dist/lib/button-variants.d.ts +4 -1
- package/dist/lib/card-classes.d.ts +4 -4
- package/dist/lib/motion-classes.d.ts +2 -0
- package/dist/lib/overlay-classes.d.ts +4 -2
- package/dist/lib/spotlight-geometry.d.ts +22 -0
- package/dist/solid/button.d.ts +8 -3
- package/dist/solid/color-disc.d.ts +33 -0
- package/dist/solid/dashboard-preview.d.ts +24 -0
- package/dist/solid/dialog-parts.d.ts +1 -0
- package/dist/solid/dialog.d.ts +3 -0
- package/dist/solid/dock.d.ts +9 -0
- package/dist/solid/docked-panel.d.ts +11 -0
- package/dist/solid/image-picker.d.ts +3 -0
- package/dist/solid/index.d.ts +9 -3
- package/dist/solid/index.js +6254 -5475
- package/dist/solid/media-store.d.ts +10 -0
- package/dist/solid/option-card.d.ts +2 -1
- package/dist/solid/page-header.d.ts +2 -2
- package/dist/solid/preview-tile.d.ts +35 -0
- package/dist/solid/responsive-dialog.d.ts +2 -0
- package/dist/solid/schema-form.d.ts +6 -1
- package/dist/solid/sliding-indicator.d.ts +2 -0
- package/dist/solid/spotlight.d.ts +14 -0
- package/dist/solid/swatch-picker.d.ts +12 -0
- package/dist/solid/tabs.d.ts +4 -1
- package/dist/solid/toggle-group.d.ts +4 -1
- package/dist/solid/widget-identity.d.ts +2 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +336 -118
- package/dist/tokens/material.d.ts +40 -0
- package/dist/tokens/presets.d.ts +3 -0
- package/dist/tokens/theme-colors.d.ts +13 -3
- package/dist/tokens/theme-recipe.d.ts +8 -0
- package/dist/{utils-COITV1s9.js → utils-CMk7R3zM.js} +488 -485
- package/package.json +2 -2
- package/scripts/check-ui-drift.mjs +5 -0
- package/src/lib/anchor-placement.ts +30 -0
- package/src/lib/button-variants.ts +13 -12
- package/src/lib/card-classes.ts +4 -3
- package/src/lib/motion-classes.ts +10 -0
- package/src/lib/overlay-classes.ts +10 -2
- package/src/lib/spotlight-geometry.ts +90 -0
- package/src/solid/bottom-sheet/bottom-sheet.tsx +8 -1
- package/src/solid/button.tsx +17 -2
- package/src/solid/color-disc.tsx +253 -0
- package/src/solid/dashboard-preview.tsx +128 -0
- package/src/solid/dialog-parts.tsx +5 -1
- package/src/solid/dialog.tsx +47 -5
- package/src/solid/dock.tsx +67 -9
- package/src/solid/docked-panel.tsx +56 -0
- package/src/solid/entity-selector.tsx +2 -2
- package/src/solid/hero-action.tsx +2 -2
- package/src/solid/image-picker.tsx +232 -147
- package/src/solid/index.ts +20 -2
- package/src/solid/media-store.ts +20 -1
- package/src/solid/option-card.tsx +27 -31
- package/src/solid/page-header.tsx +9 -16
- package/src/solid/preview-tile.tsx +89 -0
- package/src/solid/radio-group.tsx +7 -2
- package/src/solid/responsive-dialog.tsx +10 -2
- package/src/solid/schema-form.tsx +30 -4
- package/src/solid/section-card.tsx +4 -2
- package/src/solid/sliding-indicator.tsx +34 -17
- package/src/solid/spotlight.tsx +179 -0
- package/src/solid/swatch-picker.tsx +47 -0
- package/src/solid/tabs.tsx +20 -4
- package/src/solid/toggle-group.tsx +43 -8
- package/src/solid/widget-identity.tsx +3 -1
- package/src/styles/globals.css +166 -14
- package/src/styles/theme.css +25 -3
- package/src/tokens/index.ts +1 -0
- package/src/tokens/material.ts +116 -0
- package/src/tokens/presets.ts +195 -56
- package/src/tokens/theme-colors.ts +15 -3
- package/src/tokens/theme-recipe.ts +18 -4
|
@@ -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;
|
|
@@ -19,7 +20,7 @@ export declare function OptionCard(props: {
|
|
|
19
20
|
description?: string;
|
|
20
21
|
icon?: string;
|
|
21
22
|
iconImage?: string;
|
|
22
|
-
/** Per-option tone
|
|
23
|
+
/** Per-option tone (setup's brand colours); the theme primary when absent. */
|
|
23
24
|
accentVar?: string;
|
|
24
25
|
/** Drop the check when picking the card is itself the next step. */
|
|
25
26
|
ornament?: "check" | "none";
|
|
@@ -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
|
|
5
|
-
*
|
|
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
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
declare const COLUMNS: {
|
|
3
|
+
readonly 2: "grid-cols-2";
|
|
4
|
+
readonly 3: "grid-cols-3";
|
|
5
|
+
readonly 4: "grid-cols-4";
|
|
6
|
+
};
|
|
7
|
+
declare const SHAPE: {
|
|
8
|
+
readonly wide: "aspect-[16/10]";
|
|
9
|
+
readonly tile: "aspect-[5/4]";
|
|
10
|
+
};
|
|
11
|
+
export declare function PreviewTileGroup(props: {
|
|
12
|
+
value: string | null;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
"aria-label": string;
|
|
15
|
+
columns?: keyof typeof COLUMNS;
|
|
16
|
+
class?: string;
|
|
17
|
+
children: JSX.Element;
|
|
18
|
+
}): JSX.Element;
|
|
19
|
+
/** A choice shown as what it produces: a picture, a preview card, a shape. */
|
|
20
|
+
export declare function PreviewTile(props: {
|
|
21
|
+
value: string;
|
|
22
|
+
label: string;
|
|
23
|
+
/** A quieter second line under the caption. */
|
|
24
|
+
meta?: string;
|
|
25
|
+
/** Off for pictures that name themselves; the label still reaches assistive tech. */
|
|
26
|
+
caption?: boolean;
|
|
27
|
+
icon?: string;
|
|
28
|
+
shape?: keyof typeof SHAPE;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
class?: string;
|
|
31
|
+
/** Fires on every click, including a re-pick of the checked tile. */
|
|
32
|
+
onPick?: () => void;
|
|
33
|
+
children: JSX.Element;
|
|
34
|
+
}): JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -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
|
-
/**
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Component, type JSX } from "solid-js";
|
|
2
|
+
interface SpotlightProps {
|
|
3
|
+
target: Element | undefined;
|
|
4
|
+
/** What the bubble is placed against and the tail points at. Defaults to `target`. */
|
|
5
|
+
anchor?: Element;
|
|
6
|
+
scrim: boolean;
|
|
7
|
+
blocking?: boolean;
|
|
8
|
+
pad?: number;
|
|
9
|
+
onSkip?: () => void;
|
|
10
|
+
class?: string;
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
declare const Spotlight: Component<SpotlightProps>;
|
|
14
|
+
export { Spotlight };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
/** One colour out of a few, as swatches sharing one row; `children` is the custom slot at the end (a picker). */
|
|
3
|
+
export declare function SwatchPicker(props: {
|
|
4
|
+
value: string | null;
|
|
5
|
+
colors: readonly string[];
|
|
6
|
+
onChange: (color: string) => void;
|
|
7
|
+
"aria-label": string;
|
|
8
|
+
/** Names each swatch for assistive tech. */
|
|
9
|
+
labelOf?: (color: string, index: number) => string;
|
|
10
|
+
class?: string;
|
|
11
|
+
children?: JSX.Element;
|
|
12
|
+
}): JSX.Element;
|
package/dist/solid/tabs.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ type TabsProps = ComponentProps<typeof TabsPrimitive> & {
|
|
|
9
9
|
};
|
|
10
10
|
declare const Tabs: Component<TabsProps>;
|
|
11
11
|
declare const TabsList: Component<ComponentProps<typeof TabsPrimitive.List>>;
|
|
12
|
-
|
|
12
|
+
/** `icon` stacks a glyph over the word, so a tab row reads apart from the toggle groups under it. */
|
|
13
|
+
declare const TabsTrigger: Component<ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
14
|
+
icon?: string;
|
|
15
|
+
}>;
|
|
13
16
|
declare const TabsContent: Component<ComponentProps<typeof TabsPrimitive.Content>>;
|
|
14
17
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -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 };
|
|
@@ -36,6 +36,8 @@ type WidgetIdentityProps = {
|
|
|
36
36
|
widget: WidgetSummary;
|
|
37
37
|
/** Icon pill size. Rows use sm, tiles use md. */
|
|
38
38
|
iconSize?: "sm" | "md";
|
|
39
|
+
/** CSS color for the icon pill; neutral when unset. */
|
|
40
|
+
iconTone?: string;
|
|
39
41
|
/** Append `v{latestVersion}` next to the name. Default true. */
|
|
40
42
|
showVersionInline?: boolean;
|
|
41
43
|
/** Show the (personal/org) scope pill after the @scope/name line. */
|
package/dist/tokens/index.d.ts
CHANGED