@cscfi/csc-ui 4.0.0-alpha.16 → 4.0.0-alpha.18

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,8 +1,17 @@
1
+ interface CToolbarProps {
2
+ /**
3
+ * Keep the toolbar in the page flow so it scrolls away with the content
4
+ * instead of staying pinned to the top of its scroll container
5
+ */
6
+ static?: boolean;
7
+ }
1
8
  declare var __VLS_1: {};
2
9
  type __VLS_Slots = {} & {
3
10
  default?: (props: typeof __VLS_1) => any;
4
11
  };
5
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
+ declare const __VLS_base: import("vue").DefineComponent<CToolbarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CToolbarProps> & Readonly<{}>, {
13
+ static: boolean;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
15
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
16
  declare const _default: typeof __VLS_export;
8
17
  export default _default;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Scroll strip: a single-row list that scrolls sideways when it is wider
3
+ * than its box — the tab strip of `c-tab-buttons` (CONTEXT.md "Tab
4
+ * buttons"). Built on a native horizontal scroll container with its
5
+ * scrollbar hidden, so touch panning, momentum and keyboard focus
6
+ * scrolling come from the browser; this composable adds what a bare
7
+ * scroller lacks: overflow state for edge arrows, an arrow step, mouse
8
+ * drag, a vertical-wheel translation and a `reveal` that brings one child
9
+ * into view without scrolling the page.
10
+ */
11
+ import type { Ref } from 'vue';
12
+ export interface ScrollStrip {
13
+ /** Scroll back by half the visible width. */
14
+ back(): void;
15
+ /** True while the strip can scroll back (its start is out of view). */
16
+ canBack: Ref<boolean>;
17
+ /** True while the strip can scroll forward (its end is out of view). */
18
+ canForward: Ref<boolean>;
19
+ /** Scroll forward by half the visible width. */
20
+ forward(): void;
21
+ /**
22
+ * Mouse drag scrolling: bind to the scroller's `pointerdown`. Touch and
23
+ * pen pan natively and are ignored here. A drag that moved swallows the
24
+ * `click` it would otherwise end in.
25
+ */
26
+ onPointerDown(event: PointerEvent): void;
27
+ /**
28
+ * Translate a vertical wheel into horizontal scrolling while the strip
29
+ * overflows: bind to the scroller's `wheel`.
30
+ */
31
+ onWheel(event: WheelEvent): void;
32
+ /** True while the content is wider than the scroller. */
33
+ overflowing: Ref<boolean>;
34
+ /** Scroll the strip just enough to bring `el` fully into view. */
35
+ reveal(el: Element | null | undefined): void;
36
+ /** Re-read the overflow state (after content changed size). */
37
+ update(): void;
38
+ }
39
+ export declare const useScrollStrip: (scroller: Ref<HTMLElement | null>) => ScrollStrip;
@@ -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;
@@ -1212,6 +1212,7 @@ export interface CSideNavigationElementEventMap {
1212
1212
  */
1213
1213
  'change:menu-visible': CustomEvent<boolean>;
1214
1214
  }
1215
+ /** The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile. */
1215
1216
  export interface CSideNavigationElement extends Omit<HTMLElement, 'menuVisible' | 'mobile' | 'styles'> {
1216
1217
  /** Mobile version menu visibility */
1217
1218
  menuVisible?: boolean;
@@ -1671,7 +1672,13 @@ export interface CToastsElement extends Omit<HTMLElement, 'absolute' | 'horizont
1671
1672
  /** Remove a message by id (id should be specified in the addToast params) */
1672
1673
  removeToast(id: string): void;
1673
1674
  }
1674
- export interface CToolbarElement extends HTMLElement {
1675
+ /** 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. */
1676
+ export interface CToolbarElement extends Omit<HTMLElement, 'static'> {
1677
+ /**
1678
+ * Keep the toolbar in the page flow so it scrolls away with the content
1679
+ * instead of staying pinned to the top of its scroll container
1680
+ */
1681
+ static?: boolean;
1675
1682
  }
1676
1683
  /** Events dispatched by `<c-tooltip>`. */
1677
1684
  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.16",
3
+ "version": "4.0.0-alpha.18",
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",