Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
m-akinc committed Mar 14, 2024
1 parent e8831ed commit 463c357
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ type AppearanceState = (typeof appearanceStates)[number];
// prettier-ignore
const component = (
[interactionName, interaction]: InteractionState,
[disabledName, disabled]: DisabledState,
[iconVisible, labelVisible, endIconVisible]: PartVisibilityState,
[openName, open]: OpenState,
[disabledName, disabled]: DisabledState,
[appearanceName, appearance]: AppearanceState
): ViewTemplate => html`
<${menuButtonTag}
Expand All @@ -77,17 +77,17 @@ export const menuButtonThemeMatrix: StoryFn = createMatrixThemeStory(
component,
[
nonInteractionStates,
disabledStates,
partVisibilityStates,
openStates,
disabledStates,
appearanceStates
],
// Disabled and open is not a valid state
(
_interactionState: InteractionState,
disabledState: DisabledState,
_partVisibilityState: PartVisibilityState,
openState: OpenState,
disabledState: DisabledState
openState: OpenState
) => {
return disabledState[0] !== 'Disabled' || openState[0] !== 'Open';
}
Expand All @@ -99,23 +99,12 @@ export const menuButtonInteractionsThemeMatrix: StoryFn = createMatrixThemeStory
component,
[
interactionStates,
disabledStates,
[[false, true, false]],
openStates,
disabledStates,
appearanceStates
],
// Only interaction relevant to disabled controls is hover
(
interactionState: InteractionState,
_partVisibilityState: PartVisibilityState,
_openState: OpenState,
disabledState: DisabledState
) => {
return disabledInteractionsFilter(
interactionState,
disabledState
);
}
disabledInteractionsFilter
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const numberFieldInteractionsThemeMatrix: StoryFn = createMatrixThemeStor
createMatrix(
component,
[
interactionStates.filter(x => !x[0].includes('Active')), // skip irrelevant active states
interactionStates,
disabledStates,
hideStepStates.filter(x => x[0] !== 'Hide Step'), // always show inc/dec buttons
valueStates.filter(x => x[0] !== 'Placeholder'), // don't test placeholder text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ type CheckedState = (typeof checkedStates)[number];
// prettier-ignore
const component = (
[interactionName, interaction]: InteractionState,
[disabledName, disabled]: DisabledState,
[iconVisible, labelVisible, endIconVisible]: PartVisibilityState,
[checkedName, checked]: CheckedState,
[disabledName, disabled]: DisabledState,
[appearanceName, appearance]: AppearanceState
): ViewTemplate => html`
<${toggleButtonTag}
Expand All @@ -76,9 +76,9 @@ const component = (
export const toggleButtonThemeMatrix: StoryFn = createMatrixThemeStory(
createMatrix(component, [
nonInteractionStates,
disabledStates,
partVisibilityStates,
checkedStates,
disabledStates,
appearanceStates
])
);
Expand All @@ -88,23 +88,12 @@ export const toggleButtonInteractionsThemeMatrix: StoryFn = createMatrixThemeSto
component,
[
interactionStates,
disabledStates,
[[false, true, false]],
checkedStates,
disabledStates,
appearanceStates
],
// Only interaction relevant to disabled controls is hover
(
interactionState: InteractionState,
_partVisibilityState: PartVisibilityState,
_checkedState: CheckedState,
disabledState: DisabledState
) => {
return disabledInteractionsFilter(
interactionState,
disabledState
);
}
disabledInteractionsFilter
)
);

Expand Down

0 comments on commit 463c357

Please sign in to comment.