Skip to content

Commit f557a0f

Browse files
castastrophepfulton
authored andcommitted
feat(underlay): background tokens used directory
1 parent 137b55d commit f557a0f

File tree

4 files changed

+69
-2
lines changed

4 files changed

+69
-2
lines changed

components/underlay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spectrum-css/underlay",
3-
"version": "2.0.54",
3+
"version": "2.1.0-alpha.0",
44
"description": "The Spectrum CSS underlay component",
55
"license": "Apache-2.0",
66
"author": "Adobe",

components/underlay/skin.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ governing permissions and limitations under the License.
1111
*/
1212

1313
.spectrum-Underlay {
14-
background: var(--spectrum-dialog-confirm-overlay-background-color);
14+
/* TODO update to --spectrum-overlay-color token once an RGB stripped value is available */
15+
background: rgba(var(--spectrum-black-rgb), var(--spectrum-overlay-opacity));
1516
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { html } from 'lit-html';
2+
import { classMap } from 'lit-html/directives/class-map.js';
3+
import { styleMap } from 'lit-html/directives/style-map.js';
4+
5+
import "../index.css";
6+
import "../skin.css";
7+
8+
export const Template = ({
9+
rootClass = "spectrum-Underlay",
10+
customClasses = [],
11+
style = [],
12+
content,
13+
isOpen = true,
14+
...globals
15+
}) => {
16+
return html`
17+
<div class=${classMap({
18+
[rootClass]: true,
19+
"is-open": isOpen,
20+
...customClasses.reduce((a, c) => ({ ...a, [c]: true }), {}),
21+
})} id="spectrum-underlay"
22+
style=${styleMap(style)}>
23+
${content}
24+
</div>
25+
`;
26+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Import the component markup template
2+
import { Template } from "./template";
3+
4+
export default {
5+
title: "Components/Underlay",
6+
description: "A underlay component is used with modal and dialog. It lays over the rest of the page to deliver a blocking layer between the two contexts.",
7+
component: "Underlay",
8+
argTypes: {
9+
isOpen: {
10+
description: "Whether the underlay is open (visible).",
11+
table: {
12+
type: { summary: "boolean" },
13+
category: "State",
14+
},
15+
control: "boolean",
16+
},
17+
content: {
18+
table: { disable: true }
19+
},
20+
},
21+
args: {
22+
isOpen: true,
23+
rootClass: "spectrum-Underlay",
24+
},
25+
parameters: {
26+
actions: {
27+
handles: []
28+
},
29+
status: {
30+
type: process.env.MIGRATED_PACKAGES.includes('underlay') ? 'migrated' : undefined
31+
}
32+
}
33+
};
34+
35+
export const Default = Template.bind({});
36+
Default.args = {
37+
content: [
38+
"This is a underlay. Don't use it like this. Use it with a Modal and a Dialog.",
39+
],
40+
};

0 commit comments

Comments
 (0)