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

Define _level default property as 0 across components #7382

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/BREAKING_CHANGES.v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ The following components have been removed:

- The DOM event `kol-selection-change` has been renamed to `kolSelectionChange`.

### kol-alert

- The default value for the property `_level` changed to `0` which results in rendering a `strong` tag instead of `h1` when no level is provided.

### kol-card

- The default value for the property `_level` changed to `0` which results in rendering a `strong` tag instead of `h1` when no level is provided.

### kol-heading

- The default value for the property `_level` changed to `0` which results in rendering a `strong` tag instead of `h1` when no level is provided.

### kol-table-stateless

- The DOM event `kol-selection-change` has been renamed to `kolSelectionChange`.
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/alert/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class KolAlertWc implements AlertAPI {
/**
* Defines which H-level from 1-6 the heading has. 0 specifies no heading and is shown as bold text.
*/
@Prop() public _level?: HeadingLevel = 1;
@Prop() public _level?: HeadingLevel = 0;

/**
* Gibt die EventCallback-Function für das Schließen des Alerts an.
Expand All @@ -86,7 +86,7 @@ export class KolAlertWc implements AlertAPI {
@Prop() public _variant?: AlertVariant = 'msg';

@State() public state: AlertStates = {
_level: 1,
_level: 0,
};

@Watch('_alert')
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/alert/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class KolAlert implements AlertProps {
/**
* Defines which H-level from 1-6 the heading has. 0 specifies no heading and is shown as bold text.
*/
@Prop() public _level?: HeadingLevel = 1;
@Prop() public _level?: HeadingLevel = 0;

/**
* Gibt die EventCallback-Function für das Schließen des Alerts an.
Expand All @@ -67,6 +67,6 @@ export class KolAlert implements AlertProps {
@Prop() public _variant?: AlertVariant = 'msg';

@State() public state: AlertStates = {
_level: 1,
_level: 0,
};
}
2 changes: 1 addition & 1 deletion packages/components/src/components/card/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class KolCard implements CardAPI {
/**
* Defines which H-level from 1-6 the heading has. 0 specifies no heading and is shown as bold text.
*/
@Prop() public _level?: HeadingLevel = 1;
@Prop() public _level?: HeadingLevel = 0;

@State() public state: CardStates = {
_label: '', // ⚠ required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ exports[`kol-card should render with _label="Überschrift" 1`] = `
<template shadowrootmode="open">
<div class="kol-card">
<div class="kol-card__header">
<h1 class="kol-card__headline kol-headline kol-headline--h1 kol-headline--single">
<strong class="kol-card__headline kol-headline kol-headline--single kol-headline--strong">
Überschrift
</h1>
</strong>
</div>
<div class="kol-card__content">
<slot></slot>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/heading/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class KolHeading implements HeadingAPI {
/**
* Defines which H-level from 1-6 the heading has. 0 specifies no heading and is shown as bold text.
*/
@Prop() public _level?: HeadingLevel = 1;
@Prop() public _level?: HeadingLevel = 0;

/**
* Defines the text of the secondary headline.
Expand All @@ -39,7 +39,7 @@ export class KolHeading implements HeadingAPI {

@State() public state: HeadingStates = {
_label: '', // ⚠ required
_level: 1,
_level: 0,
};

@Watch('_label')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,87 +80,87 @@ exports[`kol-heading should render with _label="Headline" _level=6 1`] = `
exports[`kol-heading should render with _label="Headline" _variant="h1" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h1 kol-headline--single">
<strong class="kol-headline kol-headline--h1 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="h2" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h2 kol-headline--single">
<strong class="kol-headline kol-headline--h2 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="h3" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h3 kol-headline--single">
<strong class="kol-headline kol-headline--h3 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="h4" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h4 kol-headline--single">
<strong class="kol-headline kol-headline--h4 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="h5" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h5 kol-headline--single">
<strong class="kol-headline kol-headline--h5 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="h6" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h6 kol-headline--single">
<strong class="kol-headline kol-headline--h6 kol-headline--single">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" _variant="strong" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--single kol-headline--strong">
<strong class="kol-headline kol-headline--single kol-headline--strong">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;

exports[`kol-heading should render with _label="Headline" 1`] = `
<kol-heading>
<template shadowrootmode="open">
<h1 class="kol-headline kol-headline--h1 kol-headline--single">
<strong class="kol-headline kol-headline--single kol-headline--strong">
Headline
<slot name="expert" slot="expert"></slot>
</h1>
</strong>
</template>
</kol-heading>
`;
Loading