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

web component accordion #26547

Merged

Conversation

brianchristopherbrady
Copy link
Contributor

πŸ“– Description

Adds the Accordion web component.

πŸ‘©β€πŸ’» Reviewer Notes

βœ… Checklist

General

  • I have included a change request file using $ yarn change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

@fabricteam
Copy link
Collaborator

fabricteam commented Jan 30, 2023

πŸ“Š Bundle size report

πŸ€– This report was generated against b79b33d10cbd6015531fa943e0e6dbe7f84b9b42

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 11b3852:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Jan 30, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: b79b33d10cbd6015531fa943e0e6dbe7f84b9b42 (build)

/**
* An Accordion Item can be medium, large, and larger in height
*/
export type AccordionItemSize = 'medium' | 'large' | 'larger';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In FUIR9, there are 4 sizes (applicable to AccordionHeader): 'small' | 'medium' | 'large' | 'extra-large'

/**
* An Accordion Item can be medium, large, and larger in height
*/
export type AccordionItemSize = 'medium' | 'large' | 'larger';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all the options, export const object + type, see text component as an example:

export const TextFont = {
base: 'base',
numeric: 'numeric',
monospace: 'monospace',
} as const;
/**
* Applies font family to the content
* @public
*/
export type TextFont = ValuesOf<typeof TextFont>;

import { styles } from './accordion.styles.js';
import { template } from './accordion.template.js';

export const definition = Accordion.compose({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add jsdocs

presentationIcon: {
description: 'Slot for presentation icons',
control: {
type: 'boolean',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know how we want to document slots.
With this approach I see presentationIcon: boolean But there is neither presentationIcon attribute nor a slot.

I would rather add a separate story to document the presentation icon.

The same applies to the customExpandIcon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miroslavstastny I've just added a separate story for customExpandIcon as well as presentationIcon

</svg>`;

const storyTemplate = html<AccordionStoryArgs>`
<fluent-accordion expand-mode=${x => x.expandMode}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With expand-mode="single" I am still able to expand multiple items:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component API differs from FUIR9.
As part of every component implementation we should have an md which documents the API and highlights + justifies the differences.
Check https://github.com/microsoft/fluentui/blob/619b625d628ba1b30398052d7dc6b8110aff2c80/packages/react-components/react-button/docs/MIGRATION.md for inspiration.

@chrisdholt, @levithomason - I would like to here your opinion as I think this is important.

Copy link
Member

@chrisdholt chrisdholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks for making the updates @brianchristopherbrady

* @public
* @default 'start'
* @remarks
* HTML Attribute: expandIconPosition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* HTML Attribute: expandIconPosition
* HTML Attribute: expand-icon-position

align-items: center;
padding-right: ${spacingHorizontalS};
grid-column: 2 / span 1;
grid-row: 1 / span 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is start and end in the same grid column?


export const styles = css`
:host {
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use display helper function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${display("flex")} :host {}

@brianchristopherbrady brianchristopherbrady merged commit 1ad2597 into web-components-v3 Feb 21, 2023
@khmakoto khmakoto deleted the user/brianbrady/web-component-accordion branch April 6, 2023 00:10
chrisdholt pushed a commit that referenced this pull request Apr 29, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 30, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request Apr 30, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 2, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 2, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 2, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 3, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 6, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 6, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 8, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
radium-v pushed a commit that referenced this pull request May 10, 2024
* accordion and accordion item init

* yarn change

* updates docs

* updates accordion item styles

* code formatting

* updates imports

* adds v9 appearance sizes

* updates attribute name to align with fluent v9

* adds alternative stories for accordion with custom icons

* adds docs

* updates storybook

* updates changelog

* removes dead code

* removes dynamic icons from sb

* removes dead code

* adds accordion README

* moves accordion readme to accordion directory

* updates docs

* updates accordion docs

* updates docs

* updates docs

* fixes docs

* fixes exports

* adds display helper to styles

* optimizes styles

* updates html helper to use html.partial

* optimizes styles

* exports directly on class

* removes html helper

* removes arg tables from stories

* sorts exports alphabetically

* api report

* flattens accordion componnent folders

* removes comment

* updates styles

* optimizes styles

* updates attributes

* removes renaming of definition import

* removes attribute syntax

* adds attr

* reverts api-report

* removes dead code

* updates styles

* consolidates stories into one

* updates docs

* adds display helper to accordion styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants