Code Monkey home page Code Monkey logo

Comments (3)

kyubisation avatar kyubisation commented on September 27, 2024 1

@DavideMininni-Fincons Could I ask you to take a look at https://angular.app.sbb.ch/angular/components/accordion/overview and write a specification along that use case? I apologize for only mentioning this now.

from lyne-components.

DavideMininni-Fincons avatar DavideMininni-Fincons commented on September 27, 2024

Check both sbb-accordion and sbb-accordion-item

sbb-accordion-item

  • Icon at left: @Prop() public iconName?: string;
  • Title: can we use @Prop() public titleContent?: string; & @Prop() public titleLevel?: InterfaceTitleAttributes['level’]; ?
  • Toggle: chevron-small-up/down icon instead than current SVG?
  • Add a disableAnimation property
  • Events: willOpen/didOpen/willClose/didClose ?
  • Reuse SbbOverlayState ?
  • Two variants (default/milk)?
  • What state is 'Opacity 80%'?
  • Animation?

sbb-accordion

  • Keep the onlyOneOpen logic?

from lyne-components.

DavideMininni-Fincons avatar DavideMininni-Fincons commented on September 27, 2024

sbb-accordion-item (or sbb-expansion-panel ?)

Slots:

  • ‘content’ for the elements which became visibile when expanded
  • unnamed slot for title? or use @props titleContent / titleLevel ?

Props:

  • two color background variant (see sbb-selection-panel): @Prop() public color: 'white' | 'milk' = 'white';
  • icon at left: @Prop() public iconName?: string;
  • add a prop to disable open/close animation: @Prop({ reflect: true }) public disableAnimation = false;
  • Toggle: 
    • can the chevron-small-up/chevron-small-down icons can be used instead than the current SVG?
    • can we hide the toggle as in the Angular SBB lib? If yes, add @Prop() hideToggle = false;
  • force the opening of the panel with @Prop({ reflect: true }) public forceOpen = false;

States:

  • toggling the panel can be disabled with @Prop() disabled = false;
  • which state is 'opacity 80%' in Figma?

Events:

  • combination of did/will & open/close as in many other components

Questions:

  • can accordion-items be nested?
  • iconName is mandatory?

Example with titleContent

<sbb-accordion-item titleContent='This is the title'>
  <div slot="content">Lorem ipsum dolor sit amet.</div>
</sbb-accordion-item>

Example with slotted title and icon

<sbb-accordion-item icon-name='pie-small'>
  <div>Title</div>
  <div slot="content">Lorem ipsum dolor sit amet.</div>
</sbb-accordion-item>

sbb-accordion

Slots:

  • unnamed slot for one or more sbb-accordion-items

Prop:

  • allows for more than one expanded sbb-accordion-item at the same time: @Prop() multi = false;

Example

<sbb-accordion multi>
  <sbb-accordion-item titleContent='This is the title'>
    <div slot="content">Lorem ipsum dolor sit amet.</div>
  </sbb-accordion-item>
  <sbb-accordion-item titleContent='This is another title'>
    <div slot="content">Amet sit dolor ipsum lorem.</div>
  </sbb-accordion-item>
</sbb-accordion>

from lyne-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.