@dorsk/tsumikit 0.18.5 → 0.18.7

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.
@@ -1,7 +1,10 @@
1
1
  <script lang="ts">
2
2
  // Application frame: sticky header, optional sidebar, main content, optional
3
3
  // footer — all supplied as snippets. Responsive by default:
4
- // • desktop (≥ 48rem): the sidebar is a persistent grid column.
4
+ // • desktop (≥ 64rem): the sidebar is a persistent grid column.
5
+ // • tablet (48–64rem): the column narrows to an icon rail
6
+ // (--shell-rail-w, default 4.5rem); the `sidebar` container query lets
7
+ // nav content collapse to icons.
5
8
  // • mobile: the sidebar becomes an off-canvas drawer that slides in over a
6
9
  // scrim; AppShell renders the hamburger toggle for you (shown only on
7
10
  // mobile), locks body scroll while open, closes on Escape / scrim click,
@@ -172,7 +175,7 @@
172
175
  .shell {
173
176
  min-height: 100dvh;
174
177
  display: grid;
175
- grid-template-columns: 1fr;
178
+ grid-template-columns: minmax(0, 1fr);
176
179
  grid-template-rows: auto 1fr auto;
177
180
  grid-template-areas:
178
181
  'header'
@@ -264,7 +267,7 @@
264
267
  /* Desktop: persistent sidebar column; hide drawer chrome. */
265
268
  @media (min-width: 48rem) {
266
269
  .shell {
267
- grid-template-columns: var(--shell-sidebar-w) 1fr;
270
+ grid-template-columns: var(--shell-sidebar-w) minmax(0, 1fr);
268
271
  grid-template-areas:
269
272
  'header header'
270
273
  'sidebar main'
@@ -312,4 +315,18 @@
312
315
  background: var(--accent);
313
316
  }
314
317
  }
318
+
319
+ /* Tablet: the persistent column narrows to an icon rail so the content and
320
+ header keep room; the `sidebar` container query collapses nav content. */
321
+ @media (min-width: 48rem) and (max-width: 63.999rem) {
322
+ .shell {
323
+ grid-template-columns: var(--shell-rail-w, 4.5rem) minmax(0, 1fr);
324
+ }
325
+ .shell-sidebar {
326
+ width: auto;
327
+ }
328
+ .shell-sidebar-resize {
329
+ display: none;
330
+ }
331
+ }
315
332
  </style>
@@ -11,7 +11,12 @@
11
11
  // `max` caps each column's width: instead of growing to fill the row (the
12
12
  // default `1fr`), columns top out at `max` and the grid left-packs them
13
13
  // (auto-fill + justify-content:start) so a 3-item and a 4-item section both
14
- // show uniform fixed-width columns rather than stretching to fill. `align`
14
+ // show uniform fixed-width columns rather than stretching to fill. Beware:
15
+ // auto-fill counts tracks by a definite `max`, so column count only grows
16
+ // when another `max`-wide track fits — a narrow container can end up with
17
+ // one capped column and dead space. `fill` keeps empty tracks (auto-fill)
18
+ // without capping width: tracks are counted by `min`, so density rises
19
+ // monotonically with space and sparse rows don't stretch to fill. `align`
15
20
  // controls cross-axis alignment of items within their row; it defaults to
16
21
  // `start` so cards don't stretch to the tallest sibling.
17
22
  import type { Snippet } from 'svelte';
@@ -20,6 +25,7 @@
20
25
  as = 'div',
21
26
  min = '14rem',
22
27
  max,
28
+ fill = false,
23
29
  gap = 'var(--sp-4)',
24
30
  maxCols,
25
31
  align = 'start',
@@ -33,6 +39,10 @@
33
39
  /** Maximum column width. When set, columns stop growing at this width and
34
40
  * the grid left-packs uniform tracks instead of stretching to fill. */
35
41
  max?: string;
42
+ /** Keep empty tracks (auto-fill) without capping column width: columns are
43
+ * counted by `min`, so count grows monotonically with available space and
44
+ * sparse rows don't stretch to fill. Ignored when `max` is set. */
45
+ fill?: boolean;
36
46
  gap?: string;
37
47
  maxCols?: number;
38
48
  /** Cross-axis alignment of items in their row (align-items). Defaults to `start`. */
@@ -49,7 +59,7 @@
49
59
  let track = $derived(max != null ? max : '1fr');
50
60
  // auto-fill keeps capped tracks from stretching to fill the row; auto-fit
51
61
  // (the default) collapses empty tracks so columns expand to use the space.
52
- let mode = $derived(max != null ? 'auto-fill' : 'auto-fit');
62
+ let mode = $derived(max != null || fill ? 'auto-fill' : 'auto-fit');
53
63
  // Left-pack capped grids by default so columns don't drift to fill the row.
54
64
  let justifyValue = $derived(justify ?? (max != null ? 'start' : null));
55
65
 
@@ -5,6 +5,10 @@ type $$ComponentProps = {
5
5
  /** Maximum column width. When set, columns stop growing at this width and
6
6
  * the grid left-packs uniform tracks instead of stretching to fill. */
7
7
  max?: string;
8
+ /** Keep empty tracks (auto-fill) without capping column width: columns are
9
+ * counted by `min`, so count grows monotonically with available space and
10
+ * sparse rows don't stretch to fill. Ignored when `max` is set. */
11
+ fill?: boolean;
8
12
  gap?: string;
9
13
  maxCols?: number;
10
14
  /** Cross-axis alignment of items in their row (align-items). Defaults to `start`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dorsk/tsumikit",
3
- "version": "0.18.5",
3
+ "version": "0.18.7",
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",