@dorsk/tsumikit 0.41.0 → 0.42.0

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 CHANGED
@@ -211,7 +211,9 @@ their own `breakpoint`, so `selected` can be driven from the URL), Container, St
211
211
  (vertical), Cluster (wrapping row; `stackAt="xs|sm|md|lg"` makes it its own
212
212
  query container and stacks children full-width below 18/30/40/48rem — phone
213
213
  action rows without a viewport query), AutoGrid (intrinsically responsive
214
- columns — no media/container query needed).
214
+ columns — no media/container query needed; a child marked
215
+ `data-span="2|3|4|full"` claims that many tracks, so a primary action can sit
216
+ at 2 of 4 columns and take the whole row once the columns halve).
215
217
 
216
218
  ### Container
217
219
 
@@ -296,7 +298,9 @@ and drive `showModal()`/`close()` from state (closing writes `open = false`).
296
298
  `tone="danger" | "warn" | "info"` adds a title glyph and a 3px top border;
297
299
  `busy` makes the body inert, shows a spinner by the title and disables Escape,
298
300
  backdrop and the close button. The `footer` snippet is a right-aligned flex row
299
- (`justify-content: flex-end; gap: var(--sp-2)`).
301
+ (`justify-content: flex-end; gap: var(--sp-2)`); `footerFill` stretches its
302
+ children instead, for a footer that is one layout wrapper rather than a short
303
+ row of buttons.
300
304
 
301
305
  `ConfirmModal` wraps it as a yes/no dialog: `title`, `message` (or `children`),
302
306
  `confirmLabel`/`cancelLabel`, `tone="primary" | "danger" | "warn"`, `busy`,
@@ -148,6 +148,9 @@
148
148
  appearance: none;
149
149
  -webkit-appearance: none;
150
150
  flex: 1;
151
+ /* Firefox sizes a range input's min-content at ~12em, so without this it
152
+ refuses to shrink and paints over whatever shares its row. */
153
+ min-width: 0;
151
154
  position: relative;
152
155
  z-index: 1;
153
156
  height: 1.25rem;
@@ -104,6 +104,24 @@
104
104
  grid-template-columns: repeat(var(--ag-mode), minmax(min(100%, var(--ag-min)), var(--ag-track)));
105
105
  }
106
106
 
107
+ /* A child may claim several tracks (`data-span="2"`, `data-span="full"`) —
108
+ the grid counterpart to Cluster's `data-grow`. Handy for an action row
109
+ whose primary sits at 2/4 of a wide grid and takes the whole row once the
110
+ columns halve. A numeric span wider than the current column count would
111
+ add an implicit track, so pick one no larger than `maxCols`. */
112
+ .autogrid-c > :global([data-span='2']) {
113
+ grid-column: span 2;
114
+ }
115
+ .autogrid-c > :global([data-span='3']) {
116
+ grid-column: span 3;
117
+ }
118
+ .autogrid-c > :global([data-span='4']) {
119
+ grid-column: span 4;
120
+ }
121
+ .autogrid-c > :global([data-span='full']) {
122
+ grid-column: 1 / -1;
123
+ }
124
+
107
125
  /* Cap at N columns: the per-column floor becomes the larger of `min` and the
108
126
  width each column gets when N share the row (minus the N-1 gaps), so
109
127
  auto-fit stops adding tracks once N fit. `min(100%, …)` keeps it from
@@ -27,6 +27,7 @@
27
27
  onclose,
28
28
  body,
29
29
  footer,
30
+ footerFill = false,
30
31
  size = 'md',
31
32
  tone = 'neutral',
32
33
  busy = false,
@@ -44,6 +45,10 @@
44
45
  onclose?: () => void;
45
46
  body: Snippet;
46
47
  footer?: Snippet;
48
+ /** Let the footer's content own the full width instead of hugging the
49
+ * right edge — for a footer that is one layout wrapper (an AutoGrid of
50
+ * actions, say) rather than a short row of buttons. */
51
+ footerFill?: boolean;
47
52
  /** Title glyph + 3px top border in the semantic colour. */
48
53
  tone?: Tone;
49
54
  /** Work in flight: body is inert, a spinner sits by the title and Escape,
@@ -185,7 +190,7 @@
185
190
  {@render body()}
186
191
  </div>
187
192
  {#if footer}
188
- <div class="sheet-foot">{@render footer()}</div>
193
+ <div class="sheet-foot" class:foot-fill={footerFill}>{@render footer()}</div>
189
194
  {/if}
190
195
  {#if resizeKey}
191
196
  <div
@@ -319,6 +324,12 @@
319
324
  padding: var(--sp-4);
320
325
  border-top: 1px solid var(--border);
321
326
  }
327
+ /* Opt-in: a flex item is shrink-to-fit, so a layout wrapper handed to the
328
+ footer would size to its content and hug the right edge instead of
329
+ spanning the sheet. */
330
+ .sheet-foot.foot-fill > :global(*) {
331
+ flex: 1;
332
+ }
322
333
 
323
334
  .sheet-resize {
324
335
  display: none;
@@ -9,6 +9,10 @@ type $$ComponentProps = {
9
9
  onclose?: () => void;
10
10
  body: Snippet;
11
11
  footer?: Snippet;
12
+ /** Let the footer's content own the full width instead of hugging the
13
+ * right edge — for a footer that is one layout wrapper (an AutoGrid of
14
+ * actions, say) rather than a short row of buttons. */
15
+ footerFill?: boolean;
12
16
  /** Title glyph + 3px top border in the semantic colour. */
13
17
  tone?: Tone;
14
18
  /** Work in flight: body is inert, a spinner sits by the title and Escape,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorsk/tsumikit",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "Minimal, dependency-free Svelte 5 + pure-CSS UI kit. Token-driven atoms, molecules & layouts with theming out of the box.",
5
5
  "type": "module",
6
6
  "license": "MIT",