Skip to content

Commit 7087970

Browse files
authored
chore: remove button state (#4501)
* chore: remove button state * fix: issue with remaining state property
1 parent 57aeb60 commit 7087970

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

docs/migration/v2.x.x-to-v3.0.0.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22

33
## db-button/DBButton type
44

5+
### `type` property
6+
57
We changed the behaviour of the `type` property in the `db-button`/`DBButton` component.
68
Those changes will only affect React and Vue users.
79
If you use `onClick` or `@click` you will get `type=button` as default, otherwise it will be `type=submit`.
810
You can still set the `type` property manually, to overwrite this.
911
Angular and Web Components users will not be affected by this change, the default will be `button`, because click event listeners can't be undefined in the frameworks.
1012
Please provide the correct `type` property in your code anyhow as a best practise.
1113

14+
### `state` property
15+
16+
We removed the `state` property from the `db-button`/`DBButton` component for now.
17+
It wasn't implemented in any framework causing some confusion, and we will reintroduce it in a future version.
18+
1219
## icon-before/-after
1320

1421
We renamed the `data-icon-after` and `data-icon-before` properties to `data-icon-trailing` and `data-icon-leading`,

packages/components/src/components/button/button.lite.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default function DBButton(props: DBButtonProps) {
4444
data-icon-trailing={props.iconTrailing}
4545
data-hide-icon-trailing={getHideProp(props.showIconTrailing)}
4646
data-size={props.size}
47-
data-state={props.state}
4847
data-width={props.width}
4948
data-variant={props.variant}
5049
data-no-text={getBooleanAsString(props.noText)}

packages/components/src/components/button/button.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,6 @@
101101
opacity: variables.$db-opacity-md;
102102
}
103103

104-
// States (currently only "loading")
105-
&[data-state="loading"] {
106-
@include icons.is-icon-text-replace();
107-
108-
font-size: 0;
109-
110-
&::before {
111-
content: "";
112-
}
113-
}
114-
115104
// Workaround for current stencil implementation for header
116105
&:has(> .db-button) {
117106
margin: 0;

packages/components/src/components/button/model.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ export type ButtonVariantType = (typeof ButtonVariantList)[number];
2424
export const ButtonTypeList = ['button', 'reset', 'submit'] as const;
2525
export type ButtonTypeType = (typeof ButtonTypeList)[number];
2626

27-
export const ButtonStateList = ['loading'] as const;
28-
export type ButtonStateType = (typeof ButtonStateList)[number];
29-
3027
export type DBButtonDefaultProps = {
3128
/**
3229
* The disabled attribute can be set to [keep a user from clicking on the button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled).
@@ -48,11 +45,6 @@ export type DBButtonDefaultProps = {
4845
*/
4946
noText?: boolean | string;
5047

51-
/**
52-
* Show loading progress inside button.
53-
*/
54-
state?: ButtonStateType;
55-
5648
/**
5749
* The type attribute specifies the [type of button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type).
5850
*/

showcases/react-showcase/src/components/button/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import DefaultComponent from '../default-component';
77

88
const getButton = ({
99
variant,
10-
state,
1110
size,
1211
noText,
1312
icon,
@@ -21,7 +20,6 @@ const getButton = ({
2120
}: DBButtonProps) => (
2221
<DBButton
2322
variant={variant}
24-
state={state}
2523
size={size}
2624
noText={noText}
2725
icon={icon}

0 commit comments

Comments
 (0)