carterkit 0.4.0__tar.gz → 0.5.0__tar.gz

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.
Files changed (93) hide show
  1. {carterkit-0.4.0 → carterkit-0.5.0}/PKG-INFO +1 -1
  2. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/buffer.py +8 -2
  3. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/control-def.md +5 -3
  4. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/gauge.md +10 -3
  5. carterkit-0.5.0/carterkit/controldocs/grid-dimensions.md +93 -0
  6. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/index.md +5 -0
  7. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/map.md +1 -1
  8. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/privacy.md +1 -1
  9. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/progress-ring.md +9 -1
  10. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/terms.md +1 -1
  11. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/layout.py +22 -8
  12. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/PKG-INFO +1 -1
  13. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/SOURCES.txt +1 -0
  14. {carterkit-0.4.0 → carterkit-0.5.0}/pyproject.toml +1 -1
  15. {carterkit-0.4.0 → carterkit-0.5.0}/LICENSE +0 -0
  16. {carterkit-0.4.0 → carterkit-0.5.0}/README.md +0 -0
  17. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/__init__.py +0 -0
  18. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/__main__.py +0 -0
  19. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/bind.py +0 -0
  20. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/catalog.py +0 -0
  21. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/cli.py +0 -0
  22. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/client.py +0 -0
  23. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/codegen.py +0 -0
  24. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/accordion.md +0 -0
  25. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/actions.md +0 -0
  26. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/animations.md +0 -0
  27. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/appearance.md +0 -0
  28. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/button.md +0 -0
  29. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/cardList.md +0 -0
  30. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/carousel.md +0 -0
  31. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/chat.md +0 -0
  32. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/color-picker.md +0 -0
  33. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/date-picker.md +0 -0
  34. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/divider.md +0 -0
  35. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/flip-card.md +0 -0
  36. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/graph.md +0 -0
  37. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/group-def.md +0 -0
  38. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/haptics.md +0 -0
  39. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/image.md +0 -0
  40. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/joystick.md +0 -0
  41. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/label.md +0 -0
  42. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/layout-config.md +0 -0
  43. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/list.md +0 -0
  44. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/log-console.md +0 -0
  45. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/long-press.md +0 -0
  46. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/picker.md +0 -0
  47. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/pulse.md +0 -0
  48. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/qr-code.md +0 -0
  49. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/segmented.md +0 -0
  50. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/slider.md +0 -0
  51. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/spacer.md +0 -0
  52. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/sparkline.md +0 -0
  53. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/status-light.md +0 -0
  54. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/stepper.md +0 -0
  55. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/sync.md +0 -0
  56. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/text-input.md +0 -0
  57. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/theming.md +0 -0
  58. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/toggle.md +0 -0
  59. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/visibility.md +0 -0
  60. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controldocs/web-view.md +0 -0
  61. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/controls.py +0 -0
  62. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/declare.py +0 -0
  63. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/dynamic.py +0 -0
  64. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/e2ee.py +0 -0
  65. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/grid.py +0 -0
  66. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/infer.py +0 -0
  67. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/py.typed +0 -0
  68. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/theming.py +0 -0
  69. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/tune.py +0 -0
  70. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit/validate.py +0 -0
  71. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/dependency_links.txt +0 -0
  72. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/entry_points.txt +0 -0
  73. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/requires.txt +0 -0
  74. {carterkit-0.4.0 → carterkit-0.5.0}/carterkit.egg-info/top_level.txt +0 -0
  75. {carterkit-0.4.0 → carterkit-0.5.0}/setup.cfg +0 -0
  76. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_bind.py +0 -0
  77. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_buffer.py +0 -0
  78. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_catalog.py +0 -0
  79. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_cli.py +0 -0
  80. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_client.py +0 -0
  81. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_codegen.py +0 -0
  82. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_controls.py +0 -0
  83. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_declare.py +0 -0
  84. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_dynamic.py +0 -0
  85. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_e2ee.py +0 -0
  86. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_grid.py +0 -0
  87. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_infer.py +0 -0
  88. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_layout.py +0 -0
  89. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_theming.py +0 -0
  90. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_tune.py +0 -0
  91. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_ui.py +0 -0
  92. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_validate.py +0 -0
  93. {carterkit-0.4.0 → carterkit-0.5.0}/tests/test_validate_bindings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: carterkit
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Build and drive CAR-TER layouts from Python — the control docs are the library.
5
5
  Author: Carter Beaudoin
6
6
  License-Expression: MIT
@@ -168,10 +168,16 @@ class LayoutBuffer:
168
168
  return ch
169
169
 
170
170
  def add_tab(self, title: str, icon: str = "square.grid.2x2",
171
- columns: int = DEFAULT_COLUMNS, rows: int = DEFAULT_ROWS) -> int:
171
+ columns: int = DEFAULT_COLUMNS, rows: int = DEFAULT_ROWS,
172
+ mode: str = None, row_height: int = None) -> int:
173
+ grid = {"columns": columns, "rows": rows}
174
+ if mode is not None:
175
+ grid["mode"] = mode
176
+ if row_height is not None:
177
+ grid["rowHeight"] = row_height
172
178
  self.tabs.append({
173
179
  "title": title, "icon": icon,
174
- "grid": {"columns": columns, "rows": rows}, "children": [],
180
+ "grid": grid, "children": [],
175
181
  })
176
182
  return len(self.tabs) - 1
177
183
 
@@ -19,8 +19,8 @@ Every control — regardless of type — shares the same base fields. A control
19
19
 
20
20
  | Field | Type | Default | Description |
21
21
  |-------|------|---------|-------------|
22
- | `span` | [rows, cols] | `[1, 1]` | Grid cells occupied (column width; **row count is advisory** see `controlHeight`) |
23
- | `controlHeight` | number | — | Explicit rendered height in points. The grid lays controls out as natural-height rows, so tall controls (`map`, `list`, `graph`, `sparkline`) need this to claim vertical space. Opt-in: omit to keep the control's intrinsic height. |
22
+ | `span` | [rowSpan, colSpan] | `[1, 1]` | Grid cells occupied. `colSpan` sets width; in a 2-D grid `rowSpan` sets height (`rowSpan × rowHeight`). Make a control bigger by spanning more cells. See [[grid-dimensions]]. |
23
+ | `controlHeight` | number | — | **Override** the grid-derived height with an exact point value. Rarely needed: in a 2-D grid the cell (`rowSpan × rowHeight`) is the height, and in a `flow` grid shaped controls auto-size to their aspect. Use it to pin a height the grid wouldn't otherwise give. See [[grid-dimensions]]. |
24
24
  | `label` | string | — | Display label for the control |
25
25
  | `defaultValue` | bool/number/string | — | Initial value before sync |
26
26
  | `action` | [[actions\|ActionDefinition]] | — | Command fired on interaction |
@@ -40,7 +40,8 @@ Every control — regardless of type — shares the same base fields. A control
40
40
  | `tint` | string | `"#667eea"` | Hex color for accents |
41
41
  | `style` | string | varies | Style variant (per control type) |
42
42
  | `hideLabel` | bool | `false` | Suppress the label |
43
- | `hideBackground` | bool | `false` | Remove the glass card background |
43
+ | `hideValue` | bool | `false` | Hide the numeric readout (e.g. a ring/gauge's center value) so the control becomes a pure compact visual that scales to fill its cell |
44
+ | `hideBackground` | bool | `false` | Remove the glass card behind the control — it floats on the page and fills its cell. Pairs with `hideValue` for a minimal glyph |
44
45
  | `formatValue` | string | — | Number formatter for displayed values (see below) |
45
46
 
46
47
  ## Value Types
@@ -90,6 +91,7 @@ The `theme` object overrides theme values for a single control. It accepts the s
90
91
  Common override keys: `accentColor`, `foregroundColor`, `secondaryColor`, `surfacePrimary`, `borderColor`, `borderWidth`, `cornerRadius`, `controlPadding`, `fontFamily`, `fontDesign`, `labelFontSize`, `valueFontSize`. Toggle/slider/progress controls also accept `trackColor`, `trackActiveColor`, `thumbColor`, `knobColor`, etc. See each control's **Theme Overrides** table for its specific keys, and [[theming]] for the full system.
91
92
 
92
93
  ## Related
94
+ - [[grid-dimensions]] — how `position` / `span` map to size; grid modes
93
95
  - [[group-def]] — containers for controls
94
96
  - [[layout-config]] — the top-level structure
95
97
  - [[theming]] — Theme system & live theme builder
@@ -43,8 +43,12 @@ fields:
43
43
  description: Rotates the arc start position in degrees
44
44
  - name: arcThickness
45
45
  type: number
46
- default: 8
47
- description: Arc stroke width in points
46
+ default: auto
47
+ description: Arc stroke width in points. Omit to auto-scale with the gauge's size.
48
+ - name: hideValue
49
+ type: bool
50
+ default: false
51
+ description: Show just the arc — hide the center value
48
52
  themeFields:
49
53
  - name: cornerRadius
50
54
  type: number
@@ -106,10 +110,13 @@ Inherits all [[shared-properties]]. Key fields:
106
110
  | `step` | number | `1` | Used to determine decimal formatting of center value |
107
111
  | `arcAngle` | number | `180` | Arc sweep in degrees (1-360) |
108
112
  | `arcRotation` | number | `0` | Rotates the arc start position in degrees |
109
- | `arcThickness` | number | `8` | Arc stroke width in points |
113
+ | `arcThickness` | number | auto | Arc stroke width in points. Omit to auto-scale with the gauge's size; set for an absolute width |
114
+ | `hideValue` | bool | `false` | Show just the arc — hide the center value (pairs with `hideBackground` for a compact glyph) |
110
115
 
111
116
  > **Note:** `gaugeStyle` is a shorthand alias. `"half"` sets `arcAngle: 180` and `"full"` sets `arcAngle: 360`. When `arcAngle` is set explicitly, it takes precedence over `gaugeStyle`.
112
117
 
118
+ > **Sizing:** the arc, stroke, and center value all scale to the gauge's size. A `half` gauge is wide (2:1); a `full` gauge is square (1:1) — give it ~3 `rowSpan` in a 2-D grid so it reads square. See [[grid-dimensions]].
119
+
113
120
  ## Gauge Segments
114
121
 
115
122
  Color zones that change based on the current value:
@@ -0,0 +1,93 @@
1
+ ---
2
+ type: grid-dimensions
3
+ label: Grid Dimensions
4
+ icon: square.grid.3x3
5
+ category: models
6
+ fields:
7
+ - name: columns
8
+ type: number
9
+ description: Number of columns the grid is divided into (required)
10
+ - name: rows
11
+ type: number
12
+ description: Number of rows the grid is divided into (required)
13
+ - name: mode
14
+ type: string
15
+ description: '"grid" (2-D, default) or "flow" (legacy row-banded)'
16
+ - name: rowHeight
17
+ type: number
18
+ description: Points per row-unit in 2-D mode (default 56)
19
+ ---
20
+
21
+ Every tab and every [[group-def|group]] lays its children out on a **grid** of
22
+ `columns` × `rows`. A child declares where it sits with `position: [row, col]`
23
+ and how many cells it covers with `span: [rowSpan, colSpan]` (see [[control-def]]).
24
+
25
+ ```json
26
+ "grid": { "columns": 4, "rows": 6 }
27
+ ```
28
+
29
+ ## Modes
30
+
31
+ | `mode` | Layout | Best for |
32
+ |--------|--------|----------|
33
+ | `"grid"` *(default)* | **True 2-D.** Each child occupies a real `row × col` rectangle. Columns divide the width evenly; rows are a fixed `rowHeight` unit. A child can span **both** axes, so a tall control can sit **beside** two stacked shorter ones (masonry / L-shapes). | Dashboards and mixed screens — gauges, rings, inputs, maps together. |
34
+ | `"flow"` | **Legacy row-banded.** Children are grouped by their row index into horizontal bands; `colSpan` sets proportional width but heights are natural (or `controlHeight`). `rowSpan` is ignored. | Full-page content (a single `map` / `chat` / `cardList` filling the tab) and pure forms where natural heights read best. |
35
+
36
+ `mode` is optional — omit it for the default 2-D grid. Set `"flow"` to opt a tab
37
+ or group out.
38
+
39
+ ```json
40
+ "grid": { "columns": 4, "rows": 8, "mode": "flow" }
41
+ ```
42
+
43
+ ## How spans map to size
44
+
45
+ | | 2-D (`"grid"`) | `"flow"` |
46
+ |--|----------------|----------|
47
+ | **`colSpan`** (width) | `colSpan / columns` of the row width | `colSpan / columns` of the row width |
48
+ | **`rowSpan`** (height) | `rowSpan × rowHeight` points | ignored — height is natural / `controlHeight` |
49
+
50
+ So in 2-D a 1×1 cell is genuinely small, and you make a control bigger by spanning
51
+ more cells. Visual controls scale all of their internals (stroke, glyph, font) to
52
+ the cell they're given — a small ring is tight and legible, a large ring is bold.
53
+
54
+ ## `rowHeight`
55
+
56
+ The height of one row-unit, in points (2-D mode only; default **56**). One unit is
57
+ a comfortable input row, so:
58
+
59
+ - inputs (`slider`, `toggle`, `segmentedControl`, …) sit in **1 row**,
60
+ - a square control (`progressRing`, full `gauge`) wants **~3 rows** to read square,
61
+ - tall content (`map`, `list`, `graph`, `image`) spans **as many rows as you give it**.
62
+
63
+ ```json
64
+ "grid": { "columns": 4, "rows": 10, "rowHeight": 64 }
65
+ ```
66
+
67
+ ## Sizing a control
68
+
69
+ You usually don't set a height at all — in 2-D the cell (`rowSpan × rowHeight`)
70
+ *is* the height, and in flow shaped controls auto-size to their natural aspect.
71
+ `controlHeight` (see [[control-def]]) is an **override** for the rare case you want
72
+ an exact point height regardless of the grid.
73
+
74
+ ## Example — a 2-D dashboard with an L-shape
75
+
76
+ ```json
77
+ {
78
+ "grid": { "columns": 4, "rows": 5 },
79
+ "children": [
80
+ { "type": "progressRing", "id": "cpu", "position": [0, 0], "span": [3, 2], "label": "CPU" },
81
+ { "type": "gauge", "id": "mem", "position": [0, 2], "span": [2, 2], "label": "Memory" },
82
+ { "type": "statusLight", "id": "net", "position": [2, 2], "span": [1, 2], "label": "Uplink" }
83
+ ]
84
+ }
85
+ ```
86
+
87
+ The CPU ring is a tall 2×2-plus block on the left; Memory and the Uplink light
88
+ stack to its right — placement that the flow renderer can't express.
89
+
90
+ ## Related
91
+ - [[control-def]] — `position`, `span`, `controlHeight`, `hideValue`, `hideBackground`
92
+ - [[group-def]] — a group has its own grid (and its own `mode`)
93
+ - [[layout-config]] — the top-level structure
@@ -125,6 +125,11 @@ A layout JSON file has this shape:
125
125
  }
126
126
  ```
127
127
 
128
+ Each tab lays its children out on a **2-D grid** — a control's `position` and `span`
129
+ place it in a `row × col` rectangle, so a tall control can sit beside two stacked
130
+ shorter ones. Set a grid's `mode` to `"flow"` for the simpler row-banded layout
131
+ (full-page content, plain forms). See [[grid-dimensions]].
132
+
128
133
  Tap any node in the graph to explore the full documentation for each control type, system feature, and data model.
129
134
 
130
135
  ---
@@ -71,7 +71,7 @@ Inherits all [[shared-properties]]. Key fields:
71
71
  | `mapStyle` | string | `"standard"` | `"standard"`, `"satellite"`, `"hybrid"` |
72
72
  | `mapInteractive` | bool | `true` | Allow user pan/zoom |
73
73
  | `mapZoom` | number | `0.01` | Default coordinate span in degrees |
74
- | `controlHeight` | number | `120` (min) | Rendered height in points. The map is only ~120pt tall by default; set this (e.g. `300`) for a full-screen-feel map. See [[control-def]]. |
74
+ | `controlHeight` | number | `120` (min) | In a 2-D grid, give the map more `rowSpan` for a taller map (height = `rowSpan × rowHeight`). In a `flow` grid it is ~120pt by default set this (e.g. `300`) for a full-screen-feel map. See [[grid-dimensions]]. |
75
75
  | `label` | string | — | Header label above the map |
76
76
  | `tint` | string | `"#667eea"` | Center point marker color |
77
77
 
@@ -49,4 +49,4 @@ We may update this policy; the effective date above reflects the latest version.
49
49
 
50
50
  ## Contact
51
51
 
52
- Questions or data requests: support@carterbeaudoin.com
52
+ Questions or data requests: support@carterbeaudoin.net
@@ -28,6 +28,10 @@ fields:
28
28
  - name: icon
29
29
  type: string
30
30
  description: SF Symbol in center (ring only)
31
+ - name: hideValue
32
+ type: bool
33
+ default: false
34
+ description: Show just the arc — hide the center value
31
35
  themeFields:
32
36
  - name: cornerRadius
33
37
  type: number
@@ -85,11 +89,15 @@ Inherits all [[shared-properties]]. Key fields:
85
89
  | `tint` | string | `"#667eea"` | Fill color |
86
90
  | `label` | string | — | Center text (ring) or header text (bar) |
87
91
  | `icon` | string | — | SF Symbol in center (ring only) |
92
+ | `hideValue` | bool | `false` | Show just the arc — hide the center value (pairs with `hideBackground` for a compact glyph) |
88
93
 
89
94
  ## Styles
90
95
 
91
96
  ### `"ring"` (default)
92
- Circular progress ring with percentage and optional label/icon in the center. Square aspect ratio.
97
+ Circular progress ring with percentage and optional label/icon in the center. The
98
+ stroke, number, icon, and label all scale to the ring's size, so a small cell stays
99
+ tight and a large one reads bold. Square aspect (1:1) — give it ~3 `rowSpan` in a
100
+ 2-D grid. Set `hideValue` (and `hideBackground`) for a bare ring glyph. See [[grid-dimensions]].
93
101
 
94
102
  ### `"bar"`
95
103
  Linear progress bar (thin horizontal bar). Header shows label and percentage.
@@ -37,4 +37,4 @@ Your use is also governed by our **Privacy Policy** at https://carterbeaudoin.ne
37
37
 
38
38
  ## 6. Changes and contact
39
39
 
40
- We may update these Terms; the effective date reflects the latest version. Questions: support@carterbeaudoin.com
40
+ We may update these Terms; the effective date reflects the latest version. Questions: support@carterbeaudoin.net
@@ -164,14 +164,20 @@ class _GridScope:
164
164
 
165
165
  def group(self, label=None, *, id=None, span=None, position=None, cols: int = 4,
166
166
  rows: int = 4, dynamic=None, visible=None, pulse=None,
167
- hide_background=None) -> "GroupHandle":
167
+ hide_background=None, mode: str = None, row_height: int = None) -> "GroupHandle":
168
168
  """Add a group container and return a handle you can `with`-enter to fill.
169
169
 
170
170
  `dynamic="event"` makes the group's children runtime-injectable (replaced by a
171
- broadcast with matching `msg_type` — build that payload with :class:`Fragment`)."""
171
+ broadcast with matching `msg_type` — build that payload with :class:`Fragment`).
172
+ `mode="flow"` opts this group out of the default 2-D grid; `row_height` sets the
173
+ 2-D row unit in points (default 56)."""
172
174
  gid = self._owner._unique_id(id or "group")
173
- g: dict = {"type": "group", "id": gid,
174
- "grid": {"columns": cols, "rows": rows}, "children": []}
175
+ grid: dict = {"columns": cols, "rows": rows}
176
+ if mode is not None:
177
+ grid["mode"] = mode
178
+ if row_height is not None:
179
+ grid["rowHeight"] = row_height
180
+ g: dict = {"type": "group", "id": gid, "grid": grid, "children": []}
175
181
  if label is not None:
176
182
  g["label"] = label
177
183
  if dynamic is not None:
@@ -304,19 +310,27 @@ class Layout:
304
310
  return self
305
311
 
306
312
  def tab(self, title: str, *, icon: str = "square.grid.2x2",
307
- cols: int = None, rows: int = 6, columns: int = None) -> TabHandle:
313
+ cols: int = None, rows: int = 6, columns: int = None,
314
+ mode: str = None, row_height: int = None) -> TabHandle:
308
315
  """Start a tab and make it current. First call configures the default tab;
309
316
  later calls append. `with ui.tab(...)` scopes controls to it; the flat form
310
- ``ui.tab("Main"); ui.gauge(...)`` works too."""
317
+ ``ui.tab("Main"); ui.gauge(...)`` works too. `mode="flow"` opts the tab out of
318
+ the default 2-D grid; `row_height` sets the 2-D row unit (points, default 56)."""
311
319
  cols = cols if cols is not None else (columns if columns is not None else 4)
320
+ grid = {"columns": cols, "rows": rows}
321
+ if mode is not None:
322
+ grid["mode"] = mode
323
+ if row_height is not None:
324
+ grid["rowHeight"] = row_height
312
325
  if not self._first_tab_used:
313
326
  t = self._buf.tabs[0]
314
327
  t["title"], t["icon"] = title, icon
315
- t["grid"] = {"columns": cols, "rows": rows}
328
+ t["grid"] = grid
316
329
  self._tab_index = 0
317
330
  self._first_tab_used = True
318
331
  else:
319
- self._tab_index = self._buf.add_tab(title, icon=icon, columns=cols, rows=rows)
332
+ self._tab_index = self._buf.add_tab(title, icon=icon, columns=cols, rows=rows,
333
+ mode=mode, row_height=row_height)
320
334
  self._scope = self._scope_for_tab(self._tab_index)
321
335
  return TabHandle(self, self._scope, self._tab_index)
322
336
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: carterkit
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Build and drive CAR-TER layouts from Python — the control docs are the library.
5
5
  Author: Carter Beaudoin
6
6
  License-Expression: MIT
@@ -41,6 +41,7 @@ carterkit/controldocs/divider.md
41
41
  carterkit/controldocs/flip-card.md
42
42
  carterkit/controldocs/gauge.md
43
43
  carterkit/controldocs/graph.md
44
+ carterkit/controldocs/grid-dimensions.md
44
45
  carterkit/controldocs/group-def.md
45
46
  carterkit/controldocs/haptics.md
46
47
  carterkit/controldocs/image.md
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "carterkit"
7
- version = "0.4.0"
7
+ version = "0.5.0"
8
8
  description = "Build and drive CAR-TER layouts from Python — the control docs are the library."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes