Skip to content

Commit 1e4d5d5

Browse files
marissahuysentruytcastastrophepfultoncdransfAziz Ramos
committed
docs(textarea): add figma assets to design tab (#3327)
* docs(textarea): add figma assets to design tab --------- Co-authored-by: castastrophe <castastrophe@users.noreply.github.com> Co-authored-by: Patrick Fulton <pfulton@adobe.com> Co-authored-by: Cory Dransfeldt <cdransfeldt@adobe.com> Co-authored-by: Aziz Ramos <azizramos@Azizs-MBP.lan> Co-authored-by: Josh Winn <965114+jawinn@users.noreply.github.com> Co-authored-by: Rise Erpelding <rise@heysparkbox.com> Co-authored-by: Rajdeep Chandra <rajdeepc@adobe.com> Co-authored-by: TarunAdobe <ttomar@adobe.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0b6cbb1 commit 1e4d5d5

File tree

4 files changed

+40
-43
lines changed

4 files changed

+40
-43
lines changed

.storybook/assets/base.css

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* stylelint-disable selector-class-pattern -- custom storybook styles */
21
/*!
32
* Copyright 2024 Adobe. All rights reserved.
43
*
@@ -12,6 +11,7 @@
1211
* governing permissions and limitations under the License.
1312
*/
1413

14+
/* stylelint-disable selector-class-pattern */
1515
body {
1616
--spectrum-font-family: var(--spectrum-sans-font-family-stack);
1717
--spectrum-font-style: var(--spectrum-default-font-style);
@@ -27,31 +27,12 @@ body {
2727
background-color: var(--spectrum-background-base-color, rgb(230, 230, 230));
2828
}
2929

30-
nav.sidebar-container,
31-
div.sb-bar {
32-
color: var(--spectrum-neutral-content-color-default);
33-
background-color: var(--spectrum-background-base-color);
34-
}
35-
36-
nav.sidebar-container,
37-
div.sb-bar {
38-
color: var(--spectrum-neutral-content-color-default);
39-
background-color: var(--spectrum-background-layer-2-color);
40-
}
41-
42-
/* Layers around the components */
43-
body.spectrum,
44-
.docs-story {
30+
.spectrum {
4531
color: var(--spectrum-neutral-content-color-default);
4632
background-color: var(--spectrum-background-layer-1-color);
4733
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
4834
}
4935

50-
.sb-story [data-inner-container] {
51-
padding: 0 !important;
52-
border: none !important;
53-
}
54-
5536
/* Hide the SVG elements that only include references */
5637
svg:has(symbol):not(:has(use)) {
5738
display: none;

.storybook/assets/index.css

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* stylelint-disable selector-class-pattern -- custom storybook styles */
21
/*!
32
* Copyright 2024 Adobe. All rights reserved.
43
*
@@ -12,6 +11,7 @@
1211
* governing permissions and limitations under the License.
1312
*/
1413

14+
/* stylelint-disable selector-class-pattern */
1515
body {
1616
--spectrum-font-family-ar: myriad-arabic, adobe-clean, "Source Sans Pro", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, ubuntu, "Trebuchet MS", "Lucida Grande", sans-serif;
1717
--spectrum-font-family-he: myriad-hebrew, adobe-clean, "Source Sans Pro", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, ubuntu, "Trebuchet MS", "Lucida Grande", sans-serif;
@@ -27,7 +27,7 @@ body {
2727
font-style: var(--spectrum-font-style);
2828

2929
color: var(--spectrum-neutral-content-color-default);
30-
background-color: var(--spectrum-background-base-color);
30+
background-color: var(--spectrum-background-layer-2-color);
3131
}
3232

3333
body:lang(ar) {
@@ -118,10 +118,4 @@ select:focus,
118118
border-color: rgb(2, 101, 220) !important;
119119
box-shadow: rgb(2, 101, 220) 0 0 0 1px inset !important;
120120
}
121-
122-
nav.sidebar-container,
123-
div.sb-bar {
124-
color: var(--spectrum-neutral-content-color-default) !important;
125-
background-color: var(--spectrum-background-layer-2-color) !important;
126-
}
127121
/* stylelint-enable selector-class-pattern */

.storybook/decorators/utilities.js

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Template as Typography } from "@spectrum-css/typography/stories/template.js";
21
import { html, nothing } from "lit";
32
import { styleMap } from "lit/directives/style-map.js";
43
import { when } from "lit/directives/when.js";
@@ -11,26 +10,45 @@ import { capitalize } from "lodash-es";
1110
* @param {string} props.content - The content to render in the heading or code block.
1211
* @param {string} props.size - The size of the heading to render.
1312
* @param {string} props.weight - The weight of the heading to render.
14-
* @param {string[]} props.customClasses - Additional classes to apply to the heading or code block.
1513
*/
1614
const Heading = ({
1715
semantics = "heading",
1816
content,
1917
size = "l",
2018
weight,
21-
customClasses = [],
2219
} = {}) => {
23-
return Typography({
24-
semantics,
25-
size,
26-
weight,
27-
content,
28-
skipLineBreak: true,
29-
customClasses: ["chromatic-ignore", ...customClasses],
30-
customStyles: {
31-
"color": semantics === "detail" ? "var(--spectrum-heading-color)" : undefined,
32-
}
33-
});
20+
if (!content) return nothing;
21+
22+
const headingStyles = {
23+
"display": "block",
24+
"color": "black",
25+
"font-family": 'adobe-clean, "adobe clean", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Trebuchet MS", "Lucida Grande", sans-serif',
26+
"font-size": "11px",
27+
"line-height": "1.3",
28+
"letter-spacing": ".06em",
29+
"font-weight": "700",
30+
};
31+
32+
if (size === "l") {
33+
headingStyles["font-size"] = "14px";
34+
}
35+
36+
if (semantics === "detail") {
37+
headingStyles["text-transform"] = "uppercase";
38+
}
39+
40+
if (weight === "light") {
41+
headingStyles["font-weight"] = "400";
42+
}
43+
44+
return html`
45+
<span
46+
class="chromatic-ignore"
47+
style=${styleMap(headingStyles)}
48+
>
49+
${content}
50+
</span>
51+
`;
3452
};
3553

3654
/**

components/textfield/stories/textarea.stories.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default {
2323
parameters: {
2424
packageJson,
2525
metadata,
26+
design: {
27+
type: "figma",
28+
url: "https://www.figma.com/design/Mngz9H7WZLbrCvGQf3GnsY/S2-%2F-Desktop?node-id=725-2579",
29+
},
2630
}
2731
};
2832

0 commit comments

Comments
 (0)