@cscfi/csc-ui 4.0.0-rc.8 → 4.0.1

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,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@cscfi/csc-ui",
4
- "version": "4.0.0-rc.8",
4
+ "version": "4.0.1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -24,8 +24,8 @@ declare const _default: typeof __VLS_export;
24
24
  export default _default;
25
25
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CMenuProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CMenuProps> & Readonly<{}>, {
26
26
  open: boolean;
27
- distance: number;
28
27
  position: CMenuPosition;
28
+ distance: number;
29
29
  trigger: HTMLElement | string;
30
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
31
31
  trigger?: (props: {}) => any;
@@ -32,8 +32,8 @@ export default _default;
32
32
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CPopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CPopoverProps> & Readonly<{}>, {
33
33
  open: boolean;
34
34
  heading: string;
35
- distance: number;
36
35
  position: CPopoverPosition;
36
+ distance: number;
37
37
  trigger: HTMLElement | string;
38
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
39
39
  trigger?: (props: {}) => any;
@@ -55,9 +55,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CToast
55
55
  addToast: (message: CToastMessage) => string | undefined;
56
56
  removeToast: (id: string) => void;
57
57
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CToastsProps> & Readonly<{}>, {
58
+ position: CToastsPosition;
58
59
  absolute: boolean;
59
60
  vertical: CToastsVertical;
60
- position: CToastsPosition;
61
61
  contained: boolean;
62
62
  horizontal: CToastsHorizontal;
63
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -37,8 +37,8 @@ export default _default;
37
37
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTooltipProps> & Readonly<{}>, {
38
38
  text: string;
39
39
  open: boolean;
40
- distance: number;
41
40
  position: CTooltipPosition;
41
+ distance: number;
42
42
  trigger: HTMLElement | string;
43
43
  delay: number;
44
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -7,14 +7,11 @@
7
7
  * exactly as it does for a slotted one.
8
8
  *
9
9
  * Positioning: CSS anchor names are tree-scoped, so the shadow-DOM panel
10
- * cannot reference an `anchor-name` on an outer-tree element. Instead the
11
- * component keeps a *proxy anchor* — an inert, fixed-position box in its own
12
- * shadow root carrying the anchor name — and this composable pins it over
13
- * the designated trigger's rect while the panel is open (a rAF loop).
14
- * `position-area` placement and the `position-try-fallbacks` flip/shift keep
15
- * working unchanged; only the measurement is JS. Without native anchor
16
- * positioning the proxy is unused: Floating UI places the panel against the
17
- * designated element directly (`useFallbackPosition`, ADR-0056).
10
+ * cannot reference an `anchor-name` on an outer-tree element. Floating UI
11
+ * places the panel against the designated element in every browser
12
+ * (`useFallbackPosition` with `scripted`, ADR-0056 amended 2026-11-20); the
13
+ * fixed-position proxy anchor it replaced was misplaced by Safari 26 once
14
+ * the page scrolled.
18
15
  */
19
16
  import { type Ref } from 'vue';
20
17
  export interface DesignatedTriggerHandle {
@@ -22,9 +19,6 @@ export interface DesignatedTriggerHandle {
22
19
  element: Readonly<Ref<HTMLElement | null>>;
23
20
  /** Re-resolve the prop (an ID may match only after later DOM insertion). */
24
21
  resolve(): HTMLElement | null;
25
- /** Pin the proxy over the trigger every frame until `stopTracking`. */
26
- startTracking(): void;
27
- stopTracking(): void;
28
22
  }
29
23
  export interface UseDesignatedTriggerOptions {
30
24
  /** Tag name for console warnings (e.g. `c-popover`). */
@@ -33,8 +27,6 @@ export interface UseDesignatedTriggerOptions {
33
27
  listeners: Record<string, EventListener>;
34
28
  /** Resolved element changed — mirror/clean ARIA here. */
35
29
  onElementChange?: (el: HTMLElement | null, prev: HTMLElement | null) => void;
36
- /** The in-shadow proxy anchor to pin over the designated trigger. */
37
- proxy: Ref<HTMLElement | null>;
38
30
  /** The raw `trigger` prop: a document ID or an element reference. */
39
31
  source: () => HTMLElement | string | undefined;
40
32
  }
@@ -18,19 +18,32 @@
18
18
  * which Vue's next `:style` patch would wipe.
19
19
  *
20
20
  * On a browser with native support every method is a no-op and `style` stays
21
- * empty, so the native path is untouched — unless the panel is `scripted`,
22
- * placed this way in every browser. Floating UI is imported lazily, and
23
- * preloaded at setup where it will be needed so the first open does not wait
24
- * on it.
21
+ * empty, so the native path is untouched — unless the panel is `scripted`, or
22
+ * its anchor sits in a fixed or sticky box (`inFixedOrStickyBox`), decided at
23
+ * each open: those are placed this way in every browser (ADR-0056, amended
24
+ * 2026-11-20). The scripted style also switches the panel's own
25
+ * `position-area` and `position-try-fallbacks` off, which would otherwise
26
+ * still shape it. Floating UI is imported lazily, and preloaded where it will
27
+ * be needed so the first open does not wait on it. Call `start()` right after
28
+ * `showPopover()`: the placement then lands before the first paint, which the
29
+ * queued `toggle` event would miss.
25
30
  *
26
31
  * Each consumer's `fallbacks` mirror its `position-try-fallbacks` rule; keep
27
32
  * the two in step.
28
33
  */
29
- import { type Ref } from 'vue';
34
+ import { type MaybeRefOrGetter, type Ref } from 'vue';
30
35
  import type { Placement as PanelPlacement } from './positionArea';
31
36
  type Side = 'bottom' | 'left' | 'right' | 'top';
32
37
  /** True when the browser positions anchors without this fallback. */
33
38
  export declare const supportsAnchorPositioning: () => boolean;
39
+ /**
40
+ * True when `el` or a flat-tree ancestor is `position: fixed` or `sticky`: a
41
+ * box that does not scroll with the page, such as a pinned toolbar, or a
42
+ * top-layer panel or modal dialog (fixed by the UA). Safari 26's native
43
+ * positioning misplaces a panel anchored inside one by the scroll distance
44
+ * (ADR-0056, amended 2026-11-20).
45
+ */
46
+ export declare const inFixedOrStickyBox: (el: Element | null | undefined) => boolean;
34
47
  /** The `flip-block` try-tactic: mirror across the block axis. */
35
48
  export declare const flipBlock: (placement: PanelPlacement) => PanelPlacement;
36
49
  /** The `flip-inline` try-tactic: mirror across the inline axis. */
@@ -41,11 +54,14 @@ export declare const flipInline: (placement: PanelPlacement) => PanelPlacement;
41
54
  */
42
55
  export declare const flipChain: (placement: PanelPlacement) => PanelPlacement[];
43
56
  export interface FallbackPosition {
44
- /** Start positioning — call once the panel is open. */
57
+ /**
58
+ * Start positioning — call right after `showPopover()`. A second call
59
+ * while this open is already placed does nothing.
60
+ */
45
61
  start(): void;
46
62
  /** Stop tracking — call when the panel closes. */
47
63
  stop(): void;
48
- /** Declarations to append to the panel's inline style; empty with native support. */
64
+ /** Declarations to append to the panel's inline style; empty while native. */
49
65
  style: Readonly<Ref<string>>;
50
66
  }
51
67
  export interface UseFallbackPositionOptions {
@@ -63,9 +79,9 @@ export interface UseFallbackPositionOptions {
63
79
  * Place the panel with Floating UI in every browser, even where anchors are
64
80
  * positioned natively: a submenu, anchored inside the menu's own top-layer
65
81
  * panel, is left behind by Safari's native positioning once the page
66
- * scrolls.
82
+ * scrolls, and a designated trigger has no native anchor at all.
67
83
  */
68
- scripted?: boolean;
84
+ scripted?: MaybeRefOrGetter<boolean>;
69
85
  }
70
86
  export declare const useFallbackPosition: (options: UseFallbackPositionOptions) => FallbackPosition;
71
87
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-rc.8",
3
+ "version": "4.0.1",
4
4
  "description": "The CSC Design System's components as native custom elements: one set of c-* tags for plain HTML, Vue, React and Angular.",
5
5
  "type": "module",
6
6
  "main": "./dist/csc-ui.js",