Skip to content

Commit

Permalink
chore(stepper): update vrt snpashots (#3123)
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe authored Sep 18, 2024
1 parent 0061fba commit 2e467a1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
8 changes: 5 additions & 3 deletions components/stepper/stories/stepper.stories.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isDisabled, isFocused, isInvalid, isKeyboardFocused, isQuiet, size } from "@spectrum-css/preview/types";
import { Sizes } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isDisabled, isFocused, isHovered, isInvalid, isKeyboardFocused, isQuiet, size } from "@spectrum-css/preview/types";
import pkgJson from "../package.json";
import { StepperGroup } from "./stepper.test.js";
import { Template, DisabledVariantsGroup, AllDefaultVariantsGroup } from "./template";
import { AllDefaultVariantsGroup, DisabledVariantsGroup, Template } from "./template";

/**
* A stepper can be used to increment or decrement a value by a specified amount via an up/down button. An input field displays the current value.
Expand All @@ -26,13 +26,15 @@ export default {
isDisabled,
isInvalid,
isFocused,
isHovered,
isKeyboardFocused,
},
args: {
rootClass: "spectrum-Stepper",
size: "m",
isQuiet: false,
isFocused: false,
isHovered: false,
isKeyboardFocused: false,
isInvalid: false,
isDisabled: false,
Expand Down
38 changes: 20 additions & 18 deletions components/stepper/stories/stepper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ export const StepperGroup = Variants({
isQuiet: true,
},
{
testHeading: "Hide stepper",
hideStepper: true,
testHeading: "Invalid",
isInvalid: true,
},
{
testHeading: "Quiet + invalid",
isQuiet: true,
isInvalid: true,
},
],
stateData: [
{
testHeading: "Hide stepper",
hideStepper: true,
},
{
testHeading: "Disabled",
isDisabled: true,
},
{
testHeading: "Hovered",
isHovered: true,
},
{
testHeading: "Focused",
isFocused: true,
Expand All @@ -30,28 +43,17 @@ export const StepperGroup = Variants({
isKeyboardFocused: true,
},
{
testHeading: "Invalid",
isInvalid: true,
},
{
testHeading: "Invalid + focused",
isInvalid: true,
isFocused: true,
},
{
testHeading: "Invalid + keyboard-focused",
isInvalid: true,
isKeyboardFocused: true,
testHeading: "Disabled + hovered",
isDisabled: true,
isHovered: true,
},
{
testHeading: "Invalid + disabled + focused",
isInvalid: true,
testHeading: "Disabled + focused",
isDisabled: true,
isFocused: true,
},
{
testHeading: "Invalid + disabled + keyboard-focused",
isInvalid: true,
testHeading: "Disabled + keyboard-focused",
isDisabled: true,
isKeyboardFocused: true,
},
Expand Down
16 changes: 13 additions & 3 deletions components/stepper/stories/template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Template as InfieldButton } from "@spectrum-css/infieldbutton/stories/template.js";
import { getRandomId, Container } from "@spectrum-css/preview/decorators";
import { Container, getRandomId } from "@spectrum-css/preview/decorators";
import { Template as Textfield } from "@spectrum-css/textfield/stories/template.js";
import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";
Expand All @@ -14,6 +14,7 @@ export const Template = ({
size = "m",
isQuiet = false,
isFocused = false,
isHovered = false,
isKeyboardFocused = false,
isInvalid = false,
isDisabled = false,
Expand Down Expand Up @@ -44,6 +45,7 @@ export const Template = ({
[`${rootClass}--size${size?.toUpperCase()}`]: typeof size !== "undefined",
[`${rootClass}--quiet`]: isQuiet,
"is-focused": isFocused,
"is-hover": isHovered,
"is-keyboardFocused": isKeyboardFocused,
"is-invalid": isInvalid,
"is-disabled": isDisabled,
Expand Down Expand Up @@ -115,6 +117,14 @@ export const AllDefaultVariantsGroup = (args, context) => Container({
heading: "Invalid",
content: Template({...args, isInvalid: true}, context)
})}
${Container({
withBorder: false,
containerStyles: {
"gap": "8px",
},
heading: "Hovered",
content: Template({...args, isHovered: true}, context)
})}
${Container({
withBorder: false,
containerStyles: {
Expand All @@ -136,15 +146,15 @@ export const AllDefaultVariantsGroup = (args, context) => Container({
containerStyles: {
"gap": "8px",
},
heading: "Keyboard focused",
heading: "Keyboard-focused",
content: Template({...args, isKeyboardFocused: true}, context)
})}
${Container({
withBorder: false,
containerStyles: {
"gap": "8px",
},
heading: "Invalid, keyboard focused",
heading: "Invalid, keyboard-focused",
content: Template({...args, isInvalid: true, isKeyboardFocused: true}, context)
})}
`
Expand Down

0 comments on commit 2e467a1

Please sign in to comment.