@cscfi/csc-ui 4.0.0-alpha.6 → 4.0.0-alpha.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.
@@ -703,13 +703,22 @@ export interface CMenuElementEventMap {
703
703
  value: unknown;
704
704
  }>;
705
705
  }
706
- export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position'> {
706
+ export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position' | 'trigger'> {
707
707
  /** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
708
708
  distance?: number | string;
709
709
  /** Whether the menu is open. Two-way: emits `change:open`. */
710
710
  open?: boolean;
711
711
  /** Preferred placement of the panel relative to the trigger. */
712
712
  position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
713
+ /**
714
+ * Designated trigger: an element elsewhere in the document that opens the
715
+ * menu — its document ID, or the element itself. The same trigger concept
716
+ * as the `trigger` slot, supplied by reference: the menu wires
717
+ * click-to-toggle, arrow-key opening, ARIA and focus return onto it and
718
+ * anchors the panel to it. When both routes are supplied, this prop wins
719
+ * over the slot.
720
+ */
721
+ trigger?: HTMLElement | string;
713
722
  addEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
714
723
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
715
724
  removeEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
@@ -910,7 +919,7 @@ export interface CPopoverElementEventMap {
910
919
  'change:open': CustomEvent<boolean>;
911
920
  }
912
921
  /** A click-opened, non-modal surface anchored to its trigger, floating in the top layer; its content may be interactive. */
913
- export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position'> {
922
+ export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position' | 'trigger'> {
914
923
  /** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
915
924
  distance?: number | string;
916
925
  /**
@@ -924,6 +933,14 @@ export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading
924
933
  open?: boolean;
925
934
  /** Preferred placement of the panel relative to the trigger. */
926
935
  position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
936
+ /**
937
+ * Designated trigger: an element elsewhere in the document that opens the
938
+ * popover — its document ID, or the element itself. The same trigger
939
+ * concept as the `trigger` slot, supplied by reference: the popover wires
940
+ * click-to-toggle, ARIA and focus return onto it and anchors the panel to
941
+ * it. When both routes are supplied, this prop wins over the slot.
942
+ */
943
+ trigger?: HTMLElement | string;
927
944
  addEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
928
945
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
929
946
  removeEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
@@ -1567,7 +1584,7 @@ export interface CTooltipElementEventMap {
1567
1584
  'change:open': CustomEvent<boolean>;
1568
1585
  }
1569
1586
  /** A non-interactive text hint shown when its trigger is hovered or keyboard-focused, floating in the top layer on the inverted surface tier. */
1570
- export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text'> {
1587
+ export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text' | 'trigger'> {
1571
1588
  /**
1572
1589
  * Delay before the tooltip shows on hover, in milliseconds. Keyboard focus
1573
1590
  * shows the tooltip immediately, regardless of this value. Defaults to
@@ -1585,6 +1602,15 @@ export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance'
1585
1602
  * populated.
1586
1603
  */
1587
1604
  text?: string;
1605
+ /**
1606
+ * Designated trigger: an element elsewhere in the document that the
1607
+ * tooltip describes — its document ID, or the element itself. The same
1608
+ * trigger concept as the `trigger` slot, supplied by reference: the
1609
+ * tooltip wires hover/focus, mirrors `aria-description` onto it and
1610
+ * anchors the bubble to it. When both routes are supplied, this prop wins
1611
+ * over the slot.
1612
+ */
1613
+ trigger?: HTMLElement | string;
1588
1614
  addEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
1589
1615
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1590
1616
  removeEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-alpha.6",
3
+ "version": "4.0.0-alpha.7",
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",