@close-by/clay 0.2.12 → 0.2.14

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/api.md CHANGED
@@ -1052,7 +1052,7 @@ ui.stat([
1052
1052
 
1053
1053
  #### `ui.areaChart(props)`
1054
1054
 
1055
- Stacked area chart (Recharts). Optional card chrome via `title` / `description`. Set `interactive: true` with ISO date `xKey` values for client-side period tabs (default 7d / 30d / 90d; override with `periods`). Optional `headline: { value, trend?, trendDirection? }` for a KPI row above the chart; `loading: true` shows a skeleton. Legend is always shown. Pass `stacked: false` to overlay series instead of stacking (default `true`).
1055
+ Stacked area chart (Recharts). Optional card chrome via `title` / `description`. Set `interactive: true` with ISO date `xKey` values for client-side period tabs (default 7d / 30d / 90d; override with `periods`). Optional `headline: { value, trend?, trendDirection? }` for a KPI row above the chart; `loading: true` shows a skeleton. Legend is shown by default; pass `showLegend: false` to hide. Pass `stacked: false` to overlay series instead of stacking (default `true`).
1056
1056
 
1057
1057
  ```typescript
1058
1058
  ui.areaChart({
@@ -1071,7 +1071,7 @@ ui.areaChart({
1071
1071
 
1072
1072
  #### `ui.barChart(props)`
1073
1073
 
1074
- Bar chart with the same cartesian props as area (`data`, `xKey`, `series`, title/description/height/interactive, `headline`, `periods`, `loading`). Optional `stacked` (default `false`) and `layout: 'vertical' | 'horizontal'` (default `'vertical'` — category on X).
1074
+ Bar chart with the same cartesian props as area (`data`, `xKey`, `series`, title/description/height/interactive, `headline`, `periods`, `loading`, `showLegend?`). Optional `stacked` (default `false`) and `layout: 'vertical' | 'horizontal'` (default `'vertical'` — category on X).
1075
1075
 
1076
1076
  ```typescript
1077
1077
  ui.barChart({
@@ -1089,11 +1089,22 @@ ui.barChart({
1089
1089
 
1090
1090
  #### `ui.lineChart(props)`
1091
1091
 
1092
- Line chart with the same cartesian props as area (including interactive date ranges, headline, periods, loading).
1092
+ Line chart with the same cartesian props as area (including interactive date ranges, headline, periods, loading, `showLegend?`). Line styling:
1093
+
1094
+ | Prop | Default | Description |
1095
+ |------|---------|-------------|
1096
+ | `curve` | `'monotone'` | Recharts interpolation: `'linear'`, `'natural'`, `'step'`, `'stepBefore'`, `'stepAfter'`, `'basis'` |
1097
+ | `strokeWidth` | `2` | Line thickness in px |
1098
+ | `dots` | `false` | Show point markers |
1099
+ | `strokeDasharray` / `dashed` | — | Dashed stroke; `dashed: true` → `'4 4'` |
1100
+ | `variant` | `'default'` | `'minimal'` hides the grid for a cleaner plot |
1093
1101
 
1094
1102
  ```typescript
1095
1103
  ui.lineChart({
1096
1104
  title: 'Traffic trend',
1105
+ showLegend: false,
1106
+ curve: 'step',
1107
+ dots: true,
1097
1108
  data: monthly,
1098
1109
  xKey: 'month',
1099
1110
  series: [
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) |
@@ -101,9 +102,9 @@ Each factory creates an `Element` with a wire `type` string. The React client ma
101
102
  | `upload` | `upload` | File picker / dropzone → `POST /upload` (progress/abort) → WS `upload` / `progress` / `error` / `abort` |
102
103
  | `stat` | `stat` | Grid of metric cards (optional per-item `sparkline`) |
103
104
  | `sparkline` | `sparkline` | KPI card with inline area/line mini chart (`headline`, `value`/`trend` shorthand) |
104
- | `areaChart` | `areachart` | Recharts stacked area (+ legend, optional interactive periods, `headline`, `loading`, `stacked?`) |
105
- | `barChart` | `barchart` | Recharts bar (`stacked?`, `layout?: 'vertical' \| 'horizontal'`, shared cartesian chrome) |
106
- | `lineChart` | `linechart` | Recharts line (+ optional interactive periods, headline, loading) |
105
+ | `areaChart` | `areachart` | Recharts stacked area (+ legend, optional interactive periods, `headline`, `loading`, `stacked?`, `showLegend?`) |
106
+ | `barChart` | `barchart` | Recharts bar (`stacked?`, `layout?: 'vertical' \| 'horizontal'`, shared cartesian chrome, `showLegend?`) |
107
+ | `lineChart` | `linechart` | Recharts line (+ interactive periods, headline, loading, `curve`/`strokeWidth`/`dots`/`dashed`/`variant`, `showLegend?`) |
107
108
  | `pieChart` | `piechart` | Recharts pie/donut (`nameKey`/`valueKey` or `series`, `innerRadius?`) |
108
109
  | `radarChart` | `radarchart` | Recharts radar (`angleKey` + `series`, optional `fillOpacity`) |
109
110
  | `radialChart` | `radialchart` | Recharts radial bar (`nameKey`/`valueKey` or stacked `series`, optional center text / angles) |
@@ -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.14",
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.14",
41
+ "@close-by/clay-core": "0.2.14",
42
+ "@close-by/clay-components": "0.2.14",
43
+ "@close-by/clay-server": "0.2.14",
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,
@@ -232,6 +237,9 @@ import {
232
237
  type ChartPeriod,
233
238
  type ChartReferenceLine,
234
239
  type ChartReferenceArea,
240
+ type LineCurve,
241
+ type LineChartVariant,
242
+ type LineChartStyleProps,
235
243
  type SparklineProps,
236
244
  type CardProps,
237
245
  type DialogProps,
@@ -948,6 +956,14 @@ export function pageHeading(props: PageHeadingProps, trailing?: () => void): Ele
948
956
  return pageHeadingFactory(props, trailing);
949
957
  }
950
958
 
959
+ /**
960
+ * Explicit space between siblings. Default orientation is horizontal (width).
961
+ * Prefer parent `gap` for even stacks; use spacer for uneven breaks.
962
+ */
963
+ export function spacer(props?: SpacerProps): Element {
964
+ return spacerFactory(props);
965
+ }
966
+
951
967
  /** Standalone pager. See {@link PaginationProps}. */
952
968
  export function pagination(props?: PaginationProps): Element {
953
969
  return paginationFactory(props);
@@ -1807,6 +1823,7 @@ export const ui = {
1807
1823
  buttonGroup,
1808
1824
  empty,
1809
1825
  pageHeading,
1826
+ spacer,
1810
1827
  pagination,
1811
1828
  filterBar,
1812
1829
  filterChips,