@glasshome/ui 1.15.0 → 1.16.1

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.
@@ -1,10 +1,11 @@
1
1
  import { type JSX } from "solid-js";
2
2
  import { TABLE_HEAD_CELL_CLASS, TABLE_HEAD_LABEL_CLASS } from "./table.js";
3
3
  /**
4
- * Generic data-table vocabulary: sticky-less header, row height/padding, border
4
+ * Generic data-table vocabulary: head strip, row height/padding, border
5
5
  * treatment, hover, numeric alignment, toolbar (search/filter/sort), bulk bar,
6
- * and empty/loading/error states. Each list renders its own row markup but
7
- * shares these primitives + class tokens. Presentational only — no app data.
6
+ * and empty/loading/error states. A list composes DataTableRow for the shared
7
+ * press and keyboard behaviour, or the class tokens for bespoke markup.
8
+ * Presentational only — no app data.
8
9
  *
9
10
  * Tables live inside a card; go edge-to-edge with `TABLE_BLEED` (cancels the
10
11
  * card's p-3) and re-add the inset via the cell padding tokens.
@@ -14,7 +15,7 @@ export declare const TABLE_BLEED: string;
14
15
  export declare const TABLE_CELL_X = "px-4";
15
16
  export declare const TABLE_ROW_CLASS = "flex items-center gap-4 border-border/50 border-b px-4 py-2.5 transition-colors last:border-b-0 hover:bg-foreground/[0.03]";
16
17
  export declare const TABLE_HEAD_CLASS = "flex items-center gap-4 border-border/50 border-b px-4 py-2";
17
- export declare const TABLE_SCROLL_CLASS = "max-h-[600px] overflow-auto gh-scroll";
18
+ export declare const TABLE_SCROLL_CLASS = "overflow-x-auto gh-scroll";
18
19
  export declare const TABLE_NUM_CELL_CLASS = "text-right text-muted-foreground text-xs tabular-nums";
19
20
  export type SortDirection = "asc" | "desc";
20
21
  /** Toolbar filter dropdown, built on the Select. Leading filter icon, h-9. Pass
@@ -35,6 +36,35 @@ export declare function TableSearchInput(props: {
35
36
  label: string;
36
37
  class?: string;
37
38
  }): JSX.Element;
39
+ /**
40
+ * One row of a flex data table. The row itself is what you press: activation
41
+ * rides on a real button covering it, the same mechanism `ListRow` uses, so a
42
+ * row reachable by Tab is also openable by Enter. Cells go in `children`;
43
+ * anything separately clickable goes in `actions`, which stacks above the
44
+ * overlay.
45
+ */
46
+ export declare function DataTableRow(props: {
47
+ children: JSX.Element;
48
+ /** Activates the whole row. Requires `openLabel`. */
49
+ onOpen?: () => void;
50
+ /** The whole row is a link. Requires `openLabel`. */
51
+ href?: string;
52
+ /** Accessible name for the whole-row activation. */
53
+ openLabel?: string;
54
+ selected?: boolean;
55
+ actions?: JSX.Element;
56
+ class?: string;
57
+ }): JSX.Element;
58
+ /**
59
+ * Column header strip. `sticky` keeps the labels against the top of the
60
+ * scrollport while a long list scrolls under them, which needs its own
61
+ * background so rows do not read through the glass.
62
+ */
63
+ export declare function DataTableHead(props: {
64
+ children: JSX.Element;
65
+ sticky?: boolean;
66
+ class?: string;
67
+ }): JSX.Element;
38
68
  /** Sortable column header button. `align="end"` for numeric columns. */
39
69
  export declare function TableSortHeader(props: {
40
70
  label: string;
@@ -1,4 +1,6 @@
1
- /** A page is one strip-width of items. The last one is whatever is left. */
1
+ /** A page is one strip-width of items. The last one is whatever is left.
2
+ * The tolerance keeps a strip a sub-pixel over its viewport on one page: both
3
+ * numbers are rounded reads of the same box. */
2
4
  export declare function pageCount(scrollWidth: number, viewport: number): number;
3
5
  /** The page a scroll position sits on, counting a half-page as turned. */
4
6
  export declare function pageOf(scrollLeft: number, viewport: number): number;
@@ -25,7 +25,7 @@ export { ColorWheel } from "./color-wheel.js";
25
25
  export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "./context-menu.js";
26
26
  export { CopyButton } from "./copy-button.js";
27
27
  export { CountPill } from "./count-pill.js";
28
- export { type SortDirection, TABLE_BLEED, TABLE_CELL_X, TABLE_HEAD_CELL_CLASS, TABLE_HEAD_CLASS, TABLE_HEAD_LABEL_CLASS, TABLE_NUM_CELL_CLASS, TABLE_ROW_CLASS, TABLE_SCROLL_CLASS, TableBulkBar, TableEmpty, TableError, TableFilterSelect, TableSearchInput, TableSkeleton, TableSortHeader, } from "./data-table.js";
28
+ export { DataTableHead, DataTableRow, type SortDirection, TABLE_BLEED, TABLE_CELL_X, TABLE_HEAD_CELL_CLASS, TABLE_HEAD_CLASS, TABLE_HEAD_LABEL_CLASS, TABLE_NUM_CELL_CLASS, TABLE_ROW_CLASS, TABLE_SCROLL_CLASS, TableBulkBar, TableEmpty, TableError, TableFilterSelect, TableSearchInput, TableSkeleton, TableSortHeader, } from "./data-table.js";
29
29
  export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./dialog.js";
30
30
  export type { ModalSize } from "./dialog-parts.js";
31
31
  export type { DockIconButtonProps, DockItem, DockProps } from "./dock.js";
@@ -69,7 +69,7 @@ export { ResponsiveDialog, ResponsiveDialogBody, ResponsiveDialogClose, Responsi
69
69
  export { type ExtendedJSONSchema, SCHEMA_FORM_FORM_TYPES, SchemaForm, } from "./schema-form.js";
70
70
  export { ScopeIndicator } from "./scope-indicator.js";
71
71
  export { ScrollArea, ScrollBar } from "./scroll-area.js";
72
- export { type GlassSurface, ListRow, NOOP_GLASS, SectionCard, SectionGroup, SectionIcon, SectionLabel, SectionMeta, SectionRow, SectionRowSkeleton, SectionRowSkeletons, SectionSubtitle, SectionTitle, } from "./section-card.js";
72
+ export { FactRow, type GlassSurface, ListRow, NOOP_GLASS, SectionCard, SectionGroup, SectionIcon, SectionLabel, SectionMeta, SectionRow, SectionRowSkeleton, SectionRowSkeletons, SectionSubtitle, SectionTitle, } from "./section-card.js";
73
73
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, } from "./select.js";
74
74
  export { Separator } from "./separator.js";
75
75
  export { LabeledField, LabeledIconPicker, LabeledInput, RowActions, SectionAddButton, SectionEmpty, SwitchRow, } from "./settings-row.js";