@glasshome/ui 1.8.0 → 1.10.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/README.md +2 -13
- package/SPEC.md +6 -5
- package/dist/lib/badge-tone.d.ts +0 -2
- package/dist/solid/badge.d.ts +1 -1
- package/dist/solid/card.d.ts +4 -2
- package/dist/solid/icon.d.ts +14 -0
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/index.js +2156 -2101
- package/dist/solid/section-card.d.ts +17 -1
- package/dist/solid/spinner.d.ts +1 -1
- package/package.json +5 -11
- package/scripts/check-ui-drift.mjs +5 -0
- package/src/lib/badge-tone.ts +0 -4
- package/src/lib/carousel-classes.ts +2 -3
- package/src/styles/theme.css +12 -0
- package/dist/lib/carousel-init.d.ts +0 -9
- package/src/astro/Alert.astro +0 -63
- package/src/astro/Badge.astro +0 -18
- package/src/astro/Button.astro +0 -47
- package/src/astro/Card.astro +0 -48
- package/src/astro/Carousel.astro +0 -82
- package/src/astro/Logo.astro +0 -73
- package/src/astro/TierBadge.astro +0 -33
- package/src/lib/carousel-init.ts +0 -87
package/README.md
CHANGED
|
@@ -70,20 +70,9 @@ Framework-free theme model: presets, oklch parsing/derivation, and oklch→hex c
|
|
|
70
70
|
import { THEME_PRESETS, DEFAULT_THEME_ID, resolveThemeColors, oklchToHex } from "@glasshome/ui/tokens";
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
###
|
|
73
|
+
### Astro
|
|
74
74
|
|
|
75
|
-
Astro
|
|
76
|
-
|
|
77
|
-
```astro
|
|
78
|
-
---
|
|
79
|
-
import Badge from "@glasshome/ui/astro/Badge.astro";
|
|
80
|
-
import Button from "@glasshome/ui/astro/Button.astro";
|
|
81
|
-
import Card from "@glasshome/ui/astro/Card.astro";
|
|
82
|
-
import Alert from "@glasshome/ui/astro/Alert.astro";
|
|
83
|
-
---
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Do not import `@glasshome/ui/solid` in server-run `.astro` files; use these or the root recipes instead.
|
|
75
|
+
`.astro` files import `@glasshome/ui/solid` like any Solid file. The package ships its source under the `solid` export condition, so Astro's Solid integration compiles it for the server; a component with no `client:` directive renders to static HTML with no runtime shipped.
|
|
87
76
|
|
|
88
77
|
### `@glasshome/ui/styles` — Tailwind v4 CSS
|
|
89
78
|
|
package/SPEC.md
CHANGED
|
@@ -101,7 +101,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
101
101
|
|
|
102
102
|
| Need | Use | Never |
|
|
103
103
|
|---|---|---|
|
|
104
|
-
| a panel | `<Card>`
|
|
104
|
+
| a panel | `<Card>` | `border bg-card/NN backdrop-blur` |
|
|
105
105
|
| a floating panel | `<Overlay>` / the overlay-wearing primitive | raw `bg-popover shadow` |
|
|
106
106
|
| a modal | `<ResponsiveDialog>` (desktop dialog + mobile bottom sheet), `<Dialog>` for desktop-only | `<Sheet side="bottom">` as a modal |
|
|
107
107
|
| an avatar or icon beside a modal title | `<Header media={…}>` | a hand-rolled row inside the header |
|
|
@@ -109,6 +109,7 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
109
109
|
| a form inside a modal | `<Body as="form" id="…">` + a footer button with `form="…"` | a `display: contents` form wrapper inside the Body |
|
|
110
110
|
| a status chip | `<Badge tone="var(--success)">` | `rounded-full bg-green-500/10` |
|
|
111
111
|
| a callout | `<Alert tone="warning">` | `border-amber-500/30 bg-amber-500/10` |
|
|
112
|
+
| a labelled group inside a card | `<SectionGroup icon label count action>` | a hand-rolled `SectionIcon` + `SectionSubtitle` header row |
|
|
112
113
|
| a titled group of form rows | `<FieldSet>` + `<FieldLegend>` (+ `<FieldDescription>`) | a tracked uppercase `SectionLabel` eyebrow |
|
|
113
114
|
| rows that belong to the row above them | `<FieldSubGroup>` | a bare `<Separator>` and a left pad |
|
|
114
115
|
| picking one of a few described choices | `<OptionCardGroup>` + `<OptionCard>` | a hand-rolled `role="radio"` card list |
|
|
@@ -117,9 +118,9 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
117
118
|
| tinted text alone | `glassToneText(tone)` | ad-hoc color-mix |
|
|
118
119
|
| a metallic tier chip | `<TierBadge>` | gradients by hand |
|
|
119
120
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
Server-run `.astro` markup imports `@glasshome/ui/solid` too: the `solid`
|
|
122
|
+
export condition hands Astro the source, and a component with no `client:`
|
|
123
|
+
directive renders to static HTML with no runtime shipped.
|
|
123
124
|
|
|
124
125
|
## Motion (the pillar)
|
|
125
126
|
|
|
@@ -180,5 +181,5 @@ Checklist for a new component:
|
|
|
180
181
|
around, cascade requirements, a11y invariants). One line each.
|
|
181
182
|
|
|
182
183
|
Guards: `bun run check:tokens` (theme.css ↔ tokens/presets.ts sync) here;
|
|
183
|
-
`bun
|
|
184
|
+
`bun gov check --only ui-drift` in dash (deny-by-default drift scan for every app; escape with a
|
|
184
185
|
`ui-drift-ok <reason>` line comment only for genuinely bespoke art).
|
package/dist/lib/badge-tone.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export declare const BADGE_DEFAULT_TONE = "var(--primary)";
|
|
2
|
-
/** @deprecated CHIP from lib/pill-classes.ts */
|
|
3
|
-
export declare const BADGE_TONE_CLASS = "glass glass-tint inline-flex w-fit shrink-0 select-none items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 py-0.5 font-medium text-xs";
|
|
4
2
|
export declare const BADGE_NEUTRAL_KNOBS = "[--glass-wash:12%] [--glass-light:0.08]";
|
package/dist/solid/badge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type ComponentProps, type ValidComponent } from "solid-js";
|
|
2
|
-
type BadgeProps = ComponentProps<"span"> & {
|
|
2
|
+
type BadgeProps = ComponentProps<"span"> & Partial<Pick<ComponentProps<"a">, "href" | "target" | "rel">> & {
|
|
3
3
|
as?: ValidComponent;
|
|
4
4
|
/** Any CSS color (semantic token or arbitrary hue). Defaults to var(--primary). */
|
|
5
5
|
tone?: string;
|
package/dist/solid/card.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type Component, type ComponentProps, type ValidComponent } from "solid-js";
|
|
2
2
|
import { type CardPadding } from "../lib/card-classes.js";
|
|
3
|
-
type CardProps = ComponentProps<"div"> & {
|
|
3
|
+
type CardProps = ComponentProps<"div"> & Partial<Pick<ComponentProps<"a">, "href" | "target" | "rel">> & Partial<Pick<ComponentProps<"details">, "name" | "open">> & {
|
|
4
4
|
interactive?: boolean;
|
|
5
5
|
opaque?: boolean;
|
|
6
6
|
padding?: CardPadding;
|
|
7
7
|
as?: ValidComponent;
|
|
8
|
-
|
|
8
|
+
type?: "button" | "submit" | "reset";
|
|
9
|
+
/** The corner glyph of a go-somewhere ("arrow") or picked ("check") card. */
|
|
10
|
+
ornament?: "arrow" | "check";
|
|
9
11
|
};
|
|
10
12
|
declare const Card: Component<CardProps>;
|
|
11
13
|
declare const CardHeader: Component<ComponentProps<"div">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "iconify-icon";
|
|
2
|
+
import type { IconifyIconProperties } from "iconify-icon";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
declare module "solid-js" {
|
|
5
|
+
namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
"iconify-icon": HTMLAttributes<HTMLElement> & IconifyIconProperties & {
|
|
8
|
+
rotate?: string | number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export type IconProps = JSX.IntrinsicElements["iconify-icon"];
|
|
14
|
+
export declare function Icon(props: IconProps): JSX.Element;
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export { ResponsiveDialog, ResponsiveDialogBody, ResponsiveDialogClose, Responsi
|
|
|
66
66
|
export { type ExtendedJSONSchema, SCHEMA_FORM_FORM_TYPES, SchemaForm, } from "./schema-form.js";
|
|
67
67
|
export { ScopeIndicator } from "./scope-indicator.js";
|
|
68
68
|
export { ScrollArea, ScrollBar } from "./scroll-area.js";
|
|
69
|
-
export { type GlassSurface, ListRow, NOOP_GLASS, SectionCard, SectionIcon, SectionLabel, SectionMeta, SectionRow, SectionRowSkeleton, SectionRowSkeletons, SectionSubtitle, SectionTitle, } from "./section-card.js";
|
|
69
|
+
export { type GlassSurface, ListRow, NOOP_GLASS, SectionCard, SectionGroup, SectionIcon, SectionLabel, SectionMeta, SectionRow, SectionRowSkeleton, SectionRowSkeletons, SectionSubtitle, SectionTitle, } from "./section-card.js";
|
|
70
70
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, } from "./select.js";
|
|
71
71
|
export { Separator } from "./separator.js";
|
|
72
72
|
export { LabeledField, LabeledIconPicker, LabeledInput, RowActions, SectionAddButton, SectionEmpty, SwitchRow, } from "./settings-row.js";
|