@getflip/swirl-ai 0.528.0 → 0.529.0

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.
@@ -14,6 +14,7 @@ The SwirlPopoverTrigger component is used to position and open a referenced [Swi
14
14
  - `hoverDelay` (number | undefined) –
15
15
  - `hoverLingerDuration` (number | undefined) –
16
16
  - `setAriaAttributes` (boolean | undefined) –
17
+ - `trigger` (SwirlPopoverTriggerMethod[] | string | undefined) –
17
18
  - `triggerOnClick` (boolean | undefined) –
18
19
  - `triggerOnHover` (boolean | undefined) –
19
20
  - `parentScrollContainer` (HTMLElement | undefined) –
@@ -48,8 +49,14 @@ _None._
48
49
 
49
50
  ### Keyboard
50
51
 
51
- Keyboard behavior is defined by the associated SwirlPopover (e.g. Enter/Space to
52
- open, Escape to close).
52
+ | Key | Function |
53
+ | --------------------------- | ---------------------------------------------------------------------------- |
54
+ | <kbd>Tab</kbd> | Moves focus to the trigger, opening the popover when `"focus"` is active. |
55
+ | <kbd>Escape</kbd> | Closes the popover while the trigger has focus. |
56
+ | <kbd>Enter</kbd>/<kbd>Space</kbd> | Toggles the popover when `"click"` is active (native button behavior). |
57
+
58
+ Further keyboard behavior (moving focus within the popover, closing on
59
+ outside click) is defined by the associated SwirlPopover.
53
60
 
54
61
  ## Minimal example
55
62
 
@@ -79,6 +79,11 @@ The SwirlPopover component is used to display small non-modal dialogs or menus.
79
79
  - After closing, the focus is returned to the trigger.
80
80
  - Moving focus outside the popover closes it.
81
81
 
82
+ ⚠️ **Hover/focus-triggered popovers behave differently:** when opened via
83
+ [swirl-popover-trigger](?path=/docs/components-swirlpopovertrigger--docs)'s
84
+ `"hover"` or `"focus"` trigger, focus is never moved into the popover content,
85
+ and focus is never returned to the trigger on close.
86
+
82
87
  ## Minimal example
83
88
 
84
89
  ```html
@@ -48311,7 +48311,7 @@
48311
48311
  {
48312
48312
  "name": "via",
48313
48313
  "type": {
48314
- "text": "\"click\" | \"hover\" | \"programmatic\"",
48314
+ "text": "\"click\" | \"focus\" | \"hover\" | \"programmatic\"",
48315
48315
  "references": [
48316
48316
  {
48317
48317
  "name": "Promise",
@@ -48374,7 +48374,7 @@
48374
48374
  {
48375
48375
  "name": "via",
48376
48376
  "type": {
48377
- "text": "\"click\" | \"hover\" | \"programmatic\"",
48377
+ "text": "\"click\" | \"focus\" | \"hover\" | \"programmatic\"",
48378
48378
  "references": [
48379
48379
  {
48380
48380
  "name": "Promise",
@@ -48445,7 +48445,7 @@
48445
48445
  "name": "popover__scroll-container"
48446
48446
  }
48447
48447
  ],
48448
- "description": "The SwirlPopover component is used to display small non-modal dialogs or menus.\n\nAccessibility\n\n### ARIA\n\n| ARIA | Usage |\n| --------------- | ------------------------------------------------------- |\n| `role=\"dialog\"` | The popover content has `role` set to `dialog`. |\n| `aria-label` | Describes the popover content. |\n| `aria-controls` | Associates the popover and its trigger. |\n| `aria-expanded` | Used on the trigger to convey the state of the popover. |\n| `aria-haspopup` | Set on the trigger to denote that it opens a popover. |\n\n### Keyboard\n\n| Key | Action |\n| ---------------- | -------------------------------------------- |\n| <kbd>ENTER</kbd> | Activates the trigger and opens the popover. |\n| <kbd>SPACE</kbd> | Activates the trigger and opens the popover. |\n| <kbd>ESC</kbd> | Closes the popover. |\n\n### Focus handling\n\n- Focus is moved to the popover content when opened.\n- After closing, the focus is returned to the trigger.\n- Moving focus outside the popover closes it."
48448
+ "description": "The SwirlPopover component is used to display small non-modal dialogs or menus.\n\nAccessibility\n\n### ARIA\n\n| ARIA | Usage |\n| --------------- | ------------------------------------------------------- |\n| `role=\"dialog\"` | The popover content has `role` set to `dialog`. |\n| `aria-label` | Describes the popover content. |\n| `aria-controls` | Associates the popover and its trigger. |\n| `aria-expanded` | Used on the trigger to convey the state of the popover. |\n| `aria-haspopup` | Set on the trigger to denote that it opens a popover. |\n\n### Keyboard\n\n| Key | Action |\n| ---------------- | -------------------------------------------- |\n| <kbd>ENTER</kbd> | Activates the trigger and opens the popover. |\n| <kbd>SPACE</kbd> | Activates the trigger and opens the popover. |\n| <kbd>ESC</kbd> | Closes the popover. |\n\n### Focus handling\n\n- Focus is moved to the popover content when opened.\n- After closing, the focus is returned to the trigger.\n- Moving focus outside the popover closes it.\n\n⚠️ **Hover/focus-triggered popovers behave differently:** when opened via\n[swirl-popover-trigger](?path=/docs/components-swirlpopovertrigger--docs)'s\n`\"hover\"` or `\"focus\"` trigger, focus is never moved into the popover content,\nand focus is never returned to the trigger on close."
48449
48449
  }
48450
48450
  ],
48451
48451
  "exports": [
@@ -48522,13 +48522,26 @@
48522
48522
  },
48523
48523
  "fieldName": "swirlPopover"
48524
48524
  },
48525
+ {
48526
+ "name": "trigger",
48527
+ "type": {
48528
+ "text": "SwirlPopoverTriggerMethod[] | string | undefined",
48529
+ "references": [
48530
+ {
48531
+ "name": "SwirlPopoverTriggerMethod"
48532
+ }
48533
+ ]
48534
+ },
48535
+ "fieldName": "trigger"
48536
+ },
48525
48537
  {
48526
48538
  "name": "trigger-on-click",
48527
48539
  "type": {
48528
48540
  "text": "boolean | undefined"
48529
48541
  },
48530
48542
  "default": "true",
48531
- "fieldName": "triggerOnClick"
48543
+ "fieldName": "triggerOnClick",
48544
+ "deprecated": "Please use the \"trigger\" prop instead, e.g. trigger=\"click\"."
48532
48545
  },
48533
48546
  {
48534
48547
  "name": "trigger-on-hover",
@@ -48536,7 +48549,8 @@
48536
48549
  "text": "boolean | undefined"
48537
48550
  },
48538
48551
  "default": "false",
48539
- "fieldName": "triggerOnHover"
48552
+ "fieldName": "triggerOnHover",
48553
+ "deprecated": "Please use the \"trigger\" prop instead, e.g. trigger=\"hover focus\"."
48540
48554
  }
48541
48555
  ],
48542
48556
  "members": [
@@ -48611,6 +48625,20 @@
48611
48625
  "readonly": true,
48612
48626
  "attribute": "swirl-popover"
48613
48627
  },
48628
+ {
48629
+ "kind": "field",
48630
+ "name": "trigger",
48631
+ "type": {
48632
+ "text": "SwirlPopoverTriggerMethod[] | string | undefined",
48633
+ "references": [
48634
+ {
48635
+ "name": "SwirlPopoverTriggerMethod"
48636
+ }
48637
+ ]
48638
+ },
48639
+ "readonly": true,
48640
+ "attribute": "trigger"
48641
+ },
48614
48642
  {
48615
48643
  "kind": "field",
48616
48644
  "name": "triggerOnClick",
@@ -48618,6 +48646,7 @@
48618
48646
  "text": "boolean | undefined"
48619
48647
  },
48620
48648
  "default": "true",
48649
+ "deprecated": "Please use the \"trigger\" prop instead, e.g. trigger=\"click\".",
48621
48650
  "readonly": true,
48622
48651
  "attribute": "trigger-on-click"
48623
48652
  },
@@ -48628,6 +48657,7 @@
48628
48657
  "text": "boolean | undefined"
48629
48658
  },
48630
48659
  "default": "false",
48660
+ "deprecated": "Please use the \"trigger\" prop instead, e.g. trigger=\"hover focus\".",
48631
48661
  "readonly": true,
48632
48662
  "attribute": "trigger-on-hover"
48633
48663
  }
@@ -48638,7 +48668,7 @@
48638
48668
  "description": "The trigger element (e.g. a button) that opens the popover."
48639
48669
  }
48640
48670
  ],
48641
- "description": "The SwirlPopoverTrigger component is used to position and open a referenced [SwirlPopover component](?path=/docs/components-swirlpopover--docs).\n\nAccessibility\n\n### ARIA\n\n| ARIA | Usage |\n| --------------- | -------------------------------------------------------------------- |\n| `aria-controls` | Set on the wrapped trigger element, referencing the popover element. |\n| `aria-expanded` | Set on the wrapped trigger element. |\n| `aria-haspopup` | Set to \"dialog\" on the wrapped trigger element. |\n\n### Keyboard\n\nKeyboard behavior is defined by the associated SwirlPopover (e.g. Enter/Space to\nopen, Escape to close)."
48671
+ "description": "The SwirlPopoverTrigger component is used to position and open a referenced [SwirlPopover component](?path=/docs/components-swirlpopover--docs).\n\nAccessibility\n\n### ARIA\n\n| ARIA | Usage |\n| --------------- | -------------------------------------------------------------------- |\n| `aria-controls` | Set on the wrapped trigger element, referencing the popover element. |\n| `aria-expanded` | Set on the wrapped trigger element. |\n| `aria-haspopup` | Set to \"dialog\" on the wrapped trigger element. |\n\n### Keyboard\n\n| Key | Function |\n| --------------------------- | ---------------------------------------------------------------------------- |\n| <kbd>Tab</kbd> | Moves focus to the trigger, opening the popover when `\"focus\"` is active. |\n| <kbd>Escape</kbd> | Closes the popover while the trigger has focus. |\n| <kbd>Enter</kbd>/<kbd>Space</kbd> | Toggles the popover when `\"click\"` is active (native button behavior). |\n\nFurther keyboard behavior (moving focus within the popover, closing on\noutside click) is defined by the associated SwirlPopover."
48642
48672
  }
48643
48673
  ],
48644
48674
  "exports": [
@@ -1,7 +1,7 @@
1
1
  import { ComputePositionReturn, Placement } from "@floating-ui/dom";
2
2
  import { EventEmitter } from "../../stencil-public-runtime";
3
3
  export type SwirlPopoverAnimation = "fade-in" | "scale-in-xy" | "scale-in-y";
4
- export type SwirlPopoverControlMethod = "click" | "hover" | "programmatic";
4
+ export type SwirlPopoverControlMethod = "click" | "hover" | "focus" | "programmatic";
5
5
  declare const swirlPopoverBorderRadiusTokens: readonly ["xs", "sm", "base", "l", "xl"];
6
6
  export type SwirlPopoverBorderRadius = (typeof swirlPopoverBorderRadiusTokens)[number] | string;
7
7
  /** Mirrors {@link https://floating-ui.com/docs/flip#fallbackaxissidedirection Floating UI `flip`}. */
@@ -1,4 +1,5 @@
1
1
  import { SwirlPopover } from "../swirl-popover/swirl-popover";
2
+ export type SwirlPopoverTriggerMethod = "click" | "hover" | "focus";
2
3
  /**
3
4
  * @slot slot - The trigger element (e.g. a button) that opens the popover.
4
5
  */
@@ -8,7 +9,10 @@ export declare class SwirlPopoverTrigger {
8
9
  parentScrollContainer?: HTMLElement;
9
10
  setAriaAttributes?: boolean;
10
11
  swirlPopover: string | HTMLSwirlPopoverElement | SwirlPopover;
12
+ trigger?: SwirlPopoverTriggerMethod[] | string;
13
+ /** @deprecated Please use the "trigger" prop instead, e.g. trigger="click". */
11
14
  triggerOnClick?: boolean;
15
+ /** @deprecated Please use the "trigger" prop instead, e.g. trigger="hover focus". */
12
16
  triggerOnHover?: boolean;
13
17
  hoverLingerDuration?: number;
14
18
  hoverDelay?: number;
@@ -18,11 +22,15 @@ export declare class SwirlPopoverTrigger {
18
22
  private hoverDelayReference?;
19
23
  private popoverElRef?;
20
24
  private triggerIsActive;
25
+ private triggerMethods;
21
26
  connectedCallback(): void;
27
+ componentWillLoad(): void;
22
28
  componentDidLoad(): void;
23
29
  disconnectedCallback(): void;
24
30
  watchPopover(): void;
25
- watchHover(): void;
31
+ watchTrigger(): void;
32
+ private warnAboutDeprecatedProps;
33
+ private resolveTriggerMethods;
26
34
  private getPopoverEl;
27
35
  private getTriggerEl;
28
36
  private setupIntersectionObserver;
@@ -32,13 +40,23 @@ export declare class SwirlPopoverTrigger {
32
40
  popoverMouseEnter: () => void;
33
41
  popoverMouseLeave: () => void;
34
42
  private onMouseenter;
35
- private mouseenterHandler;
36
43
  private onMouseleave;
37
44
  private mouseleaveHandler;
38
45
  private startHoverLingerTimer;
39
46
  private stopHoverLingerTimer;
40
47
  private onClick;
48
+ private onFocusin;
49
+ private onFocusout;
50
+ private onKeyDown;
51
+ private focusStaysWithin;
52
+ private ariaOpenHandler;
53
+ private ariaCloseHandler;
54
+ private removeAriaSyncListeners;
55
+ private syncAriaOnNextTransition;
56
+ private openPopover;
57
+ private closePopover;
41
58
  private updateTriggerElAriaAttributes;
59
+ private get opensWithoutActivation();
42
60
  private isPopoverOpen;
43
61
  render(): any;
44
62
  }
@@ -7,6 +7,19 @@ declare const _default: {
7
7
  type: string;
8
8
  };
9
9
  };
10
+ trigger: {
11
+ description: string;
12
+ control: {
13
+ type: string;
14
+ };
15
+ options: string[];
16
+ };
17
+ triggerOnClick: {
18
+ description: string;
19
+ };
20
+ triggerOnHover: {
21
+ description: string;
22
+ };
10
23
  };
11
24
  component: string;
12
25
  tags: string[];
@@ -55,6 +55,7 @@ import { SwirlOptionListItemContext, SwirlOptionListItemRole } from "./component
55
55
  import { SwirlPaginationVariant } from "./components/swirl-pagination/swirl-pagination";
56
56
  import { SwirlPopoverAnimation, SwirlPopoverBorderRadius, SwirlPopoverControlMethod, SwirlPopoverFallbackAxisSideDirection } from "./components/swirl-popover/swirl-popover";
57
57
  import { SwirlPopover } from "./components/swirl-popover/swirl-popover";
58
+ import { SwirlPopoverTriggerMethod } from "./components/swirl-popover-trigger/swirl-popover-trigger";
58
59
  import { SwirlProgressIndicatorSize, SwirlProgressIndicatorVariant } from "./components/swirl-progress-indicator/swirl-progress-indicator";
59
60
  import { SwirlRadioState, SwirlRadioVariant } from "./components/swirl-radio/swirl-radio";
60
61
  import { SwirlBoxPadding as SwirlBoxPadding1, SwirlResourceListSemantics } from "./components/swirl-resource-list/swirl-resource-list";
@@ -139,6 +140,7 @@ export { SwirlOptionListItemContext, SwirlOptionListItemRole } from "./component
139
140
  export { SwirlPaginationVariant } from "./components/swirl-pagination/swirl-pagination";
140
141
  export { SwirlPopoverAnimation, SwirlPopoverBorderRadius, SwirlPopoverControlMethod, SwirlPopoverFallbackAxisSideDirection } from "./components/swirl-popover/swirl-popover";
141
142
  export { SwirlPopover } from "./components/swirl-popover/swirl-popover";
143
+ export { SwirlPopoverTriggerMethod } from "./components/swirl-popover-trigger/swirl-popover-trigger";
142
144
  export { SwirlProgressIndicatorSize, SwirlProgressIndicatorVariant } from "./components/swirl-progress-indicator/swirl-progress-indicator";
143
145
  export { SwirlRadioState, SwirlRadioVariant } from "./components/swirl-radio/swirl-radio";
144
146
  export { SwirlBoxPadding as SwirlBoxPadding1, SwirlResourceListSemantics } from "./components/swirl-resource-list/swirl-resource-list";
@@ -4208,11 +4210,14 @@ export namespace Components {
4208
4210
  */
4209
4211
  "setAriaAttributes"?: boolean;
4210
4212
  "swirlPopover": string | HTMLSwirlPopoverElement | SwirlPopover;
4213
+ "trigger"?: SwirlPopoverTriggerMethod[] | string;
4211
4214
  /**
4215
+ * @deprecated Please use the "trigger" prop instead, e.g. trigger="click".
4212
4216
  * @default true
4213
4217
  */
4214
4218
  "triggerOnClick"?: boolean;
4215
4219
  /**
4220
+ * @deprecated Please use the "trigger" prop instead, e.g. trigger="hover focus".
4216
4221
  * @default false
4217
4222
  */
4218
4223
  "triggerOnHover"?: boolean;
@@ -14629,11 +14634,14 @@ declare namespace LocalJSX {
14629
14634
  */
14630
14635
  "setAriaAttributes"?: boolean;
14631
14636
  "swirlPopover": string | HTMLSwirlPopoverElement | SwirlPopover;
14637
+ "trigger"?: SwirlPopoverTriggerMethod[] | string;
14632
14638
  /**
14639
+ * @deprecated Please use the "trigger" prop instead, e.g. trigger="click".
14633
14640
  * @default true
14634
14641
  */
14635
14642
  "triggerOnClick"?: boolean;
14636
14643
  /**
14644
+ * @deprecated Please use the "trigger" prop instead, e.g. trigger="hover focus".
14637
14645
  * @default false
14638
14646
  */
14639
14647
  "triggerOnHover"?: boolean;
@@ -18429,6 +18437,7 @@ declare namespace LocalJSX {
18429
18437
  "hidePopoverWhenInvisible": boolean;
18430
18438
  "setAriaAttributes": boolean;
18431
18439
  "swirlPopover": string | HTMLSwirlPopoverElement | SwirlPopover;
18440
+ "trigger": SwirlPopoverTriggerMethod[] | string;
18432
18441
  "triggerOnClick": boolean;
18433
18442
  "triggerOnHover": boolean;
18434
18443
  "hoverLingerDuration": number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getflip/swirl-ai",
3
- "version": "0.528.0",
3
+ "version": "0.529.0",
4
4
  "description": "Swirl Design System AI package with artifacts for AI agents",
5
5
  "author": "Flip GmbH",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "lint": "tsc --noEmit"
27
27
  },
28
28
  "devDependencies": {
29
- "@getflip/swirl-components": "0.528.0",
29
+ "@getflip/swirl-components": "0.529.0",
30
30
  "@getflip/swirl-tokens": "2.14.3",
31
31
  "@types/node": "25.3.0",
32
32
  "tsx": "^4.7.0",