@fluentui/web-components 3.0.0-rc.12 → 3.0.0-rc.13

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.
@@ -2285,6 +2285,82 @@ export declare class BaseField extends FASTElement {
2285
2285
  setValidationStates(): void;
2286
2286
  }
2287
2287
 
2288
+ /**
2289
+ * A Base Menu List Custom HTML Element.
2290
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.
2291
+ *
2292
+ * @public
2293
+ */
2294
+ export declare class BaseMenuList extends FASTElement {
2295
+ /**
2296
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2297
+ *
2298
+ * @internal
2299
+ */
2300
+ elementInternals: ElementInternals;
2301
+ /**
2302
+ * @internal
2303
+ */
2304
+ items: HTMLElement[];
2305
+ protected itemsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void;
2306
+ protected menuItems: Element[] | undefined;
2307
+ /**
2308
+ * The index of the focusable element in the items array
2309
+ * defaults to -1
2310
+ */
2311
+ private focusIndex;
2312
+ private static focusableElementRoles;
2313
+ constructor();
2314
+ /**
2315
+ * @internal
2316
+ */
2317
+ connectedCallback(): void;
2318
+ /**
2319
+ * @internal
2320
+ */
2321
+ disconnectedCallback(): void;
2322
+ /**
2323
+ * @internal
2324
+ */
2325
+ readonly isNestedMenu: () => boolean;
2326
+ /**
2327
+ * Focuses the first item in the menu.
2328
+ *
2329
+ * @public
2330
+ */
2331
+ focus(): void;
2332
+ /**
2333
+ * @internal
2334
+ */
2335
+ handleMenuKeyDown(e: KeyboardEvent): void | boolean;
2336
+ /**
2337
+ * if focus is moving out of the menu, reset to a stable initial state
2338
+ * @internal
2339
+ */
2340
+ handleFocusOut: (e: FocusEvent) => void;
2341
+ private handleItemFocus;
2342
+ private removeItemListeners;
2343
+ private static elementIndent;
2344
+ protected setItems(): void;
2345
+ /**
2346
+ * Method for Observable changes to the hidden attribute of child elements
2347
+ */
2348
+ handleChange(source: any, propertyName: string): void;
2349
+ /**
2350
+ * Handle change from child MenuItem element and set radio group behavior
2351
+ */
2352
+ private changedMenuItemHandler;
2353
+ /**
2354
+ * check if the item is a menu item
2355
+ */
2356
+ protected isMenuItemElement: (el: Element) => el is HTMLElement;
2357
+ /**
2358
+ * check if the item is focusable
2359
+ */
2360
+ private isFocusableElement;
2361
+ private setFocus;
2362
+ }
2363
+
2288
2364
  /**
2289
2365
  * A Progress HTML Element.
2290
2366
  * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
@@ -2384,576 +2460,562 @@ export declare class BaseProgressBar extends FASTElement {
2384
2460
  }
2385
2461
 
2386
2462
  /**
2387
- * The base class used for constructing a fluent-rating-display custom element
2388
- *
2389
- * @slot icon - SVG element used as the rating icon
2463
+ * A Base Radio Group Custom HTML Element.
2464
+ * Implements the {@link https://w3c.github.io/aria/#radiogroup | ARIA `radiogroup` role}.
2390
2465
  *
2391
2466
  * @public
2392
2467
  */
2393
- export declare class BaseRatingDisplay extends FASTElement {
2394
- private numberFormatter;
2468
+ export declare class BaseRadioGroup extends FASTElement {
2395
2469
  /**
2396
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2397
- *
2398
- * @internal
2399
- */
2400
- elementInternals: ElementInternals;
2401
- /**
2402
- * Reference to the slot element used for the rating icon.
2470
+ * The index of the checked radio, scoped to the enabled radios.
2403
2471
  *
2404
2472
  * @internal
2405
2473
  */
2406
- iconSlot: HTMLSlotElement;
2474
+ protected checkedIndex: number;
2407
2475
  /**
2408
- * Updates the icon when the referenced slot is bound in the template.
2476
+ * Sets the checked state of the nearest enabled radio when the `checkedIndex` changes.
2409
2477
  *
2478
+ * @param prev - the previous index
2479
+ * @param next - the current index
2410
2480
  * @internal
2411
2481
  */
2412
- iconSlotChanged(): void;
2413
- protected defaultCustomIconViewBox: string;
2482
+ protected checkedIndexChanged(prev: number | undefined, next: number): void;
2414
2483
  /**
2415
- * The element that displays the rating icons.
2416
- * @internal
2484
+ * Indicates that the value has been changed by the user.
2417
2485
  */
2418
- display: HTMLElement;
2486
+ private dirtyState;
2419
2487
  /**
2420
- * The number of ratings.
2488
+ * Disables the radio group and child radios.
2421
2489
  *
2422
2490
  * @public
2423
2491
  * @remarks
2424
- * HTML Attribute: `count`
2492
+ * HTML Attribute: `disabled`
2425
2493
  */
2426
- count?: number;
2494
+ disabled: boolean;
2427
2495
  /**
2428
- * The `viewBox` attribute of the icon <svg> element.
2496
+ * Sets the `disabled` attribute on all child radios when the `disabled` property changes.
2429
2497
  *
2430
- * @public
2431
- * @remarks
2432
- * HTML Attribute: `icon-view-box`
2433
- * @deprecated Add `viewBox` attribute on the custom SVG directly.
2498
+ * @param prev - the previous disabled value
2499
+ * @param next - the current disabled value
2500
+ * @internal
2434
2501
  */
2435
- iconViewBox?: string;
2502
+ protected disabledChanged(prev?: boolean, next?: boolean): void;
2436
2503
  /**
2437
- * The maximum possible value of the rating.
2438
- * This attribute determines the number of icons displayed.
2439
- * Must be a whole number greater than 1.
2504
+ * The value of the checked radio.
2440
2505
  *
2441
2506
  * @public
2442
2507
  * @remarks
2443
- * HTML Attribute: `max`
2508
+ * HTML Attribute: `value`
2444
2509
  */
2445
- max?: number;
2446
- protected maxChanged(): void;
2510
+ initialValue?: string;
2447
2511
  /**
2448
- * The value of the rating.
2512
+ * Sets the matching radio to checked when the value changes. If no radio matches the value, no radio will be checked.
2513
+ *
2514
+ * @param prev - the previous value
2515
+ * @param next - the current value
2516
+ */
2517
+ initialValueChanged(prev: string | undefined, next: string | undefined): void;
2518
+ /**
2519
+ * The name of the radio group.
2449
2520
  *
2450
2521
  * @public
2451
2522
  * @remarks
2452
- * HTML Attribute: `value`
2523
+ * HTML Attribute: `name`
2453
2524
  */
2454
- value?: number;
2455
- protected valueChanged(): void;
2456
- constructor();
2457
- connectedCallback(): void;
2525
+ name: string;
2458
2526
  /**
2459
- * Returns "count" as string, formatted according to the locale.
2527
+ * Sets the `name` attribute on all child radios when the `name` property changes.
2460
2528
  *
2461
2529
  * @internal
2462
2530
  */
2463
- get formattedCount(): string;
2464
- /** @internal */
2465
- handleSlotChange(): void;
2466
- protected renderSlottedIcon(svg: SVGSVGElement | null): void;
2467
- protected setCustomPropertyValue(propertyName: PropertyNameForCalculation): void;
2468
- }
2469
-
2470
- /**
2471
- * The base class used for constructing a fluent-spinner custom element
2472
- * @public
2473
- */
2474
- export declare class BaseSpinner extends FASTElement {
2531
+ protected nameChanged(prev: string | undefined, next: string | undefined): void;
2475
2532
  /**
2476
- * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2533
+ * The orientation of the group.
2477
2534
  *
2478
- * @internal
2535
+ * @public
2536
+ * @remarks
2537
+ * HTML Attribute: `orientation`
2479
2538
  */
2480
- elementInternals: ElementInternals;
2481
- constructor();
2482
- }
2483
-
2484
- /**
2485
- * A Tablist element that wraps a collection of tab elements
2486
- * @public
2487
- */
2488
- export declare class BaseTablist extends FASTElement {
2539
+ orientation?: RadioGroupOrientation;
2489
2540
  /**
2490
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2541
+ * Sets the ariaOrientation attribute when the orientation changes.
2491
2542
  *
2543
+ * @param prev - the previous orientation
2544
+ * @param next - the current orientation
2492
2545
  * @internal
2493
2546
  */
2494
- elementInternals: ElementInternals;
2547
+ orientationChanged(prev: RadioGroupOrientation | undefined, next: RadioGroupOrientation | undefined): void;
2495
2548
  /**
2496
- * Used for disabling all click and keyboard events for the tabs, child tab elements.
2549
+ * The collection of all child radios.
2550
+ *
2497
2551
  * @public
2498
- * @remarks
2499
- * HTML Attribute: disabled.
2500
2552
  */
2501
- disabled: boolean;
2553
+ radios: Radio[];
2502
2554
  /**
2503
- * Handles disabled changes
2504
- * @param prev - previous value
2505
- * @param next - next value
2555
+ * Updates the enabled radios collection when properties on the child radios change.
2506
2556
  *
2507
- * @internal
2557
+ * @param prev - the previous radios
2558
+ * @param next - the current radios
2508
2559
  */
2509
- protected disabledChanged(prev: boolean, next: boolean): void;
2560
+ radiosChanged(prev: Radio[] | undefined, next: Radio[] | undefined): void;
2510
2561
  /**
2511
- * The orientation
2562
+ * Indicates whether the radio group is required.
2563
+ *
2512
2564
  * @public
2513
2565
  * @remarks
2514
- * HTML Attribute: orientation
2566
+ * HTML Attribute: `required`
2515
2567
  */
2516
- orientation: TablistOrientation;
2568
+ required: boolean;
2569
+ /**
2570
+ *
2571
+ * @param prev - the previous required value
2572
+ * @param next - the current required value
2573
+ */
2574
+ requiredChanged(prev: boolean, next: boolean): void;
2517
2575
  /**
2576
+ * The collection of radios that are slotted into the default slot.
2577
+ *
2518
2578
  * @internal
2519
2579
  */
2520
- protected orientationChanged(prev: TablistOrientation, next: TablistOrientation): void;
2580
+ slottedRadios: Radio[];
2521
2581
  /**
2522
- * The id of the active tab
2582
+ * Updates the radios collection when the slotted radios change.
2523
2583
  *
2524
- * @public
2525
- * @remarks
2526
- * HTML Attribute: activeid
2584
+ * @param prev - the previous slotted radios
2585
+ * @param next - the current slotted radios
2527
2586
  */
2528
- activeid: string;
2587
+ slottedRadiosChanged(prev: Radio[] | undefined, next: Radio[]): void;
2529
2588
  /**
2589
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2590
+ *
2530
2591
  * @internal
2531
2592
  */
2532
- protected activeidChanged(oldValue: string, newValue: string): void;
2593
+ elementInternals: ElementInternals;
2533
2594
  /**
2534
- * Content slotted in the tab slot.
2595
+ * A collection of child radios that are not disabled.
2596
+ *
2535
2597
  * @internal
2536
2598
  */
2537
- slottedTabs: Node[];
2599
+ get enabledRadios(): Radio[];
2538
2600
  /**
2539
- * Updates the tabs property when content in the tabs slot changes.
2540
- * @internal
2601
+ * The form-associated flag.
2602
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
2603
+ *
2604
+ * @public
2541
2605
  */
2542
- slottedTabsChanged(prev: Node[] | undefined, next: Node[] | undefined): void;
2606
+ static formAssociated: boolean;
2543
2607
  /**
2608
+ * The fallback validation message, taken from a native checkbox `<input>` element.
2609
+ *
2544
2610
  * @internal
2545
2611
  */
2546
- tabs: Tab[];
2612
+ private _validationFallbackMessage;
2547
2613
  /**
2614
+ * The validation message. Uses the browser's default validation message for native checkboxes if not otherwise
2615
+ * specified (e.g., via `setCustomValidity`).
2616
+ *
2548
2617
  * @internal
2549
2618
  */
2550
- protected tabsChanged(prev: Tab[] | undefined, next: Tab[] | undefined): void;
2619
+ get validationMessage(): string;
2551
2620
  /**
2552
- * A reference to the active tab
2621
+ * The element's validity state.
2622
+ *
2553
2623
  * @public
2624
+ * @remarks
2625
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
2554
2626
  */
2555
- activetab: Tab;
2556
- private prevActiveTabIndex;
2557
- private activeTabIndex;
2558
- private tabIds;
2559
- private tabPanelMap;
2560
- private change;
2561
- private getActiveIndex;
2627
+ get validity(): ValidityState;
2562
2628
  /**
2563
- * Function that is invoked whenever the selected tab or the tab collection changes.
2629
+ * The current value of the checked radio.
2564
2630
  *
2565
2631
  * @public
2566
2632
  */
2567
- protected setTabs(): void;
2568
- private getTabIds;
2569
- private setComponent;
2570
- private handleTabClick;
2571
- private isHorizontal;
2572
- private handleTabKeyDown;
2633
+ get value(): string | null;
2634
+ set value(next: string | null);
2573
2635
  /**
2574
- * The adjust method for FASTTabs
2575
- * @public
2576
- * @remarks
2577
- * This method allows the active index to be adjusted by numerical increments
2636
+ * Sets the checked state of all radios when any radio emits a `change` event.
2637
+ *
2638
+ * @param e - the change event
2578
2639
  */
2579
- adjust(adjustment: number): void;
2580
- private activateTabByIndex;
2581
- private focusTab;
2582
- constructor();
2640
+ changeHandler(e: Event): boolean | void;
2583
2641
  /**
2642
+ * Checks the radio at the specified index.
2643
+ *
2644
+ * @param index - the index of the radio to check
2584
2645
  * @internal
2585
2646
  */
2586
- connectedCallback(): void;
2587
- }
2588
-
2589
- /**
2590
- * A Text Area Custom HTML Element.
2591
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | `<textarea>`} element.
2592
- *
2593
- * @slot - The default content/value of the component.
2594
- * @slot label - The content for the `<label>`, it should be a `<fluent-label>` element.
2595
- * @csspart label - The `<label>` element.
2596
- * @csspart root - The container element of the `<textarea>` element.
2597
- * @csspart control - The internal `<textarea>` element.
2598
- * @fires change - Fires after the control loses focus, if the content has changed.
2599
- * @fires select - Fires when the `select()` method is called.
2600
- *
2601
- * @public
2602
- */
2603
- export declare class BaseTextArea extends FASTElement {
2647
+ checkRadio(index?: number, shouldEmit?: boolean): void;
2604
2648
  /**
2605
- * The form-associated flag.
2606
- * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
2649
+ * Checks the validity of the element and returns the result.
2607
2650
  *
2608
2651
  * @public
2652
+ * @remarks
2653
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
2609
2654
  */
2610
- static readonly formAssociated = true;
2655
+ checkValidity(): boolean;
2611
2656
  /**
2612
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2657
+ * Handles click events for the radio group.
2613
2658
  *
2659
+ * @param e - the click event
2614
2660
  * @internal
2615
2661
  */
2616
- elementInternals: ElementInternals;
2617
- /**
2618
- * The `<label>` element.
2619
- * @internal
2620
- */
2621
- labelEl: HTMLLabelElement;
2622
- /**
2623
- * The root container element.
2624
- * @internal
2625
- */
2626
- rootEl: HTMLDivElement;
2627
- /**
2628
- * The `<textarea>` element.
2629
- * @internal
2630
- */
2631
- controlEl: HTMLTextAreaElement;
2662
+ clickHandler(e: MouseEvent): boolean | void;
2663
+ constructor();
2632
2664
  /**
2633
- * Sets up a mutation observer to watch for changes to the control element's
2634
- * attributes that could affect validity, and binds an input event listener to detect user interaction.
2665
+ * Focuses the checked radio or the first enabled radio.
2635
2666
  *
2636
2667
  * @internal
2637
2668
  */
2638
- protected controlElChanged(): void;
2669
+ focus(): void;
2639
2670
  /**
2671
+ * Enables tabbing through the radio group when the group receives focus.
2672
+ *
2673
+ * @param e - the focus event
2640
2674
  * @internal
2641
2675
  */
2642
- autoSizerEl?: HTMLDivElement;
2676
+ focusinHandler(e: FocusEvent): boolean | void;
2643
2677
  /**
2644
- * The list of nodes that are assigned to the default slot.
2678
+ * Sets the tabindex of the radios based on the checked state when the radio group loses focus.
2679
+ *
2680
+ * @param e - the focusout event
2645
2681
  * @internal
2646
2682
  */
2647
- defaultSlottedNodes: Node[];
2648
- protected defaultSlottedNodesChanged(): void;
2649
- private filteredLabelSlottedNodes;
2683
+ focusoutHandler(e: FocusEvent): boolean | void;
2684
+ formResetCallback(): void;
2685
+ private getEnabledIndexInBounds;
2650
2686
  /**
2651
- * The list of nodes that are assigned to the `label` slot.
2687
+ * Handles keydown events for the radio group.
2688
+ *
2689
+ * @param e - the keyboard event
2652
2690
  * @internal
2653
2691
  */
2654
- labelSlottedNodes: Label[];
2655
- protected labelSlottedNodesChanged(): void;
2656
- private userInteracted;
2657
- private autoSizerObserver?;
2658
- private controlElAttrObserver;
2659
- private preConnectControlEl;
2692
+ keydownHandler(e: KeyboardEvent): boolean | void;
2660
2693
  /**
2661
- * Indicates the element's autocomplete state.
2662
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete | `autocomplete`} attribute
2663
2694
  *
2664
- * @public
2665
- * @remarks
2666
- * HTML Attribute: `autocomplete`
2695
+ * @param e - the disabled event
2667
2696
  */
2668
- autocomplete?: TextAreaAutocomplete;
2697
+ disabledRadioHandler(e: CustomEvent): void;
2669
2698
  /**
2670
- * Indicates whether the element’s block size (height) should be automatically changed based on the content.
2671
- * Note: When this property’s value is set to be `true`, the element should not have a fixed block-size
2672
- * defined in CSS. Instead, use `min-height` or `min-block-size`.
2699
+ * Reports the validity of the element.
2673
2700
  *
2674
2701
  * @public
2675
2702
  * @remarks
2676
- * HTML Attribute: `auto-resize`
2703
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
2677
2704
  */
2678
- autoResize: boolean;
2679
- protected autoResizeChanged(): void;
2705
+ reportValidity(): boolean;
2680
2706
  /**
2681
- * Sets the name of the value directionality to be submitted with form data.
2682
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/dirname | `dirname`} attribute
2707
+ * Resets the `tabIndex` for all child radios when the radio group loses focus.
2683
2708
  *
2684
- * @public
2685
- * @remarks
2686
- * HTML Attribute: `dirname`
2709
+ * @internal
2687
2710
  */
2688
- dirName?: string;
2711
+ private restrictFocus;
2689
2712
  /**
2690
- * Sets the element's disabled state.
2691
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/disabled | `disabled`} attribute
2713
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
2692
2714
  *
2693
- * @public
2694
- * @remarks
2695
- * HTML Attribute: `disabled`
2715
+ * @internal
2696
2716
  */
2697
- disabled: boolean;
2698
- protected disabledChanged(): void;
2717
+ setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
2699
2718
  /**
2700
- * Indicates whether the element displays a box shadow. This only has effect when `appearance` is set to be `filled-darker` or `filled-lighter`.
2719
+ * Sets the validity of the element.
2701
2720
  *
2702
- * @public
2721
+ * @param flags - Validity flags to set.
2722
+ * @param message - Optional message to supply. If not provided, the element's `validationMessage` will be used.
2723
+ * @param anchor - Optional anchor to use for the validation message.
2724
+ *
2725
+ * @internal
2703
2726
  * @remarks
2704
- * HTML Attribute: `display-shadow`
2727
+ * RadioGroup validation is reported through the individual Radio elements rather than the RadioGroup itself.
2728
+ * This is necessary because:
2729
+ * 1. Each Radio is form-associated (extends BaseCheckbox which has `formAssociated = true`)
2730
+ * 2. Browser validation UIs and screen readers announce validation against individual form controls
2731
+ * 3. For groups like RadioGroup, the browser needs to report the error on a specific member of the group
2732
+ * 4. We anchor the error to the first Radio so it receives focus and announcement
2733
+ *
2734
+ * When the group is invalid (required but no selection):
2735
+ * - Only the first Radio gets the invalid state with the validation message
2736
+ * - Other Radios are kept valid since selecting any of them would satisfy the requirement
2737
+ *
2738
+ * When the group becomes valid (user selects any Radio):
2739
+ * - All Radios are cleared back to valid state
2740
+ * - This allows form submission to proceed
2705
2741
  */
2706
- displayShadow: boolean;
2742
+ setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
2743
+ }
2744
+
2745
+ /**
2746
+ * The base class used for constructing a fluent-rating-display custom element
2747
+ *
2748
+ * @slot icon - SVG element used as the rating icon
2749
+ *
2750
+ * @public
2751
+ */
2752
+ export declare class BaseRatingDisplay extends FASTElement {
2753
+ private numberFormatter;
2707
2754
  /**
2708
- * The id of a form to associate the element to.
2755
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2709
2756
  *
2710
- * @public
2711
- * @remarks
2712
- * HTML Attribute: `form`
2757
+ * @internal
2713
2758
  */
2714
- initialForm?: string;
2759
+ elementInternals: ElementInternals;
2715
2760
  /**
2716
- * The form element that’s associated to the element, or `null` if no form is associated.
2761
+ * Reference to the slot element used for the rating icon.
2717
2762
  *
2718
- * @public
2763
+ * @internal
2719
2764
  */
2720
- get form(): HTMLFormElement | null;
2765
+ iconSlot: HTMLSlotElement;
2721
2766
  /**
2722
- * A `NodeList` of `<label>` element associated with the element.
2723
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/labels | `labels`} property
2767
+ * Updates the icon when the referenced slot is bound in the template.
2724
2768
  *
2725
- * @public
2769
+ * @internal
2726
2770
  */
2727
- get labels(): NodeList;
2771
+ iconSlotChanged(): void;
2772
+ protected defaultCustomIconViewBox: string;
2728
2773
  /**
2729
- * The maximum number of characters a user can enter.
2730
- *
2731
- * @public
2732
- * @remarks
2733
- * HTML Attribute: `maxlength`
2774
+ * The element that displays the rating icons.
2775
+ * @internal
2734
2776
  */
2735
- maxLength?: number;
2777
+ display: HTMLElement;
2736
2778
  /**
2737
- * The minimum number of characters a user can enter.
2738
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/minlength | `minlength`} attribute
2779
+ * The number of ratings.
2739
2780
  *
2740
2781
  * @public
2741
2782
  * @remarks
2742
- * HTML Attribute: `minlength`
2783
+ * HTML Attribute: `count`
2743
2784
  */
2744
- minLength?: number;
2785
+ count?: number;
2745
2786
  /**
2746
- * The name of the element. This element's value will be surfaced during form submission under the provided name.
2787
+ * The `viewBox` attribute of the icon <svg> element.
2747
2788
  *
2748
2789
  * @public
2749
2790
  * @remarks
2750
- * HTML Attribute: `name`
2791
+ * HTML Attribute: `icon-view-box`
2792
+ * @deprecated Add `viewBox` attribute on the custom SVG directly.
2751
2793
  */
2752
- name: string;
2794
+ iconViewBox?: string;
2753
2795
  /**
2754
- * Sets the placeholder value of the element, generally used to provide a hint to the user.
2755
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/placeholder | `placeholder`} attribute
2796
+ * The maximum possible value of the rating.
2797
+ * This attribute determines the number of icons displayed.
2798
+ * Must be a whole number greater than 1.
2756
2799
  *
2757
2800
  * @public
2758
2801
  * @remarks
2759
- * HTML Attribute: `placeholder`
2760
- * This attribute is not a valid substitute for a label.
2802
+ * HTML Attribute: `max`
2761
2803
  */
2762
- placeholder?: string;
2804
+ max?: number;
2805
+ protected maxChanged(): void;
2763
2806
  /**
2764
- * When true, the control will be immutable by user interaction.
2765
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/readonly | `readonly`} attribute
2807
+ * The value of the rating.
2766
2808
  *
2767
2809
  * @public
2768
2810
  * @remarks
2769
- * HTML Attribute: `readonly`
2811
+ * HTML Attribute: `value`
2770
2812
  */
2771
- readOnly: boolean;
2772
- protected readOnlyChanged(): void;
2813
+ value?: number;
2814
+ protected valueChanged(): void;
2815
+ constructor();
2816
+ connectedCallback(): void;
2773
2817
  /**
2774
- * The element's required attribute.
2818
+ * Returns "count" as string, formatted according to the locale.
2775
2819
  *
2776
- * @public
2777
- * @remarks
2778
- * HTML Attribute: `required`
2820
+ * @internal
2779
2821
  */
2780
- required: boolean;
2781
- protected requiredChanged(): void;
2782
- /**
2783
- * Indicates whether the element can be resized by end users.
2784
- *
2785
- * @public
2786
- * @remarks
2787
- * HTML Attribute: `resize`
2788
- */
2789
- resize: TextAreaResize;
2790
- protected resizeChanged(prev: TextAreaResize | undefined, next: TextAreaResize | undefined): void;
2791
- /**
2792
- * Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.
2793
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck | `spellcheck`} attribute
2794
- *
2795
- * @public
2796
- * @remarks
2797
- * HTML Attribute: `spellcheck`
2798
- */
2799
- spellcheck: boolean;
2822
+ get formattedCount(): string;
2823
+ /** @internal */
2824
+ handleSlotChange(): void;
2825
+ protected renderSlottedIcon(svg: SVGSVGElement | null): void;
2826
+ protected setCustomPropertyValue(propertyName: PropertyNameForCalculation): void;
2827
+ }
2828
+
2829
+ /**
2830
+ * The base class used for constructing a fluent-spinner custom element
2831
+ * @public
2832
+ */
2833
+ export declare class BaseSpinner extends FASTElement {
2800
2834
  /**
2801
- * The length of the current value.
2802
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#textLength | 'textLength'} property
2835
+ * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2803
2836
  *
2804
- * @public
2837
+ * @internal
2805
2838
  */
2806
- get textLength(): number;
2839
+ elementInternals: ElementInternals;
2840
+ constructor();
2841
+ }
2842
+
2843
+ /**
2844
+ * A Tablist element that wraps a collection of tab elements
2845
+ * @public
2846
+ */
2847
+ export declare class BaseTablist extends FASTElement {
2807
2848
  /**
2808
- * The type of the element, which is always "textarea".
2809
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/type | `type`} property
2849
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2810
2850
  *
2811
- * @public
2851
+ * @internal
2812
2852
  */
2813
- get type(): 'textarea';
2853
+ elementInternals: ElementInternals;
2814
2854
  /**
2815
- * The element's validity state.
2816
- *
2855
+ * Used for disabling all click and keyboard events for the tabs, child tab elements.
2817
2856
  * @public
2818
2857
  * @remarks
2819
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
2858
+ * HTML Attribute: disabled.
2820
2859
  */
2821
- get validity(): ValidityState;
2860
+ disabled: boolean;
2822
2861
  /**
2823
- * The validation message.
2862
+ * Handles disabled changes
2863
+ * @param prev - previous value
2864
+ * @param next - next value
2824
2865
  *
2825
- * @public
2826
- * @remarks
2827
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
2866
+ * @internal
2828
2867
  */
2829
- get validationMessage(): string;
2868
+ protected disabledChanged(prev: boolean, next: boolean): void;
2830
2869
  /**
2831
- * Determines if the control can be submitted for constraint validation.
2832
- *
2870
+ * The orientation
2833
2871
  * @public
2834
2872
  * @remarks
2835
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
2873
+ * HTML Attribute: orientation
2836
2874
  */
2837
- get willValidate(): boolean;
2875
+ orientation: TablistOrientation;
2838
2876
  /**
2839
- * The text content of the element before user interaction.
2840
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#defaultvalue | `defaultValue`} property
2841
- *
2842
- * @public
2843
- * @remarks
2844
- * In order to set the initial/default value, an author should either add the default value in the HTML as the children
2845
- * of the component, or setting this property in JavaScript. Setting `innerHTML`, `innerText`, or `textContent` on this
2846
- * component will not change the default value or the content displayed inside the component.
2877
+ * @internal
2847
2878
  */
2848
- get defaultValue(): string;
2849
- set defaultValue(next: string);
2879
+ protected orientationChanged(prev: TablistOrientation, next: TablistOrientation): void;
2850
2880
  /**
2851
- * The value of the element.
2881
+ * The id of the active tab
2852
2882
  *
2853
2883
  * @public
2854
2884
  * @remarks
2855
- * Reflects the `value` property.
2885
+ * HTML Attribute: activeid
2856
2886
  */
2857
- get value(): string;
2858
- set value(next: string);
2859
- constructor();
2887
+ activeid: string;
2860
2888
  /**
2861
2889
  * @internal
2862
2890
  */
2863
- connectedCallback(): void;
2891
+ protected activeidChanged(oldValue: string, newValue: string): void;
2864
2892
  /**
2893
+ * Content slotted in the tab slot.
2865
2894
  * @internal
2866
2895
  */
2867
- disconnectedCallback(): void;
2896
+ slottedTabs: Node[];
2868
2897
  /**
2869
- * Resets the value to its initial value when the form is reset.
2870
- *
2898
+ * Updates the tabs property when content in the tabs slot changes.
2871
2899
  * @internal
2872
2900
  */
2873
- formResetCallback(): void;
2901
+ slottedTabsChanged(prev: Node[] | undefined, next: Node[] | undefined): void;
2874
2902
  /**
2875
2903
  * @internal
2876
2904
  */
2877
- formDisabledCallback(disabled: boolean): void;
2905
+ tabs: Tab[];
2878
2906
  /**
2879
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
2880
- *
2881
2907
  * @internal
2882
2908
  */
2883
- setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
2909
+ protected tabsChanged(prev: Tab[] | undefined, next: Tab[] | undefined): void;
2884
2910
  /**
2885
- * Checks the validity of the element and returns the result.
2886
- *
2911
+ * A reference to the active tab
2887
2912
  * @public
2888
- * @remarks
2889
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
2890
2913
  */
2891
- checkValidity(): boolean;
2914
+ activetab: Tab;
2915
+ private prevActiveTabIndex;
2916
+ private activeTabIndex;
2917
+ private tabIds;
2918
+ private tabPanelMap;
2919
+ private change;
2920
+ private getActiveIndex;
2892
2921
  /**
2893
- * Reports the validity of the element.
2922
+ * Function that is invoked whenever the selected tab or the tab collection changes.
2894
2923
  *
2895
2924
  * @public
2925
+ */
2926
+ protected setTabs(): void;
2927
+ private getTabIds;
2928
+ private setComponent;
2929
+ private handleTabClick;
2930
+ private isHorizontal;
2931
+ private handleTabKeyDown;
2932
+ /**
2933
+ * The adjust method for FASTTabs
2934
+ * @public
2896
2935
  * @remarks
2897
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
2936
+ * This method allows the active index to be adjusted by numerical increments
2898
2937
  */
2899
- reportValidity(): boolean;
2938
+ adjust(adjustment: number): void;
2939
+ private activateTabByIndex;
2940
+ private focusTab;
2941
+ constructor();
2900
2942
  /**
2901
- * Sets the custom validity message.
2902
- * @param message - The message to set
2943
+ * @internal
2944
+ */
2945
+ connectedCallback(): void;
2946
+ }
2947
+
2948
+ /**
2949
+ * A Text Area Custom HTML Element.
2950
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | `<textarea>`} element.
2951
+ *
2952
+ * @slot - The default content/value of the component.
2953
+ * @slot label - The content for the `<label>`, it should be a `<fluent-label>` element.
2954
+ * @csspart label - The `<label>` element.
2955
+ * @csspart root - The container element of the `<textarea>` element.
2956
+ * @csspart control - The internal `<textarea>` element.
2957
+ * @fires change - Fires after the control loses focus, if the content has changed.
2958
+ * @fires select - Fires when the `select()` method is called.
2959
+ *
2960
+ * @public
2961
+ */
2962
+ export declare class BaseTextArea extends FASTElement {
2963
+ /**
2964
+ * The form-associated flag.
2965
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
2903
2966
  *
2904
2967
  * @public
2905
2968
  */
2906
- setCustomValidity(message: string | null): void;
2969
+ static readonly formAssociated = true;
2907
2970
  /**
2908
- * Sets the validity of the control.
2909
- *
2910
- * @param flags - Validity flags. If not provided, the control's `validity` will be used.
2911
- * @param message - Optional message to supply. If not provided, the control's `validationMessage` will be used. If the control does not have a `validationMessage`, the message will be empty.
2912
- * @param anchor - Optional anchor to use for the validation message. If not provided, the control will be used.
2971
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2913
2972
  *
2914
2973
  * @internal
2915
2974
  */
2916
- setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
2975
+ elementInternals: ElementInternals;
2917
2976
  /**
2918
- * Selects the content in the element.
2919
- *
2920
- * @public
2977
+ * The `<label>` element.
2978
+ * @internal
2921
2979
  */
2922
- select(): void;
2980
+ labelEl: HTMLLabelElement;
2923
2981
  /**
2924
- * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
2982
+ * The root container element.
2983
+ * @internal
2925
2984
  */
2926
- private getContent;
2927
- private setDisabledSideEffect;
2928
- private toggleUserValidityState;
2929
- private maybeCreateAutoSizerEl;
2985
+ rootEl: HTMLDivElement;
2930
2986
  /**
2987
+ * The `<textarea>` element.
2931
2988
  * @internal
2932
2989
  */
2933
- handleControlInput(): void;
2990
+ controlEl: HTMLTextAreaElement;
2934
2991
  /**
2992
+ * Sets up a mutation observer to watch for changes to the control element's
2993
+ * attributes that could affect validity, and binds an input event listener to detect user interaction.
2994
+ *
2935
2995
  * @internal
2936
2996
  */
2937
- handleControlChange(): void;
2997
+ protected controlElChanged(): void;
2938
2998
  /**
2939
2999
  * @internal
2940
3000
  */
2941
- handleControlSelect(): void;
2942
- }
2943
-
2944
- /**
2945
- * A Text Input Custom HTML Element.
2946
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input | `<input>`} element.
2947
- *
2948
- * @slot start - Content which can be provided before the input
2949
- * @slot end - Content which can be provided after the input
2950
- * @slot - The default slot for button content
2951
- * @csspart label - The internal `<label>` element
2952
- * @csspart root - the root container for the internal control
2953
- * @csspart control - The internal `<input>` control
2954
- * @public
2955
- */
2956
- export declare class BaseTextInput extends FASTElement {
3001
+ autoSizerEl?: HTMLDivElement;
3002
+ /**
3003
+ * The list of nodes that are assigned to the default slot.
3004
+ * @internal
3005
+ */
3006
+ defaultSlottedNodes: Node[];
3007
+ protected defaultSlottedNodesChanged(): void;
3008
+ private filteredLabelSlottedNodes;
3009
+ /**
3010
+ * The list of nodes that are assigned to the `label` slot.
3011
+ * @internal
3012
+ */
3013
+ labelSlottedNodes: Label[];
3014
+ protected labelSlottedNodesChanged(): void;
3015
+ private userInteracted;
3016
+ private autoSizerObserver?;
3017
+ private controlElAttrObserver;
3018
+ private preConnectControlEl;
2957
3019
  /**
2958
3020
  * Indicates the element's autocomplete state.
2959
3021
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete | `autocomplete`} attribute
@@ -2962,53 +3024,27 @@ export declare class BaseTextInput extends FASTElement {
2962
3024
  * @remarks
2963
3025
  * HTML Attribute: `autocomplete`
2964
3026
  */
2965
- autocomplete?: string;
3027
+ autocomplete?: TextAreaAutocomplete;
2966
3028
  /**
2967
- * Indicates that the element should get focus after the page finishes loading.
2968
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#autofocus | `autofocus`} attribute
3029
+ * Indicates whether the element’s block size (height) should be automatically changed based on the content.
3030
+ * Note: When this property’s value is set to be `true`, the element should not have a fixed block-size
3031
+ * defined in CSS. Instead, use `min-height` or `min-block-size`.
2969
3032
  *
2970
3033
  * @public
2971
3034
  * @remarks
2972
- * HTML Attribute: `autofocus`
3035
+ * HTML Attribute: `auto-resize`
2973
3036
  */
2974
- autofocus: boolean;
3037
+ autoResize: boolean;
3038
+ protected autoResizeChanged(): void;
2975
3039
  /**
2976
- * The current value of the input.
3040
+ * Sets the name of the value directionality to be submitted with form data.
3041
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/dirname | `dirname`} attribute
3042
+ *
2977
3043
  * @public
2978
3044
  * @remarks
2979
- * HTML Attribute: `current-value`
3045
+ * HTML Attribute: `dirname`
2980
3046
  */
2981
- currentValue: string;
2982
- /**
2983
- * Tracks the current value of the input.
2984
- *
2985
- * @param prev - the previous value
2986
- * @param next - the next value
2987
- *
2988
- * @internal
2989
- */
2990
- currentValueChanged(prev: string, next: string): void;
2991
- /**
2992
- * The default slotted content. This is the content that appears in the text field label.
2993
- *
2994
- * @internal
2995
- */
2996
- defaultSlottedNodes: Node[];
2997
- /**
2998
- * Updates the control label visibility based on the presence of default slotted content.
2999
- *
3000
- * @internal
3001
- */
3002
- defaultSlottedNodesChanged(prev: Node[] | undefined, next: Node[] | undefined): void;
3003
- /**
3004
- * Sets the directionality of the element to be submitted with form data.
3005
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/dirname | `dirname`} attribute
3006
- *
3007
- * @public
3008
- * @remarks
3009
- * HTML Attribute: `dirname`
3010
- */
3011
- dirname?: string;
3047
+ dirName?: string;
3012
3048
  /**
3013
3049
  * Sets the element's disabled state.
3014
3050
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/disabled | `disabled`} attribute
@@ -3017,39 +3053,37 @@ export declare class BaseTextInput extends FASTElement {
3017
3053
  * @remarks
3018
3054
  * HTML Attribute: `disabled`
3019
3055
  */
3020
- disabled?: boolean;
3056
+ disabled: boolean;
3057
+ protected disabledChanged(): void;
3021
3058
  /**
3022
- * The id of a form to associate the element to.
3023
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
3059
+ * Indicates whether the element displays a box shadow. This only has effect when `appearance` is set to be `filled-darker` or `filled-lighter`.
3024
3060
  *
3025
3061
  * @public
3026
3062
  * @remarks
3027
- * HTML Attribute: `form`
3063
+ * HTML Attribute: `display-shadow`
3028
3064
  */
3029
- formAttribute?: string;
3065
+ displayShadow: boolean;
3030
3066
  /**
3031
- * The initial value of the input.
3067
+ * The id of a form to associate the element to.
3032
3068
  *
3033
3069
  * @public
3034
3070
  * @remarks
3035
- * HTML Attribute: `value`
3071
+ * HTML Attribute: `form`
3036
3072
  */
3037
- initialValue: string;
3073
+ initialForm?: string;
3038
3074
  /**
3039
- * Sets the value of the element to the initial value.
3075
+ * The form element that’s associated to the element, or `null` if no form is associated.
3040
3076
  *
3041
- * @internal
3077
+ * @public
3042
3078
  */
3043
- initialValueChanged(): void;
3079
+ get form(): HTMLFormElement | null;
3044
3080
  /**
3045
- * Allows associating a `<datalist>` to the element by ID.
3046
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#list | `list`} attribute
3081
+ * A `NodeList` of `<label>` element associated with the element.
3082
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/labels | `labels`} property
3047
3083
  *
3048
3084
  * @public
3049
- * @remarks
3050
- * HTML Attribute: `list`
3051
3085
  */
3052
- list: string;
3086
+ get labels(): NodeList;
3053
3087
  /**
3054
3088
  * The maximum number of characters a user can enter.
3055
3089
  *
@@ -3057,7 +3091,7 @@ export declare class BaseTextInput extends FASTElement {
3057
3091
  * @remarks
3058
3092
  * HTML Attribute: `maxlength`
3059
3093
  */
3060
- maxlength: number;
3094
+ maxLength?: number;
3061
3095
  /**
3062
3096
  * The minimum number of characters a user can enter.
3063
3097
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/minlength | `minlength`} attribute
@@ -3066,16 +3100,7 @@ export declare class BaseTextInput extends FASTElement {
3066
3100
  * @remarks
3067
3101
  * HTML Attribute: `minlength`
3068
3102
  */
3069
- minlength: number;
3070
- /**
3071
- * Indicates that a comma-separated list of email addresses can be entered. This attribute is only valid when `type="email"`.
3072
- * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/multiple | `multiple`} attribute
3073
- *
3074
- * @public
3075
- * @remarks
3076
- * HTML Attribute: `multiple`
3077
- */
3078
- multiple: boolean;
3103
+ minLength?: number;
3079
3104
  /**
3080
3105
  * The name of the element. This element's value will be surfaced during form submission under the provided name.
3081
3106
  *
@@ -3084,14 +3109,6 @@ export declare class BaseTextInput extends FASTElement {
3084
3109
  * HTML Attribute: `name`
3085
3110
  */
3086
3111
  name: string;
3087
- /**
3088
- * A regular expression that the value must match to pass validation.
3089
- *
3090
- * @public
3091
- * @remarks
3092
- * HTML Attribute: `pattern`
3093
- */
3094
- pattern: string;
3095
3112
  /**
3096
3113
  * Sets the placeholder value of the element, generally used to provide a hint to the user.
3097
3114
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/placeholder | `placeholder`} attribute
@@ -3101,7 +3118,7 @@ export declare class BaseTextInput extends FASTElement {
3101
3118
  * HTML Attribute: `placeholder`
3102
3119
  * This attribute is not a valid substitute for a label.
3103
3120
  */
3104
- placeholder: string;
3121
+ placeholder?: string;
3105
3122
  /**
3106
3123
  * When true, the control will be immutable by user interaction.
3107
3124
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/readonly | `readonly`} attribute
@@ -3110,13 +3127,8 @@ export declare class BaseTextInput extends FASTElement {
3110
3127
  * @remarks
3111
3128
  * HTML Attribute: `readonly`
3112
3129
  */
3113
- readOnly?: boolean;
3114
- /**
3115
- * Syncs the `ElementInternals.ariaReadOnly` property when the `readonly` property changes.
3116
- *
3117
- * @internal
3118
- */
3119
- readOnlyChanged(): void;
3130
+ readOnly: boolean;
3131
+ protected readOnlyChanged(): void;
3120
3132
  /**
3121
3133
  * The element's required attribute.
3122
3134
  *
@@ -3125,23 +3137,16 @@ export declare class BaseTextInput extends FASTElement {
3125
3137
  * HTML Attribute: `required`
3126
3138
  */
3127
3139
  required: boolean;
3140
+ protected requiredChanged(): void;
3128
3141
  /**
3129
- * Syncs the element's internal `aria-required` state with the `required` attribute.
3130
- *
3131
- * @param previous - the previous required state
3132
- * @param next - the current required state
3133
- *
3134
- * @internal
3135
- */
3136
- requiredChanged(previous: boolean, next: boolean): void;
3137
- /**
3138
- * Sets the width of the element to a specified number of characters.
3142
+ * Indicates whether the element can be resized by end users.
3139
3143
  *
3140
3144
  * @public
3141
3145
  * @remarks
3142
- * HTML Attribute: `size`
3146
+ * HTML Attribute: `resize`
3143
3147
  */
3144
- size: number;
3148
+ resize: TextAreaResize;
3149
+ protected resizeChanged(prev: TextAreaResize | undefined, next: TextAreaResize | undefined): void;
3145
3150
  /**
3146
3151
  * Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.
3147
3152
  * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck | `spellcheck`} attribute
@@ -3152,53 +3157,19 @@ export declare class BaseTextInput extends FASTElement {
3152
3157
  */
3153
3158
  spellcheck: boolean;
3154
3159
  /**
3155
- * Allows setting a type or mode of text.
3160
+ * The length of the current value.
3161
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#textLength | 'textLength'} property
3156
3162
  *
3157
3163
  * @public
3158
- * @remarks
3159
- * HTML Attribute: `type`
3160
- */
3161
- type: TextInputType;
3162
- /**
3163
- * A reference to the internal input element.
3164
- *
3165
- * @internal
3166
- */
3167
- control: HTMLInputElement;
3168
- /**
3169
- * Calls the `setValidity` method when the control reference changes.
3170
- *
3171
- * @param prev - the previous control reference
3172
- * @param next - the current control reference
3173
- *
3174
- * @internal
3175
- */
3176
- controlChanged(prev: HTMLInputElement | undefined, next: HTMLInputElement | undefined): void;
3177
- /**
3178
- * A reference to the internal label element.
3179
- *
3180
- * @internal
3181
- */
3182
- controlLabel: HTMLLabelElement;
3183
- /**
3184
- * Indicates that the value has been changed by the user.
3185
- *
3186
- * @internal
3187
- */
3188
- private dirtyValue;
3189
- /**
3190
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3191
- *
3192
- * @internal
3193
3164
  */
3194
- elementInternals: ElementInternals;
3165
+ get textLength(): number;
3195
3166
  /**
3196
- * The form-associated flag.
3197
- * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
3167
+ * The type of the element, which is always "textarea".
3168
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/type | `type`} property
3198
3169
  *
3199
3170
  * @public
3200
3171
  */
3201
- static readonly formAssociated = true;
3172
+ get type(): 'textarea';
3202
3173
  /**
3203
3174
  * The element's validity state.
3204
3175
  *
@@ -3215,12 +3186,6 @@ export declare class BaseTextInput extends FASTElement {
3215
3186
  * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
3216
3187
  */
3217
3188
  get validationMessage(): string;
3218
- /**
3219
- * The current value of the input.
3220
- * @public
3221
- */
3222
- get value(): string;
3223
- set value(value: string);
3224
3189
  /**
3225
3190
  * Determines if the control can be submitted for constraint validation.
3226
3191
  *
@@ -3230,50 +3195,35 @@ export declare class BaseTextInput extends FASTElement {
3230
3195
  */
3231
3196
  get willValidate(): boolean;
3232
3197
  /**
3233
- * The associated form element.
3198
+ * The text content of the element before user interaction.
3199
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#defaultvalue | `defaultValue`} property
3234
3200
  *
3235
3201
  * @public
3236
3202
  * @remarks
3237
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
3238
- */
3239
- get form(): HTMLFormElement | null;
3240
- /**
3241
- * Handles the internal control's `keypress` event.
3242
- *
3243
- * @internal
3244
- */
3245
- beforeinputHandler(e: InputEvent): boolean | void;
3246
- /**
3247
- * Change event handler for inner control.
3248
- *
3249
- * @internal
3250
- * @privateRemarks
3251
- * "Change" events are not `composable` so they will not permeate the shadow DOM boundary. This function effectively
3252
- * proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
3203
+ * In order to set the initial/default value, an author should either add the default value in the HTML as the children
3204
+ * of the component, or setting this property in JavaScript. Setting `innerHTML`, `innerText`, or `textContent` on this
3205
+ * component will not change the default value or the content displayed inside the component.
3253
3206
  */
3254
- changeHandler(e: InputEvent): boolean | void;
3207
+ get defaultValue(): string;
3208
+ set defaultValue(next: string);
3255
3209
  /**
3256
- * Checks the validity of the element and returns the result.
3210
+ * The value of the element.
3257
3211
  *
3258
3212
  * @public
3259
3213
  * @remarks
3260
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
3214
+ * Reflects the `value` property.
3261
3215
  */
3262
- checkValidity(): boolean;
3216
+ get value(): string;
3217
+ set value(next: string);
3218
+ constructor();
3263
3219
  /**
3264
- * Clicks the inner control when the component is clicked.
3265
- *
3266
- * @param e - the event object
3220
+ * @internal
3267
3221
  */
3268
- clickHandler(e: MouseEvent): boolean | void;
3269
3222
  connectedCallback(): void;
3270
3223
  /**
3271
- * Focuses the inner control when the component is focused.
3272
- *
3273
- * @param e - the event object
3274
- * @public
3224
+ * @internal
3275
3225
  */
3276
- focusinHandler(e: FocusEvent): boolean | void;
3226
+ disconnectedCallback(): void;
3277
3227
  /**
3278
3228
  * Resets the value to its initial value when the form is reset.
3279
3229
  *
@@ -3281,41 +3231,23 @@ export declare class BaseTextInput extends FASTElement {
3281
3231
  */
3282
3232
  formResetCallback(): void;
3283
3233
  /**
3284
- * Handles implicit form submission when the user presses the "Enter" key.
3285
- *
3286
- * @internal
3287
- */
3288
- private implicitSubmit;
3289
- /**
3290
- * Handles the internal control's `input` event.
3291
- *
3292
3234
  * @internal
3293
3235
  */
3294
- inputHandler(e: InputEvent): boolean | void;
3236
+ formDisabledCallback(disabled: boolean): void;
3295
3237
  /**
3296
- * Handles the internal control's `keydown` event.
3238
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
3297
3239
  *
3298
- * @param e - the event object
3299
3240
  * @internal
3300
3241
  */
3301
- keydownHandler(e: KeyboardEvent): boolean | void;
3302
- /**
3303
- * Selects all the text in the text field.
3304
- *
3305
- * @public
3306
- * @privateRemarks
3307
- * The `select` event does not permeate the shadow DOM boundary. This function effectively proxies the event,
3308
- * emitting a `select` event whenever the internal control emits a `select` event
3309
- *
3310
- */
3311
- select(): void;
3242
+ setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
3312
3243
  /**
3313
- * Sets the custom validity message.
3314
- * @param message - The message to set
3244
+ * Checks the validity of the element and returns the result.
3315
3245
  *
3316
3246
  * @public
3247
+ * @remarks
3248
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
3317
3249
  */
3318
- setCustomValidity(message: string): void;
3250
+ checkValidity(): boolean;
3319
3251
  /**
3320
3252
  * Reports the validity of the element.
3321
3253
  *
@@ -3325,11 +3257,12 @@ export declare class BaseTextInput extends FASTElement {
3325
3257
  */
3326
3258
  reportValidity(): boolean;
3327
3259
  /**
3328
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
3260
+ * Sets the custom validity message.
3261
+ * @param message - The message to set
3329
3262
  *
3330
- * @internal
3263
+ * @public
3331
3264
  */
3332
- setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
3265
+ setCustomValidity(message: string | null): void;
3333
3266
  /**
3334
3267
  * Sets the validity of the control.
3335
3268
  *
@@ -3340,187 +3273,613 @@ export declare class BaseTextInput extends FASTElement {
3340
3273
  * @internal
3341
3274
  */
3342
3275
  setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
3343
- }
3344
-
3345
- export declare class BaseTree extends FASTElement {
3346
3276
  /**
3347
- * The currently selected tree item
3277
+ * Selects the content in the element.
3278
+ *
3348
3279
  * @public
3349
3280
  */
3350
- currentSelected: HTMLElement | null;
3281
+ select(): void;
3351
3282
  /**
3352
- * The tree item that is designated to be in the tab queue.
3353
- *
3354
- * @internal
3283
+ * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
3355
3284
  */
3356
- private currentFocused;
3285
+ private getContent;
3286
+ private setDisabledSideEffect;
3287
+ private toggleUserValidityState;
3288
+ private maybeCreateAutoSizerEl;
3357
3289
  /**
3358
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3359
- *
3360
3290
  * @internal
3361
3291
  */
3362
- elementInternals: ElementInternals;
3363
- /** @internal */
3364
- defaultSlot: HTMLSlotElement;
3292
+ handleControlInput(): void;
3365
3293
  /**
3366
- * Calls the slot change handler when the `defaultSlot` reference is updated
3367
- * by the template binding.
3368
- *
3369
3294
  * @internal
3370
3295
  */
3371
- defaultSlotChanged(): void;
3372
- constructor();
3373
- connectedCallback(): void;
3374
- /** @internal */
3375
- childTreeItems: BaseTreeItem[];
3376
- /** @internal */
3377
- childTreeItemsChanged(): void;
3296
+ handleControlChange(): void;
3378
3297
  /**
3379
- * Updates current selected when slottedTreeItems changes
3298
+ * @internal
3380
3299
  */
3381
- private updateCurrentSelected;
3300
+ handleControlSelect(): void;
3301
+ }
3302
+
3303
+ /**
3304
+ * A Text Input Custom HTML Element.
3305
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input | `<input>`} element.
3306
+ *
3307
+ * @slot start - Content which can be provided before the input
3308
+ * @slot end - Content which can be provided after the input
3309
+ * @slot - The default slot for button content
3310
+ * @csspart label - The internal `<label>` element
3311
+ * @csspart root - the root container for the internal control
3312
+ * @csspart control - The internal `<input>` control
3313
+ * @public
3314
+ */
3315
+ export declare class BaseTextInput extends FASTElement {
3382
3316
  /**
3383
- * KeyDown handler
3317
+ * Indicates the element's autocomplete state.
3318
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete | `autocomplete`} attribute
3384
3319
  *
3385
- * @internal
3320
+ * @public
3321
+ * @remarks
3322
+ * HTML Attribute: `autocomplete`
3386
3323
  */
3387
- keydownHandler(e: KeyboardEvent): boolean | void;
3324
+ autocomplete?: string;
3388
3325
  /**
3389
- * Handle focus events
3326
+ * Indicates that the element should get focus after the page finishes loading.
3327
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#autofocus | `autofocus`} attribute
3328
+ *
3329
+ * @public
3330
+ * @remarks
3331
+ * HTML Attribute: `autofocus`
3332
+ */
3333
+ autofocus: boolean;
3334
+ /**
3335
+ * The current value of the input.
3336
+ * @public
3337
+ * @remarks
3338
+ * HTML Attribute: `current-value`
3339
+ */
3340
+ currentValue: string;
3341
+ /**
3342
+ * Tracks the current value of the input.
3343
+ *
3344
+ * @param prev - the previous value
3345
+ * @param next - the next value
3390
3346
  *
3391
3347
  * @internal
3392
3348
  */
3393
- focusHandler(e: FocusEvent): void;
3349
+ currentValueChanged(prev: string, next: string): void;
3394
3350
  /**
3395
- * Handle blur events
3351
+ * The default slotted content. This is the content that appears in the text field label.
3396
3352
  *
3397
3353
  * @internal
3398
3354
  */
3399
- blurHandler(e: FocusEvent): void;
3355
+ defaultSlottedNodes: Node[];
3400
3356
  /**
3401
- * Handles click events bubbling up
3357
+ * Updates the control label visibility based on the presence of default slotted content.
3402
3358
  *
3403
- * @internal
3359
+ * @internal
3404
3360
  */
3405
- clickHandler(e: Event): boolean | void;
3361
+ defaultSlottedNodesChanged(prev: Node[] | undefined, next: Node[] | undefined): void;
3406
3362
  /**
3407
- * Handles the selected-changed events bubbling up
3408
- * from child tree items
3363
+ * Sets the directionality of the element to be submitted with form data.
3364
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/dirname | `dirname`} attribute
3409
3365
  *
3410
- * @internal
3366
+ * @public
3367
+ * @remarks
3368
+ * HTML Attribute: `dirname`
3411
3369
  */
3412
- changeHandler(e: Event): boolean | void;
3370
+ dirname?: string;
3413
3371
  /**
3414
- * checks if there are any nested tree items
3372
+ * Sets the element's disabled state.
3373
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/disabled | `disabled`} attribute
3374
+ *
3375
+ * @public
3376
+ * @remarks
3377
+ * HTML Attribute: `disabled`
3415
3378
  */
3416
- private getValidFocusableItem;
3417
- private getVisibleNodes;
3379
+ disabled?: boolean;
3418
3380
  /**
3419
- * Move focus to a tree item based on its offset from the provided item
3381
+ * The id of a form to associate the element to.
3382
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
3383
+ *
3384
+ * @public
3385
+ * @remarks
3386
+ * HTML Attribute: `form`
3420
3387
  */
3421
- private focusNextNode;
3422
- /** @internal */
3423
- handleDefaultSlotChange(): void;
3424
- }
3425
-
3426
- declare class BaseTreeItem extends FASTElement {
3388
+ formAttribute?: string;
3427
3389
  /**
3428
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3390
+ * The initial value of the input.
3429
3391
  *
3430
- * @internal
3392
+ * @public
3393
+ * @remarks
3394
+ * HTML Attribute: `value`
3431
3395
  */
3432
- elementInternals: ElementInternals;
3433
- /** @internal */
3434
- itemSlot: HTMLSlotElement;
3396
+ initialValue: string;
3435
3397
  /**
3436
- * Calls the slot change handler when the `itemSlot` reference is updated
3437
- * by the template binding.
3398
+ * Sets the value of the element to the initial value.
3438
3399
  *
3439
3400
  * @internal
3440
3401
  */
3441
- itemSlotChanged(): void;
3442
- constructor();
3402
+ initialValueChanged(): void;
3443
3403
  /**
3444
- * When true, the control will be appear expanded by user interaction.
3445
- * When true, the control will be appear expanded by user interaction.
3404
+ * Allows associating a `<datalist>` to the element by ID.
3405
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#list | `list`} attribute
3446
3406
  *
3447
- * HTML Attribute: `expanded`
3407
+ * @public
3408
+ * @remarks
3409
+ * HTML Attribute: `list`
3410
+ */
3411
+ list: string;
3412
+ /**
3413
+ * The maximum number of characters a user can enter.
3448
3414
  *
3449
3415
  * @public
3416
+ * @remarks
3417
+ * HTML Attribute: `maxlength`
3450
3418
  */
3451
- expanded: boolean;
3419
+ maxlength: number;
3452
3420
  /**
3453
- * Handles changes to the expanded attribute
3454
- * @param prev - the previous state
3455
- * @param next - the next state
3421
+ * The minimum number of characters a user can enter.
3422
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/minlength | `minlength`} attribute
3456
3423
  *
3457
3424
  * @public
3425
+ * @remarks
3426
+ * HTML Attribute: `minlength`
3458
3427
  */
3459
- expandedChanged(prev: boolean, next: boolean): void;
3428
+ minlength: number;
3460
3429
  /**
3461
- * When true, the control will appear selected by user interaction.
3430
+ * Indicates that a comma-separated list of email addresses can be entered. This attribute is only valid when `type="email"`.
3431
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/multiple | `multiple`} attribute
3432
+ *
3462
3433
  * @public
3463
3434
  * @remarks
3464
- * HTML Attribute: selected
3435
+ * HTML Attribute: `multiple`
3465
3436
  */
3466
- selected: boolean;
3437
+ multiple: boolean;
3467
3438
  /**
3468
- * Handles changes to the selected attribute
3469
- * @param prev - the previous state
3470
- * @param next - the next state
3439
+ * The name of the element. This element's value will be surfaced during form submission under the provided name.
3471
3440
  *
3472
- * @internal
3441
+ * @public
3442
+ * @remarks
3443
+ * HTML Attribute: `name`
3473
3444
  */
3474
- protected selectedChanged(prev: boolean, next: boolean): void;
3445
+ name: string;
3475
3446
  /**
3476
- * When true, the control has no child tree items
3477
- * When true, the control has no child tree items
3447
+ * A regular expression that the value must match to pass validation.
3478
3448
  *
3479
- * HTML Attribute: empty
3449
+ * @public
3450
+ * @remarks
3451
+ * HTML Attribute: `pattern`
3452
+ */
3453
+ pattern: string;
3454
+ /**
3455
+ * Sets the placeholder value of the element, generally used to provide a hint to the user.
3456
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/placeholder | `placeholder`} attribute
3480
3457
  *
3481
3458
  * @public
3459
+ * @remarks
3460
+ * HTML Attribute: `placeholder`
3461
+ * This attribute is not a valid substitute for a label.
3482
3462
  */
3483
- empty: boolean;
3484
- private styles;
3463
+ placeholder: string;
3485
3464
  /**
3486
- * The indent of the tree item element.
3487
- * This is not needed once css attr() is supported (--indent: attr(data-indent type(<number>)));
3465
+ * When true, the control will be immutable by user interaction.
3466
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/readonly | `readonly`} attribute
3467
+ *
3488
3468
  * @public
3469
+ * @remarks
3470
+ * HTML Attribute: `readonly`
3489
3471
  */
3490
- dataIndent: number | undefined;
3491
- protected dataIndentChanged(prev: number, next: number): void;
3492
- /** @internal */
3493
- childTreeItems: BaseTreeItem[] | undefined;
3472
+ readOnly?: boolean;
3494
3473
  /**
3495
- * Handles changes to the child tree items
3474
+ * Syncs the `ElementInternals.ariaReadOnly` property when the `readonly` property changes.
3475
+ *
3476
+ * @internal
3477
+ */
3478
+ readOnlyChanged(): void;
3479
+ /**
3480
+ * The element's required attribute.
3496
3481
  *
3497
3482
  * @public
3483
+ * @remarks
3484
+ * HTML Attribute: `required`
3498
3485
  */
3499
- childTreeItemsChanged(): void;
3500
- connectedCallback(): void;
3486
+ required: boolean;
3501
3487
  /**
3502
- * Updates the childrens indent
3488
+ * Syncs the element's internal `aria-required` state with the `required` attribute.
3489
+ *
3490
+ * @param previous - the previous required state
3491
+ * @param next - the current required state
3492
+ *
3493
+ * @internal
3494
+ */
3495
+ requiredChanged(previous: boolean, next: boolean): void;
3496
+ /**
3497
+ * Sets the width of the element to a specified number of characters.
3503
3498
  *
3504
3499
  * @public
3500
+ * @remarks
3501
+ * HTML Attribute: `size`
3505
3502
  */
3506
- updateChildTreeItems(): void;
3503
+ size: number;
3507
3504
  /**
3508
- * Sets the indent for each item
3505
+ * Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.
3506
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck | `spellcheck`} attribute
3507
+ *
3508
+ * @public
3509
+ * @remarks
3510
+ * HTML Attribute: `spellcheck`
3509
3511
  */
3510
- private setIndent;
3512
+ spellcheck: boolean;
3511
3513
  /**
3512
- * Toggle the expansion state of the tree item
3514
+ * Allows setting a type or mode of text.
3513
3515
  *
3514
3516
  * @public
3517
+ * @remarks
3518
+ * HTML Attribute: `type`
3515
3519
  */
3516
- toggleExpansion(): void;
3520
+ type: TextInputType;
3517
3521
  /**
3518
- * Whether the tree is nested
3522
+ * A reference to the internal input element.
3523
+ *
3519
3524
  * @internal
3520
3525
  */
3521
- get isNestedItem(): boolean;
3522
- protected updateTabindexBySelected(): void;
3523
- /** @internal */
3526
+ control: HTMLInputElement;
3527
+ /**
3528
+ * Calls the `setValidity` method when the control reference changes.
3529
+ *
3530
+ * @param prev - the previous control reference
3531
+ * @param next - the current control reference
3532
+ *
3533
+ * @internal
3534
+ */
3535
+ controlChanged(prev: HTMLInputElement | undefined, next: HTMLInputElement | undefined): void;
3536
+ /**
3537
+ * A reference to the internal label element.
3538
+ *
3539
+ * @internal
3540
+ */
3541
+ controlLabel: HTMLLabelElement;
3542
+ /**
3543
+ * Indicates that the value has been changed by the user.
3544
+ *
3545
+ * @internal
3546
+ */
3547
+ private dirtyValue;
3548
+ /**
3549
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3550
+ *
3551
+ * @internal
3552
+ */
3553
+ elementInternals: ElementInternals;
3554
+ /**
3555
+ * The form-associated flag.
3556
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
3557
+ *
3558
+ * @public
3559
+ */
3560
+ static readonly formAssociated = true;
3561
+ /**
3562
+ * The element's validity state.
3563
+ *
3564
+ * @public
3565
+ * @remarks
3566
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
3567
+ */
3568
+ get validity(): ValidityState;
3569
+ /**
3570
+ * The validation message.
3571
+ *
3572
+ * @public
3573
+ * @remarks
3574
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
3575
+ */
3576
+ get validationMessage(): string;
3577
+ /**
3578
+ * The current value of the input.
3579
+ * @public
3580
+ */
3581
+ get value(): string;
3582
+ set value(value: string);
3583
+ /**
3584
+ * Determines if the control can be submitted for constraint validation.
3585
+ *
3586
+ * @public
3587
+ * @remarks
3588
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
3589
+ */
3590
+ get willValidate(): boolean;
3591
+ /**
3592
+ * The associated form element.
3593
+ *
3594
+ * @public
3595
+ * @remarks
3596
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
3597
+ */
3598
+ get form(): HTMLFormElement | null;
3599
+ /**
3600
+ * Handles the internal control's `keypress` event.
3601
+ *
3602
+ * @internal
3603
+ */
3604
+ beforeinputHandler(e: InputEvent): boolean | void;
3605
+ /**
3606
+ * Change event handler for inner control.
3607
+ *
3608
+ * @internal
3609
+ * @privateRemarks
3610
+ * "Change" events are not `composable` so they will not permeate the shadow DOM boundary. This function effectively
3611
+ * proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
3612
+ */
3613
+ changeHandler(e: InputEvent): boolean | void;
3614
+ /**
3615
+ * Checks the validity of the element and returns the result.
3616
+ *
3617
+ * @public
3618
+ * @remarks
3619
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
3620
+ */
3621
+ checkValidity(): boolean;
3622
+ /**
3623
+ * Clicks the inner control when the component is clicked.
3624
+ *
3625
+ * @param e - the event object
3626
+ */
3627
+ clickHandler(e: MouseEvent): boolean | void;
3628
+ connectedCallback(): void;
3629
+ /**
3630
+ * Focuses the inner control when the component is focused.
3631
+ *
3632
+ * @param e - the event object
3633
+ * @public
3634
+ */
3635
+ focusinHandler(e: FocusEvent): boolean | void;
3636
+ /**
3637
+ * Resets the value to its initial value when the form is reset.
3638
+ *
3639
+ * @internal
3640
+ */
3641
+ formResetCallback(): void;
3642
+ /**
3643
+ * Handles implicit form submission when the user presses the "Enter" key.
3644
+ *
3645
+ * @internal
3646
+ */
3647
+ private implicitSubmit;
3648
+ /**
3649
+ * Handles the internal control's `input` event.
3650
+ *
3651
+ * @internal
3652
+ */
3653
+ inputHandler(e: InputEvent): boolean | void;
3654
+ /**
3655
+ * Handles the internal control's `keydown` event.
3656
+ *
3657
+ * @param e - the event object
3658
+ * @internal
3659
+ */
3660
+ keydownHandler(e: KeyboardEvent): boolean | void;
3661
+ /**
3662
+ * Selects all the text in the text field.
3663
+ *
3664
+ * @public
3665
+ * @privateRemarks
3666
+ * The `select` event does not permeate the shadow DOM boundary. This function effectively proxies the event,
3667
+ * emitting a `select` event whenever the internal control emits a `select` event
3668
+ *
3669
+ */
3670
+ select(): void;
3671
+ /**
3672
+ * Sets the custom validity message.
3673
+ * @param message - The message to set
3674
+ *
3675
+ * @public
3676
+ */
3677
+ setCustomValidity(message: string): void;
3678
+ /**
3679
+ * Reports the validity of the element.
3680
+ *
3681
+ * @public
3682
+ * @remarks
3683
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
3684
+ */
3685
+ reportValidity(): boolean;
3686
+ /**
3687
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
3688
+ *
3689
+ * @internal
3690
+ */
3691
+ setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
3692
+ /**
3693
+ * Sets the validity of the control.
3694
+ *
3695
+ * @param flags - Validity flags. If not provided, the control's `validity` will be used.
3696
+ * @param message - Optional message to supply. If not provided, the control's `validationMessage` will be used. If the control does not have a `validationMessage`, the message will be empty.
3697
+ * @param anchor - Optional anchor to use for the validation message. If not provided, the control will be used.
3698
+ *
3699
+ * @internal
3700
+ */
3701
+ setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
3702
+ }
3703
+
3704
+ export declare class BaseTree extends FASTElement {
3705
+ /**
3706
+ * The currently selected tree item
3707
+ * @public
3708
+ */
3709
+ currentSelected: HTMLElement | null;
3710
+ /**
3711
+ * The tree item that is designated to be in the tab queue.
3712
+ *
3713
+ * @internal
3714
+ */
3715
+ private currentFocused;
3716
+ /**
3717
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3718
+ *
3719
+ * @internal
3720
+ */
3721
+ elementInternals: ElementInternals;
3722
+ /** @internal */
3723
+ defaultSlot: HTMLSlotElement;
3724
+ /**
3725
+ * Calls the slot change handler when the `defaultSlot` reference is updated
3726
+ * by the template binding.
3727
+ *
3728
+ * @internal
3729
+ */
3730
+ defaultSlotChanged(): void;
3731
+ constructor();
3732
+ connectedCallback(): void;
3733
+ /** @internal */
3734
+ childTreeItems: BaseTreeItem[];
3735
+ /** @internal */
3736
+ childTreeItemsChanged(): void;
3737
+ /**
3738
+ * Updates current selected when slottedTreeItems changes
3739
+ */
3740
+ private updateCurrentSelected;
3741
+ /**
3742
+ * KeyDown handler
3743
+ *
3744
+ * @internal
3745
+ */
3746
+ keydownHandler(e: KeyboardEvent): boolean | void;
3747
+ /**
3748
+ * Handle focus events
3749
+ *
3750
+ * @internal
3751
+ */
3752
+ focusHandler(e: FocusEvent): void;
3753
+ /**
3754
+ * Handle blur events
3755
+ *
3756
+ * @internal
3757
+ */
3758
+ blurHandler(e: FocusEvent): void;
3759
+ /**
3760
+ * Handles click events bubbling up
3761
+ *
3762
+ * @internal
3763
+ */
3764
+ clickHandler(e: Event): boolean | void;
3765
+ /**
3766
+ * Handles the selected-changed events bubbling up
3767
+ * from child tree items
3768
+ *
3769
+ * @internal
3770
+ */
3771
+ changeHandler(e: Event): boolean | void;
3772
+ /**
3773
+ * checks if there are any nested tree items
3774
+ */
3775
+ private getValidFocusableItem;
3776
+ private getVisibleNodes;
3777
+ /**
3778
+ * Move focus to a tree item based on its offset from the provided item
3779
+ */
3780
+ private focusNextNode;
3781
+ /** @internal */
3782
+ handleDefaultSlotChange(): void;
3783
+ }
3784
+
3785
+ declare class BaseTreeItem extends FASTElement {
3786
+ /**
3787
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
3788
+ *
3789
+ * @internal
3790
+ */
3791
+ elementInternals: ElementInternals;
3792
+ /** @internal */
3793
+ itemSlot: HTMLSlotElement;
3794
+ /**
3795
+ * Calls the slot change handler when the `itemSlot` reference is updated
3796
+ * by the template binding.
3797
+ *
3798
+ * @internal
3799
+ */
3800
+ itemSlotChanged(): void;
3801
+ constructor();
3802
+ /**
3803
+ * When true, the control will be appear expanded by user interaction.
3804
+ * When true, the control will be appear expanded by user interaction.
3805
+ *
3806
+ * HTML Attribute: `expanded`
3807
+ *
3808
+ * @public
3809
+ */
3810
+ expanded: boolean;
3811
+ /**
3812
+ * Handles changes to the expanded attribute
3813
+ * @param prev - the previous state
3814
+ * @param next - the next state
3815
+ *
3816
+ * @public
3817
+ */
3818
+ expandedChanged(prev: boolean, next: boolean): void;
3819
+ /**
3820
+ * When true, the control will appear selected by user interaction.
3821
+ * @public
3822
+ * @remarks
3823
+ * HTML Attribute: selected
3824
+ */
3825
+ selected: boolean;
3826
+ /**
3827
+ * Handles changes to the selected attribute
3828
+ * @param prev - the previous state
3829
+ * @param next - the next state
3830
+ *
3831
+ * @internal
3832
+ */
3833
+ protected selectedChanged(prev: boolean, next: boolean): void;
3834
+ /**
3835
+ * When true, the control has no child tree items
3836
+ * When true, the control has no child tree items
3837
+ *
3838
+ * HTML Attribute: empty
3839
+ *
3840
+ * @public
3841
+ */
3842
+ empty: boolean;
3843
+ private styles;
3844
+ /**
3845
+ * The indent of the tree item element.
3846
+ * This is not needed once css attr() is supported (--indent: attr(data-indent type(<number>)));
3847
+ * @public
3848
+ */
3849
+ dataIndent: number | undefined;
3850
+ protected dataIndentChanged(prev: number, next: number): void;
3851
+ /** @internal */
3852
+ childTreeItems: BaseTreeItem[] | undefined;
3853
+ /**
3854
+ * Handles changes to the child tree items
3855
+ *
3856
+ * @public
3857
+ */
3858
+ childTreeItemsChanged(): void;
3859
+ connectedCallback(): void;
3860
+ /**
3861
+ * Updates the childrens indent
3862
+ *
3863
+ * @public
3864
+ */
3865
+ updateChildTreeItems(): void;
3866
+ /**
3867
+ * Sets the indent for each item
3868
+ */
3869
+ private setIndent;
3870
+ /**
3871
+ * Toggle the expansion state of the tree item
3872
+ *
3873
+ * @public
3874
+ */
3875
+ toggleExpansion(): void;
3876
+ /**
3877
+ * Whether the tree is nested
3878
+ * @internal
3879
+ */
3880
+ get isNestedItem(): boolean;
3881
+ protected updateTabindexBySelected(): void;
3882
+ /** @internal */
3524
3883
  handleItemSlotChange(): void;
3525
3884
  }
3526
3885
 
@@ -7845,1544 +8204,1203 @@ export declare const lineHeightBase500 = "var(--lineHeightBase500)";
7845
8204
  export declare const lineHeightBase600 = "var(--lineHeightBase600)";
7846
8205
 
7847
8206
  /**
7848
- * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero1000 | `lineHeightHero1000`} design token.
7849
- * @public
7850
- */
7851
- export declare const lineHeightHero1000 = "var(--lineHeightHero1000)";
7852
-
7853
- /**
7854
- * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero700 | `lineHeightHero700`} design token.
7855
- * @public
7856
- */
7857
- export declare const lineHeightHero700 = "var(--lineHeightHero700)";
7858
-
7859
- /**
7860
- * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero800 | `lineHeightHero800`} design token.
7861
- * @public
7862
- */
7863
- export declare const lineHeightHero800 = "var(--lineHeightHero800)";
7864
-
7865
- /**
7866
- * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero900 | `lineHeightHero900`} design token.
7867
- * @public
7868
- */
7869
- export declare const lineHeightHero900 = "var(--lineHeightHero900)";
7870
-
7871
- /**
7872
- * An Anchor Custom HTML Element.
7873
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
7874
- *
7875
- * @tag fluent-link
7876
- *
7877
- * @slot start - Content which can be provided before the link content
7878
- * @slot end - Content which can be provided after the link content
7879
- * @slot - The default slot for link content
7880
- *
7881
- * @public
7882
- */
7883
- export declare class Link extends BaseAnchor {
7884
- /**
7885
- * The appearance the link should have.
7886
- *
7887
- * @public
7888
- * @remarks
7889
- * HTML Attribute: `appearance`
7890
- */
7891
- appearance?: LinkAppearance | undefined;
7892
- /**
7893
- * The link is inline with text
7894
- * In chromium browsers, if the link is contained within a semantic
7895
- * text element (`h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p`) or `fluent-text`,
7896
- * `:host-context()` ensures inline links are styled appropriately.
7897
- *
7898
- * @public
7899
- * @remarks
7900
- * HTML Attribute: `inline`
7901
- */
7902
- inline: boolean;
7903
- }
7904
-
7905
- /**
7906
- * Link Appearance constants
7907
- * @public
7908
- */
7909
- export declare const LinkAppearance: {
7910
- readonly subtle: "subtle";
7911
- };
7912
-
7913
- /**
7914
- * An Link can be subtle or the default appearance
7915
- * @public
7916
- */
7917
- export declare type LinkAppearance = ValuesOf<typeof LinkAppearance>;
7918
-
7919
- /**
7920
- * @public
7921
- * @remarks
7922
- * HTML Element: \<fluent-link\>
7923
- */
7924
- export declare const LinkDefinition: FASTElementDefinition<typeof Link>;
7925
-
7926
- export declare const LinkStyles: ElementStyles;
7927
-
7928
- /**
7929
- * Link target values.
7930
- *
7931
- * @public
7932
- */
7933
- export declare const LinkTarget: {
7934
- readonly _self: "_self";
7935
- readonly _blank: "_blank";
7936
- readonly _parent: "_parent";
7937
- readonly _top: "_top";
7938
- };
7939
-
7940
- /**
7941
- * Type for link target values.
7942
- *
7943
- * @public
7944
- */
7945
- export declare type LinkTarget = ValuesOf<typeof AnchorTarget>;
7946
-
7947
- /**
7948
- * The template for the Link component.
7949
- * @public
7950
- */
7951
- export declare const LinkTemplate: ElementViewTemplate<Link>;
7952
-
7953
- /**
7954
- * A Listbox Custom HTML Element.
7955
- * Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox } role.
7956
- *
7957
- * @tag fluent-listbox
7958
- *
7959
- * @slot - The default slot for the options.
7960
- *
7961
- * @remarks
7962
- * The listbox component represents a list of options that can be selected.
7963
- * It is intended to be used in conjunction with the {@link BaseDropdown | Dropdown} component.
7964
- *
7965
- * @public
7966
- */
7967
- export declare class Listbox extends FASTElement {
7968
- /**
7969
- * A reference to the default slot element.
7970
- *
7971
- * @internal
7972
- */
7973
- defaultSlot: HTMLSlotElement;
7974
- /**
7975
- * Calls the `slotchangeHandler` when the `defaultSlot` element is assigned
7976
- * via the `ref` directive in the template.
7977
- *
7978
- * @internal
7979
- */
7980
- protected defaultSlotChanged(): void;
7981
- /**
7982
- * Indicates whether the listbox allows multiple selection.
7983
- *
7984
- * @public
7985
- */
7986
- multiple?: boolean;
7987
- /**
7988
- * Updates the multiple selection state of the listbox and its options.
7989
- *
7990
- * @param prev - the previous multiple value
7991
- * @param next - the current multiple value
7992
- */
7993
- multipleChanged(prev: boolean | undefined, next: boolean | undefined): void;
7994
- /**
7995
- * The collection of all child options.
7996
- *
7997
- * @public
7998
- */
7999
- options: DropdownOption[];
8000
- /**
8001
- * Updates the enabled options collection when properties on the child options change.
8002
- *
8003
- * @param prev - the previous options
8004
- * @param next - the current options
8005
- *
8006
- * @internal
8007
- */
8008
- optionsChanged(prev: DropdownOption[] | undefined, next: DropdownOption[] | undefined): void;
8009
- /**
8010
- * The index of the first selected and enabled option.
8011
- * @internal
8012
- */
8013
- selectedIndex: number;
8014
- /**
8015
- * Reference to the parent dropdown element.
8016
- * @internal
8017
- */
8018
- dropdown?: BaseDropdown;
8019
- /**
8020
- * Handles the `beforetoggle` event on the listbox.
8021
- *
8022
- * @param e - the toggle event
8023
- * @returns true to allow the default popover behavior, undefined to prevent it
8024
- * @internal
8025
- */
8026
- beforetoggleHandler(e: ToggleEvent): boolean | undefined;
8027
- /**
8028
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8029
- *
8030
- * @internal
8031
- */
8032
- elementInternals: ElementInternals;
8033
- /**
8034
- * The collection of child options that are not disabled.
8035
- *
8036
- * @internal
8037
- */
8038
- get enabledOptions(): DropdownOption[];
8039
- /**
8040
- * The collection of child options that are selected.
8041
- *
8042
- * @public
8043
- */
8044
- get selectedOptions(): DropdownOption[];
8045
- /**
8046
- * Sets the `selected` state on a target option when clicked.
8047
- *
8048
- * @param e - The pointer event
8049
- * @public
8050
- */
8051
- clickHandler(e: PointerEvent): boolean | void;
8052
- constructor();
8053
- connectedCallback(): void;
8054
- /**
8055
- * Handles observable subscriptions for the listbox.
8056
- *
8057
- * @param source - The source of the observed change
8058
- * @param propertyName - The name of the property that changed
8059
- *
8060
- * @internal
8061
- */
8062
- handleChange(source: any, propertyName?: string): void;
8063
- /**
8064
- * Selects an option by index.
8065
- *
8066
- * @param index - The index of the option to select.
8067
- * @public
8068
- */
8069
- selectOption(index?: number): void;
8070
- /**
8071
- * Handles the `slotchange` event for the default slot.
8072
- * Sets the `options` property to the list of slotted options.
8073
- *
8074
- * @param e - The slotchange event
8075
- * @public
8076
- */
8077
- slotchangeHandler(e?: Event): void;
8078
- }
8079
-
8080
- /**
8081
- * The Fluent Listbox Element
8082
- *
8207
+ * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero1000 | `lineHeightHero1000`} design token.
8083
8208
  * @public
8084
- * @remarks
8085
- * HTML Element: `<fluent-listbox>`
8086
8209
  */
8087
- export declare const ListboxDefinition: FASTElementDefinition<typeof Listbox>;
8210
+ export declare const lineHeightHero1000 = "var(--lineHeightHero1000)";
8088
8211
 
8089
8212
  /**
8090
- * Styles for the {@link (Listbox:class)} component.
8091
- *
8213
+ * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero700 | `lineHeightHero700`} design token.
8092
8214
  * @public
8093
8215
  */
8094
- export declare const ListboxStyles: ElementStyles;
8216
+ export declare const lineHeightHero700 = "var(--lineHeightHero700)";
8095
8217
 
8096
8218
  /**
8097
- * Template for the Listbox component.
8098
- *
8219
+ * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero800 | `lineHeightHero800`} design token.
8099
8220
  * @public
8100
8221
  */
8101
- export declare const ListboxTemplate: ElementViewTemplate<Listbox>;
8222
+ export declare const lineHeightHero800 = "var(--lineHeightHero800)";
8102
8223
 
8103
8224
  /**
8104
- * Generates a template for the {@link (Dropdown:class)} component.
8105
- *
8106
- * @returns The template object.
8107
- *
8225
+ * CSS custom property value for the {@link @fluentui/tokens#lineHeightHero900 | `lineHeightHero900`} design token.
8108
8226
  * @public
8109
8227
  */
8110
- export declare function listboxTemplate<T extends Listbox>(): ElementViewTemplate<T>;
8228
+ export declare const lineHeightHero900 = "var(--lineHeightHero900)";
8111
8229
 
8112
8230
  /**
8113
- * An abstract behavior to react to media queries. Implementations should implement
8114
- * the `constructListener` method to perform some action based on media query changes.
8231
+ * An Anchor Custom HTML Element.
8232
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
8233
+ *
8234
+ * @tag fluent-link
8235
+ *
8236
+ * @slot start - Content which can be provided before the link content
8237
+ * @slot end - Content which can be provided after the link content
8238
+ * @slot - The default slot for link content
8115
8239
  *
8116
8240
  * @public
8117
8241
  */
8118
- export declare abstract class MatchMediaBehavior implements HostBehavior {
8119
- /**
8120
- * The behavior needs to operate on element instances but elements might share a behavior instance.
8121
- * To ensure proper attachment / detachment per instance, we construct a listener for
8122
- * each bind invocation and cache the listeners by element reference.
8123
- */
8124
- private listenerCache;
8125
- /**
8126
- * The media query that the behavior operates on.
8127
- */
8128
- readonly query: MediaQueryList;
8242
+ export declare class Link extends BaseAnchor {
8129
8243
  /**
8244
+ * The appearance the link should have.
8130
8245
  *
8131
- * @param query - The media query to operate from.
8132
- */
8133
- constructor(query: MediaQueryList);
8134
- /**
8135
- * Constructs a function that will be invoked with the MediaQueryList context
8136
- * @param controller - The host controller orchestrating this behavior.
8137
- */
8138
- protected abstract constructListener(controller: HostController): MediaQueryListListener;
8139
- /**
8140
- * Binds the behavior to the element.
8141
- * @param controller - The host controller orchestrating this behavior.
8246
+ * @public
8247
+ * @remarks
8248
+ * HTML Attribute: `appearance`
8142
8249
  */
8143
- connectedCallback(controller: HostController): void;
8250
+ appearance?: LinkAppearance | undefined;
8144
8251
  /**
8145
- * Unbinds the behavior from the element.
8146
- * @param controller - The host controller orchestrating this behavior.
8252
+ * The link is inline with text
8253
+ * In chromium browsers, if the link is contained within a semantic
8254
+ * text element (`h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p`) or `fluent-text`,
8255
+ * `:host-context()` ensures inline links are styled appropriately.
8256
+ *
8257
+ * @public
8258
+ * @remarks
8259
+ * HTML Attribute: `inline`
8147
8260
  */
8148
- disconnectedCallback(controller: HostController): void;
8261
+ inline: boolean;
8149
8262
  }
8150
8263
 
8151
8264
  /**
8152
- * A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that
8153
- * styles are applied while the a query matches the environment and that styles are not applied if the query does
8154
- * not match the environment.
8155
- *
8265
+ * Link Appearance constants
8156
8266
  * @public
8157
8267
  */
8158
- export declare class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {
8159
- /**
8160
- * The media query that the behavior operates on.
8161
- */
8162
- readonly query: MediaQueryList;
8163
- /**
8164
- * The styles object to be managed by the behavior.
8165
- */
8166
- readonly styles: ElementStyles;
8167
- /**
8168
- * Constructs a {@link MatchMediaStyleSheetBehavior} instance.
8169
- * @param query - The media query to operate from.
8170
- * @param styles - The styles to coordinate with the query.
8171
- */
8172
- constructor(query: MediaQueryList, styles: ElementStyles);
8173
- /**
8174
- * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for
8175
- * a provided query.
8176
- * @param query - The media query to operate from.
8177
- *
8178
- * @public
8179
- * @example
8180
- *
8181
- * ```ts
8182
- * import { css } from "@microsoft/fast-element";
8183
- * import { MatchMediaStyleSheetBehavior } from "@fluentui/web-components";
8184
- *
8185
- * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(
8186
- * window.matchMedia("(orientation: landscape)")
8187
- * );
8188
- *
8189
- * const styles = css`
8190
- * :host {
8191
- * width: 200px;
8192
- * height: 400px;
8193
- * }
8194
- * `
8195
- * .withBehaviors(landscapeBehavior(css`
8196
- * :host {
8197
- * width: 400px;
8198
- * height: 200px;
8199
- * }
8200
- * `))
8201
- * ```
8202
- */
8203
- static with(query: MediaQueryList): (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
8204
- /**
8205
- * Constructs a match-media listener for a provided element.
8206
- * @param source - the element for which to attach or detach styles.
8207
- */
8208
- protected constructListener(controller: HostController): MediaQueryListListener;
8209
- /**
8210
- * Unbinds the behavior from the element.
8211
- * @param controller - The host controller orchestrating this behavior.
8212
- * @internal
8213
- */
8214
- removedCallback(controller: HostController<any>): void;
8215
- }
8268
+ export declare const LinkAppearance: {
8269
+ readonly subtle: "subtle";
8270
+ };
8216
8271
 
8217
8272
  /**
8218
- * An event listener fired by a {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList | MediaQueryList }.
8273
+ * An Link can be subtle or the default appearance
8219
8274
  * @public
8220
8275
  */
8221
- export declare type MediaQueryListListener = (this: MediaQueryList, ev?: MediaQueryListEvent) => void;
8276
+ export declare type LinkAppearance = ValuesOf<typeof LinkAppearance>;
8222
8277
 
8223
8278
  /**
8224
- * A Menu component that provides a customizable menu element.
8225
- *
8226
- * @tag fluent-menu
8227
- *
8228
- * @class Menu
8229
- * @extends FASTElement
8230
- *
8231
- * @attr open-on-hover - Determines if the menu should open on hover.
8232
- * @attr open-on-context - Determines if the menu should open on right click.
8233
- * @attr close-on-scroll - Determines if the menu should close on scroll.
8234
- * @attr persist-on-item-click - Determines if the menu open state should persist on click of menu item.
8235
- * @attr split - Determines if the menu is in split state.
8236
- *
8237
- * @cssproperty --menu-max-height - The max-height of the menu.
8238
- *
8239
- * @slot primary-action - Slot for the primary action elements. Used when in `split` state.
8240
- * @slot trigger - Slot for the trigger elements.
8241
- * @slot - Default slot for the menu list.
8242
- *
8243
- * @method connectedCallback - Called when the element is connected to the DOM. Sets up the component.
8244
- * @method disconnectedCallback - Called when the element is disconnected from the DOM. Removes event listeners.
8245
- * @method setComponent - Sets the component state.
8246
- * @method toggleMenu - Toggles the open state of the menu.
8247
- * @method closeMenu - Closes the menu.
8248
- * @method openMenu - Opens the menu.
8249
- * @method focusMenuList - Focuses on the menu list.
8250
- * @method focusTrigger - Focuses on the menu trigger.
8251
- * @method openOnHoverChanged - Called whenever the 'openOnHover' property changes.
8252
- * @method persistOnItemClickChanged - Called whenever the 'persistOnItemClick' property changes.
8253
- * @method openOnContextChanged - Called whenever the 'openOnContext' property changes.
8254
- * @method closeOnScrollChanged - Called whenever the 'closeOnScroll' property changes.
8255
- * @method addListeners - Adds event listeners.
8256
- * @method removeListeners - Removes event listeners.
8257
- * @method menuKeydownHandler - Handles keyboard interaction for the menu.
8258
- * @method triggerKeydownHandler - Handles keyboard interaction for the trigger.
8259
- * @method documentClickHandler - Handles document click events to close the menu when a click occurs outside of the menu or the trigger.
8260
- *
8261
- * @summary The Menu component functions as a customizable menu element.
8262
- *
8263
- * @tag fluent-menu
8279
+ * @public
8280
+ * @remarks
8281
+ * HTML Element: \<fluent-link\>
8282
+ */
8283
+ export declare const LinkDefinition: FASTElementDefinition<typeof Link>;
8284
+
8285
+ export declare const LinkStyles: ElementStyles;
8286
+
8287
+ /**
8288
+ * Link target values.
8264
8289
  *
8265
8290
  * @public
8266
8291
  */
8267
- export declare class Menu extends FASTElement {
8268
- /**
8269
- * Determines if the menu should open on hover.
8270
- * @public
8271
- */
8272
- openOnHover?: boolean;
8273
- /**
8274
- * Determines if the menu should open on right click.
8275
- * @public
8276
- */
8277
- openOnContext?: boolean;
8278
- /**
8279
- * Determines if the menu should close on scroll.
8280
- * @public
8281
- */
8282
- closeOnScroll?: boolean;
8283
- /**
8284
- * Determines if the menu open state should persis on click of menu item
8285
- * @public
8286
- */
8287
- persistOnItemClick?: boolean;
8288
- /**
8289
- * Determines if the menu is in split state.
8290
- * @public
8291
- */
8292
- split?: boolean;
8293
- /**
8294
- * Holds the slotted menu list.
8295
- * @public
8296
- */
8297
- slottedMenuList: MenuList[];
8298
- /**
8299
- * Sets up the component when the slotted menu list changes.
8300
- * @param prev - The previous items in the slotted menu list.
8301
- * @param next - The new items in the slotted menu list.
8302
- * @internal
8303
- */
8304
- slottedMenuListChanged(prev: MenuList[] | undefined, next: MenuList[] | undefined): void;
8305
- /**
8306
- * Holds the slotted triggers.
8307
- * @public
8308
- */
8309
- slottedTriggers: HTMLElement[];
8310
- /**
8311
- * Holds the primary slot element.
8312
- * @public
8313
- */
8314
- primaryAction: HTMLSlotElement;
8315
- /**
8316
- * Defines whether the menu is open or not.
8317
- * @internal
8318
- */
8319
- private _open;
8292
+ export declare const LinkTarget: {
8293
+ readonly _self: "_self";
8294
+ readonly _blank: "_blank";
8295
+ readonly _parent: "_parent";
8296
+ readonly _top: "_top";
8297
+ };
8298
+
8299
+ /**
8300
+ * Type for link target values.
8301
+ *
8302
+ * @public
8303
+ */
8304
+ export declare type LinkTarget = ValuesOf<typeof AnchorTarget>;
8305
+
8306
+ /**
8307
+ * The template for the Link component.
8308
+ * @public
8309
+ */
8310
+ export declare const LinkTemplate: ElementViewTemplate<Link>;
8311
+
8312
+ /**
8313
+ * A Listbox Custom HTML Element.
8314
+ * Implements the {@link https://w3c.github.io/aria/#listbox | ARIA listbox } role.
8315
+ *
8316
+ * @tag fluent-listbox
8317
+ *
8318
+ * @slot - The default slot for the options.
8319
+ *
8320
+ * @remarks
8321
+ * The listbox component represents a list of options that can be selected.
8322
+ * It is intended to be used in conjunction with the {@link BaseDropdown | Dropdown} component.
8323
+ *
8324
+ * @public
8325
+ */
8326
+ export declare class Listbox extends FASTElement {
8320
8327
  /**
8321
- * The trigger element of the menu.
8328
+ * A reference to the default slot element.
8329
+ *
8322
8330
  * @internal
8323
8331
  */
8324
- private _trigger?;
8332
+ defaultSlot: HTMLSlotElement;
8325
8333
  /**
8326
- * The menu list element of the menu which has the popover behavior.
8334
+ * Calls the `slotchangeHandler` when the `defaultSlot` element is assigned
8335
+ * via the `ref` directive in the template.
8336
+ *
8327
8337
  * @internal
8328
8338
  */
8329
- private _menuList?;
8330
- /**
8331
- * Called when the element is connected to the DOM.
8332
- * Sets up the component.
8333
- * @public
8334
- */
8335
- connectedCallback(): void;
8336
- /**
8337
- * Called when the element is disconnected from the DOM.
8338
- * Removes event listeners.
8339
- * @public
8340
- */
8341
- disconnectedCallback(): void;
8339
+ protected defaultSlotChanged(): void;
8342
8340
  /**
8343
- * Sets the component.
8344
- * Sets the trigger and menu list elements and adds event listeners.
8341
+ * Indicates whether the listbox allows multiple selection.
8342
+ *
8345
8343
  * @public
8346
8344
  */
8347
- setComponent(): void;
8345
+ multiple?: boolean;
8348
8346
  /**
8349
- * Toggles the open state of the menu.
8350
- * @public
8347
+ * Updates the multiple selection state of the listbox and its options.
8348
+ *
8349
+ * @param prev - the previous multiple value
8350
+ * @param next - the current multiple value
8351
8351
  */
8352
- toggleMenu: () => void;
8352
+ multipleChanged(prev: boolean | undefined, next: boolean | undefined): void;
8353
8353
  /**
8354
- * Closes the menu.
8354
+ * The collection of all child options.
8355
+ *
8355
8356
  * @public
8356
8357
  */
8357
- closeMenu: (event?: Event) => void;
8358
+ options: DropdownOption[];
8358
8359
  /**
8359
- * Opens the menu.
8360
- * @public
8360
+ * Updates the enabled options collection when properties on the child options change.
8361
+ *
8362
+ * @param prev - the previous options
8363
+ * @param next - the current options
8364
+ *
8365
+ * @internal
8361
8366
  */
8362
- openMenu: (e?: Event) => void;
8367
+ optionsChanged(prev: DropdownOption[] | undefined, next: DropdownOption[] | undefined): void;
8363
8368
  /**
8364
- * Focuses on the menu list.
8365
- * @public
8369
+ * The index of the first selected and enabled option.
8370
+ * @internal
8366
8371
  */
8367
- focusMenuList(): void;
8372
+ selectedIndex: number;
8368
8373
  /**
8369
- * Focuses on the menu trigger.
8370
- * @public
8374
+ * Reference to the parent dropdown element.
8375
+ * @internal
8371
8376
  */
8372
- focusTrigger(): void;
8377
+ dropdown?: BaseDropdown;
8373
8378
  /**
8374
- * Handles the 'toggle' event on the popover.
8375
- * @public
8376
- * @param e - the event
8377
- * @returns void
8379
+ * Handles the `beforetoggle` event on the listbox.
8380
+ *
8381
+ * @param e - the toggle event
8382
+ * @returns true to allow the default popover behavior, undefined to prevent it
8383
+ * @internal
8378
8384
  */
8379
- toggleHandler: (e: Event) => void;
8385
+ beforetoggleHandler(e: ToggleEvent): boolean | undefined;
8380
8386
  /**
8381
- * Called whenever the 'openOnHover' property changes.
8382
- * Adds or removes a 'mouseover' event listener to the trigger based on the new value.
8387
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8383
8388
  *
8384
- * @param oldValue - The previous value of 'openOnHover'.
8385
- * @param newValue - The new value of 'openOnHover'.
8386
- * @public
8389
+ * @internal
8387
8390
  */
8388
- openOnHoverChanged(oldValue: boolean, newValue: boolean): void;
8391
+ elementInternals: ElementInternals;
8389
8392
  /**
8390
- * Called whenever the 'persistOnItemClick' property changes.
8391
- * Adds or removes a 'click' event listener to the menu list based on the new value.
8392
- * @public
8393
- * @param oldValue - The previous value of 'persistOnItemClick'.
8394
- * @param newValue - The new value of 'persistOnItemClick'.
8393
+ * The collection of child options that are not disabled.
8394
+ *
8395
+ * @internal
8395
8396
  */
8396
- persistOnItemClickChanged(oldValue: boolean, newValue: boolean): void;
8397
+ get enabledOptions(): DropdownOption[];
8397
8398
  /**
8398
- * Called whenever the 'openOnContext' property changes.
8399
- * Adds or removes a 'contextmenu' event listener to the trigger based on the new value.
8399
+ * The collection of child options that are selected.
8400
+ *
8400
8401
  * @public
8401
- * @param oldValue - The previous value of 'openOnContext'.
8402
- * @param newValue - The new value of 'openOnContext'.
8403
8402
  */
8404
- openOnContextChanged(oldValue: boolean, newValue: boolean): void;
8403
+ get selectedOptions(): DropdownOption[];
8405
8404
  /**
8406
- * Called whenever the 'closeOnScroll' property changes.
8407
- * Adds or removes a 'closeOnScroll' event listener to the trigger based on the new value.
8405
+ * Sets the `selected` state on a target option when clicked.
8406
+ *
8407
+ * @param e - The pointer event
8408
8408
  * @public
8409
- * @param oldValue - The previous value of 'closeOnScroll'.
8410
- * @param newValue - The new value of 'closeOnScroll'.
8411
- */
8412
- closeOnScrollChanged(oldValue: boolean, newValue: boolean): void;
8413
- /**
8414
- * Adds event listeners.
8415
- * Adds click and keydown event listeners to the trigger.
8416
- * Adds a 'toggle' event listener to the menu list.
8417
- * If 'openOnHover' is true, adds a 'mouseover' event listener to the trigger.
8418
- * If 'openOnContext' is true, adds a 'contextmenu' event listener to the trigger and a document 'click' event listener.
8419
- * @internal
8420
8409
  */
8421
- private addListeners;
8410
+ clickHandler(e: PointerEvent): boolean | void;
8411
+ constructor();
8412
+ connectedCallback(): void;
8422
8413
  /**
8423
- * Removes event listeners.
8424
- * Removes click and keydown event listeners from the trigger.
8425
- * Also removes toggle event listener from the menu list.
8426
- * Also removes 'mouseover' event listeners from the trigger.
8427
- * Also removes 'contextmenu' event listeners from the trigger and document 'click' event listeners.
8414
+ * Handles observable subscriptions for the listbox.
8415
+ *
8416
+ * @param source - The source of the observed change
8417
+ * @param propertyName - The name of the property that changed
8418
+ *
8428
8419
  * @internal
8429
8420
  */
8430
- private removeListeners;
8421
+ handleChange(source: any, propertyName?: string): void;
8431
8422
  /**
8432
- * Handles keyboard interaction for the menu. Closes the menu and focuses on the trigger when the Escape key is
8433
- * pressed. Closes the menu when the Tab key is pressed.
8423
+ * Selects an option by index.
8434
8424
  *
8435
- * @param e - the keyboard event
8425
+ * @param index - The index of the option to select.
8436
8426
  * @public
8437
8427
  */
8438
- menuKeydownHandler(e: KeyboardEvent): boolean | void;
8428
+ selectOption(index?: number): void;
8439
8429
  /**
8440
- * Handles keyboard interaction for the trigger. Toggles the menu when the Space or Enter key is pressed. If the menu
8441
- * is open, focuses on the menu list.
8430
+ * Handles the `slotchange` event for the default slot.
8431
+ * Sets the `options` property to the list of slotted options.
8442
8432
  *
8443
- * @param e - the keyboard event
8433
+ * @param e - The slotchange event
8444
8434
  * @public
8445
8435
  */
8446
- triggerKeydownHandler: (e: KeyboardEvent) => boolean | void;
8447
- /**
8448
- * Handles document click events to close a menu opened with contextmenu in popover="manual" mode.
8449
- * @internal
8450
- * @param e - The event triggered on document click.
8451
- */
8452
- private documentClickHandler;
8436
+ slotchangeHandler(e?: Event): void;
8453
8437
  }
8454
8438
 
8455
8439
  /**
8456
- * The base class used for constructing a fluent-menu-button custom element
8457
- *
8458
- * @tag fluent-menu-button
8440
+ * The Fluent Listbox Element
8459
8441
  *
8460
- * @public
8461
- */
8462
- export declare class MenuButton extends Button {
8463
- }
8464
-
8465
- /**
8466
- * Menu Button Appearance constants
8467
- * @public
8468
- */
8469
- export declare const MenuButtonAppearance: {
8470
- readonly primary: "primary";
8471
- readonly outline: "outline";
8472
- readonly subtle: "subtle";
8473
- readonly transparent: "transparent";
8474
- };
8475
-
8476
- /**
8477
- * A Menu Button can be secondary, primary, outline, subtle, transparent
8478
- * @public
8479
- */
8480
- export declare type MenuButtonAppearance = ValuesOf<typeof MenuButtonAppearance>;
8481
-
8482
- /**
8483
8442
  * @public
8484
8443
  * @remarks
8485
- * HTML Element: \<fluent-button\>
8486
- */
8487
- export declare const MenuButtonDefinition: FASTElementDefinition<typeof MenuButton>;
8488
-
8489
- /**
8490
- * A Menu Button can be square, circular or rounded.
8491
- * @public
8492
- */
8493
- export declare const MenuButtonShape: {
8494
- readonly circular: "circular";
8495
- readonly rounded: "rounded";
8496
- readonly square: "square";
8497
- };
8498
-
8499
- /**
8500
- * A Menu Button can be square, circular or rounded
8501
- * @public
8502
- */
8503
- export declare type MenuButtonShape = ValuesOf<typeof MenuButtonShape>;
8504
-
8505
- /**
8506
- * A Menu Button can be a size of small, medium or large.
8507
- * @public
8444
+ * HTML Element: `<fluent-listbox>`
8508
8445
  */
8509
- export declare const MenuButtonSize: {
8510
- readonly small: "small";
8511
- readonly medium: "medium";
8512
- readonly large: "large";
8513
- };
8446
+ export declare const ListboxDefinition: FASTElementDefinition<typeof Listbox>;
8514
8447
 
8515
8448
  /**
8516
- * A Menu Button can be on of several preset sizes.
8449
+ * Styles for the {@link (Listbox:class)} component.
8450
+ *
8517
8451
  * @public
8518
8452
  */
8519
- export declare type MenuButtonSize = ValuesOf<typeof MenuButtonSize>;
8453
+ export declare const ListboxStyles: ElementStyles;
8520
8454
 
8521
8455
  /**
8522
- * The template for the Button component.
8456
+ * Template for the Listbox component.
8457
+ *
8523
8458
  * @public
8524
8459
  */
8525
- export declare const MenuButtonTemplate: ElementViewTemplate<MenuButton>;
8460
+ export declare const ListboxTemplate: ElementViewTemplate<Listbox>;
8526
8461
 
8527
8462
  /**
8528
- * The Fluent Menu Element.
8463
+ * Generates a template for the {@link (Dropdown:class)} component.
8464
+ *
8465
+ * @returns The template object.
8529
8466
  *
8530
8467
  * @public
8531
- * @remarks
8532
- * HTML Element: <fluent-menu>
8533
8468
  */
8534
- export declare const MenuDefinition: FASTElementDefinition<typeof Menu>;
8469
+ export declare function listboxTemplate<T extends Listbox>(): ElementViewTemplate<T>;
8535
8470
 
8536
8471
  /**
8537
- * A Switch Custom HTML Element.
8538
- * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
8539
- *
8540
- * @tag fluent-menu-item
8541
- *
8542
- * @slot indicator - The checkbox or radio indicator
8543
- * @slot start - Content which can be provided before the menu item content
8544
- * @slot - The default slot for menu item content
8545
- * @slot end - Content which can be provided after the menu item content
8546
- * @slot submenu-glyph - The submenu expand/collapse indicator
8547
- * @slot submenu - Used to nest menu's within menu items
8548
- * @csspart content - The element wrapping the menu item content
8549
- * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
8472
+ * An abstract behavior to react to media queries. Implementations should implement
8473
+ * the `constructListener` method to perform some action based on media query changes.
8550
8474
  *
8551
8475
  * @public
8552
8476
  */
8553
- export declare class MenuItem extends FASTElement {
8477
+ export declare abstract class MatchMediaBehavior implements HostBehavior {
8554
8478
  /**
8555
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8556
- *
8557
- * @internal
8479
+ * The behavior needs to operate on element instances but elements might share a behavior instance.
8480
+ * To ensure proper attachment / detachment per instance, we construct a listener for
8481
+ * each bind invocation and cache the listeners by element reference.
8558
8482
  */
8559
- elementInternals: ElementInternals;
8483
+ private listenerCache;
8560
8484
  /**
8561
- * The disabled state of the element.
8562
- *
8563
- * @public
8564
- * @remarks
8565
- * HTML Attribute: disabled
8485
+ * The media query that the behavior operates on.
8566
8486
  */
8567
- disabled: boolean;
8487
+ readonly query: MediaQueryList;
8568
8488
  /**
8569
- * Handles changes to disabled attribute custom states and element internals
8570
- * @param prev - the previous state
8571
- * @param next - the next state
8489
+ *
8490
+ * @param query - The media query to operate from.
8572
8491
  */
8573
- disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
8492
+ constructor(query: MediaQueryList);
8574
8493
  /**
8575
- * The role of the element.
8576
- *
8577
- * @public
8578
- * @remarks
8579
- * HTML Attribute: role
8494
+ * Constructs a function that will be invoked with the MediaQueryList context
8495
+ * @param controller - The host controller orchestrating this behavior.
8580
8496
  */
8581
- role: MenuItemRole;
8497
+ protected abstract constructListener(controller: HostController): MediaQueryListListener;
8582
8498
  /**
8583
- * Handles changes to role attribute element internals properties
8584
- * @param prev - the previous state
8585
- * @param next - the next state
8499
+ * Binds the behavior to the element.
8500
+ * @param controller - The host controller orchestrating this behavior.
8586
8501
  */
8587
- roleChanged(prev: MenuItemRole | undefined, next: MenuItemRole | undefined): void;
8502
+ connectedCallback(controller: HostController): void;
8588
8503
  /**
8589
- * The checked value of the element.
8590
- *
8591
- * @public
8592
- * @remarks
8593
- * HTML Attribute: checked
8504
+ * Unbinds the behavior from the element.
8505
+ * @param controller - The host controller orchestrating this behavior.
8594
8506
  */
8595
- checked: boolean;
8507
+ disconnectedCallback(controller: HostController): void;
8508
+ }
8509
+
8510
+ /**
8511
+ * A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that
8512
+ * styles are applied while the a query matches the environment and that styles are not applied if the query does
8513
+ * not match the environment.
8514
+ *
8515
+ * @public
8516
+ */
8517
+ export declare class MatchMediaStyleSheetBehavior extends MatchMediaBehavior {
8596
8518
  /**
8597
- * Handles changes to checked attribute custom states and element internals
8598
- * @param prev - the previous state
8599
- * @param next - the next state
8519
+ * The media query that the behavior operates on.
8600
8520
  */
8601
- protected checkedChanged(prev: boolean, next: boolean): void;
8521
+ readonly query: MediaQueryList;
8602
8522
  /**
8603
- * The hidden attribute.
8604
- *
8605
- * @public
8606
- * @remarks
8607
- * HTML Attribute: hidden
8523
+ * The styles object to be managed by the behavior.
8608
8524
  */
8609
- hidden: boolean;
8525
+ readonly styles: ElementStyles;
8610
8526
  /**
8611
- * The submenu slotted content.
8612
- *
8613
- * @internal
8527
+ * Constructs a {@link MatchMediaStyleSheetBehavior} instance.
8528
+ * @param query - The media query to operate from.
8529
+ * @param styles - The styles to coordinate with the query.
8614
8530
  */
8615
- slottedSubmenu: HTMLElement[];
8531
+ constructor(query: MediaQueryList, styles: ElementStyles);
8616
8532
  /**
8617
- * Sets the submenu and updates its position.
8533
+ * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for
8534
+ * a provided query.
8535
+ * @param query - The media query to operate from.
8618
8536
  *
8619
- * @internal
8537
+ * @public
8538
+ * @example
8539
+ *
8540
+ * ```ts
8541
+ * import { css } from "@microsoft/fast-element";
8542
+ * import { MatchMediaStyleSheetBehavior } from "@fluentui/web-components";
8543
+ *
8544
+ * const landscapeBehavior = MatchMediaStyleSheetBehavior.with(
8545
+ * window.matchMedia("(orientation: landscape)")
8546
+ * );
8547
+ *
8548
+ * const styles = css`
8549
+ * :host {
8550
+ * width: 200px;
8551
+ * height: 400px;
8552
+ * }
8553
+ * `
8554
+ * .withBehaviors(landscapeBehavior(css`
8555
+ * :host {
8556
+ * width: 400px;
8557
+ * height: 200px;
8558
+ * }
8559
+ * `))
8560
+ * ```
8620
8561
  */
8621
- protected slottedSubmenuChanged(prev: HTMLElement[] | undefined, next: HTMLElement[]): void;
8562
+ static with(query: MediaQueryList): (styles: ElementStyles) => MatchMediaStyleSheetBehavior;
8622
8563
  /**
8623
- * @internal
8564
+ * Constructs a match-media listener for a provided element.
8565
+ * @param source - the element for which to attach or detach styles.
8624
8566
  */
8625
- submenu: HTMLElement | undefined;
8626
- connectedCallback(): void;
8567
+ protected constructListener(controller: HostController): MediaQueryListListener;
8627
8568
  /**
8569
+ * Unbinds the behavior from the element.
8570
+ * @param controller - The host controller orchestrating this behavior.
8628
8571
  * @internal
8629
8572
  */
8630
- handleMenuItemKeyDown: (e: KeyboardEvent) => boolean;
8573
+ removedCallback(controller: HostController<any>): void;
8574
+ }
8575
+
8576
+ /**
8577
+ * An event listener fired by a {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList | MediaQueryList }.
8578
+ * @public
8579
+ */
8580
+ export declare type MediaQueryListListener = (this: MediaQueryList, ev?: MediaQueryListEvent) => void;
8581
+
8582
+ /**
8583
+ * A Menu component that provides a customizable menu element.
8584
+ *
8585
+ * @tag fluent-menu
8586
+ *
8587
+ * @class Menu
8588
+ * @extends FASTElement
8589
+ *
8590
+ * @attr open-on-hover - Determines if the menu should open on hover.
8591
+ * @attr open-on-context - Determines if the menu should open on right click.
8592
+ * @attr close-on-scroll - Determines if the menu should close on scroll.
8593
+ * @attr persist-on-item-click - Determines if the menu open state should persist on click of menu item.
8594
+ * @attr split - Determines if the menu is in split state.
8595
+ *
8596
+ * @cssproperty --menu-max-height - The max-height of the menu.
8597
+ *
8598
+ * @slot primary-action - Slot for the primary action elements. Used when in `split` state.
8599
+ * @slot trigger - Slot for the trigger elements.
8600
+ * @slot - Default slot for the menu list.
8601
+ *
8602
+ * @method connectedCallback - Called when the element is connected to the DOM. Sets up the component.
8603
+ * @method disconnectedCallback - Called when the element is disconnected from the DOM. Removes event listeners.
8604
+ * @method setComponent - Sets the component state.
8605
+ * @method toggleMenu - Toggles the open state of the menu.
8606
+ * @method closeMenu - Closes the menu.
8607
+ * @method openMenu - Opens the menu.
8608
+ * @method focusMenuList - Focuses on the menu list.
8609
+ * @method focusTrigger - Focuses on the menu trigger.
8610
+ * @method openOnHoverChanged - Called whenever the 'openOnHover' property changes.
8611
+ * @method persistOnItemClickChanged - Called whenever the 'persistOnItemClick' property changes.
8612
+ * @method openOnContextChanged - Called whenever the 'openOnContext' property changes.
8613
+ * @method closeOnScrollChanged - Called whenever the 'closeOnScroll' property changes.
8614
+ * @method addListeners - Adds event listeners.
8615
+ * @method removeListeners - Removes event listeners.
8616
+ * @method menuKeydownHandler - Handles keyboard interaction for the menu.
8617
+ * @method triggerKeydownHandler - Handles keyboard interaction for the trigger.
8618
+ * @method documentClickHandler - Handles document click events to close the menu when a click occurs outside of the menu or the trigger.
8619
+ *
8620
+ * @summary The Menu component functions as a customizable menu element.
8621
+ *
8622
+ * @tag fluent-menu
8623
+ *
8624
+ * @public
8625
+ */
8626
+ export declare class Menu extends FASTElement {
8631
8627
  /**
8632
- * @internal
8628
+ * Determines if the menu should open on hover.
8629
+ * @public
8633
8630
  */
8634
- handleMenuItemClick: (e: MouseEvent) => boolean;
8631
+ openOnHover?: boolean;
8635
8632
  /**
8636
- * @internal
8633
+ * Determines if the menu should open on right click.
8634
+ * @public
8637
8635
  */
8638
- handleMouseOver: (e: MouseEvent) => boolean;
8636
+ openOnContext?: boolean;
8639
8637
  /**
8640
- * @internal
8638
+ * Determines if the menu should close on scroll.
8639
+ * @public
8641
8640
  */
8642
- handleMouseOut: (e: MouseEvent) => boolean;
8641
+ closeOnScroll?: boolean;
8643
8642
  /**
8644
- * Setup required ARIA on open/close
8645
- * @internal
8643
+ * Determines if the menu open state should persis on click of menu item
8644
+ * @public
8646
8645
  */
8647
- toggleHandler: (e: Event) => void;
8646
+ persistOnItemClick?: boolean;
8648
8647
  /**
8649
- * @internal
8648
+ * Determines if the menu is in split state.
8649
+ * @public
8650
8650
  */
8651
- private invoke;
8651
+ split?: boolean;
8652
8652
  /**
8653
- * Set fallback position of menu on open when CSS anchor not supported
8654
- * @internal
8655
- */
8656
- setSubmenuPosition: () => void;
8657
- }
8658
-
8659
- /**
8660
- * Mark internal because exporting class and interface of the same name
8661
- * confuses API documenter.
8662
- * TODO: https://github.com/microsoft/fast/issues/3317
8663
- * @internal
8664
- */
8665
- export declare interface MenuItem extends StartEnd {
8666
- }
8667
-
8668
- export declare type MenuItemColumnCount = 0 | 1 | 2;
8669
-
8670
- /**
8671
- * @public
8672
- * @remarks
8673
- * HTML Element: <fluent-menu-item>
8674
- */
8675
- export declare const MenuItemDefinition: FASTElementDefinition<typeof MenuItem>;
8676
-
8677
- /**
8678
- * Menu Item configuration options
8679
- * @public
8680
- */
8681
- export declare type MenuItemOptions = StartEndOptions<MenuItem> & {
8682
- indicator?: StaticallyComposableHTML<MenuItem>;
8683
- submenuGlyph?: StaticallyComposableHTML<MenuItem>;
8684
- };
8685
-
8686
- /**
8687
- * Menu items roles.
8688
- * @public
8689
- */
8690
- export declare const MenuItemRole: {
8653
+ * Holds the slotted menu list.
8654
+ * @public
8655
+ */
8656
+ slottedMenuList: MenuList[];
8691
8657
  /**
8692
- * The menu item has a "menuitem" role
8658
+ * Sets up the component when the slotted menu list changes.
8659
+ * @param prev - The previous items in the slotted menu list.
8660
+ * @param next - The new items in the slotted menu list.
8661
+ * @internal
8693
8662
  */
8694
- readonly menuitem: "menuitem";
8663
+ slottedMenuListChanged(prev: MenuList[] | undefined, next: MenuList[] | undefined): void;
8695
8664
  /**
8696
- * The menu item has a "menuitemcheckbox" role
8665
+ * Holds the slotted triggers.
8666
+ * @public
8697
8667
  */
8698
- readonly menuitemcheckbox: "menuitemcheckbox";
8668
+ slottedTriggers: HTMLElement[];
8699
8669
  /**
8700
- * The menu item has a "menuitemradio" role
8670
+ * Holds the primary slot element.
8671
+ * @public
8701
8672
  */
8702
- readonly menuitemradio: "menuitemradio";
8703
- };
8704
-
8705
- /**
8706
- * The types for menu item roles
8707
- * @public
8708
- */
8709
- export declare type MenuItemRole = ValuesOf<typeof MenuItemRole>;
8710
-
8711
- /** MenuItem styles
8712
- * @public
8713
- */
8714
- export declare const MenuItemStyles: ElementStyles;
8715
-
8716
- export declare const MenuItemTemplate: ElementViewTemplate<MenuItem>;
8717
-
8718
- /**
8719
- * A Menu Custom HTML Element.
8720
- * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.
8721
- *
8722
- * @tag fluent-menu-list
8723
- *
8724
- * @slot - The default slot for the menu items
8725
- *
8726
- * @public
8727
- */
8728
- export declare class MenuList extends FASTElement {
8673
+ primaryAction: HTMLSlotElement;
8729
8674
  /**
8730
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8731
- *
8675
+ * Defines whether the menu is open or not.
8732
8676
  * @internal
8733
8677
  */
8734
- elementInternals: ElementInternals;
8678
+ private _open;
8735
8679
  /**
8680
+ * The trigger element of the menu.
8736
8681
  * @internal
8737
8682
  */
8738
- items: HTMLElement[];
8739
- protected itemsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void;
8740
- protected menuItems: Element[] | undefined;
8683
+ private _trigger?;
8741
8684
  /**
8742
- * The index of the focusable element in the items array
8743
- * defaults to -1
8685
+ * The menu list element of the menu which has the popover behavior.
8686
+ * @internal
8744
8687
  */
8745
- private focusIndex;
8746
- private static focusableElementRoles;
8747
- constructor();
8688
+ private _menuList?;
8748
8689
  /**
8749
- * @internal
8690
+ * Called when the element is connected to the DOM.
8691
+ * Sets up the component.
8692
+ * @public
8750
8693
  */
8751
8694
  connectedCallback(): void;
8752
8695
  /**
8753
- * @internal
8696
+ * Called when the element is disconnected from the DOM.
8697
+ * Removes event listeners.
8698
+ * @public
8754
8699
  */
8755
8700
  disconnectedCallback(): void;
8756
8701
  /**
8757
- * @internal
8702
+ * Sets the component.
8703
+ * Sets the trigger and menu list elements and adds event listeners.
8704
+ * @public
8758
8705
  */
8759
- readonly isNestedMenu: () => boolean;
8706
+ setComponent(): void;
8760
8707
  /**
8761
- * Focuses the first item in the menu.
8762
- *
8708
+ * Toggles the open state of the menu.
8763
8709
  * @public
8764
8710
  */
8765
- focus(): void;
8711
+ toggleMenu: () => void;
8766
8712
  /**
8767
- * @internal
8713
+ * Closes the menu.
8714
+ * @public
8768
8715
  */
8769
- handleMenuKeyDown(e: KeyboardEvent): void | boolean;
8716
+ closeMenu: (event?: Event) => void;
8770
8717
  /**
8771
- * if focus is moving out of the menu, reset to a stable initial state
8772
- * @internal
8718
+ * Opens the menu.
8719
+ * @public
8773
8720
  */
8774
- handleFocusOut: (e: FocusEvent) => void;
8775
- private handleItemFocus;
8776
- private removeItemListeners;
8777
- private static elementIndent;
8778
- protected setItems(): void;
8721
+ openMenu: (e?: Event) => void;
8779
8722
  /**
8780
- * Method for Observable changes to the hidden attribute of child elements
8723
+ * Focuses on the menu list.
8724
+ * @public
8781
8725
  */
8782
- handleChange(source: any, propertyName: string): void;
8726
+ focusMenuList(): void;
8783
8727
  /**
8784
- * Handle change from child MenuItem element and set radio group behavior
8728
+ * Focuses on the menu trigger.
8729
+ * @public
8785
8730
  */
8786
- private changedMenuItemHandler;
8731
+ focusTrigger(): void;
8787
8732
  /**
8788
- * check if the item is a menu item
8733
+ * Handles the 'toggle' event on the popover.
8734
+ * @public
8735
+ * @param e - the event
8736
+ * @returns void
8789
8737
  */
8790
- protected isMenuItemElement: (el: Element) => el is HTMLElement;
8738
+ toggleHandler: (e: Event) => void;
8791
8739
  /**
8792
- * check if the item is focusable
8740
+ * Called whenever the 'openOnHover' property changes.
8741
+ * Adds or removes a 'mouseover' event listener to the trigger based on the new value.
8742
+ *
8743
+ * @param oldValue - The previous value of 'openOnHover'.
8744
+ * @param newValue - The new value of 'openOnHover'.
8745
+ * @public
8793
8746
  */
8794
- private isFocusableElement;
8795
- private setFocus;
8796
- }
8797
-
8798
- /**
8799
- * @public
8800
- * @remarks
8801
- * HTML Element: <fluent-menu-list>
8802
- */
8803
- export declare const MenuListDefinition: FASTElementDefinition<typeof MenuList>;
8804
-
8805
- /** MenuList styles
8806
- * @public
8807
- */
8808
- export declare const MenuListStyles: ElementStyles;
8809
-
8810
- export declare const MenuListTemplate: ElementViewTemplate<MenuList>;
8811
-
8812
- /** Menu styles
8813
- * @public
8814
- */
8815
- export declare const MenuStyles: ElementStyles;
8816
-
8817
- export declare const MenuTemplate: ElementViewTemplate<Menu>;
8818
-
8819
- /**
8820
- * A Message Bar Custom HTML Element.
8821
- *
8822
- * @tag fluent-message-bar
8823
- *
8824
- * @slot actions - Content that can be provided for the actions
8825
- * @slot dismiss - Content that can be provided for the dismiss button
8826
- * @slot - The default slot for the content
8827
- * @public
8828
- */
8829
- export declare class MessageBar extends FASTElement {
8747
+ openOnHoverChanged(oldValue: boolean, newValue: boolean): void;
8830
8748
  /**
8831
- * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8832
- *
8833
- * @internal
8749
+ * Called whenever the 'persistOnItemClick' property changes.
8750
+ * Adds or removes a 'click' event listener to the menu list based on the new value.
8751
+ * @public
8752
+ * @param oldValue - The previous value of 'persistOnItemClick'.
8753
+ * @param newValue - The new value of 'persistOnItemClick'.
8834
8754
  */
8835
- elementInternals: ElementInternals;
8836
- constructor();
8755
+ persistOnItemClickChanged(oldValue: boolean, newValue: boolean): void;
8837
8756
  /**
8838
- * Sets the shape of the Message Bar.
8839
- *
8757
+ * Called whenever the 'openOnContext' property changes.
8758
+ * Adds or removes a 'contextmenu' event listener to the trigger based on the new value.
8840
8759
  * @public
8841
- * @remarks
8842
- * HTML Attribute: `shape`
8760
+ * @param oldValue - The previous value of 'openOnContext'.
8761
+ * @param newValue - The new value of 'openOnContext'.
8843
8762
  */
8844
- shape?: MessageBarShape;
8763
+ openOnContextChanged(oldValue: boolean, newValue: boolean): void;
8845
8764
  /**
8846
- * Sets the layout of the control.
8847
- *
8765
+ * Called whenever the 'closeOnScroll' property changes.
8766
+ * Adds or removes a 'closeOnScroll' event listener to the trigger based on the new value.
8848
8767
  * @public
8849
- * @remarks
8850
- * HTML Attribute: `layout`
8768
+ * @param oldValue - The previous value of 'closeOnScroll'.
8769
+ * @param newValue - The new value of 'closeOnScroll'.
8851
8770
  */
8852
- layout?: MessageBarLayout;
8771
+ closeOnScrollChanged(oldValue: boolean, newValue: boolean): void;
8853
8772
  /**
8854
- * Sets the intent of the control.
8773
+ * Adds event listeners.
8774
+ * Adds click and keydown event listeners to the trigger.
8775
+ * Adds a 'toggle' event listener to the menu list.
8776
+ * If 'openOnHover' is true, adds a 'mouseover' event listener to the trigger.
8777
+ * If 'openOnContext' is true, adds a 'contextmenu' event listener to the trigger and a document 'click' event listener.
8778
+ * @internal
8779
+ */
8780
+ private addListeners;
8781
+ /**
8782
+ * Removes event listeners.
8783
+ * Removes click and keydown event listeners from the trigger.
8784
+ * Also removes toggle event listener from the menu list.
8785
+ * Also removes 'mouseover' event listeners from the trigger.
8786
+ * Also removes 'contextmenu' event listeners from the trigger and document 'click' event listeners.
8787
+ * @internal
8788
+ */
8789
+ private removeListeners;
8790
+ /**
8791
+ * Handles keyboard interaction for the menu. Closes the menu and focuses on the trigger when the Escape key is
8792
+ * pressed. Closes the menu when the Tab key is pressed.
8855
8793
  *
8794
+ * @param e - the keyboard event
8856
8795
  * @public
8857
- * @remarks
8858
- * HTML Attribute: `intent`
8859
8796
  */
8860
- intent?: MessageBarIntent;
8797
+ menuKeydownHandler(e: KeyboardEvent): boolean | void;
8861
8798
  /**
8862
- * Method to emit a `dismiss` event when the message bar is dismissed
8799
+ * Handles keyboard interaction for the trigger. Toggles the menu when the Space or Enter key is pressed. If the menu
8800
+ * is open, focuses on the menu list.
8863
8801
  *
8802
+ * @param e - the keyboard event
8864
8803
  * @public
8865
8804
  */
8866
- dismissMessageBar: () => void;
8805
+ triggerKeydownHandler: (e: KeyboardEvent) => boolean | void;
8806
+ /**
8807
+ * Handles document click events to close a menu opened with contextmenu in popover="manual" mode.
8808
+ * @internal
8809
+ * @param e - The event triggered on document click.
8810
+ */
8811
+ private documentClickHandler;
8867
8812
  }
8868
8813
 
8869
8814
  /**
8870
- * The Fluent MessageBar Element definition.
8815
+ * The base class used for constructing a fluent-menu-button custom element
8816
+ *
8817
+ * @tag fluent-menu-button
8871
8818
  *
8819
+ * @public
8820
+ */
8821
+ export declare class MenuButton extends Button {
8822
+ }
8823
+
8824
+ /**
8825
+ * Menu Button Appearance constants
8826
+ * @public
8827
+ */
8828
+ export declare const MenuButtonAppearance: {
8829
+ readonly primary: "primary";
8830
+ readonly outline: "outline";
8831
+ readonly subtle: "subtle";
8832
+ readonly transparent: "transparent";
8833
+ };
8834
+
8835
+ /**
8836
+ * A Menu Button can be secondary, primary, outline, subtle, transparent
8837
+ * @public
8838
+ */
8839
+ export declare type MenuButtonAppearance = ValuesOf<typeof MenuButtonAppearance>;
8840
+
8841
+ /**
8872
8842
  * @public
8873
8843
  * @remarks
8874
- * HTML Element: `<fluent-message-bar>`
8844
+ * HTML Element: \<fluent-button\>
8875
8845
  */
8876
- export declare const MessageBarDefinition: FASTElementDefinition<typeof MessageBar>;
8846
+ export declare const MenuButtonDefinition: FASTElementDefinition<typeof MenuButton>;
8877
8847
 
8878
8848
  /**
8879
- * The `intent` variations for the MessageBar component.
8880
- *
8849
+ * A Menu Button can be square, circular or rounded.
8881
8850
  * @public
8882
8851
  */
8883
- export declare const MessageBarIntent: {
8884
- readonly success: "success";
8885
- readonly warning: "warning";
8886
- readonly error: "error";
8887
- readonly info: "info";
8852
+ export declare const MenuButtonShape: {
8853
+ readonly circular: "circular";
8854
+ readonly rounded: "rounded";
8855
+ readonly square: "square";
8888
8856
  };
8889
8857
 
8890
- export declare type MessageBarIntent = ValuesOf<typeof MessageBarIntent>;
8891
-
8892
8858
  /**
8893
- * The `layout` variations for the MessageBar component.
8894
- *
8859
+ * A Menu Button can be square, circular or rounded
8895
8860
  * @public
8896
8861
  */
8897
- export declare const MessageBarLayout: {
8898
- readonly multiline: "multiline";
8899
- readonly singleline: "singleline";
8900
- };
8901
-
8902
- export declare type MessageBarLayout = ValuesOf<typeof MessageBarLayout>;
8862
+ export declare type MenuButtonShape = ValuesOf<typeof MenuButtonShape>;
8903
8863
 
8904
8864
  /**
8905
- * The `shape` variations for the MessageBar component.
8906
- *
8865
+ * A Menu Button can be a size of small, medium or large.
8907
8866
  * @public
8908
8867
  */
8909
- export declare const MessageBarShape: {
8910
- readonly rounded: "rounded";
8911
- readonly square: "square";
8868
+ export declare const MenuButtonSize: {
8869
+ readonly small: "small";
8870
+ readonly medium: "medium";
8871
+ readonly large: "large";
8912
8872
  };
8913
8873
 
8914
- export declare type MessageBarShape = ValuesOf<typeof MessageBarShape>;
8874
+ /**
8875
+ * A Menu Button can be on of several preset sizes.
8876
+ * @public
8877
+ */
8878
+ export declare type MenuButtonSize = ValuesOf<typeof MenuButtonSize>;
8915
8879
 
8916
8880
  /**
8917
- * Styles for the MessageBar component.
8918
- *
8881
+ * The template for the Button component.
8919
8882
  * @public
8920
8883
  */
8921
- export declare const MessageBarStyles: ElementStyles;
8884
+ export declare const MenuButtonTemplate: ElementViewTemplate<MenuButton>;
8922
8885
 
8923
8886
  /**
8924
- * The template for the MessageBar component.
8925
- * @type {ElementViewTemplate<MessageBar>}
8887
+ * The Fluent Menu Element.
8888
+ *
8889
+ * @public
8890
+ * @remarks
8891
+ * HTML Element: <fluent-menu>
8926
8892
  */
8927
- export declare const MessageBarTemplate: ElementViewTemplate<MessageBar>;
8893
+ export declare const MenuDefinition: FASTElementDefinition<typeof Menu>;
8928
8894
 
8929
8895
  /**
8930
- * A Progress HTML Element.
8931
- * Based on BaseProgressBar and includes style and layout specific attributes
8896
+ * A Switch Custom HTML Element.
8897
+ * Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
8932
8898
  *
8933
- * @tag fluent-progress-bar
8899
+ * @tag fluent-menu-item
8900
+ *
8901
+ * @slot indicator - The checkbox or radio indicator
8902
+ * @slot start - Content which can be provided before the menu item content
8903
+ * @slot - The default slot for menu item content
8904
+ * @slot end - Content which can be provided after the menu item content
8905
+ * @slot submenu-glyph - The submenu expand/collapse indicator
8906
+ * @slot submenu - Used to nest menu's within menu items
8907
+ * @csspart content - The element wrapping the menu item content
8908
+ * @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
8934
8909
  *
8935
8910
  * @public
8936
8911
  */
8937
- export declare class ProgressBar extends BaseProgressBar {
8912
+ export declare class MenuItem extends FASTElement {
8938
8913
  /**
8939
- * The thickness of the progress bar
8914
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
8940
8915
  *
8941
- * The thickness of the progress bar
8916
+ * @internal
8917
+ */
8918
+ elementInternals: ElementInternals;
8919
+ /**
8920
+ * The disabled state of the element.
8942
8921
  *
8943
- * HTML Attribute: `thickness`
8922
+ * @public
8923
+ * @remarks
8924
+ * HTML Attribute: disabled
8925
+ */
8926
+ disabled: boolean;
8927
+ /**
8928
+ * Handles changes to disabled attribute custom states and element internals
8929
+ * @param prev - the previous state
8930
+ * @param next - the next state
8931
+ */
8932
+ disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
8933
+ /**
8934
+ * The role of the element.
8944
8935
  *
8945
8936
  * @public
8937
+ * @remarks
8938
+ * HTML Attribute: role
8946
8939
  */
8947
- thickness?: ProgressBarThickness;
8940
+ role: MenuItemRole;
8948
8941
  /**
8949
- * The shape of the progress bar
8950
- * The shape of the progress bar
8942
+ * Handles changes to role attribute element internals properties
8943
+ * @param prev - the previous state
8944
+ * @param next - the next state
8945
+ */
8946
+ roleChanged(prev: MenuItemRole | undefined, next: MenuItemRole | undefined): void;
8947
+ /**
8948
+ * The checked value of the element.
8951
8949
  *
8952
- * HTML Attribute: `shape`
8950
+ * @public
8951
+ * @remarks
8952
+ * HTML Attribute: checked
8953
+ */
8954
+ checked: boolean;
8955
+ /**
8956
+ * Handles changes to checked attribute custom states and element internals
8957
+ * @param prev - the previous state
8958
+ * @param next - the next state
8959
+ */
8960
+ protected checkedChanged(prev: boolean, next: boolean): void;
8961
+ /**
8962
+ * The hidden attribute.
8953
8963
  *
8954
8964
  * @public
8965
+ * @remarks
8966
+ * HTML Attribute: hidden
8955
8967
  */
8956
- shape?: ProgressBarShape;
8968
+ hidden: boolean;
8969
+ /**
8970
+ * The submenu slotted content.
8971
+ *
8972
+ * @internal
8973
+ */
8974
+ slottedSubmenu: HTMLElement[];
8975
+ /**
8976
+ * Sets the submenu and updates its position.
8977
+ *
8978
+ * @internal
8979
+ */
8980
+ protected slottedSubmenuChanged(prev: HTMLElement[] | undefined, next: HTMLElement[]): void;
8981
+ /**
8982
+ * @internal
8983
+ */
8984
+ submenu: HTMLElement | undefined;
8985
+ connectedCallback(): void;
8986
+ /**
8987
+ * @internal
8988
+ */
8989
+ handleMenuItemKeyDown: (e: KeyboardEvent) => boolean;
8990
+ /**
8991
+ * @internal
8992
+ */
8993
+ handleMenuItemClick: (e: MouseEvent) => boolean;
8994
+ /**
8995
+ * @internal
8996
+ */
8997
+ handleMouseOver: (e: MouseEvent) => boolean;
8998
+ /**
8999
+ * @internal
9000
+ */
9001
+ handleMouseOut: (e: MouseEvent) => boolean;
9002
+ /**
9003
+ * Setup required ARIA on open/close
9004
+ * @internal
9005
+ */
9006
+ toggleHandler: (e: Event) => void;
9007
+ /**
9008
+ * @internal
9009
+ */
9010
+ private invoke;
9011
+ /**
9012
+ * Set fallback position of menu on open when CSS anchor not supported
9013
+ * @internal
9014
+ */
9015
+ setSubmenuPosition: () => void;
8957
9016
  }
8958
9017
 
8959
9018
  /**
8960
- * The Fluent ProgressBar Element.
8961
- *
8962
- *
9019
+ * Mark internal because exporting class and interface of the same name
9020
+ * confuses API documenter.
9021
+ * TODO: https://github.com/microsoft/fast/issues/3317
9022
+ * @internal
9023
+ */
9024
+ export declare interface MenuItem extends StartEnd {
9025
+ }
9026
+
9027
+ export declare type MenuItemColumnCount = 0 | 1 | 2;
9028
+
9029
+ /**
8963
9030
  * @public
8964
9031
  * @remarks
8965
- * HTML Element: \<fluent-progress-bar\>
9032
+ * HTML Element: <fluent-menu-item>
8966
9033
  */
8967
- export declare const ProgressBarDefinition: FASTElementDefinition<typeof ProgressBar>;
9034
+ export declare const MenuItemDefinition: FASTElementDefinition<typeof MenuItem>;
8968
9035
 
8969
9036
  /**
8970
- * ProgressBarShape Constants
9037
+ * Menu Item configuration options
8971
9038
  * @public
8972
9039
  */
8973
- export declare const ProgressBarShape: {
8974
- readonly rounded: "rounded";
8975
- readonly square: "square";
9040
+ export declare type MenuItemOptions = StartEndOptions<MenuItem> & {
9041
+ indicator?: StaticallyComposableHTML<MenuItem>;
9042
+ submenuGlyph?: StaticallyComposableHTML<MenuItem>;
8976
9043
  };
8977
9044
 
8978
9045
  /**
8979
- * Applies bar shape to the content
9046
+ * Menu items roles.
8980
9047
  * @public
8981
9048
  */
8982
- export declare type ProgressBarShape = ValuesOf<typeof ProgressBarShape>;
9049
+ export declare const MenuItemRole: {
9050
+ /**
9051
+ * The menu item has a "menuitem" role
9052
+ */
9053
+ readonly menuitem: "menuitem";
9054
+ /**
9055
+ * The menu item has a "menuitemcheckbox" role
9056
+ */
9057
+ readonly menuitemcheckbox: "menuitemcheckbox";
9058
+ /**
9059
+ * The menu item has a "menuitemradio" role
9060
+ */
9061
+ readonly menuitemradio: "menuitemradio";
9062
+ };
8983
9063
 
8984
- /** ProgressBar styles
9064
+ /**
9065
+ * The types for menu item roles
8985
9066
  * @public
8986
9067
  */
8987
- export declare const ProgressBarStyles: ElementStyles;
9068
+ export declare type MenuItemRole = ValuesOf<typeof MenuItemRole>;
8988
9069
 
8989
- export declare const ProgressBarTemplate: ElementViewTemplate<ProgressBar>;
9070
+ /** MenuItem styles
9071
+ * @public
9072
+ */
9073
+ export declare const MenuItemStyles: ElementStyles;
9074
+
9075
+ export declare const MenuItemTemplate: ElementViewTemplate<MenuItem>;
8990
9076
 
8991
9077
  /**
8992
- * ProgressBarThickness Constants
9078
+ * A Menu List Custom HTML Element.
9079
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#menu | ARIA menu }.
9080
+ *
9081
+ * @tag fluent-menu-list
9082
+ *
9083
+ * @slot - The default slot for the menu items
9084
+ *
8993
9085
  * @public
8994
9086
  */
8995
- export declare const ProgressBarThickness: {
8996
- readonly medium: "medium";
8997
- readonly large: "large";
8998
- };
9087
+ export declare class MenuList extends BaseMenuList {
9088
+ }
8999
9089
 
9000
9090
  /**
9001
- * Applies bar thickness to the content
9002
9091
  * @public
9092
+ * @remarks
9093
+ * HTML Element: <fluent-menu-list>
9003
9094
  */
9004
- export declare type ProgressBarThickness = ValuesOf<typeof ProgressBarThickness>;
9095
+ export declare const MenuListDefinition: FASTElementDefinition<typeof MenuList>;
9005
9096
 
9006
- /**
9007
- * ProgressBarValidationState Constants
9097
+ /** MenuList styles
9008
9098
  * @public
9009
9099
  */
9010
- export declare const ProgressBarValidationState: {
9011
- readonly success: "success";
9012
- readonly warning: "warning";
9013
- readonly error: "error";
9014
- };
9100
+ export declare const MenuListStyles: ElementStyles;
9101
+
9102
+ export declare const MenuListTemplate: ElementViewTemplate<MenuList>;
9015
9103
 
9016
- /**
9017
- * Applies validation state to the content
9104
+ /** Menu styles
9018
9105
  * @public
9019
9106
  */
9020
- export declare type ProgressBarValidationState = ValuesOf<typeof ProgressBarValidationState>;
9107
+ export declare const MenuStyles: ElementStyles;
9021
9108
 
9022
- declare type PropertyNameForCalculation = 'max' | 'value';
9109
+ export declare const MenuTemplate: ElementViewTemplate<Menu>;
9023
9110
 
9024
9111
  /**
9025
- * A Radio Custom HTML Element.
9026
- * Implements the {@link https://w3c.github.io/aria/#radio | ARIA `radio` role}.
9027
- *
9028
- * @tag fluent-radio
9112
+ * A Message Bar Custom HTML Element.
9029
9113
  *
9030
- * @slot checked-indicator - The checked indicator slot
9031
- * @fires change - Emits a custom change event when the checked state changes
9032
- * @fires input - Emits a custom input event when the checked state changes
9114
+ * @tag fluent-message-bar
9033
9115
  *
9116
+ * @slot actions - Content that can be provided for the actions
9117
+ * @slot dismiss - Content that can be provided for the dismiss button
9118
+ * @slot - The default slot for the content
9034
9119
  * @public
9035
9120
  */
9036
- export declare class Radio extends BaseCheckbox {
9037
- constructor();
9121
+ export declare class MessageBar extends FASTElement {
9038
9122
  /**
9039
- * Toggles the disabled state when the user changes the `disabled` property.
9123
+ * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
9040
9124
  *
9041
- * @param prev - the previous value of the `disabled` property
9042
- * @param next - the current value of the `disabled` property
9043
9125
  * @internal
9044
- * @override
9045
9126
  */
9046
- protected disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
9127
+ elementInternals: ElementInternals;
9128
+ constructor();
9047
9129
  /**
9048
- * This method is a no-op for the radio component.
9130
+ * Sets the shape of the Message Bar.
9049
9131
  *
9050
- * @internal
9051
- * @override
9132
+ * @public
9052
9133
  * @remarks
9053
- * To make a group of radio controls required, see {@link RadioGroup.required}.
9134
+ * HTML Attribute: `shape`
9054
9135
  */
9055
- protected requiredChanged(): void;
9136
+ shape?: MessageBarShape;
9056
9137
  /**
9057
- * This method is a no-op for the radio component.
9138
+ * Sets the layout of the control.
9058
9139
  *
9059
- * @internal
9060
- * @override
9140
+ * @public
9061
9141
  * @remarks
9062
- * The radio form value is controlled by the `RadioGroup` component.
9142
+ * HTML Attribute: `layout`
9063
9143
  */
9064
- setFormValue(): void;
9144
+ layout?: MessageBarLayout;
9065
9145
  /**
9066
- * Sets the validity of the control.
9146
+ * Sets the intent of the control.
9067
9147
  *
9068
- * @internal
9069
- * @override
9148
+ * @public
9070
9149
  * @remarks
9071
- * The radio component does not have a `required` attribute, so this method always sets the validity to `true`.
9150
+ * HTML Attribute: `intent`
9072
9151
  */
9073
- setValidity(): void;
9152
+ intent?: MessageBarIntent;
9074
9153
  /**
9075
- * Toggles the checked state of the control.
9154
+ * Method to emit a `dismiss` event when the message bar is dismissed
9076
9155
  *
9077
- * @param force - Forces the element to be checked or unchecked
9078
9156
  * @public
9079
- * @override
9080
- * @remarks
9081
- * The radio checked state is controlled by the `RadioGroup` component, so the `force` parameter defaults to `true`.
9082
9157
  */
9083
- toggleChecked(force?: boolean): void;
9158
+ dismissMessageBar: () => void;
9084
9159
  }
9085
9160
 
9086
9161
  /**
9162
+ * The Fluent MessageBar Element definition.
9163
+ *
9087
9164
  * @public
9165
+ * @remarks
9166
+ * HTML Element: `<fluent-message-bar>`
9088
9167
  */
9089
- export declare type RadioControl = Pick<HTMLInputElement, 'checked' | 'disabled' | 'focus' | 'setAttribute' | 'getAttribute'>;
9168
+ export declare const MessageBarDefinition: FASTElementDefinition<typeof MessageBar>;
9090
9169
 
9091
9170
  /**
9092
- * The Fluent Radio Element.
9093
- *
9171
+ * The `intent` variations for the MessageBar component.
9094
9172
  *
9095
9173
  * @public
9096
- * @remarks
9097
- * HTML Element: \<fluent-radio\>
9098
9174
  */
9099
- export declare const RadioDefinition: FASTElementDefinition<typeof Radio>;
9175
+ export declare const MessageBarIntent: {
9176
+ readonly success: "success";
9177
+ readonly warning: "warning";
9178
+ readonly error: "error";
9179
+ readonly info: "info";
9180
+ };
9181
+
9182
+ export declare type MessageBarIntent = ValuesOf<typeof MessageBarIntent>;
9100
9183
 
9101
9184
  /**
9102
- * A Radio Group Custom HTML Element.
9103
- * Implements the {@link https://w3c.github.io/aria/#radiogroup | ARIA `radiogroup` role}.
9104
- *
9105
- * @tag fluent-radio-group
9185
+ * The `layout` variations for the MessageBar component.
9106
9186
  *
9107
9187
  * @public
9188
+ */
9189
+ export declare const MessageBarLayout: {
9190
+ readonly multiline: "multiline";
9191
+ readonly singleline: "singleline";
9192
+ };
9193
+
9194
+ export declare type MessageBarLayout = ValuesOf<typeof MessageBarLayout>;
9195
+
9196
+ /**
9197
+ * The `shape` variations for the MessageBar component.
9108
9198
  *
9109
- * @slot - The default slot for the radio group
9199
+ * @public
9110
9200
  */
9111
- export declare class RadioGroup extends FASTElement {
9112
- /**
9113
- * The index of the checked radio, scoped to the enabled radios.
9114
- *
9115
- * @internal
9116
- */
9117
- protected checkedIndex: number;
9118
- /**
9119
- * Sets the checked state of the nearest enabled radio when the `checkedIndex` changes.
9120
- *
9121
- * @param prev - the previous index
9122
- * @param next - the current index
9123
- * @internal
9124
- */
9125
- protected checkedIndexChanged(prev: number | undefined, next: number): void;
9126
- /**
9127
- * Indicates that the value has been changed by the user.
9128
- */
9129
- private dirtyState;
9130
- /**
9131
- * Disables the radio group and child radios.
9132
- *
9133
- * @public
9134
- * @remarks
9135
- * HTML Attribute: `disabled`
9136
- */
9137
- disabled: boolean;
9138
- /**
9139
- * Sets the `disabled` attribute on all child radios when the `disabled` property changes.
9140
- *
9141
- * @param prev - the previous disabled value
9142
- * @param next - the current disabled value
9143
- * @internal
9144
- */
9145
- protected disabledChanged(prev?: boolean, next?: boolean): void;
9146
- /**
9147
- * The value of the checked radio.
9148
- *
9149
- * @public
9150
- * @remarks
9151
- * HTML Attribute: `value`
9152
- */
9153
- initialValue?: string;
9154
- /**
9155
- * Sets the matching radio to checked when the value changes. If no radio matches the value, no radio will be checked.
9156
- *
9157
- * @param prev - the previous value
9158
- * @param next - the current value
9159
- */
9160
- initialValueChanged(prev: string | undefined, next: string | undefined): void;
9161
- /**
9162
- * The name of the radio group.
9163
- *
9164
- * @public
9165
- * @remarks
9166
- * HTML Attribute: `name`
9167
- */
9168
- name: string;
9169
- /**
9170
- * Sets the `name` attribute on all child radios when the `name` property changes.
9171
- *
9172
- * @internal
9173
- */
9174
- protected nameChanged(prev: string | undefined, next: string | undefined): void;
9175
- /**
9176
- * The orientation of the group.
9177
- *
9178
- * @public
9179
- * @remarks
9180
- * HTML Attribute: `orientation`
9181
- */
9182
- orientation?: RadioGroupOrientation;
9183
- /**
9184
- * Sets the ariaOrientation attribute when the orientation changes.
9185
- *
9186
- * @param prev - the previous orientation
9187
- * @param next - the current orientation
9188
- * @internal
9189
- */
9190
- orientationChanged(prev: RadioGroupOrientation | undefined, next: RadioGroupOrientation | undefined): void;
9191
- /**
9192
- * The collection of all child radios.
9193
- *
9194
- * @public
9195
- */
9196
- radios: Radio[];
9197
- /**
9198
- * Updates the enabled radios collection when properties on the child radios change.
9199
- *
9200
- * @param prev - the previous radios
9201
- * @param next - the current radios
9202
- */
9203
- radiosChanged(prev: Radio[] | undefined, next: Radio[] | undefined): void;
9204
- /**
9205
- * Indicates whether the radio group is required.
9206
- *
9207
- * @public
9208
- * @remarks
9209
- * HTML Attribute: `required`
9210
- */
9211
- required: boolean;
9212
- /**
9213
- *
9214
- * @param prev - the previous required value
9215
- * @param next - the current required value
9216
- */
9217
- requiredChanged(prev: boolean, next: boolean): void;
9218
- /**
9219
- * The collection of radios that are slotted into the default slot.
9220
- *
9221
- * @internal
9222
- */
9223
- slottedRadios: Radio[];
9224
- /**
9225
- * Updates the radios collection when the slotted radios change.
9226
- *
9227
- * @param prev - the previous slotted radios
9228
- * @param next - the current slotted radios
9229
- */
9230
- slottedRadiosChanged(prev: Radio[] | undefined, next: Radio[]): void;
9231
- /**
9232
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
9233
- *
9234
- * @internal
9235
- */
9236
- elementInternals: ElementInternals;
9237
- /**
9238
- * A collection of child radios that are not disabled.
9239
- *
9240
- * @internal
9241
- */
9242
- get enabledRadios(): Radio[];
9243
- /**
9244
- * The form-associated flag.
9245
- * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
9246
- *
9247
- * @public
9248
- */
9249
- static formAssociated: boolean;
9250
- /**
9251
- * The fallback validation message, taken from a native checkbox `<input>` element.
9252
- *
9253
- * @internal
9254
- */
9255
- private _validationFallbackMessage;
9201
+ export declare const MessageBarShape: {
9202
+ readonly rounded: "rounded";
9203
+ readonly square: "square";
9204
+ };
9205
+
9206
+ export declare type MessageBarShape = ValuesOf<typeof MessageBarShape>;
9207
+
9208
+ /**
9209
+ * Styles for the MessageBar component.
9210
+ *
9211
+ * @public
9212
+ */
9213
+ export declare const MessageBarStyles: ElementStyles;
9214
+
9215
+ /**
9216
+ * The template for the MessageBar component.
9217
+ * @type {ElementViewTemplate<MessageBar>}
9218
+ */
9219
+ export declare const MessageBarTemplate: ElementViewTemplate<MessageBar>;
9220
+
9221
+ /**
9222
+ * A Progress HTML Element.
9223
+ * Based on BaseProgressBar and includes style and layout specific attributes
9224
+ *
9225
+ * @tag fluent-progress-bar
9226
+ *
9227
+ * @public
9228
+ */
9229
+ export declare class ProgressBar extends BaseProgressBar {
9256
9230
  /**
9257
- * The validation message. Uses the browser's default validation message for native checkboxes if not otherwise
9258
- * specified (e.g., via `setCustomValidity`).
9231
+ * The thickness of the progress bar
9259
9232
  *
9260
- * @internal
9261
- */
9262
- get validationMessage(): string;
9263
- /**
9264
- * The element's validity state.
9233
+ * The thickness of the progress bar
9265
9234
  *
9266
- * @public
9267
- * @remarks
9268
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
9269
- */
9270
- get validity(): ValidityState;
9271
- /**
9272
- * The current value of the checked radio.
9235
+ * HTML Attribute: `thickness`
9273
9236
  *
9274
9237
  * @public
9275
9238
  */
9276
- get value(): string | null;
9277
- set value(next: string | null);
9278
- /**
9279
- * Sets the checked state of all radios when any radio emits a `change` event.
9280
- *
9281
- * @param e - the change event
9282
- */
9283
- changeHandler(e: Event): boolean | void;
9239
+ thickness?: ProgressBarThickness;
9284
9240
  /**
9285
- * Checks the radio at the specified index.
9241
+ * The shape of the progress bar
9242
+ * The shape of the progress bar
9286
9243
  *
9287
- * @param index - the index of the radio to check
9288
- * @internal
9289
- */
9290
- checkRadio(index?: number, shouldEmit?: boolean): void;
9291
- /**
9292
- * Checks the validity of the element and returns the result.
9244
+ * HTML Attribute: `shape`
9293
9245
  *
9294
9246
  * @public
9295
- * @remarks
9296
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
9297
- */
9298
- checkValidity(): boolean;
9299
- /**
9300
- * Handles click events for the radio group.
9301
- *
9302
- * @param e - the click event
9303
- * @internal
9304
9247
  */
9305
- clickHandler(e: MouseEvent): boolean | void;
9248
+ shape?: ProgressBarShape;
9249
+ }
9250
+
9251
+ /**
9252
+ * The Fluent ProgressBar Element.
9253
+ *
9254
+ *
9255
+ * @public
9256
+ * @remarks
9257
+ * HTML Element: \<fluent-progress-bar\>
9258
+ */
9259
+ export declare const ProgressBarDefinition: FASTElementDefinition<typeof ProgressBar>;
9260
+
9261
+ /**
9262
+ * ProgressBarShape Constants
9263
+ * @public
9264
+ */
9265
+ export declare const ProgressBarShape: {
9266
+ readonly rounded: "rounded";
9267
+ readonly square: "square";
9268
+ };
9269
+
9270
+ /**
9271
+ * Applies bar shape to the content
9272
+ * @public
9273
+ */
9274
+ export declare type ProgressBarShape = ValuesOf<typeof ProgressBarShape>;
9275
+
9276
+ /** ProgressBar styles
9277
+ * @public
9278
+ */
9279
+ export declare const ProgressBarStyles: ElementStyles;
9280
+
9281
+ export declare const ProgressBarTemplate: ElementViewTemplate<ProgressBar>;
9282
+
9283
+ /**
9284
+ * ProgressBarThickness Constants
9285
+ * @public
9286
+ */
9287
+ export declare const ProgressBarThickness: {
9288
+ readonly medium: "medium";
9289
+ readonly large: "large";
9290
+ };
9291
+
9292
+ /**
9293
+ * Applies bar thickness to the content
9294
+ * @public
9295
+ */
9296
+ export declare type ProgressBarThickness = ValuesOf<typeof ProgressBarThickness>;
9297
+
9298
+ /**
9299
+ * ProgressBarValidationState Constants
9300
+ * @public
9301
+ */
9302
+ export declare const ProgressBarValidationState: {
9303
+ readonly success: "success";
9304
+ readonly warning: "warning";
9305
+ readonly error: "error";
9306
+ };
9307
+
9308
+ /**
9309
+ * Applies validation state to the content
9310
+ * @public
9311
+ */
9312
+ export declare type ProgressBarValidationState = ValuesOf<typeof ProgressBarValidationState>;
9313
+
9314
+ declare type PropertyNameForCalculation = 'max' | 'value';
9315
+
9316
+ /**
9317
+ * A Radio Custom HTML Element.
9318
+ * Implements the {@link https://w3c.github.io/aria/#radio | ARIA `radio` role}.
9319
+ *
9320
+ * @tag fluent-radio
9321
+ *
9322
+ * @slot checked-indicator - The checked indicator slot
9323
+ * @fires change - Emits a custom change event when the checked state changes
9324
+ * @fires input - Emits a custom input event when the checked state changes
9325
+ *
9326
+ * @public
9327
+ */
9328
+ export declare class Radio extends BaseCheckbox {
9306
9329
  constructor();
9307
9330
  /**
9308
- * Focuses the checked radio or the first enabled radio.
9309
- *
9310
- * @internal
9311
- */
9312
- focus(): void;
9313
- /**
9314
- * Enables tabbing through the radio group when the group receives focus.
9315
- *
9316
- * @param e - the focus event
9317
- * @internal
9318
- */
9319
- focusinHandler(e: FocusEvent): boolean | void;
9320
- /**
9321
- * Sets the tabindex of the radios based on the checked state when the radio group loses focus.
9331
+ * Toggles the disabled state when the user changes the `disabled` property.
9322
9332
  *
9323
- * @param e - the focusout event
9333
+ * @param prev - the previous value of the `disabled` property
9334
+ * @param next - the current value of the `disabled` property
9324
9335
  * @internal
9336
+ * @override
9325
9337
  */
9326
- focusoutHandler(e: FocusEvent): boolean | void;
9327
- formResetCallback(): void;
9328
- private getEnabledIndexInBounds;
9338
+ protected disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
9329
9339
  /**
9330
- * Handles keydown events for the radio group.
9340
+ * This method is a no-op for the radio component.
9331
9341
  *
9332
- * @param e - the keyboard event
9333
9342
  * @internal
9334
- */
9335
- keydownHandler(e: KeyboardEvent): boolean | void;
9336
- /**
9337
- *
9338
- * @param e - the disabled event
9339
- */
9340
- disabledRadioHandler(e: CustomEvent): void;
9341
- /**
9342
- * Reports the validity of the element.
9343
- *
9344
- * @public
9343
+ * @override
9345
9344
  * @remarks
9346
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
9345
+ * To make a group of radio controls required, see {@link RadioGroup.required}.
9347
9346
  */
9348
- reportValidity(): boolean;
9347
+ protected requiredChanged(): void;
9349
9348
  /**
9350
- * Resets the `tabIndex` for all child radios when the radio group loses focus.
9349
+ * This method is a no-op for the radio component.
9351
9350
  *
9352
9351
  * @internal
9352
+ * @override
9353
+ * @remarks
9354
+ * The radio form value is controlled by the `RadioGroup` component.
9353
9355
  */
9354
- private restrictFocus;
9356
+ setFormValue(): void;
9355
9357
  /**
9356
- * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
9358
+ * Sets the validity of the control.
9357
9359
  *
9358
9360
  * @internal
9361
+ * @override
9362
+ * @remarks
9363
+ * The radio component does not have a `required` attribute, so this method always sets the validity to `true`.
9359
9364
  */
9360
- setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
9365
+ setValidity(): void;
9361
9366
  /**
9362
- * Sets the validity of the element.
9363
- *
9364
- * @param flags - Validity flags to set.
9365
- * @param message - Optional message to supply. If not provided, the element's `validationMessage` will be used.
9366
- * @param anchor - Optional anchor to use for the validation message.
9367
+ * Toggles the checked state of the control.
9367
9368
  *
9368
- * @internal
9369
+ * @param force - Forces the element to be checked or unchecked
9370
+ * @public
9371
+ * @override
9369
9372
  * @remarks
9370
- * RadioGroup validation is reported through the individual Radio elements rather than the RadioGroup itself.
9371
- * This is necessary because:
9372
- * 1. Each Radio is form-associated (extends BaseCheckbox which has `formAssociated = true`)
9373
- * 2. Browser validation UIs and screen readers announce validation against individual form controls
9374
- * 3. For groups like RadioGroup, the browser needs to report the error on a specific member of the group
9375
- * 4. We anchor the error to the first Radio so it receives focus and announcement
9376
- *
9377
- * When the group is invalid (required but no selection):
9378
- * - Only the first Radio gets the invalid state with the validation message
9379
- * - Other Radios are kept valid since selecting any of them would satisfy the requirement
9380
- *
9381
- * When the group becomes valid (user selects any Radio):
9382
- * - All Radios are cleared back to valid state
9383
- * - This allows form submission to proceed
9373
+ * The radio checked state is controlled by the `RadioGroup` component, so the `force` parameter defaults to `true`.
9384
9374
  */
9385
- setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
9375
+ toggleChecked(force?: boolean): void;
9376
+ }
9377
+
9378
+ /**
9379
+ * @public
9380
+ */
9381
+ export declare type RadioControl = Pick<HTMLInputElement, 'checked' | 'disabled' | 'focus' | 'setAttribute' | 'getAttribute'>;
9382
+
9383
+ /**
9384
+ * The Fluent Radio Element.
9385
+ *
9386
+ *
9387
+ * @public
9388
+ * @remarks
9389
+ * HTML Element: \<fluent-radio\>
9390
+ */
9391
+ export declare const RadioDefinition: FASTElementDefinition<typeof Radio>;
9392
+
9393
+ /**
9394
+ * A Radio Group Custom HTML Element.
9395
+ * Implements the {@link https://w3c.github.io/aria/#radiogroup | ARIA `radiogroup` role}.
9396
+ *
9397
+ * @tag fluent-radio-group
9398
+ *
9399
+ * @slot - The default slot for the radio group
9400
+ *
9401
+ * @public
9402
+ */
9403
+ export declare class RadioGroup extends BaseRadioGroup {
9386
9404
  }
9387
9405
 
9388
9406
  /**