@colixsystems/widget-sdk 0.329.0 → 0.329.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.
- package/README.md +6 -2
- package/dist/grid-logic.js +3 -10
- package/dist/index.d.ts +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,7 +91,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
91
91
|
|
|
92
92
|
## Status
|
|
93
93
|
|
|
94
|
-
`v0.329.
|
|
94
|
+
`v0.329.1` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
95
|
+
|
|
96
|
+
### What's new in 0.329.1 (contract 1.268.0)
|
|
97
|
+
|
|
98
|
+
**A tile row given `maxColumns` still fits a phone.** `<Grid balance="tiles" maxColumns={4}>` used `maxColumns` as the count per line at every width, so four stat tiles sat side by side on a phone and their figures wrapped a word per line. `maxColumns` now only lowers the width-tier ceiling (4 wide, 3 medium, 2 narrow): the same grid is 4 a line wide and 2 + 2 on a phone, on the web and in the exported app.
|
|
95
99
|
|
|
96
100
|
### What's new in 0.329.0 (contract 1.268.0)
|
|
97
101
|
|
|
@@ -3636,7 +3640,7 @@ import { defineWidget, validateManifest, useDatastoreQuery, Text, View } from "@
|
|
|
3636
3640
|
- `List`, `ListRow`, `ListHeader`, `EmptyState` — the themed list building blocks. `<ListRow title subtitle leading trailing onPress selected divider>` draws one record row from the theme's `list` scope (padding, height, gap, radius, background, divider); `<List>` spaces its rows and hands overrides down; `<ListHeader>` labels a table's columns on the rows' own inset; `<EmptyState icon title message>` is the "nothing here" panel. Use them by default for record rows and a table's header; build your own row when it needs what `ListRow` cannot do (a swipe-to-delete row, a row that expands in place).
|
|
3637
3641
|
- `DataTable` — a list or table of records laid out for its own width, on both hosts. `<DataTable columns rows>` is stacked label/value cards when narrow, one card per row at medium and aligned columns under a sticky header when wide, built from `List` / `ListRow` / `ListHeader` and styled by the theme's `list` scope. A column is `{ key, label, flex, align, minWidth, sortable, render }`; `renderCell`, `onRowPress`, `keyField` (default `"id"`), `loading` and `emptyTitle` / `emptyMessage`, `maxHeight` (480) and `showHeader` (`false` drops the wide header row) complete it. A sortable header is a 44px button named by its column and described by its sort, and a change of sort is announced once; with `onSortChange` the widget orders the rows (a server sort) and the table draws them as given, otherwise it sorts them itself (a `Date` as a date). A controlled `sort` without `onSortChange` is display-only, its headers plain labels. Use it by default for records; editable cells, grouped rows, resizable columns or a pivot are yours to build from `ListHeader` + `ListRow`.
|
|
3638
3642
|
- `Badge`, `Avatar`, `Progress`, `Stat`, `Divider` — the themed status pill, person picture, completion bar or ring, headline figure and rule the built-in widgets of the same names render through. Reach for them inside a record row instead of hand-rolling a pill or a circle from `View`.
|
|
3639
|
-
- `Grid` — balanced lines of cells sized from the grid's own measured width, on both hosts. `<Grid minCellWidth gap balance>`: `balance` `"cards"` (default) fits as many cells to a line as `minCellWidth` allows (240 when unset), fills every line but the last and pads that one with empty cells; `"tiles"` spreads the remainder and stretches each line (5 at 4 per line are 3 + 2), with `
|
|
3643
|
+
- `Grid` — balanced lines of cells sized from the grid's own measured width, on both hosts. `<Grid minCellWidth gap balance>`: `balance` `"cards"` (default) fits as many cells to a line as `minCellWidth` allows (240 when unset), fills every line but the last and pads that one with empty cells; `"tiles"` spreads the remainder and stretches each line (5 at 4 per line are 3 + 2), with what fits at `minCellWidth` or the width tier (4 / 3 / 2) as the ceiling, which `maxColumns` only lowers. `columns` fixes the count per line; `cell={{ min, max }}` with `square` makes definite-size cells (calendar days, seats, swatches) in a centred block. It measures an inner box with no padding, and `gap` is a theme spacing name or a number. Each child keeps its own look, and a child with `flex: 1` fills its cell's height. Use it by default for card grids, tile rows and capped cells; masonry or spanning cells are yours to lay out with `useContainerWidth()`.
|
|
3640
3644
|
- `Form`, `FieldRow`, `FormSection`, `FormActions`, `FormField` — a form laid out in width tiers from its own measured width, on both hosts: `<Form columns maxWidth gap>` puts its fields one to a line when narrow, two at medium and up to three when wide (`columns` is the wide ceiling), capped near 1000px and centred (`maxWidth={null}` for none). A `<FormField>`, or a `<TextField>`, `<Select>`, `<RadioGroup>`, `<PeoplePicker>` or `<FileUpload>` with its own label, is one field; a multiline field, `<FormField span="full">`, `<FieldRow>` (short related fields on one line, stacked when narrow), `<FormSection title description>` and `<FormActions>` (Save / Cancel in normal flow, secondary first and primary last, a trailing row or a full-width stack when narrow) take the whole line. `<FormField label required helper error>` draws the form controls' label, required mark, helper and error round any control and names it for a screen reader; a control that frames its own label is handed them instead, so one label is drawn. `required` (also on `TextField`, `Select`, `RadioGroup`, `PeoplePicker`, `FileUpload`) draws the mark and adds "Required" to the spoken name; it does not validate. Use it by default; a multi-step wizard, a form beside a live preview or fields laid over a picture are yours to lay out with `useContainerWidth()`.
|
|
3641
3645
|
- `SortableList`, `Board` — drag and drop on both hosts. `<SortableList items onReorder renderItem>` is a list the user reorders, each row a `<ListRow>`; `<Board columns items getColumn onMove renderCard>` is cards moved between columns, each a `<Card>`. Both own the grip handle, the lifted copy, the vacated slot, the drop highlight in the soft primary, the spring back of a cancelled drag and a narrow board's sideways scroll, and give a user who cannot drag the same moves: a tap or Enter on the handle opens its move options, the arrow keys move it on the web, a screen reader gets them as actions, and each move is announced. `onReorder(nextItems, { from, to, item })` and `onMove(item, { fromColumn, toColumn, index })` run once per real change. Use them by default; a drag they cannot express (free-form positioning, a drag between two widgets) is yours to build with `Animated` + `PanResponder`.
|
|
3642
3646
|
- `Card`, `Button`, `TextField` — the themed card surface, button and text field the built-in widgets render through. With no props each takes the app's look from Design > Components (Cards, Buttons, Inputs); never hand-roll one from `View` / `Pressable` / a bare `TextInput`. `<TextField leadingIcon trailingIcon onTrailingPress trailingAccessibilityLabel>` draws icons inside the field's own border.
|
package/dist/grid-logic.js
CHANGED
|
@@ -148,16 +148,9 @@ export function planGrid(input) {
|
|
|
148
148
|
|
|
149
149
|
const counted = minCellWidth !== null && minCellWidth > 0 ? minCellWidth : null;
|
|
150
150
|
if (balance === "tiles") {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
max = capped(cellsPerLine(width, gap, counted));
|
|
155
|
-
} else if (maxColumns) {
|
|
156
|
-
max = maxColumns;
|
|
157
|
-
} else {
|
|
158
|
-
if (width === 0) return null;
|
|
159
|
-
max = TILE_COLUMNS_BY_TIER[widthTier(width)];
|
|
160
|
-
}
|
|
151
|
+
if (width === 0) return null;
|
|
152
|
+
// maxColumns only lowers the ceiling: four tiles never share a phone's line.
|
|
153
|
+
const max = capped(counted ? cellsPerLine(width, gap, counted) : TILE_COLUMNS_BY_TIER[widthTier(width)]);
|
|
161
154
|
return { lengths: tileLineLengths(count, max), slots: null, cellSize: null, blockWidth: null };
|
|
162
155
|
}
|
|
163
156
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2859,8 +2859,9 @@ export type GridGap = "xs" | "sm" | "md" | "lg" | "xl" | number;
|
|
|
2859
2859
|
* above. 6 that fit 5 are 3 + 3.
|
|
2860
2860
|
* - `balance="tiles"`: the remainder spreads over every line and each line
|
|
2861
2861
|
* stretches, so 5 tiles at 4 per line are 3 + 2, never 4 + 1. The per-line
|
|
2862
|
-
* ceiling is
|
|
2863
|
-
*
|
|
2862
|
+
* ceiling is what fits at `minCellWidth`, or else 4 / 3 / 2 for the wide /
|
|
2863
|
+
* medium / narrow width tier; `maxColumns` only lowers it, so
|
|
2864
|
+
* `maxColumns={4}` is still 2 a line on a phone.
|
|
2864
2865
|
* - `columns`: exactly that many cells per line, the last line padded.
|
|
2865
2866
|
* - `cell={{ min, max }}`: definite-size cells (calendar days, seats,
|
|
2866
2867
|
* swatches) as large as fit up to `max`, never below `min` (32 when unset),
|
|
@@ -2883,6 +2884,7 @@ export const Grid: (props: {
|
|
|
2883
2884
|
balance?: GridBalance;
|
|
2884
2885
|
/** The narrowest a cell may be; the per-line count is derived from it. */
|
|
2885
2886
|
minCellWidth?: number;
|
|
2887
|
+
/** Lowers the per-line ceiling; never raises it past what the width allows. */
|
|
2886
2888
|
maxColumns?: number;
|
|
2887
2889
|
columns?: number;
|
|
2888
2890
|
cell?: { min?: number; max: number };
|
package/package.json
CHANGED