@cscfi/csc-ui 4.0.0-alpha.15 → 4.0.0-alpha.17

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,10 +1,14 @@
1
1
  /**
2
2
  * Visual viewport tracking for the **fullscreen panel** (CONTEXT.md,
3
- * ADR-0050). A `position: fixed` top-layer surface sized with `100dvh` does
4
- * not shrink when the on-screen keyboard opens on iOS — only the
5
- * `visualViewport` API reports the visible box there. Both fullscreen
6
- * implementations (the anchored-panel composable and `c-dropdown`'s dialog)
7
- * follow it through this one helper while they are open.
3
+ * ADR-0050). Two layers. The *surface* — the panel element itself,
4
+ * `position: fixed; inset: 0` — spans the layout viewport, which the
5
+ * on-screen keyboard overlays but never shrinks, so it covers everything
6
+ * visible whatever the keyboard does. The *content box* inside it (heading
7
+ * row, search input, list) follows `visualViewport` — the only API that sees
8
+ * the iOS keyboard — so it ends above the keyboard. A late or wrong box then
9
+ * shows more surface, never the page. Both fullscreen implementations (the
10
+ * anchored-panel composable and `c-dropdown`'s dialog) go through this one
11
+ * helper while they are open.
8
12
  */
9
13
  /** Stop following the visual viewport. Idempotent. */
10
14
  export type StopTracking = () => void;
@@ -15,7 +19,7 @@ export interface ViewportBox {
15
19
  top: number;
16
20
  width: number;
17
21
  }
18
- /** The current visual viewport box; `null` where the API is missing (then size with `100dvh`). */
22
+ /** The current visual viewport box; `null` where the API is missing (then the content box fills the surface). */
19
23
  export declare const readVisualViewport: () => null | ViewportBox;
20
24
  /**
21
25
  * Report the visual viewport's box now and on every resize / scroll of it
@@ -25,11 +29,23 @@ export declare const readVisualViewport: () => null | ViewportBox;
25
29
  */
26
30
  export declare const trackVisualViewport: (onBox: (box: null | ViewportBox) => void) => StopTracking;
27
31
  /**
28
- * Inline declarations that make a `position: fixed` surface the visual
29
- * viewport's box — or, with no box, the layout viewport (`100dvh`). Both
30
- * override the UA popover / dialog defaults (`inset: 0`, fit-content sizing,
31
- * auto margins).
32
+ * Inline declarations that make a top-layer element the surface: the layout
33
+ * viewport's box. Overrides the UA popover / dialog defaults (`inset: 0` is
34
+ * theirs too, but with fit-content sizing and auto margins).
32
35
  */
33
- export declare const fullscreenBoxStyle: (box: null | ViewportBox) => string;
34
- /** The same box written straight onto an element's inline style (for a surface whose placement is imperative, like `c-dropdown`'s dialog). */
35
- export declare const applyFullscreenBox: (el: HTMLElement, box: null | ViewportBox) => void;
36
+ export declare const FULLSCREEN_SURFACE_STYLE = "position:fixed;inset:0;margin:0;width:auto;height:auto;";
37
+ /**
38
+ * Inline declarations placing the content box inside the surface on the
39
+ * visual viewport's box; with no box (no API) it fills the surface.
40
+ */
41
+ export declare const contentBoxStyle: (box: null | ViewportBox) => string;
42
+ /**
43
+ * `FULLSCREEN_SURFACE_STYLE` written straight onto an element's inline style,
44
+ * for a surface whose placement is imperative (`c-dropdown`'s dialog). Margins
45
+ * are left to its classes.
46
+ */
47
+ export declare const applyFullscreenSurface: (el: HTMLElement) => void;
48
+ /** `contentBoxStyle(box)` written straight onto an element's inline style. */
49
+ export declare const applyContentBox: (el: HTMLElement, box: null | ViewportBox) => void;
50
+ /** Remove exactly what `applyContentBox` set. */
51
+ export declare const clearContentBox: (el: HTMLElement) => void;
@@ -745,7 +745,7 @@ export interface CLoginCardContentElement extends HTMLElement {
745
745
  }
746
746
  export interface CLoginCardTitleElement extends HTMLElement {
747
747
  }
748
- /** Wrapper component for the whole page */
748
+ /** The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls. */
749
749
  export interface CMainElement extends Omit<HTMLElement, 'disableLayout'> {
750
750
  /** Disable the default dashboard layout */
751
751
  disableLayout?: boolean;
@@ -1671,7 +1671,13 @@ export interface CToastsElement extends Omit<HTMLElement, 'absolute' | 'horizont
1671
1671
  /** Remove a message by id (id should be specified in the addToast params) */
1672
1672
  removeToast(id: string): void;
1673
1673
  }
1674
- export interface CToolbarElement extends HTMLElement {
1674
+ /** The app-wide bar at the top of the dashboard layout: the logo, the service name and global actions such as the user menu or log out. It is pinned to the top of the viewport by default and stays there while the page scrolls; `static` keeps it in the page flow so it scrolls away with the content. */
1675
+ export interface CToolbarElement extends Omit<HTMLElement, 'static'> {
1676
+ /**
1677
+ * Keep the toolbar in the page flow so it scrolls away with the content
1678
+ * instead of staying pinned to the top of its scroll container
1679
+ */
1680
+ static?: boolean;
1675
1681
  }
1676
1682
  /** Events dispatched by `<c-tooltip>`. */
1677
1683
  export interface CTooltipElementEventMap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.17",
4
4
  "description": "Vue 3-based replacement for @cscfi/csc-ui — same custom element tag names, Vue v-model contract.",
5
5
  "type": "module",
6
6
  "main": "./dist/csc-ui.js",