Skip to content
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(dropzone): migrating new S2 tokens, more spaced out dashed lines, more illustrations #3429

Merged
merged 25 commits into from
Mar 5, 2025

Conversation

aramos-adobe
Copy link
Collaborator

@aramos-adobe aramos-adobe commented Dec 4, 2024

Dropzone S2 Migration

Since dropzone shares a lot of illustrated message's new content tokens (typography and spacing), tons of unused--mods were removed.

The component reflects the new design of the borders that includes dash length and dash gap.

SVG Border

To support the intention of the design, an SVG element is used. There modifiable tokens to adjust the length of dashed lines and the gap between them. It's understood it may be too much to consume an additional element so there's a fallback where the SVG element is not necessary - dropzone will use the standard border CSS property.

New mods

--mod-drop-zone-content-height

Removed mods

--mod-drop-zone-body-color
--mod-drop-zone-body-font-family
--mod-drop-zone-body-font-style
--mod-drop-zone-body-font-weight
--mod-drop-zone-body-line-height
--mod-drop-zone-content-color
--mod-drop-zone-content-edge-to-text
--mod-drop-zone-content-font-size
--mod-drop-zone-heading-color
--mod-drop-zone-heading-font-family
--mod-drop-zone-heading-font-size
--mod-drop-zone-heading-font-style
--mod-drop-zone-heading-font-weight
--mod-drop-zone-heading-line-height
--mod-drop-zone-heading-to-body
--mod-drop-zone-illustration-to-heading
--mod-drop-zone-illustration-to-title

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

  • Filled reflects hover state
  • Filled & Dragged state reflects replace
  • WHCM
  • S2 Tokens are being used
  • Normal border dashed style with no SVG - remove or comment out <svg className="spectrum-DropZone-stroke">

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

Screenshot 2024-12-04 at 4 30 58 PM Screenshot 2024-12-04 at 4 30 21 PM Screenshot 2024-12-04 at 4 30 16 PM

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

@aramos-adobe aramos-adobe self-assigned this Dec 4, 2024
Copy link

changeset-bot bot commented Dec 4, 2024

🦋 Changeset detected

Latest commit: 7f5e9c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@spectrum-css/dropzone Major

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

@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css781-illustrated-message-s2-tokens branch from b244774 to 230c342 Compare January 8, 2025 17:44
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css782-dropzone-s2-migration branch from 70c8b73 to b2b714d Compare January 9, 2025 15:20
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css781-illustrated-message-s2-tokens branch 2 times, most recently from 5a2a335 to 27ac354 Compare January 9, 2025 16:57
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css781-illustrated-message-s2-tokens branch 2 times, most recently from e7f55d8 to 654db3d Compare January 22, 2025 20:43
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css782-dropzone-s2-migration branch from ac120bd to 8894290 Compare January 28, 2025 18:43
@aramos-adobe aramos-adobe changed the title Dropzone S2 migration feat(dropzone): migrating new S2 tokens, more spaced out dashed lines, more illustrations Jan 29, 2025
@aramos-adobe aramos-adobe requested a review from jawinn January 29, 2025 21:02
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css781-illustrated-message-s2-tokens branch 3 times, most recently from 491b648 to c608159 Compare February 3, 2025 18:57
Base automatically changed from aramos-adobe/css781-illustrated-message-s2-tokens to spectrum-two February 3, 2025 19:24
Copy link
Contributor

github-actions bot commented Feb 3, 2025

🚀 Deployed on https://pr-3429--spectrum-css.netlify.app

Copy link
Contributor

github-actions bot commented Feb 3, 2025

File metrics

Summary

Total size: 1.37 MB*

Package Size Minified Gzipped
dropzone 8.62 KB 8.19 KB 1.65 KB

dropzone

Filename Head Minified Gzipped Compared to base
index.css 8.62 KB 8.19 KB 1.65 KB 🟢 ⬇ 3.66 KB
metadata.json 4.50 KB - - 🟢 ⬇ 2.04 KB
* Size is the sum of all main files for packages in the library.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

Gosh, this one was a lot of work too! Leaving some initial thoughts and some questions about the CSS and design spec.

I think you might have made a couple of pushes after I started reviewing, so pardon if some of the comments made aren't up to date!

Comment on lines 114 to 113
inline-size: 101%;
block-size: 101.5%;
Copy link
Collaborator

Choose a reason for hiding this comment

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

How are these numbers calculated?

Copy link
Collaborator Author

@aramos-adobe aramos-adobe Feb 4, 2025

Choose a reason for hiding this comment

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

This was to make the stroke of the svg/rect fit. I think I can bring this back to 100% now that I figured out how the radius of the svg rectangle works

@castastrophe castastrophe force-pushed the spectrum-two branch 2 times, most recently from 56c6806 to 793571c Compare February 5, 2025 17:33
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css782-dropzone-s2-migration branch 2 times, most recently from 5841e1d to f070d25 Compare February 5, 2025 21:08
@castastrophe castastrophe force-pushed the spectrum-two branch 2 times, most recently from db2a5dd to f34473b Compare February 7, 2025 17:35
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css782-dropzone-s2-migration branch from cf1337c to 940d10c Compare February 27, 2025 13:37
Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

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

Nice work on this! This one was pretty hairy and super intwined with illustrated message. Thanks for cleaning it all up!

I have some questions that I didn't quite know where to put...

  • My first question is about using the mod-drop-zone-width. If I set that, the inner content is then uncentered. Should we add
display: flex;
align-items: center;
justify-content: center;

to .spectrum-DropZone to prevent/combat that from happening? I guess I'm thinking that if a user needs to use that mod, I wouldn't want them to also have to go into the CSS to recenter the content. I'd just want them to be able to set the mod, and it just works for them. Does that make sense? Is that even a valid concern?

Screenshot 2025-02-28 at 10 43 05 AM
  • I also wanted to double check the color of the upload SVG visual. You've got it set correctly I think, to neutral-content-color-default (an alias for gray-800) like the Figma specs say. But Figma is actually using neutral-visual-color (which is an alias for gray-500) instead. You may have already checked on this, but which one is design expecting? There's definitely a difference since those 2 grays are quite distinct from each other.

Figma:
Screenshot 2025-02-28 at 9 20 12 AM

Code:
Screenshot 2025-02-28 at 9 20 03 AM

  • Last thing I'm curious about is the button color for isDragged+isFilled. Currently, the background of the button in the isDragged+isFilled state is set to accent-visual-color like the design specs. 👍 However...that token is resolving to a different rgb in the browser when I compare between Chrome and Figma. Is that design token incorrect? It seems like that token (maybe in tandem with the background color opacity?) is causing the button colors to change- is that correct? If I remove the background style from .spectrum-DropZone-button they resolve to the same rgb, but _not accent-visual-color. (it's --spectrum-accent-background-color-default 🤦‍♀️)

Lemme know if you wanna pair through any of this! I know I left a lot of ideas and questions for you!

@@ -325,7 +325,7 @@ Output for all component CSS files is now being run through a lightweight optimi

### 🛑 BREAKING CHANGES

- Replaces DNA tokens with Spectrum tokens.
- Replaces DNA tokens with Spectrum tokens.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm also not sure we need to change anything for pagination in this PR. If it were me, I might drop this, but I'll leave it up to you since it's not hurting anything (and arguably makes it better).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@aramos-adobe I still see these changes in the latest pull of this branch. I don't think it's really necessary to make this change in the context of this PR, that's all. It's not related to the rest of the work, but I'll leave it up to you if you want to keep it 👍

--mod-drop-zone-content-height: 280px;

/* Typography */
--mod-illustrated-message-title-font-weight: var(--spectrum-title-serif-font-weight);
}

.spectrum-DropZone {
box-sizing: border-box;
inline-size: var(--mod-drop-zone-width, var(--spectrum-drop-zone-width));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't anything you introduced, but I believe the preference is to not use the token (in this case, drop-zone-width) in a direct style definition like this. I think we would need to define a custom property up towards the top of the file with the padding and border width, etc. and then use that in this style definition.

.spectrum-Dropzone {
	--spectrum-drop-zone-padding: var(--spectrum-spacing-400);
	--spectrum-drop-zone-border-width: var(--spectrum-border-width-200);
	--spectrum-drop-zone-corner-radius: var(--spectrum-corner-radius-700);
	--spectrum-drop-zone-border-color: var(--spectrum-gray-300);
	--spectrum-drop-zone-inline-size: var(--spectrum-drop-zone-width); // use the token here just to define the custom prop

	... // all of the other custom props & mods....
}

.spectrum-Dropzone {
	box-sizing: border-box;
	inline-size: var(--mod-drop-zone-inline-size, var(--spectrum-drop-zone-inline-size)); // then use the custom prop in the style definition
	... // and all the rest of the styles

This could be a nice way to "leave it better than we found it." Thoughts?

Copy link
Collaborator Author

@aramos-adobe aramos-adobe left a comment

Choose a reason for hiding this comment

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

@marissahuysentruyt ,

I addressed the color of the illustration last week in a thread. Design team is updating the Figma to match the token colors

Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

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

This looks really good! I left some really small comments, but I don't think any of them are blocking, so I'll approve 👍 Sounds like there's some updates that are needed on the Figma side, but the code is all pointing to the right values & tokens.

Comment on lines 64 to 65
--spectrum-examples-gradient-static-black: linear-gradient(45deg, rgb(255 241 246), rgb(238 245 255));
--spectrum-examples-gradient-static-white: linear-gradient(45deg, rgb(64 0 22), rgb(14 24 67));
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aramos-adobe I still see these changes. Do we need them?

@@ -325,7 +325,7 @@ Output for all component CSS files is now being run through a lightweight optimi

### 🛑 BREAKING CHANGES

- Replaces DNA tokens with Spectrum tokens.
- Replaces DNA tokens with Spectrum tokens.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aramos-adobe I still see these changes in the latest pull of this branch. I don't think it's really necessary to make this change in the context of this PR, that's all. It's not related to the rest of the work, but I'll leave it up to you if you want to keep it 👍

};

/**
* The filled state of a drop zone is used to indicate that a file has been dropped into the drop zone. Since the type size doesn't change in this state the dropzone size would be identical in all size variants.
Copy link
Collaborator

Choose a reason for hiding this comment

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

A comma may be appropriate in the last sentence here. This is a very small, non-blocking nitpick.

Suggested change
* The filled state of a drop zone is used to indicate that a file has been dropped into the drop zone. Since the type size doesn't change in this state the dropzone size would be identical in all size variants.
* The filled state of a drop zone is used to indicate that a file has been dropped into the drop zone. Since the type size doesn't change in this state, the dropzone size would be identical in all size variants.

class=${classMap({
size = "m",
image = "dropzone-illustration.png",
...globals
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh this isn't something I noticed during the last review. Are we starting to transition away from context and back to ...globals? Since the spectrum-two branch doesn't have the S1 or Express contexts?

I would say revert this back to using the context = {} stuff (as well as the ...globals in the IllustratedMessage() down further), but are we even storing context data anymore? I don't actually know 🙃

@aramos-adobe aramos-adobe merged commit 924fc7f into spectrum-two Mar 5, 2025
12 checks passed
@aramos-adobe aramos-adobe deleted the aramos-adobe/css782-dropzone-s2-migration branch March 5, 2025 21:04
@github-actions github-actions bot mentioned this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants