Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add slot event part docs to foundation #5912

Merged
merged 12 commits into from
May 2, 2022
Prev Previous commit
Next Next commit
update through listbox option
  • Loading branch information
chrisdholt committed May 2, 2022
commit 0f27b29b711b8680f4c4562592b7c01f2880e0df
8 changes: 4 additions & 4 deletions packages/web-components/fast-foundation/src/anchor/anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export type AnchorOptions = FoundationElementDefinition & StartEndOptions;
* An Anchor Custom HTML Element.
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
*
* @slot start - Content which can be provided before the button content
* @slot end - Content which can be provided after the button content
* @slot - The default slot for accordion item content
* @slot start - Content which can be provided before the anchor content
* @slot end - Content which can be provided after the anchor content
* @slot - The default slot for anchor content
* @csspart control - The anchor element
* @csspart content - The button content
* @csspart content - The element wrapping anchor content
*
* @public
*/
Expand Down
6 changes: 6 additions & 0 deletions packages/web-components/fast-foundation/src/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export type ButtonOptions = FoundationElementDefinition & StartEndOptions;
* A Button Custom HTML Element.
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
*
* @slot start - Content which can be provided before the button content
* @slot end - Content which can be provided after the button content
* @slot - The default slot for button content
* @csspart control - The button element
* @csspart content - The element wrapping button content
*
* @public
*/
export class Button extends FormAssociatedButton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export type CalendarOptions = FoundationElementDefinition &

/**
* Calendar component
*
* @slot - The default slot for calendar content
* @fires dateselected - Fires a custom 'dateselected' event when Enter is invoked via keyboard on a date
*
* @public
*/
export class Calendar extends FoundationElement {
Expand Down
2 changes: 2 additions & 0 deletions packages/web-components/fast-foundation/src/card/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { FoundationElement } from "../foundation-element/foundation-element.js";
/**
* An Card Custom HTML Element.
*
* @slot - The default slot for the card content
*
* @public
*/
export class Card extends FoundationElement {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export type CheckboxOptions = FoundationElementDefinition & {
* A Checkbox Custom HTML Element.
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
*
* @slot checked-indicator - The checked indicator
* @slot indeterminate-indicator - The indeterminate indicator
* @slot - The default slot for the label
* @csspart control - The element representing the visual checkbox control
* @csspart label - The label
* @fires change - Emits a custom change event when the checked state changes
*
* @public
*/
export class Checkbox extends FormAssociatedCheckbox {
Expand Down
11 changes: 11 additions & 0 deletions packages/web-components/fast-foundation/src/combobox/combobox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ export type ComboboxOptions = FoundationElementDefinition &
* A Combobox Custom HTML Element.
* Implements the {@link https://w3c.github.io/aria-practices/#combobox | ARIA combobox }.
*
* @slot start - Content which can be provided before the input
* @slot end - Content which can be provided after the input
* @slot control - Used to replace the input element representing the combobox
* @slot indicator - The visual indicator representing the expanded state
* @slot - The default slot for the options
* @csspart control - The wrapper element containing the input area, including start and end
* @csspart selected-value - The input element representing the selected value
* @csspart indicator - The element wrapping the indicator slot
* @csspart listbox - The wrapper for the listbox slotted options
* @fires change - Fires a custom 'change' event when the value updates
*
* @public
*/
export class Combobox extends FormAssociatedCombobox {
Expand Down
7 changes: 7 additions & 0 deletions packages/web-components/fast-foundation/src/dialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { FoundationElement } from "../foundation-element/foundation-element.js";
* A Switch Custom HTML Element.
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#dialog | ARIA dialog }.
*
* @slot - The default slot for the dialog content
* @csspart positioning-region - A wrapping element used to center the dialog and position the modal overlay
* @csspart overlay - The modal dialog overlay
* @csspart control - The dialog element
* @fires cancel - Fires a custom 'cancel' event when the modal overlay is clicked
* @fires close - Fires a custom 'close' event when the dialog is hidden
*
* @public
*/
export class Dialog extends FoundationElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { FoundationElement } from "../foundation-element/foundation-element.js";
* A Disclosure Custom HTML Element.
* Based largely on the {@link https://w3c.github.io/aria-practices/#disclosure | disclosure element }.
*
* @slot start - Content which can be provided before the summary content
* @slot end - Content which can be provided after the summary content
* @slot title - The summary content
* @slot - The default slot for the disclosure content
* @fires toggle - fires a toggle event when the summary is toggled
*
* @public
*/
export class Disclosure extends FoundationElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export type FlipperOptions = FoundationElementDefinition & {
* A Flipper Custom HTML Element.
* Flippers are a form of button that implies directional content navigation, such as in a carousel.
*
* @slot next - The next flipper content
* @slot previous - The previous flipper content
* @csspart next - Wraps the next flipper content
* @csspart previous - Wraps the previous flipper content
* @fires click - Fires a custom 'click' event when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.
*
* @public
*/
export class Flipper extends FoundationElement {
Expand Down Expand Up @@ -63,7 +69,7 @@ export class Flipper extends FoundationElement {
if (!this.hiddenFromAT) {
const key = e.key;

if (key === "Enter") {
if (key === "Enter" || key === "Space") {
this.$emit("click", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ export type HorizontalScrollOptions = FoundationElementDefinition &

/**
* A HorizontalScroll Custom HTML Element
*
* @slot start - Content which can be provided before the scroll area
* @slot end - Content which can be provided after the scroll area
* @csspart scroll-area - Wraps the entire scrollable region
* @csspart scroll-view - The visible scroll area
* @csspart content-container - The container for the content
* @csspart scroll-prev - The previous flipper container
* @csspart scroll-action-previous - The element wrapping the previous flipper
* @csspart scroll-next - The next flipper container
* @csspart scroll-action-next - The element wrapping the next flipper
* @fires scrollstart - Fires a custom 'scrollstart' event when scrolling
* @fires scrollend - Fires a custom 'scrollend' event when scrolling stops
*
* @public
*/
export class HorizontalScroll extends FoundationElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export function isListboxOption(el: Element): el is ListboxOption {
* An Option Custom HTML Element.
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
*
* @slot start - Content which can be provided before the listbox option content
* @slot end - Content which can be provided after the listbox option content
* @slot - The default slot for listbox option content
* @csspart content - Wraps the listbox option content
*
* @public
*/
export class ListboxOption extends FoundationElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { applyMixins } from "../utilities/apply-mixins.js";
* A Listbox Custom HTML Element.
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#listbox | ARIA listbox }.
*
* @slot - The default slot for the listbox options
*
* @public
*/
export abstract class Listbox extends FoundationElement {
Expand Down