-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(illustratedmessage): adding new s2 tokens, horizontal layout, vrts #3246
base: spectrum-two
Are you sure you want to change the base?
feat(illustratedmessage): adding new s2 tokens, horizontal layout, vrts #3246
Conversation
🦋 Changeset detectedLatest commit: bc881d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 86 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
File metricsSummaryTotal size: 1.74 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsdropzone
illustratedmessage
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-3246--spectrum-css.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got sizing and variants in here now, which is really exciting! Leaving some feedback to improve the custom property definitions and use of tokens!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! There are some typography tokens that need to be updated to match the spec, and the illustration color token also needs updating, but otherwise colors and layouts are looking good!
A couple of other thoughts I had:
- Could we drop the update tokens commit and use the
yarn.lock
fromspectrum-two
? That might be safer than the updates on this branch. - We'll need to update documentation (like the Docs page in Storybook) for Illustrated message since we're introducing a new variant and t-shirt sizing), I think it'd be ok to do this later once we get these changes in
main
since we've had a lot of documentation changes between these two branches, but maybe we could ensure that we write a Jira card so we don't lose track of the fact that the work needs to be done? What do you think?
I thought I merged the updates from |
You did! There were just deviations in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the tokens are good now! I left some comments about some things that still need to be cleaned up, let me know if you want to pair through any of these!
&:lang(ja), | ||
&:lang(zh), | ||
&:lang(ko) { | ||
--spectrum-illustrated-message-cjk-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I see what you're trying to do here and I think this is a good strategy, I was originally thinking we should have something like:
&:lang(ja),
&:lang(zh),
&:lang(ko) {
--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size);
}
and then also
.spectrum-IllustratedMessage--sizeS {
&:lang(ja),
&:lang(zh),
&:lang(ko) {
--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-small-cjk-title-font-size);
}
}
.spectrum-IllustratedMessage--sizeL {
&:lang(ja),
&:lang(zh),
&:lang(ko) {
--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-large-cjk-title-font-size);
}
}
That gets kind of ugly and repetitive since it needs to change for every t-shirt size though, so let's not do that!
Instead let's take what you already have, I think this has the potential to be cleaner, it's just that --spectrum-illustrated-message-cjk-title-font-size
isn't being used right now. What if we add a custom property definition to the title section like this:
--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-medium-title-font-size);
--spectrum-illustrated-message-title-line-height: var(--spectrum-title-line-height);
--spectrum-illustrated-message-title-color: var(--spectrum-heading-color);
/* These first 3 are already in the code, I'm just adding them so you have an idea of where in the code this would be */
--spectrum-illustrated-message-cjk-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size);
and then change what you have here to
&:lang(ja),
&:lang(zh),
&:lang(ko) {
--spectrum-illustrated-message-title-font-size: var(--spectrum-illustrated-message-cjk-title-font-size);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These cjk font sizes are not coming through and this custom property is showing up as unused in my editor:
You'll need to set --spectrum-illustrated-message-title-font-size
to --spectrum-illustrated-message-cjk-title-font-size
somewhere within the cjk lang selector. This --spectrum-illustrated-message-cjk-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size);
that you have currently can be moved up to around L33 where we have the other title custom properties set. Although I think it would also work if it stayed here within the cjk lang selector.
Adobe Clean doesn't render correctly for the component anymore 😅 |
Do you have a screen shot of what this looks like for you? I did notice some weirdness with tokens disappearing - like for instance the space between the description and button group would suddenly stop being defined, but I couldn't figure out what was triggering it and so far it's been rendering fine for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming along! I left some more specific comments, but another more general concern I have is what regressions this might be causing to Drop Zone. Since VRTs aren't working great for spectrum-two
, I visually compared with another branch on spectrum-two
and see some differences that need looking into, primarily with the image size and typography, we'll probably want to look into why these are happening and if there's anything we can do to prevent them:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! This is starting to look really good and I think after another round of (smaller) changes, you could see if someone else wants to review it and also see if we can get illustrated message design reviewed.
A lot of the callouts I have now are more general and maybe up for discussion, so I'm not requesting changes this time around:
- Storybook controls: Comparing this branch with
main
, it looks like the accent color story disappears inmain
and uses the controls to flip the accent color on and off. It'd be great if we can make it like that in this branch, too, if possible! There's also a heading control that appears to control the heading text onmain
, so that might be another change to adopt here. - The illustrated message image: The Figma specs call for a square svg, and we're currently using a rectangular image. I would want to confirm with design that this always-square image might be something new for S2, since the way we have the CSS right now, the width and height use the same custom properties. If images are always meant to be square and never rectangular, we might want to update the image.
- Font size for cjk: This still needs some kind of fix to make sure the title cjk font size is being applied, but is probably worth asking design about what cjk tokens should be used other than the title font-size.
- Drop zone: There's still some wonkiness here! But I'm realizing now that I think this might be coming from token changes on
spectrum-two
and maybe it would be better to leave it alone until it's ready for migration 🥴
I also did occasionally have the problem I was noticing before with tokens, I'm attaching some screenshots at the bottom but basically what I'm seeing is that all of the typography styles are suddenly overriding the component-level styles, I don't think this is something that you did but might be worth investigating as a separate bug:
Will re-review when I'm back from PTO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the CJK tokens are the only ones I'm seeing that aren't coming through properly, and while I called it out last time, I'm actually seeing why that's happening now.
I'm also really bothered by the typography bug I'm seeing but would love to see another reviewer's opinion/know if they're seeing the same thing.
Last thing: since we have no package.json changes in this PR, can we remove the changes that appear from yarn.lock in the PR? (Totally fine if individual commits show changes, as long as the changes from all commits don't have yarn.lock listed.)
&:lang(ja), | ||
&:lang(zh), | ||
&:lang(ko) { | ||
--spectrum-illustrated-message-cjk-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These cjk font sizes are not coming through and this custom property is showing up as unused in my editor:
You'll need to set --spectrum-illustrated-message-title-font-size
to --spectrum-illustrated-message-cjk-title-font-size
somewhere within the cjk lang selector. This --spectrum-illustrated-message-cjk-title-font-size: var(--spectrum-illustrated-message-medium-cjk-title-font-size);
that you have currently can be moved up to around L33 where we have the other title custom properties set. Although I think it would also work if it stayed here within the cjk lang selector.
heading, | ||
() => | ||
html`<h2 | ||
class="spectrum-Heading spectrum-Heading--regular ${rootClass}-heading" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really love to hear others' opinions on this, but given that the title and body are setting font-weight, font-style, font-family, and font-size, I'm not seeing any rationale for keeping .spectrum-Heading
and .spectrum-Body
classes in the template. I'm still seeing that issue I mentioned last time where the typography classes are inconsistently prioritized over the component-specific classes and I don't know why that's happening (maybe it has something to do with removing the t-shirt sized typography classes?), but removing the typography classes here would likely fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow --spectrum-illustrated-message-cjk-title-font-size
didn't appear as an unused property until I reset my VSCode 😅 It was rendering normally for me on my end. I ended up adding the language selectors within each t-shirt size. For some reason moving that line of code more up top still comes up as unused property. Switching the languages look normal now.
For the .spectrum-Heading
and .spectrum-Body
the only reason why I kept it there was because main
branch had it. Removing it now doesn't break anything so it's good now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holy smokes this was a big one! You covered a lot of stuff and this seems like it's getting in better and better shape- well done! I left you some questions and comments, and then I had a couple more questions that I didn't really know where to put in the files. Hopefully I don't repeat too much of what Rise & Josh have already mentioned.
Do we need an updated illustration at all? The designs are using that cloud, which seems very S2 ☁️😄 We should be able to export it directly from Figma (I can try to help with that if you want/need)
Do we want or need to allow users to test out the description text with a description
text control? I see it's disabled now, but I don't have the context as to why.
/** | ||
* An accent color class can be used on elements of the illustration SVG. | ||
*/ | ||
export const AccentColor = Template.bind({}); | ||
AccentColor.tags = ["!dev"]; | ||
AccentColor.args = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to ask about the sizing stories, but it looks like you and Rise already talked about those stories being added later. Do you want to make a card for the follow up work so we keep those additions on our radar once we merge? If you already created it, my apologies- I must have missed it in my very quick search! We could add the Figma design guidance around each of the sizes too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I was also going to ask about the accent color story, but I see Rise's covered it! Just to clarify for me, design was ok with us keeping this story then in our documentation and examples for this component? I know you mentioned the accent color is used for the illustration and hover state in Drop zone, but should we continue showing that accent color variant here for illustrated message?
--spectrum-illustrated-message-illustration-size: 96px; | ||
|
||
/* Title */ | ||
--spectrum-illustrated-message-title-font-family: var(--spectrum-title-sans-serif-font-family); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to check with Rise & Josh on this one, but I would suggest we keep the original token here, and continue to use spectrum-sans-font-family-stack
instead of spectrum-title-sans-serif-font-family
.
Currently, this is what is in the tokens/dist
--spectrum-title-sans-serif-font-family:var(--spectrum-sans-serif-font-family);
...
--spectrum-sans-serif-font-family:Adobe Clean;
The title-sans-serif-font-family token (although called for in the design) isn't pointing to the web font stack, so we probably shouldn't be using that title-sans-serif token as it is currently. The correct web font stack is actually defined in that original sans-font-family-stack:
--spectrum-sans-font-family-stack: adobe-clean, var(--spectrum-sans-serif-font-family), 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Trebuchet MS', 'Lucida Grande', sans-serif;
Josh mentioned that the font loaded by Typekit is the "adobe-clean", and which is only defined in our stack (not the "Adobe Clean"). I'll have to do the same thing for dialog, now that we've dug into it more.
--spectrum-illustrated-message-title-color: var(--spectrum-heading-color); | ||
|
||
/* Description */ | ||
--spectrum-illustrated-message-description-font-family: var(--spectrum-body-sans-serif-font-family); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might revert this change too. I think it's in a similar situation to that title token I mentioned, with "Adobe Clean" vs. "adobe-clean".
spectrum-css/tokens/dist/index.css
Line 1664 in 0c93977
--spectrum-body-sans-serif-font-family:var(--spectrum-sans-serif-font-family); |
.changeset/beige-dragons-tickle.md
Outdated
`--mod-illustrated-message-illustration-accent-color` | ||
`--highcontrast-illustrated-message-illustration-accent-color` | ||
|
||
## Dropzone & Illustrated message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might just be me, but I wonder if we could come up with a clearer heading for this section. Maybe something like, "Dropzone nested mods?" Because those mods were added to the nested illustrated message within dropzone, right?
I don't know...take it or leave it.
components/dropzone/metadata/mods.md
Outdated
@@ -9,6 +9,7 @@ | |||
| `--mod-drop-zone-body-font-style` | | |||
| `--mod-drop-zone-body-font-weight` | | |||
| `--mod-drop-zone-body-line-height` | | |||
| `--mod-drop-zone-body-to-action` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be added to the changeset message as "new mods" for drop zone!
--mod-drop-zone-body-to-action
--mod-drop-zone-illustration-to-title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more suggestions and questions for you!
As I was reviewing the drop zone changes, I wondered- should those be a separate PR and a separate branch again? What is the minimum amount of changes that could be make in this illustrated message PR to make sure drop zone isn't "broken?" If we need all of the changes in this branch, that's totally fine! I was just ending up with quite a few drop zone comments, so that's what triggered that thought. I left some anyways 😬
@@ -1,6 +1,4 @@ | |||
import { html } from "lit"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete these couple empty lines.
: ""}" fill-rule="evenodd" clip-rule="evenodd" d="M56.2825 50.793C61.8957 37.7312 74.5092 28.5 89.3299 28.5C108.539 28.5 124.014 43.962 125.409 63.2651C140.627 65.9995 152 79.7949 152 96.1349C152 114.396 137.783 129.5 119.883 129.5C119.853 129.5 119.825 129.5 119.8 129.499C119.775 129.5 119.751 129.5 119.726 129.5H31.8807C31.7163 129.5 31.5543 129.49 31.3951 129.471C18.254 129.016 8 117.815 8 104.385C8 94.2115 13.8616 85.3693 22.4022 81.4428C22.3022 80.4808 22.2483 79.4993 22.2483 78.4996C22.2483 62.9094 34.3921 49.9713 49.734 49.9713C51.9924 49.9713 54.1854 50.2579 56.2825 50.793ZM32.2594 121.5H119.543C119.611 121.497 119.679 121.496 119.747 121.496C119.774 121.496 119.799 121.496 119.821 121.497C119.848 121.497 119.87 121.498 119.889 121.498C119.904 121.499 119.919 121.499 119.931 121.5C133.067 121.473 144 110.292 144 96.1349C144 82.4618 133.788 71.5539 121.259 70.8142C119.114 70.6875 117.453 68.8895 117.495 66.7416C117.5 66.5158 117.504 66.4133 117.507 66.3391C117.51 66.2659 117.512 66.2201 117.512 66.1104C117.512 49.5915 104.732 36.5 89.3299 36.5C76.895 36.5 66.2004 45.0052 62.5117 57.0028C62.1777 58.0892 61.3973 58.9822 60.3655 59.4587C59.3337 59.9353 58.1478 59.9504 57.1042 59.5002C54.8242 58.5168 52.3404 57.9713 49.734 57.9713C39.1343 57.9713 30.2483 66.9966 30.2483 78.4996C30.2483 80.0856 30.4387 81.6435 30.7778 83.175C31.235 85.2398 30.0059 87.3038 27.9726 87.8855C21.1678 89.8321 16 96.3955 16 104.385C16 113.898 23.2726 121.333 31.9497 121.483C32.054 121.485 32.1573 121.49 32.2594 121.5ZM119.959 121.501L119.957 121.501C119.967 121.501 119.973 121.502 119.959 121.501Z" /> | ||
</svg> | ||
`; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}; | |
}; | |
export const SizingTemplate = (args) => html` | |
${["s", "m", "l"].map((size) => { | |
return html` <div> | |
${Typography({ | |
semantics: "detail", | |
size: "s", | |
content: [ | |
{ | |
s: "Small", | |
m: "Medium", | |
l: "Large", | |
}[size], | |
], | |
})} | |
${Template({ | |
...args, | |
size, | |
})} | |
</div>`; | |
})} | |
`; |
size: { | ||
name: "Size", | ||
type: { name: "string", required: true }, | ||
table: { | ||
type: { summary: "string" }, | ||
category: "Component", | ||
}, | ||
options: ["s", "m", "l"], | ||
control: "select", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that we don't have the sizes represented on the docs page. We ALSO don't have sizes on main
since there weren't sizes for S1, so could we add them in this branch? This is one way we used to do the sizing stuff: #3246 (comment) and the template: #3246 (comment)
|
||
import { Template as Link } from "@spectrum-css/link/stories/template.js"; | ||
|
||
import { Template } from "./template"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you end up using that SizingTemplate
, we'll need it added to the imports.
const customSvg = () => html` | ||
<svg class="spectrum-IllustratedMessage-illustration" xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96" fill="none"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this SVG seem big/long? I don't really know how we handle SVGs in this project, like if we need to "optimize" it or anything. And if it already is, disregard this comment!
components/dropzone/index.css
Outdated
|
||
&.is-filled.is-dragged { | ||
--mod-drop-zone-content-display: flex; | ||
background-image: url("https://s3-alpha-sig.figma.com/img/18cd/d82f/a71c264919d2049dcb540ae23897d027?Expires=1733097600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=OMgIsMMWb10DyYC8c-pAUm4MxTwft~CTzqPojWvC0fLCFthNPTm5uh3esb1hTRxleJ9-HMNTvqawigP1GCbYI4PqCgkgMZA2CxvtksvQoi2qvVOBy-U6grTgw2KRFOkNEsT~UkcQRAdx0wDZs-PBGyeeMjs0jyZTmq7LbR5ntIVaFFNTpBTnj1o9Hl2S-Ofo1UEANW58Az~3JvY1XyuSYd3q1QIXb-lYi57QQ74F85P0B6ZDW~0n7o-9eg4SsJ0OgVgJu3LRr6XFyNCbb109Iu~wrmSHCjnCLm5~9v4lY0Tm8whnUYQ3js88LHFxUghP~3MJahtKgJXqMwJKNMhCCQ__"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be linking to the asset in the repo? Could any of the dropzone CSS be left off of this PR, to save for the dropzone migration?
My thought is that if you're doing the dropzone migration (which it looks like you are), let's separate as much as we can. I think I have some separate dropzone ideas that would be better suited in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely should link to an actual file and not the Figma; the link has expired and it is now "access denied". It looks like this URL may have been for the "placeholder-image" in the background of drop zone? If so, we shouldn't be providing any image in the CSS for the component as it looks like that is supposed to represent whatever image was currently selected. It's something we could show as an example in custom styles via the template, linking to a local asset, as part of the drop zone migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should go in the assets
folder, instead of making a new dropzone/assets
folder. What do you think? I couldn't think of another component that has its own assets directory, but I could be mistaken.
.changeset/beige-dragons-tickle.md
Outdated
@@ -0,0 +1,49 @@ | |||
--- | |||
"@spectrum-css/illustratedmessage": major | |||
"@spectrum-css/dropzone": patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the changes to dropzone are more than a patch. That might also be a good reason to split out what is more dropzone migration work, than just dropzone fixes because of the illustrated message changes.
.spectrum-IllustratedMessage--actions { | ||
margin-block-start: var(--mod-illustrated-message-description-to-action, var(--spectrum-illustrated-message-description-to-action)); | ||
} | ||
|
||
max-inline-size: var(--mod-illustrated-message-description-max-inline-size, var(--spectrum-illustrated-message-description-max-inline-size)); | ||
margin-block-start: var(--mod-illustrated-message-heading-to-description, var(--spectrum-illustrated-message-heading-to-description)); | ||
margin-block-end: 0; | ||
.spectrum-IllustratedMessage--content { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need the double hyphens here. I see similar class names like spectrum-AlertBanner-content
, or spectrum-Card-content
and spectrum-Card-actions
. I think one hyphen will do. To me, the double hyphens is specifically used for a modifier class, like spectrum-IllustratedMessage--horizontal
. Again, this is just my understanding, but the elements/blocks of the component just warrant a single hyphen (like spectrum-IllustratedMessage-description
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to Marissa's previous (outdated) comment here! The double hyphens have been removed, but I believe we'll still need them for variant/modifier classes for the horizontal variant, the rest of these are great staying single hyphen.
cdb180d
to
27d01df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I focused on the illustrated message CSS this time around, and I have a few suggestions regarding the CSS organization and styles used! Tokens/token updates and styles are looking good though!
position: var(--mod-illustrated-message-description-position); | ||
z-index: var(--mod-illustrated-message-description-z-index); | ||
pointer-events: var(--mod-illustrated-message-description-pointer-events, auto); | ||
.spectrum-IllustratedMessage-horizontal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Horizontal would be considered a variant, right? I'm wondering if we need to change the class name here to reflect that (.spectrum-IllustratedMessage--horizontal
), similar to Divider's vertical variant?
flex-direction: row; | ||
text-align: start; | ||
gap: var(--mod-illustrated-message-illustration-to-content, var(--spectrum-illustrated-message-illustration-to-content)); | ||
display: grid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toggling display: grid;
on and off in the inspector, I didn't see much difference. Is there something I'm missing regarding why this is being used?
If using flex-direction: row
is sufficient here, we could take out display: grid
and other grid-related references, like grid-template-areas
, and the grid-area
s in L143 and L92.
But if there's a clear reason to use grid for the horizontal variant, we can eliminate flex-direction: row;
in L127. I'm going to leave a follow-up comment below also, the grid-area
s should ideally be scoped to that horizonal class selector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was experimenting with display: grid
for something I cannot remember. After removing it, I don't see any breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rise-erpelding I remember now - @marissahuysentruyt revealed the illustrations on the large size is out of bonds of block size. Using display: grid
keeps the illustration block dimensions true on every shirt size.
.spectrum-IllustratedMessage-actions { | ||
margin-block-start: var(--mod-illustrated-message-description-to-action, var(--spectrum-illustrated-message-description-to-action)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this block could move up closer to .spectrum-IllustratedMessage-description
and the other child elements rather than being separated by the .spectrum-IllustratedMessage-horizontal
variant?
.spectrum-IllustratedMessage--actions { | ||
margin-block-start: var(--mod-illustrated-message-description-to-action, var(--spectrum-illustrated-message-description-to-action)); | ||
} | ||
|
||
max-inline-size: var(--mod-illustrated-message-description-max-inline-size, var(--spectrum-illustrated-message-description-max-inline-size)); | ||
margin-block-start: var(--mod-illustrated-message-heading-to-description, var(--spectrum-illustrated-message-heading-to-description)); | ||
margin-block-end: 0; | ||
.spectrum-IllustratedMessage--content { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to Marissa's previous (outdated) comment here! The double hyphens have been removed, but I believe we'll still need them for variant/modifier classes for the horizontal variant, the rest of these are great staying single hyphen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! I think the only issue I'm still seeing is with the Storybook in DropZone, while we definitely don't need to address everything here, it would be good to ensure that it works on a basic level here!
Also not necessary to add, but thinking this might be nice to have: it looks like we can use illustrated message with or without the button group, it might be nice to show a variant of this without the button group.
customHeading: "Drag and drop your file", | ||
customDescription: "Or, select a file from your computer.", | ||
customLabel: "Browse files", | ||
hasButton: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing this and I think what Marissa has suggested here is a good approach! We probably don't need all of the argTypes from illustrated message now that we've added a whole bunch, we could probably pick the ones we want and do something like:
customDescription: IllustratedMessage.argTypes.description,
customHeading: IllustratedMessage.argTypes.heading,
customLabel: ActionButton.argTypes.label,
(You can either stick with the customDescription
and customHeading
arg names or change them to match Illustrated Message as Marissa mentioned.)
I'm unclear on hasButton
, though. It doesn't seem to do anything when I toggle it and isn't referenced in the dropzone template at all. Maybe we can leave it out for now and revisit showing/hiding button controls in the Dropzone migration PR?
components/dropzone/index.css
Outdated
|
||
&.is-filled.is-dragged { | ||
--mod-drop-zone-content-display: flex; | ||
background-image: url("https://s3-alpha-sig.figma.com/img/18cd/d82f/a71c264919d2049dcb540ae23897d027?Expires=1733097600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=OMgIsMMWb10DyYC8c-pAUm4MxTwft~CTzqPojWvC0fLCFthNPTm5uh3esb1hTRxleJ9-HMNTvqawigP1GCbYI4PqCgkgMZA2CxvtksvQoi2qvVOBy-U6grTgw2KRFOkNEsT~UkcQRAdx0wDZs-PBGyeeMjs0jyZTmq7LbR5ntIVaFFNTpBTnj1o9Hl2S-Ofo1UEANW58Az~3JvY1XyuSYd3q1QIXb-lYi57QQ74F85P0B6ZDW~0n7o-9eg4SsJ0OgVgJu3LRr6XFyNCbb109Iu~wrmSHCjnCLm5~9v4lY0Tm8whnUYQ3js88LHFxUghP~3MJahtKgJXqMwJKNMhCCQ__"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely should link to an actual file and not the Figma; the link has expired and it is now "access denied". It looks like this URL may have been for the "placeholder-image" in the background of drop zone? If so, we shouldn't be providing any image in the CSS for the component as it looks like that is supposed to represent whatever image was currently selected. It's something we could show as an example in custom styles via the template, linking to a local asset, as part of the drop zone migration.
b244774
to
230c342
Compare
5a2a335
to
27ac354
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! I think these comments are all pretty minor. The CSS is looking pretty solid and I only had a couple of tiny comments for those files!
} | ||
], | ||
withSizes: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason that the SizingTemplate
is used instead of withSizes
?
As a side note, it'd also might be nice to show the horizontal variant in all sizes, but I can also see the argument for not doing that.
}, | ||
isHorizontal: { | ||
name: "Horizontal orientation", | ||
description: "The default content orientation is vertical. Add the horizontal class to align the illustration to the left.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, the horizontal orientation flips so the illustration is on the right for RTL, but also saying "Add the horizontal class to align the illustration to the inline-start size" is kind of a mouthful, I'm fine to leave it unless someone else has an opinion or idea on how to word this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rise-erpelding Maybe something like, "Add the horizontal class to horizontally align the illustration with the content. The illustration will align left or right determined by the global direction of the text."
isHorizontal: true | ||
}, | ||
{ | ||
testHeading: "With link", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, do we still have a "With link" variant? Is there a rationale for keeping it/showing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the documentation here, it shows links as one of the call to actions to prompt the user to do something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it in the Figma specs for illustrated message or dropzone, and with button group being added, I wonder if that's meant to replace link. I also suspect the documentation is a bit behind.
We're not showing this link variant anywhere but in the test, it doesn't necessarily hurt to continue to test it, and we'll eventually need design to review S2 components anyway (it'd be nice if they reviewed our tests and checked to see if there were any variants that we can remove from there). How do you feel about leaving it for now and it can be an item to follow up on later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this test file looks great! Thanks for adding in all the new S2 things!
import metadata from "../metadata/metadata.json"; | ||
import packageJson from "../package.json"; | ||
import { IllustratedMessageGroup } from "./illustratedmessage.test.js"; | ||
import { Template } from "./template.js"; | ||
import { SizingTemplate, Template } from "./template.js"; | ||
|
||
/** | ||
* The Illustrated Message displays an illustration along with a heading and description. Optionally, part of the illustration can use an accent color. It can be used for status and errors, or as a call to action. For example, the Drop Zone component makes use of Illustrated Message as an area to drag and drop files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update this description? For instance, accent color is no longer relevant, so we can remove that. I'm also noticing that we're not really talking about the button group either, it might be worth mentioning that it's part of the component.
/** | ||
* Illustrated message comes in three sizes: small, medium, and large. | ||
* - Small illustrated message is typically used in quick or in-line actions. | ||
* - The medium size is the default, and often used in panels. | ||
* - The large size illustrated message is generally used in full page layouts and dialogs. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this is a great addition!
* - The medium size is the default, and often used in panels. | ||
* - The large size illustrated message is generally used in full page layouts and dialogs. | ||
*/ | ||
export const Sizing = SizingTemplate.bind({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use the Sizes()
function in the decorators for this? I think it might be available in this branch now.
Dismissing my change requests! Josh & Rise have it covered and I don't want to hold this up any longer than necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're looking pretty good on this. Once you address the remaining comments from Rise, please re-request review here and I'll take a last look and we should be able to get this approved and merged 🚀
…tom properties (#3487) * fix(pickerbutton): add missing custom properties * fix(radio): add missing custom props * fix(calendar): add missing custom properties * fix(stepper): define unused custom props * fix(progressbar): remove unused custom properties; change background-color to background see #2929; fix static color * fix(dial): remove unused custom properties; add undefined custom properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noted this elsewhere but in case it gets lost:
- there's a selector in drop zone for
.spectrum-DropZone-actions
that I hadn't noticed before, since we're not updating the actions for drop zone in this PR, maybe it could be removed for now?
Otherwise, I had a small comment on the copyright and a follow up to the question I had about the link variant, but those are all very small things and I think this is really close!
isHorizontal: true | ||
}, | ||
{ | ||
testHeading: "With link", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it in the Figma specs for illustrated message or dropzone, and with button group being added, I wonder if that's meant to replace link. I also suspect the documentation is a bit behind.
We're not showing this link variant anywhere but in the test, it doesn't necessarily hurt to continue to test it, and we'll eventually need design to review S2 components anyway (it'd be nice if they reviewed our tests and checked to see if there were any variants that we can remove from there). How do you feel about leaving it for now and it can be an item to follow up on later.
components/dropzone/index.css
Outdated
.spectrum-DropZone-actions { | ||
margin-block-start: var(--spectrum-drop-zone-body-to-action); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this .spectrum-DropZone-actions
need to be removed as well? It does not appear to be relevant for this PR.
Copyright 2023 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
@media (forced-colors: active) { | ||
.spectrum-IllustratedMessage { | ||
--highcontrast-illustrated-message-illustration-color: CanvasText; | ||
--highcontrast-illustrated-message-illustration-accent-color: Highlight; | ||
} | ||
} | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, but the previous version of this copyright is probably the one we wanted, it probably got rebased weirdly with all the branch changes that happened while this PR was in review!
I assume at some point this copyright might get updated for all the components at once, so I'm really not too concerned with what year is on the comment. It's probably better to have 2024 than 2023 in case someone's doing a search and replace for 2024 and this component never gets changed because no one thought to search for 2023, but I'm pretty indifferent about whether or not the year gets changed to 2025.
b438a55
to
46ae687
Compare
My previous requests for changes have been resolved. Removing this so it's not blocking.
Description
Adding new S2 tokens for
illustratedmessage
. The dropzone is simply being tested in this PR to see which shared mods can go away in the illustrated message. I also modified a few template capabilities to prepare the dropzone usage (custom illustration, description, heading, action button in drag mode).I kept the ability to add more than simple text in the description. You can see the example in the test file where it maintains the ability to add Link component if you want.
#3429 Dropzone will be sharing these tokens and capabilities. It is a feature off of this branch.
Illustrated Message
New tokens
--spectrum-illustrated-message-heading-to-description
--spectrum-illustrated-message-illustration-to-heading
--spectrum-illustrated-message-illustration-to-content
--spectrum-illustration-message-description-to-action
--spectrum-illustrated-message-illustration-color
--spectrum-illustrated-message-illustration-size
--spectrum-illustrated-message-small-cjk-title-font-size
--spectrum-illustrated-message-large-cjk-title-font-size
--spectrum-illustrated-message-large-body-font-size
--spectrum-illustrated-message-horizontal-maximum-width
New mods
--mod-illustrated-message-description-to-action
--mod-illustrated-message-heading-to-description
--mod-illustrated-message-illustration-to-content
--mod-illustrated-message-horizontal-maximum-width
Removed tokens
--spectrum-illustrated-message-title-to-heading
--spectrum-illustrated-message-description-max-inline-size
--spectrum-illustrated-message-heading-max-inline-size
--spectrum-illustrated-message-illustration-accent-color
--mod-illustrated-message-illustration-accent-color
--highcontrast-illustrated-message-illustration-accent-color
Dropzone
Renamed mods
--mod-illustrated-message-title-to-heading
>--mod-illustrated-message-illustration-to-heading
--mod-illustrated-message-heading-to-body
>--mod-illustrated-message-heading-to-description
--mod-illustrated-message-content-maximum-width
>--mod-illustrated-message-vertical-maximum-width
Validation steps
Regression testing
Validate:
Screenshots
To-do list