Skip to content

Commit 7fbd0fb

Browse files
authored
revert: Revert "fix: Align disabled select controls styles (#3638)" (#3656)
1 parent 178cef0 commit 7fbd0fb

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

pages/button-trigger/permutations.page.tsx

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import * as React from 'react';
44

5-
import Box from '~components/box';
65
import ButtonTrigger, { ButtonTriggerProps } from '~components/internal/components/button-trigger';
76
import Option from '~components/internal/components/option';
87
import { OptionDefinition } from '~components/internal/components/option/interfaces';
@@ -58,18 +57,6 @@ const permutations = createPermutations<ButtonTriggerProps>([
5857
children: [<Option option={{ ...option2, disabled: true }} />],
5958
},
6059
]);
61-
62-
const responsivePermutations = createPermutations<ButtonTriggerProps>([
63-
{
64-
disabled: [true, false],
65-
children: ['Long label to check the regression'],
66-
},
67-
{
68-
disabled: [false],
69-
readOnly: [true],
70-
children: ['Long label to check the regression'],
71-
},
72-
]);
7360
/* eslint-enable react/jsx-key */
7461

7562
export default function ButtonTriggerPermutations() {
@@ -78,20 +65,6 @@ export default function ButtonTriggerPermutations() {
7865
<h1>ButtonTrigger permutations</h1>
7966
<ScreenshotArea>
8067
<PermutationsView permutations={permutations} render={permutation => <ButtonTrigger {...permutation} />} />
81-
<Box margin={{ top: 'm' }}>
82-
{/* Permutations to check that the width of the trigger doesn't change between states */}
83-
<PermutationsView
84-
permutations={responsivePermutations}
85-
render={permutation => (
86-
<div style={{ display: 'flex' }}>
87-
<div>
88-
<ButtonTrigger {...permutation} />
89-
</div>
90-
<div style={{ border: '1px solid' }}>Test</div>
91-
</div>
92-
)}
93-
/>
94-
</Box>
9568
</ScreenshotArea>
9669
</>
9770
);

src/button-dropdown/internal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ const InternalButtonDropdown = React.forwardRef(
258258
styles['trigger-item'],
259259
styles['split-trigger'],
260260
styles[`variant-${variant}`],
261+
mainActionProps.disabled && styles.disabled,
261262
mainActionProps.loading && styles.loading
262263
)}
263264
// Close dropdown upon main action click unless event is cancelled.
@@ -281,6 +282,7 @@ const InternalButtonDropdown = React.forwardRef(
281282
styles['dropdown-trigger'],
282283
isVisualRefresh && styles['visual-refresh'],
283284
styles[`variant-${variant}`],
285+
baseTriggerProps.disabled && styles.disabled,
284286
baseTriggerProps.loading && styles.loading
285287
)}
286288
{...getAnalyticsMetadataAttribute(analyticsMetadata)}

src/internal/components/button-trigger/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $padding-block-inner-filtering-token: 0px;
8484
}
8585

8686
&.disabled {
87-
@include styles.form-disabled-element;
87+
@include styles.button-trigger-disabled-element;
8888

8989
> .arrow {
9090
color: awsui.$color-text-button-inline-icon-disabled;

src/internal/styles/forms/mixins.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@
132132
cursor: auto;
133133
}
134134

135+
@mixin button-trigger-disabled-element {
136+
background-color: awsui.$color-background-input-disabled;
137+
border-block: awsui.$border-width-token solid awsui.$color-border-input-disabled;
138+
border-inline: awsui.$border-width-token solid awsui.$color-border-input-disabled;
139+
color: awsui.$color-text-input-disabled;
140+
cursor: auto;
141+
}
142+
135143
@mixin form-readonly-element {
136144
background-color: awsui.$color-background-input-default;
137145
border-block: awsui.$border-width-field solid awsui.$color-border-input-disabled;

0 commit comments

Comments
 (0)