@justeattakeaway/pie-cookie-banner 1.10.21 → 1.11.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.
@@ -101,6 +101,13 @@ export declare interface CookieBannerProps {
101
101
  * When false (default), links open in a new browser tab (`target="_blank"`).
102
102
  */
103
103
  openLinksInSameTab?: boolean;
104
+ /**
105
+ * When true, focus moves to the banner dialog when it is displayed on mount,
106
+ * so screen readers announce it. Only set this when the banner is opened
107
+ * in response to a user action; on initial page load focus must remain untouched.
108
+ * When false (default), the banner does not take focus on mount.
109
+ */
110
+ shouldFocusOnOpen?: boolean;
104
111
  }
105
112
 
106
113
  export declare const Country: {
@@ -173,14 +180,22 @@ export declare class PieCookieBanner extends PieElement implements CookieBannerP
173
180
  country: string;
174
181
  language: string;
175
182
  openLinksInSameTab: boolean;
183
+ shouldFocusOnOpen: boolean;
176
184
  _preferencesNodes: NodeListOf<PieSwitch>;
185
+ private _bannerContainer;
177
186
  /**
178
187
  * Returns the target attribute value for external links based on the openLinksInSameTab prop.
179
188
  * - false (default): returns '_blank' (new tab)
180
189
  * - true: returns '_self' (same tab)
181
190
  */
182
191
  private get _linkTargetAttribute();
192
+ firstUpdated(): void;
183
193
  updated(changedProperties: PropertyValues<this>): Promise<void>;
194
+ /**
195
+ * Moves focus to the banner dialog container.
196
+ * The container uses tabindex="-1", so it is only focusable programmatically.
197
+ */
198
+ private _focusBanner;
184
199
  private _setLocaleBasedOnCountryAndLanguage;
185
200
  /**
186
201
  * Gets the locale string for the requested language and country.