Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCastigliano committed Aug 8, 2024
1 parent cc852c3 commit 1fc04f9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/elements-experimental/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"@sbb-esta/lyne-elements-experimental/*": ["./*"]
}
},
"include": ["./**/*.ts", "../vite-env.d.ts", "../elements/teaser-hero.ts"],
"include": ["./**/*.ts", "../vite-env.d.ts"],
"exclude": ["./**/*.chromatic.stories.ts"]
}
13 changes: 7 additions & 6 deletions src/elements/teaser-hero/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ it should be an eye-catcher and should have an emotional effect on the user with
It is possible to provide the panel label via an unnamed slot,
while the link text can be provided using the `link-content` slot or the `linkContent` property;
similarly, the background image can be provided using the `image` slot or the `imageSrc` property.
Optionally a `sbb-chip` can be slotted in the `chip` slot, either together with the other slottable elements or alone.

```html
<sbb-teaser-hero
Expand Down Expand Up @@ -47,9 +48,9 @@ Avoid slotting block elements (e.g. `div`) as this violates semantic rules and c

## Slots

| Name | Description |
| -------------- | ----------------------------------------------------- |
| | Use the unnamed slot to add text content to the panel |
| `chip` | Link content of the panel |
| `image` | The background image that can be a `sbb-image` |
| `link-content` | Link content of the panel |
| Name | Description |
| -------------- | ------------------------------------------------------------------ |
| | Use the unnamed slot to add text content to the panel |
| `chip` | The `sbb-chip` component that will be displayed on top-left corner |
| `image` | The background image that can be a `sbb-image` |
| `link-content` | Link content of the panel |
4 changes: 2 additions & 2 deletions src/elements/teaser-hero/teaser-hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
& {
@include sbb.absolute-center-y;
}

// Hide panel when no content or link-content is proview.
// Hide panel when no content or link-content is provided.
:host(:not([data-slot-names~='unnamed'], [data-slot-names~='link-content'], [link-content])) & {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/teaser-hero/teaser-hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import '../link/block-link-static.js';
* @slot - Use the unnamed slot to add text content to the panel
* @slot link-content - Link content of the panel
* @slot image - The background image that can be a `sbb-image`
* @slot chip - Link content of the panel
* @slot chip - The `sbb-chip` component that will be displayed on top-left corner
*/
@customElement('sbb-teaser-hero')
@slotState()
Expand Down
2 changes: 1 addition & 1 deletion src/elements/teaser-hero/teaser-hero.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe(`sbb-teaser-hero`, () => {
`without content ${state.name}`,
state.with(async (setup) => {
await setup.withFixture(html`
<sbb-teaser-hero href="#">
<sbb-teaser-hero href="#" image-src=${imageUrl}>
<sbb-chip slot="chip">Label</sbb-chip>
</sbb-teaser-hero>
`);
Expand Down

0 comments on commit 1fc04f9

Please sign in to comment.