@spectrum-css/actionbutton
Advanced tools
Comparing version 7.0.0-s2-foundations.14 to 7.0.0-s2-foundations.15
# Change Log | ||
## 7.0.0-s2-foundations.15 | ||
### Patch Changes | ||
- [#2786](https://github.com/adobe/spectrum-css/pull/2786) [`0e08995`](https://github.com/adobe/spectrum-css/commit/0e08995cfd43f7d4495df4e3403106ced7760381) Thanks [@pfulton](https://github.com/pfulton)! - [SWC-248]: Selected, static black actionbutton content color should be white, not black | ||
## 7.0.0-s2-foundations.14 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@spectrum-css/actionbutton", | ||
"version": "7.0.0-s2-foundations.14", | ||
"version": "7.0.0-s2-foundations.15", | ||
"description": "The Spectrum CSS action button component", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -1,2 +0,2 @@ | ||
import { Variants } from "@spectrum-css/preview/decorators"; | ||
import { getRandomId } from "@spectrum-css/preview/decorators"; | ||
import { html } from "lit"; | ||
@@ -7,6 +7,7 @@ import { classMap } from "lit/directives/class-map.js"; | ||
import { when } from "lit/directives/when.js"; | ||
import { capitalize, lowerCase } from "lodash-es"; | ||
import { capitalize } from "lodash-es"; | ||
import "../index.css"; | ||
import "../themes/express.css"; | ||
import "../themes/spectrum-two.css"; | ||
import "../themes/spectrum.css"; | ||
@@ -68,3 +69,3 @@ | ||
onclick, | ||
id, | ||
id = getRandomId("actionbutton"), | ||
testId, | ||
@@ -87,3 +88,3 @@ role = "button", | ||
[`${rootClass}--emphasized`]: isEmphasized, | ||
[`${rootClass}--static${capitalize(lowerCase(staticColor))}`]: | ||
[`${rootClass}--static${capitalize(staticColor)}`]: | ||
typeof staticColor !== "undefined", | ||
@@ -97,4 +98,4 @@ ["is-disabled"]: isDisabled, | ||
})} | ||
id=${ifDefined(id)} | ||
data-testid=${ifDefined(testId)} | ||
id=${id} | ||
data-testid=${testId ?? id} | ||
role=${ifDefined(role)} | ||
@@ -111,7 +112,7 @@ style=${styleMap(customStyles)} | ||
> | ||
${when(typeof hasPopup !== "undefined" && hasPopup !== "false", () => | ||
${when(hasPopup && hasPopup !== "false", () => | ||
Icon({ | ||
size, | ||
iconName: "CornerTriangle", | ||
setName: "workflow", | ||
setName: "ui", | ||
customClasses: [`${rootClass}-hold`], | ||
@@ -135,78 +136,1 @@ }, context) | ||
}; | ||
export const ActionButtons = (args, context) => { | ||
return html` | ||
${Template(args, context)} | ||
${Template({ | ||
...args, | ||
iconName: undefined, | ||
}, context)} | ||
${Template({ | ||
...args, | ||
hideLabel: true, | ||
}, context)} | ||
${Template({ | ||
...args, | ||
hasPopup: "menu", | ||
label: "Has pop-up", | ||
iconName: undefined, | ||
}, context)} | ||
`; | ||
}; | ||
const Truncation = (args, context) => { | ||
return html` | ||
${Template(args, context)} | ||
${Template({ | ||
...args, | ||
iconName: undefined, | ||
}, context)} | ||
`; | ||
}; | ||
export const ActionButtonGroup = Variants({ | ||
Template: ActionButtons, | ||
stateDirection: "column", | ||
testData: [ | ||
{ | ||
testHeading: "Standard" | ||
}, | ||
{ | ||
testHeading: "Emphasized", | ||
isEmphasized: true, | ||
}, | ||
{ | ||
testHeading: "Quiet", | ||
isQuiet: true, | ||
}, | ||
{ | ||
Template: Truncation, | ||
testHeading: "Truncation", | ||
label: "Truncate this long content", | ||
customStyles: { | ||
maxInlineSize: "100px" | ||
}, | ||
withStates: false, | ||
}, | ||
], | ||
stateData: [{ | ||
testHeading: "Disabled", | ||
isDisabled: true, | ||
}, { | ||
testHeading: "Selected", | ||
isSelected: true, | ||
}, { | ||
testHeading: "Focused", | ||
isFocused: true, | ||
}, { | ||
testHeading: "Hovered", | ||
isHovered: true, | ||
}, { | ||
testHeading: "Active", | ||
isActive: true, | ||
}, { | ||
testHeading: "Disabled + selected", | ||
isDisabled: true, | ||
isSelected: true, | ||
}], | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
1
227284
2045