@glasshome/ui 1.38.0 → 1.40.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 +7 -2
- package/dist/solid/dock-edit.d.ts +1 -1
- package/dist/solid/dock.d.ts +6 -1
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.js +1612 -1504
- package/dist/solid/input.d.ts +4 -1
- package/dist/solid/switch.d.ts +1 -0
- package/dist/solid/term.d.ts +14 -0
- package/package.json +14 -3
- package/scripts/check-gallery.ts +22 -4
- package/src/solid/dock-edit.tsx +11 -16
- package/src/solid/dock.tsx +116 -26
- package/src/solid/icon.tsx +3 -1
- package/src/solid/index.ts +1 -0
- package/src/solid/input.tsx +12 -3
- package/src/solid/option-card.tsx +1 -1
- package/src/solid/select.tsx +7 -2
- package/src/solid/switch.tsx +6 -1
- package/src/solid/tabs.tsx +1 -1
- package/src/solid/term.tsx +51 -0
- package/src/solid/toggle-group.tsx +12 -5
- package/src/styles/theme.css +2 -0
package/SPEC.md
CHANGED
|
@@ -181,12 +181,14 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
181
181
|
| a floating panel | `<Overlay>` / the overlay-wearing primitive | raw `bg-popover shadow` |
|
|
182
182
|
| a modal | `<ResponsiveDialog>` (desktop dialog + mobile bottom sheet), `<Dialog>` for desktop-only; `anchor={el}` on the content opens the desktop panel beside the element that opened it | `<Sheet side="bottom">` as a modal; a popover restyled or repositioned as a modal |
|
|
183
183
|
| an avatar or icon beside a modal title | `<Header media={…}>` | a hand-rolled row inside the header |
|
|
184
|
+
| a word a homeowner may not know (an account kind, a feature name) | `<Term term={…}>`: tap opens an icon, one line and a docs link in place; the app keeps one glossary of definitions | a helper paragraph or a hover-only tooltip explaining it |
|
|
184
185
|
| a tab row in a modal header | `<Tabs layout="split">` around the parts, `<Header wrap action={<TabsList class="w-auto">…}>` | `class="contents"` on `Tabs` and `flex-wrap` by hand |
|
|
185
186
|
| a form inside a modal | `<Body as="form" id="…">` + a footer button with `form="…"` | a `display: contents` form wrapper inside the Body |
|
|
186
187
|
| a glyph | `<Icon icon="lucide:plus" width={16}>` (inline svg from the host's `provideIcons` source) | `<iconify-icon>`, `@iconify-icon/solid` |
|
|
187
188
|
| a status chip | `<Badge tone="var(--success)">` | `rounded-lg bg-green-500/10` |
|
|
188
189
|
| a callout | `<Alert tone="warning">` | `border-amber-500/30 bg-amber-500/10` |
|
|
189
190
|
| a button while the work its press started runs | `<Button busy={saving()}>`: keeps focus, so the popover or dialog around it stays open | `disabled={saving()}`, which drops focus to the page |
|
|
191
|
+
| a switch or text field while the work its change started runs | `<Switch busy={saving()}>` / `<Input busy={saving()}>`: keeps focus, ignores the press or edit | `disabled={saving()}` |
|
|
190
192
|
| a labelled group inside a card | `<SectionGroup icon label count action>` | a hand-rolled `SectionIcon` + `SectionSubtitle` header row |
|
|
191
193
|
| a titled group of form rows | `<FieldSet>` + `<FieldLegend>` (+ `<FieldDescription>`) | a tracked uppercase `SectionLabel` eyebrow |
|
|
192
194
|
| rows that belong to the row above them | `<FieldSubGroup>` | a bare `<Separator>` and a left pad |
|
|
@@ -209,8 +211,10 @@ role clears 4.5:1 against `--background`/`--card`/`--popover`/`--muted` (3:1 for
|
|
|
209
211
|
| a press-and-hold | `createHold({ onHold, onArm, onDisarm })`, its `down`, `move`, `up`, `cancel` on the pointer handlers (it spends the press and its release) | a `setTimeout` beside a `pointerdown`; `HOLD_MS` or `spendLongPress` by hand |
|
|
210
212
|
| copying text or an image | `<CopyButton>`, `useCopyText()`, `copyText()` / `copyImage()` (from the click; text still loading goes in as a promise) | `navigator.clipboard`, `document.execCommand("copy")` |
|
|
211
213
|
| a built-in wallpaper | `GEOMETRIC_HOUSES_SVG` from `@glasshome/ui/backgrounds` | an app's own copy of the SVG |
|
|
212
|
-
| the app's navigation dock on any viewport edge, with paging and an arrival glow for newcomers | `<Dock placement="bottom\|left\|right" arrivedIds>`; a side edge pages vertically with the dots on the
|
|
214
|
+
| the app's navigation dock on any viewport edge, with paging and an arrival glow for newcomers | `<Dock placement="bottom\|left\|right" arrivedIds>`; a side edge pages vertically with the dots behind the icons on the outer side, taking no width; while editing, a six-dot grip at the start of the dock (top of a side dock, left end of a bottom one) carries it to another edge | a second dock component for the side, a glow keyframe in the app |
|
|
213
215
|
| editing the dock in place: remove badges, an add slot, drag to reorder, carry the dock to another edge | `<Dock editing onRemove onAdd onReorder onMovePlacement>` and `DockItem.removable`; reorder reports the full id order once on release (Alt+arrows move the focused item) | a separate edit screen, drag handlers or a jiggle keyframe in the app |
|
|
216
|
+
| tools beside the dock while a mode is on, or a control that belongs to the dock but is no item | `<Dock companion companionOpen>`: a second glass unit that grows out of the dock, above a bottom dock and under a side dock (so a side dock keeps its width), and adds to its measured size; `<Dock lead>`: inside the glass before the strip, never paged away | a bar positioned against `--dock-height` in the app, a chip that pages with the items |
|
|
217
|
+
| a segmented pick in a column | `<ToggleGroup orientation="vertical">` | a column of buttons with a hand-drawn selection |
|
|
214
218
|
| pointing at a control while the user operates it | `<Spotlight>` (`blocking` on a targetless veil so the action inside the bubble is the only press that lands; a target taller than half the viewport places the bubble inside it, near the top, instead of above or below; the bubble carries a tail toward its `anchor`, which defaults to `target` and may point at a different element than the hole) | a hand-rolled fixed overlay with a cutout |
|
|
215
219
|
|
|
216
220
|
Server-run `.astro` markup imports `@glasshome/ui/solid` too: the `solid`
|
|
@@ -326,7 +330,8 @@ Checklist for a new component:
|
|
|
326
330
|
through a pure `lib/` file, never duplicate it.
|
|
327
331
|
5. Export via `src/solid/index.ts` (components) and root `src/index.ts` (pure
|
|
328
332
|
recipes needed by SSR).
|
|
329
|
-
6. Register a specimen in the gallery (`dev/groups/*` in this package).
|
|
333
|
+
6. Register a specimen in the gallery (`dev/groups/*` in this package). A
|
|
334
|
+
component with behaviour also gets a harness folder (`dev/HARNESS.md`).
|
|
330
335
|
7. Comments: only constraints the code cannot express (rendering bugs worked
|
|
331
336
|
around, cascade requirements, a11y invariants). One line each.
|
|
332
337
|
|
|
@@ -20,7 +20,7 @@ export declare function createDockReorder(options: ReorderOptions): {
|
|
|
20
20
|
onMouseDown: (e: MouseEvent) => void;
|
|
21
21
|
onClickCapture: (e: MouseEvent) => void;
|
|
22
22
|
};
|
|
23
|
-
/** The grip
|
|
23
|
+
/** The grip at the start of a dock (its top on a side, its left end at the bottom): carry it toward a screen edge and the three landing zones light up. */
|
|
24
24
|
export declare function DockMoveGrip(props: {
|
|
25
25
|
placement: EdgeZone;
|
|
26
26
|
onMove: (placement: EdgeZone) => void;
|
package/dist/solid/dock.d.ts
CHANGED
|
@@ -41,8 +41,13 @@ interface DockProps extends ComponentProps<"div"> {
|
|
|
41
41
|
onAdd?: () => void;
|
|
42
42
|
/** The full id order after a drag or an Alt+arrow move. */
|
|
43
43
|
onReorder?: (ids: string[]) => void;
|
|
44
|
-
/** While editing, a grip
|
|
44
|
+
/** While editing, a grip at the dock's start carries the whole dock to a screen edge; fires once on release over one. */
|
|
45
45
|
onMovePlacement?: (placement: DockPlacement) => void;
|
|
46
|
+
/** Sits inside the glass before the strip, never pages away; the strip's room shrinks by it. */
|
|
47
|
+
lead?: JSX.Element;
|
|
48
|
+
/** A second glass unit that grows out of the dock while `companionOpen`: above a bottom dock, under a side dock, which pages to make room. */
|
|
49
|
+
companion?: JSX.Element;
|
|
50
|
+
companionOpen?: boolean;
|
|
46
51
|
}
|
|
47
52
|
interface DockIconButtonProps extends ComponentProps<"button"> {
|
|
48
53
|
icon: Component<{
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ export { SwatchPicker } from "./swatch-picker.js";
|
|
|
98
98
|
export { Switch } from "./switch.js";
|
|
99
99
|
export { TABLE_CELL_INSET, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from "./table.js";
|
|
100
100
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
101
|
+
export { Term, type TermDefinition } from "./term.js";
|
|
101
102
|
export { Textarea } from "./textarea.js";
|
|
102
103
|
export { Toggle, toggleVariants } from "./toggle.js";
|
|
103
104
|
export { ToggleGroup, ToggleGroupItem } from "./toggle-group.js";
|