Skip to content
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
4 changes: 3 additions & 1 deletion components/checkbox/stories/checkbox.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Sizes } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isChecked, isDisabled, isEmphasized, isIndeterminate, isInvalid, isReadOnly, size } from "@spectrum-css/preview/types";
import { isChecked, isDisabled, isEmphasized, isHovered, isIndeterminate, isInvalid, isReadOnly, size } from "@spectrum-css/preview/types";
import metadata from "../dist/metadata.json";
import packageJson from "../package.json";
import { CheckboxGroup } from "./checkbox.test.js";
Expand Down Expand Up @@ -30,6 +30,7 @@ export default {
control: { type: "text" },
},
isEmphasized,
isHovered,
isInvalid,
isDisabled,
isChecked,
Expand All @@ -43,6 +44,7 @@ export default {
isChecked: false,
isDisabled: false,
isEmphasized: false,
isHovered: false,
isIndeterminate: false,
isInvalid: false,
isReadOnly: false,
Expand Down
22 changes: 22 additions & 0 deletions components/checkbox/stories/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const CheckboxGroup = Variants({
testHeading: "Checked",
isChecked: true,
},
{
testHeading: "Checked, hovered",
isChecked: true,
isHovered: true,
},
{
testHeading: "Indeterminate",
isIndeterminate: true,
Expand All @@ -40,6 +45,12 @@ export const CheckboxGroup = Variants({
isInvalid: true,
isChecked: true,
},
{
testHeading: "Invalid, checked, hovered",
isInvalid: true,
isChecked: true,
isHovered: true,
},
{
testHeading: "Invalid, indeterminate",
isInvalid: true,
Expand All @@ -54,6 +65,11 @@ export const CheckboxGroup = Variants({
isDisabled: true,
isChecked: true,
},
{
testHeading: "Disabled, checked, hovered",
isDisabled: true,
isChecked: true,
},
{
testHeading: "Disabled, indeterminate",
isDisabled: true,
Expand All @@ -68,6 +84,12 @@ export const CheckboxGroup = Variants({
isReadOnly: true,
isChecked: true,
},
{
testHeading: "Read-only, checked, hovered",
isReadOnly: true,
isChecked: true,
isHovered: true,
},
{
testHeading: "Read-only, indeterminate",
isReadOnly: true,
Expand Down
2 changes: 2 additions & 0 deletions components/checkbox/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Template = ({
label,
isChecked = false,
isEmphasized = false,
isHovered = false,
isIndeterminate = false,
isDisabled = false,
isInvalid = false,
Expand Down Expand Up @@ -55,6 +56,7 @@ export const Template = ({
["is-indeterminate"]: isIndeterminate,
["is-disabled"]: isDisabled,
["is-invalid"]: isInvalid,
["is-hover"]: isHovered && !isDisabled,
["is-readOnly"]: isReadOnly,
...customClasses.reduce((a, c) => ({ ...a, [c]: true }), {}),
})}
Expand Down
12 changes: 6 additions & 6 deletions components/form/stories/form.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Template as Checkbox } from "@spectrum-css/checkbox/stories/template.js";
import { Template as Fieldgroup } from "@spectrum-css/fieldgroup/stories/template.js";
import { Template as Picker } from "@spectrum-css/picker/stories/template.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
Expand Down Expand Up @@ -80,18 +79,19 @@ export default {
content: [
(passthroughs, context) => Fieldgroup({
layout: "horizontal",
inputType: "checkbox",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in form were inspired by a few PRs:

Combined, we can address the regressions seen in form (where the the "Interest" inputs have no labels)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, love these updates!

items: [
Checkbox({
{
...passthroughs,
label: "Kittens",
customClasses: ["spectrum-FieldGroup-item"],
}, context),
Checkbox({
},
{
...passthroughs,
label: "Puppies",
customClasses: ["spectrum-FieldGroup-item"],
}, context),]
}),
}]
}, context),
],
},{
label: "Age",
Expand Down
Loading