@close-by/clay 0.2.12 → 0.2.13

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/docs/boot.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Clay has two entry styles. Prefer **one production path** (library mode) and treat the CLI as a thin dev wrapper so port, CSS, and `clientDir` do not drift.
4
4
 
5
+ ### Dev HTML comments
6
+
7
+ When `dev` is on (default unless `NODE_ENV=production`, or set `ui.run({ dev: true })`), the shell sets `window.__CLAY_DEV__` and the client inserts HTML comments around each wire node:
8
+
9
+ ```html
10
+ <!-- clay:staticTable -->
11
+ …table markup…
12
+ <!-- /clay:staticTable -->
13
+ ```
14
+
15
+ Pass `dev: false` to disable.
16
+
5
17
  ## Recommended production path — library mode
6
18
 
7
19
  ```typescript
package/docs/elements.md CHANGED
@@ -34,7 +34,7 @@ Each factory creates an `Element` with a wire `type` string. The React client ma
34
34
  | `inputGroup` | `inputGroup` | Input with prefix/suffix addons |
35
35
  | `toggle` | `toggle` | Pressed toolbar toggle |
36
36
  | `descriptionList` | `descriptionList` | Key-value detail rows |
37
- | `staticTable` | `staticTable` | Read-only HTML table |
37
+ | `staticTable` | `staticTable` | Read-only HTML table (`bordered`/`hoverable` default on; `density`, `emptyTitle`, column `mono`) |
38
38
  | `aspectRatio` | `aspectRatio` | Fixed-ratio child wrapper |
39
39
  | `itemList` | `itemList` | Settings / notification rows |
40
40
  | `checkboxGroup` | `checkboxGroup` | Multi-select checkboxes |
@@ -76,6 +76,7 @@ Each factory creates an `Element` with a wire `type` string. The React client ma
76
76
  | `badge` | `badge` | ShadCN `Badge` |
77
77
  | `alert` | `alert` | Bordered alert box |
78
78
  | `spinner` | `spinner` | Lucide spinner |
79
+ | `spacer` | `spacer` | Fixed gap (`orientation` default `horizontal`; `size` xs–xl) |
79
80
  | `skeleton` | `skeleton` | ShadCN `Skeleton` placeholder |
80
81
  | `avatar` | `avatar` | ShadCN `Avatar` (+ fallback) |
81
82
  | `progress` | `progress` | ShadCN `Progress` (0–100) |
@@ -197,8 +197,9 @@ Prefer semantic props over Tailwind soup:
197
197
  | Feed empty muted label | `ui.empty({ title: '…', density: 'inline' })` |
198
198
  | `h-[calc(100%-7rem)]!` on resizable | `ui.resizable({ fill: 'parent' \| 'viewport' }, …)` |
199
199
  | `className: 'items-end justify-between'` on rows | `ui.row({ align: 'end', justify: 'between' }, …)` |
200
+ | `className: 'mb-2'` between uneven blocks | Parent `column({ gap })`, or `ui.spacer({ orientation: 'vertical', size: 'md' })` |
200
201
 
201
- `className` remains an escape hatch.
202
+ Prefer even stacks via parent `gap`. Use `ui.spacer` for uneven breaks (`orientation` default **`horizontal`**; `vertical` for column stacks). `className` remains an escape hatch.
202
203
 
203
204
  ## Logs / traces — sensitive bodies
204
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@close-by/clay",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "NiceGUI-like ui.* facade for Clay apps",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,10 +37,10 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@close-by/clay-compiler": "0.2.12",
41
- "@close-by/clay-core": "0.2.12",
42
- "@close-by/clay-components": "0.2.12",
43
- "@close-by/clay-server": "0.2.12",
40
+ "@close-by/clay-compiler": "0.2.13",
41
+ "@close-by/clay-core": "0.2.13",
42
+ "@close-by/clay-components": "0.2.13",
43
+ "@close-by/clay-server": "0.2.13",
44
44
  "@tailwindcss/cli": "^4.3.3",
45
45
  "tailwindcss": "^4.3.3"
46
46
  }
package/src/index.ts CHANGED
@@ -35,6 +35,7 @@ import {
35
35
  filterBar as filterBarFactory,
36
36
  filterChips as filterChipsFactory,
37
37
  pageHeading as pageHeadingFactory,
38
+ spacer as spacerFactory,
38
39
  numberField as numberFieldFactory,
39
40
  phoneInput as phoneInputFactory,
40
41
  field as fieldFactory,
@@ -164,6 +165,9 @@ import {
164
165
  type EmptyProps,
165
166
  type EmptyDensity,
166
167
  type PageHeadingProps,
168
+ type SpacerProps,
169
+ type SpacerSize,
170
+ type SpacerOrientation,
167
171
  type PaginationProps,
168
172
  type FilterBarProps,
169
173
  type FilterChip,
@@ -188,6 +192,7 @@ import {
188
192
  type DescriptionListItem,
189
193
  type StaticTableProps,
190
194
  type StaticTableColumn,
195
+ type StaticTableDensity,
191
196
  type AspectRatioProps,
192
197
  type ItemListProps,
193
198
  type ItemListEntry,
@@ -948,6 +953,14 @@ export function pageHeading(props: PageHeadingProps, trailing?: () => void): Ele
948
953
  return pageHeadingFactory(props, trailing);
949
954
  }
950
955
 
956
+ /**
957
+ * Explicit space between siblings. Default orientation is horizontal (width).
958
+ * Prefer parent `gap` for even stacks; use spacer for uneven breaks.
959
+ */
960
+ export function spacer(props?: SpacerProps): Element {
961
+ return spacerFactory(props);
962
+ }
963
+
951
964
  /** Standalone pager. See {@link PaginationProps}. */
952
965
  export function pagination(props?: PaginationProps): Element {
953
966
  return paginationFactory(props);
@@ -1807,6 +1820,7 @@ export const ui = {
1807
1820
  buttonGroup,
1808
1821
  empty,
1809
1822
  pageHeading,
1823
+ spacer,
1810
1824
  pagination,
1811
1825
  filterBar,
1812
1826
  filterChips,