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(illustratedmessage): adding new s2 tokens, horizontal layout, vrts #3246

Open
wants to merge 123 commits into
base: spectrum-two
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
c85d6cf
feat: migration of tokens to spectrum 2
castastrophe Nov 18, 2024
e3e37b4
feat: bug fixes for reducing theming variables
castastrophe Nov 22, 2024
6082064
feat: s2 foundations non-gray-800 colors update (#3413)
pfulton Nov 22, 2024
6615348
chore: release (s2-foundations) (#3421)
github-actions[bot] Dec 3, 2024
aef4ea3
fix(combobox): update border color in spectrum-two
castastrophe Dec 3, 2024
8b98218
fix(picker): update background and border color
castastrophe Dec 3, 2024
e0a8aa1
chore: release (s2-foundations) (#3425)
github-actions[bot] Dec 3, 2024
7ea067c
fix(combobox): retain border values for S1
castastrophe Dec 3, 2024
e29ecda
chore: release (s2-foundations) (#3426)
github-actions[bot] Dec 3, 2024
8ee5445
chore: minor tooling and infra updates
castastrophe Dec 4, 2024
76881ca
chore: update dependency versions ava and postcss
castastrophe Dec 4, 2024
9abd757
chore(contextualhelp,datepicker,fieldgroup): remove MDX files (#3422)
marissahuysentruyt Dec 16, 2024
69bfb16
chore(accordion,actionbar,asset): remove mdx files (#3407)
marissahuysentruyt Dec 18, 2024
f05c804
chore(colorarea,colorhandle,colorloupe,colorslider,colorwheel): remov…
marissahuysentruyt Dec 19, 2024
4c9c980
chore(assetcard,avatar,badge): remove mdx files (#3408)
marissahuysentruyt Dec 19, 2024
82800d1
chore(calendar,card,coachmark): remove MDX files (#3443)
marissahuysentruyt Dec 19, 2024
f4c117f
chore: include storybook assets in shipped results
castastrophe Dec 29, 2024
79eb129
chore: align peerDependencies to local versions
castastrophe Dec 29, 2024
d8a3f18
chore: update browser caniuse db
castastrophe Dec 29, 2024
2c5242f
feat(tokens): use 13.0.0-beta.5
pfulton Dec 11, 2023
ca1ddd2
feat(tokens): use 13.0.0-beta.8
pfulton Jan 8, 2024
7218c66
feat(tokens): use 13.0.0-beta.9
pfulton Jan 11, 2024
58d7841
feat(actiongroup)!: migrate to S2 (#2453)
mdt2 Feb 2, 2024
90275f5
feat(buttongroup)!: migrate to S2 (#2457)
jenndiaz Feb 2, 2024
f3072dd
feat(tokens)!: use 13.0.0-beta.13
pfulton Feb 2, 2024
f5e95d8
chore(release): release
pfulton Feb 6, 2024
f8e34af
feat(tokens)!: use spectrum-tokens 13.0.0-beta.16
pfulton Feb 22, 2024
9f77970
chore(actiongroup,buttongroup): specify s2 tokens for peerdeps
pfulton Feb 26, 2024
92fbbed
feat(closebutton)!: migrate to S2 (#2564)
mdt2 Mar 7, 2024
04de820
chore: s2 grays component-level migration (#2583)
pfulton Mar 7, 2024
cc3b7d7
fix(commons): remove renamed mods marked for deprecation (#2580)
jawinn Mar 8, 2024
c184290
feat(fieldlabel)!: s2 migration (#2569)
jawinn Mar 11, 2024
afafe0c
chore(tokens): use spectrum-tokens v13.0.0-beta.19
pfulton Mar 11, 2024
91f08d7
chore(tokens): manual version bump for 14.0.0-next.1
pfulton Mar 12, 2024
5f52b52
chore(release): release
pfulton Mar 12, 2024
a117833
feat(downstate): docs + implementation for example components (#2520)
mdt2 Mar 19, 2024
2c98493
feat(tokens): use spectrum-tokens 13.0.0-beta.21 (#2597)
pfulton Mar 19, 2024
f91706d
chore(release): release
pfulton Mar 21, 2024
5e37eac
chore: rebase against main and update components to use prerelease to…
pfulton Mar 28, 2024
8ec9008
feat(cornerrounding): add custom token and foundations documentation …
jenndiaz Mar 28, 2024
7233e93
fix(storybook): body classes for story and docs pages (#2617)
mdt2 Apr 1, 2024
3b0c098
feat(opacitycheckerboard): S2, small t-shirt size squares (#2610)
mdt2 Apr 8, 2024
2a5fbbc
feat(tokens): use spectrum-tokens at v13.0.0-beta.24 (#2650)
mdt2 Apr 9, 2024
f89e44d
chore(tokens): manual version bump for prerelease
pfulton Apr 9, 2024
5ec02a4
feat: add example gradients for static black and white (#2637)
jawinn Apr 11, 2024
c499b66
chore(tokens): use spectrum-tokens@13.0.0-beta.27
pfulton Apr 12, 2024
927ff86
chore(release): release
pfulton Apr 12, 2024
3fbbd33
feat(switch): s2 migration (#2651)
mdt2 Apr 15, 2024
a5b8329
chore: prerelease mode for changesets
pfulton Apr 19, 2024
16169a3
chore(tokens): use @adobe/spectrum-tokens@13.0.0-beta.30 (#2678)
pfulton Apr 19, 2024
c2dfbda
chore: release (next) (#2680)
github-actions[bot] Apr 19, 2024
b682b9e
chore: run branch through format; update pathing and fix errors (#2700)
castastrophe Apr 26, 2024
e33dc74
chore: release (next) (#2706)
github-actions[bot] Apr 26, 2024
54677d2
feat(button): migrate to Spectrum 2 (#2600)
jawinn May 1, 2024
3c654b1
chore: release s2 button (next) (#2722)
github-actions[bot] May 1, 2024
4b69e3c
feat(progressbar): s2 migration (#2659)
mdt2 May 8, 2024
ec752f2
chore: release (next) (#2739)
github-actions[bot] May 9, 2024
b5e7f34
chore(tokens): use spectrum-tokens@13.0.0-beta.35 (#2797)
pfulton May 30, 2024
c86645f
chore: release (next) (#2798)
github-actions[bot] May 30, 2024
30706e7
refactor(button): remove spectrum-ButtonWithFocusRing extend (#2725)
jawinn May 30, 2024
d9e72ec
chore: release (next) (#2801)
github-actions[bot] Jun 4, 2024
1ec6510
docs(dropshadow): add stories and docs for dropshadow (#2674)
rise-erpelding Jun 4, 2024
19dde86
feat(picker)!: migrate to spectrum 2 (#2697)
jawinn Jun 18, 2024
fd4da4e
feat(statuslight): s2 migration (#2818)
marissahuysentruyt Jun 28, 2024
d39a150
feat(tooltip): s2 migration (#2743)
mdt2 Jul 19, 2024
5665900
chore: release (next) (#2852)
github-actions[bot] Aug 12, 2024
d92b6fa
chore(tokens): use spectrum-tokens@13.0.0-beta.52 (#3351)
cdransf Oct 30, 2024
8613f4e
chore: release (next) (#3353)
github-actions[bot] Nov 1, 2024
ad8796f
feat(avatar): migrate s2 avatar (#3355)
cdransf Nov 8, 2024
e7e758f
feat(colorloupe): migrate to s2 drop-shadow tokens (#3301)
rise-erpelding Nov 12, 2024
1d8872e
feat(thumbnail): S2 migration (#3367)
cdransf Nov 12, 2024
da793ee
feat(colorarea): S2 migration (#3388)
cdransf Nov 15, 2024
e2cfa3f
feat(thumbnail-opacity-checkboard): S2 migration (#3394)
cdransf Nov 19, 2024
61996d7
build: align tooling with s2-foundations branch
castastrophe Dec 4, 2024
c992003
fix(pagination): deprecate legacy features to align with foundations
castastrophe Dec 4, 2024
c1a9f4f
feat(dialog): s2 standard dialog migration (#2860)
marissahuysentruyt Dec 9, 2024
b968966
chore: release (next) (#3379)
github-actions[bot] Dec 16, 2024
2c43c65
fix(icon): fix for icons not loading (#3454)
jawinn Dec 18, 2024
4e7b1fb
feat(alertbanner): migrate to spectrum 2 (#2652)
jawinn Dec 19, 2024
529733e
chore(tokens): use spectrum-tokens@13.0.0-beta.55 (#3456)
cdransf Dec 19, 2024
6e299d4
chore: release (next) (#3457)
github-actions[bot] Dec 19, 2024
1415f76
chore(storybook): standardize down-state decorator
castastrophe Dec 24, 2024
828fec1
build: remove theme processing, site package; add reporter
castastrophe Dec 24, 2024
9444cdb
build: add story exports; remove context from storybook
castastrophe Dec 27, 2024
9d7f088
chore: align peerDependencies to local versions
castastrophe Dec 29, 2024
616f2a7
fix: use new tag to hide storybook foundations stories (#3474)
jawinn Jan 3, 2025
52e773e
fix: restore undefined custom properties [part 5] (#3475)
5t3ph Jan 6, 2025
ab2028a
fix: restore undefined custom properties [part 4] (#3473)
jawinn Jan 6, 2025
24c6ad3
fix(textfield,menu,tag,toast,tabs,well,popover): define custom props …
rise-erpelding Jan 6, 2025
043f11c
feat(illustratedmessage): adding new s2 tokens
aramos-adobe Oct 14, 2024
3e3cc0c
feat(illustratedmessage): updating token version
aramos-adobe Oct 22, 2024
c65dc3a
feat(illustratedmessage): work in progress
aramos-adobe Oct 23, 2024
5f5c5e4
feat(illustratedmessage): adding new tokens, tshirt sizes, orientatio…
aramos-adobe Oct 24, 2024
b1bd611
feat(illustratedmessage): updating CSS structure and adding condition…
aramos-adobe Oct 30, 2024
2c735d0
feat(illustratedmessage): update tokens
aramos-adobe Oct 31, 2024
074e56a
chore(illustratedmessage): revert yarn file
aramos-adobe Oct 31, 2024
6f0b78e
feat(illustratedmessage): changeset, styles, dropzone mods
aramos-adobe Nov 3, 2024
582036c
feat(illustratedmessage): work in progress
aramos-adobe Nov 4, 2024
54c8df3
feat(illustratedmessage): updating mods
aramos-adobe Nov 5, 2024
aeef849
feat(illustratedmessage): removing message accent color selector
aramos-adobe Nov 5, 2024
8fc03e5
chore(illustratedmessage): updating changeset
aramos-adobe Nov 6, 2024
457fb4d
docs(illustratedmessage): heading controls
aramos-adobe Nov 6, 2024
6ef714a
fix(illustratedmessage): fixing cjk tokens and removing heading and b…
aramos-adobe Nov 13, 2024
85b5dae
fix(illustratedmessage): fixing cjk tokens and removing heading and b…
aramos-adobe Nov 13, 2024
b6a1144
feat(illustratedmessage): new mods
aramos-adobe Nov 19, 2024
1033d00
docs(illustratedmessage): adding horizontal story context
aramos-adobe Nov 19, 2024
947e98c
feat(illustratedmessage): removing extra dashes, reverting dropzone
aramos-adobe Dec 5, 2024
50ecd0a
chore(fix): adding stylelint disable desc
aramos-adobe Dec 5, 2024
6d5f86f
chore(fix): removing unused highcontrast accent color token
aramos-adobe Dec 5, 2024
733ffad
feat(illustratedmessage): adding grid display
aramos-adobe Dec 9, 2024
9327ed4
chore(im): removing unused import
aramos-adobe Jan 7, 2025
230c342
chore(im): removing more unused imports
aramos-adobe Jan 7, 2025
27ac354
chore(illustratedmessage): updating testing env
aramos-adobe Jan 8, 2025
dd96363
docs(avatar): update sizing documentation (#3483)
marissahuysentruyt Jan 8, 2025
f143155
Merge branch 'spectrum-two' into aramos-adobe/css781-illustrated-mess…
aramos-adobe Jan 9, 2025
4a5718e
fix(dropzone): removing unused controls
aramos-adobe Jan 9, 2025
92855aa
fix(calendar,dial,pickerbutton,progressbar,radio,stepper): unused cus…
rise-erpelding Jan 13, 2025
ab65f37
Merge branch 'spectrum-two' into aramos-adobe/css781-illustrated-mess…
aramos-adobe Jan 13, 2025
1f1f018
feat(illustratedmessage): reviewing comments
aramos-adobe Jan 14, 2025
dfbbc75
feat(illustratedmessage): adjusting story horiz copy
aramos-adobe Jan 14, 2025
be892d9
chore: commit token assets
castastrophe Jan 14, 2025
943022b
Merge branch 'spectrum-two' into aramos-adobe/css781-illustrated-mess…
aramos-adobe Jan 15, 2025
bc881d9
fix(illustratedmessage): resolving changes
aramos-adobe Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .changeset/beige-dragons-tickle.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

# S2 Illustrated Message Migration

This migration contains new tokens for t-shirt sizes (S, M, L), vertical and horizontal orientation along with their maximum width, illustatrion sizes, and content spacing. Dropzone `--mod` names are renamed to match the semantic tokens in illustrated message.
This migration contains new tokens for t-shirt sizes (S, M, L), vertical and horizontal orientation along with their maximum width, illustration sizes, and content spacing. Dropzone `--mod` names are renamed to match the semantic tokens in illustrated message.

## Illustrated Message

New tokens
New properties
`--spectrum-illustrated-message-heading-to-description`
`--spectrum-illustrated-message-illustration-to-heading`
`--spectrum-illustrated-message-illustration-to-content`
Expand All @@ -27,15 +27,21 @@ New mods
`--mod-illustrated-message-illustration-to-content`
`--mod-illustrated-message-horizontal-maximum-width`

Removed tokens
Removed properties
`--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 & Illustrated message
## Dropzone

New mods
`--mod-drop-zone-body-to-action`
`--mod-drop-zone-illustration-to-title`

## Dropzone nested mods

Renamed mods
`--mod-illustrated-message-title-to-heading` > `--mod-illustrated-message-illustration-to-heading`
Expand Down
Binary file added components/dropzone/assets/dropzone-bg.png
Copy link
Collaborator

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.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions components/dropzone/index.css
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make drop zone changes their own PR like Marissa suggested? Except for perhaps the renamed mods that are relevant to this PR. This will make it easier to review and validate. It is hard to validate drop zone changes before the component is fully migrated to S2.

Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@

&.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__");
Copy link
Collaborator

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.

Copy link
Collaborator

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.


.spectrum-DropZone-actions {
margin-block-start: 0;
}
jawinn marked this conversation as resolved.
Show resolved Hide resolved
}

&:focus-visible {
Expand All @@ -142,6 +147,10 @@
z-index: 10;
}

.spectrum-DropZone-actions {
margin-block-start: var(--spectrum-drop-zone-body-to-action);
}

Copy link
Collaborator

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.

.spectrum-DropZone-button {
box-sizing: border-box;
border: none;
Expand Down
4 changes: 4 additions & 0 deletions components/dropzone/stories/dropzone.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default {
rootClass: "spectrum-DropZone",
isDragged: false,
isFilled: false,
customHeading: "Drag and drop your file",
customDescription: "Or, select a file from your computer.",
customLabel: "Browse files",
hasButton: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

These controls are not showing up in a particular category:

Screenshot 2024-11-26 at 2 46 32 PM

I wonder if we can bring this approach over from main, where we use ...IllustratedMessage.argTypes and that label: Button.argTypes.label:

...IllustratedMessage.argTypes,

We could then just define those in the default args here instead (if we want it to say anything different from the default illustrated message heading or description):

heading: "Drag and drop your file",
description: "Or, select a file from your computer.",
label: "Browse files",
hasButtons: true,

Then in the template, we could just use those same heading, description args for the IllustratedMessage():

${IllustratedMessage({
			heading,
			description,
			customIllustration: customSvg,
		})}

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 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?

},
parameters: {
design: {
Expand Down
24 changes: 17 additions & 7 deletions components/illustratedmessage/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ governing permissions and limitations under the License.
--spectrum-illustrated-message-heading-to-description: var(--spectrum-spacing-75);
--spectrum-illustrated-message-illustration-to-heading: var(--spectrum-spacing-200);
--spectrum-illustrated-message-illustration-to-content: var(--spectrum-spacing-200);
--spectrum-illustration-message-description-to-action: var(--spectrum-spacing-300);
--spectrum-illustrated-message-description-to-action: var(--spectrum-spacing-300);
--mod-buttongroup-justify-content: center;
rise-erpelding marked this conversation as resolved.
Show resolved Hide resolved

/* Illustration */
Expand All @@ -24,15 +24,15 @@ governing permissions and limitations under the License.
--spectrum-illustrated-message-illustration-size: 96px;

/* Title */
--spectrum-illustrated-message-title-font-family: var(--spectrum-title-sans-serif-font-family);
--spectrum-illustrated-message-title-font-family: var(--spectrum-sans-font-family-stack);
--spectrum-illustrated-message-title-font-weight: var(--spectrum-title-sans-serif-font-weight);
--spectrum-illustrated-message-title-font-style: var(--spectrum-title-sans-serif-font-style);
--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);

/* Description */
--spectrum-illustrated-message-description-font-family: var(--spectrum-body-sans-serif-font-family);
--spectrum-illustrated-message-description-font-family: var(--spectrum-sans-font-family-stack);
--spectrum-illustrated-message-description-font-weight: var(--spectrum-body-sans-serif-font-weight);
--spectrum-illustrated-message-description-font-style: var(--spectrum-body-sans-serif-font-style);
--spectrum-illustrated-message-description-font-size: var(--spectrum-illustrated-message-medium-body-font-size);
Expand Down Expand Up @@ -95,8 +95,9 @@ governing permissions and limitations under the License.
color: var(--highcontrast-illustrated-message-illustration-color, var(--mod-illustrated-message-illustration-color, var(--spectrum-illustrated-message-illustration-color)));
fill: currentColor;
stroke: currentColor;
block-size: var(--mod-illustrated-message-illustration-size, var(--spectrum-illustrated-message-illustration-size));
inline-size: var(--mod-illustrated-message-illustration-size, var(--spectrum-illustrated-message-illustration-size));
block-size: var(--mod-illustrated-message-illustration-block-size, var(--mod-illustrated-message-illustration-size, var(--spectrum-illustrated-message-illustration-size)));
inline-size: var(--mod-illustrated-message-illustrated-inline-size, var(--mod-illustrated-message-illustration-size, var(--spectrum-illustrated-message-illustration-size)));
grid-area: illustration;
rise-erpelding marked this conversation as resolved.
Show resolved Hide resolved
}

.spectrum-IllustratedMessage-accent {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see any references to the accent being removed in the changelog, but I also don't see any token specs for it. Might be a good thing to follow up with design on when this is being design reviewed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Checked in with design. Accent color is mainly used for the illustration and hover state in Drop zone. Illustrated message doesn't have accent color tokens

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the Figma specs for Drop Zone, it doesn't look like that accent on the illustration (by which I mean the little arrow that's blue where the rest of the illustration is gray) is in that either... we also don't use the accent color on drop zone now, the illustration is either all gray or all blue if it's dragged.

It might be worth double-checking to see if that means the two-colored illustration is going away. If the illustrations in S2 are meant to always be a single color (whether blue or gray), we could probably take this .spectrum-IllustratedMessage-accent class out, update the template and controls (and changeset notes), and update the illustration to the cloud seen in Figma (I think we can just copy the SVG), and make sure that at some point we update the Docs page too.

Illustrated message (main, with accent):
image
Drop zone (main, not dragged):
image
Drop zone (main, dragged):
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rise-erpelding Two colored is going away and accent color is in Dropzone when dragged.

Expand Down Expand Up @@ -133,8 +134,7 @@ governing permissions and limitations under the License.

color: var(--mod-illustrated-message-description-color, var(--spectrum-illustrated-message-description-color));

margin-block-start: 0;
margin-block-end: var(--mod-illustrated-message-description-to-action, var(--spectrum-illustration-message-description-to-action));
margin-block: 0;
}

.spectrum-IllustratedMessage--horizontal {
Expand All @@ -143,8 +143,18 @@ governing permissions and limitations under the License.
flex-direction: row;
text-align: start;
gap: var(--mod-illustrated-message-illustration-to-content, var(--spectrum-illustrated-message-illustration-to-content));
display: grid;
Copy link
Collaborator

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-areas 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-areas should ideally be scoped to that horizonal class selector.
image

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

grid-template-areas: "illustration body";

.spectrum-IllustratedMessage-illustration {
marissahuysentruyt marked this conversation as resolved.
Show resolved Hide resolved
margin-block-end: 0;
}
}

.spectrum-IllustratedMessage--actions {
margin-block-start: var(--mod-illustrated-message-description-to-action, var(--spectrum-illustrated-message-description-to-action));
}

.spectrum-IllustratedMessage--content {
grid-area: body;
}
44 changes: 13 additions & 31 deletions components/illustratedmessage/stories/illustratedmessage.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Template as Link } from "@spectrum-css/link/stories/template.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { html } from "lit";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { IllustratedMessageGroup } from "./illustratedmessage.test.js";
Expand All @@ -13,15 +11,6 @@ export default {
title: "Illustrated message",
component: "IllustratedMessage",
argTypes: {
useAccentColor: {
name: "Illustration accent color",
type: { name: "boolean" },
table: {
type: { summary: "boolean" },
category: "Component",
},
control: "boolean",
},
heading: {
name: "Heading",
type: { name: "string" },
Expand All @@ -33,10 +22,12 @@ export default {
},
description: {
name: "Description",
type: { name: "string" },
table: {
type: { summary: "string" },
category: "Content",
disable: true,
},
control: "text",
},
isHorizontal: {
jawinn marked this conversation as resolved.
Show resolved Hide resolved
name: "Horizontal orientation",
Expand Down Expand Up @@ -73,7 +64,8 @@ export default {
isHorizontal: false,
size: "m",
hasButtons: true,
useAccentColor: false,
heading: "Error 404: Page not found",
description: "This page isn't available. Try checking the URL or visit a different page.",
},
parameters: {
design: {
Expand All @@ -82,32 +74,22 @@ export default {
},
packageJson,
metadata,
layout: "centered"
},
};

export const Default = Template.bind({});
Default.args = {
heading: "Error 404: Page not found",
description: [
"This page isn't available. Try checking the URL or visit a different page.",
],
isHorizontal: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since isHorizontal is false in the args by default, we don't need to redeclare isHorizontal: false again 👍

We could make it even clearer and add some documentation:
"By default, the illustrated message component has a vertical orientation.

};

/**
* To use the accent color, the class `.spectrum-IllustratedMessage-accent` can be added to element(s) within the illustration SVG.
*/
export const AccentColor = Template.bind({});
AccentColor.tags = ["!dev"];
AccentColor.args = {
heading: "Drag and drop your file",
description: [
() => {
return html`${Link({ url: "#", text: "Select a file" })} from your computer.`;
},
],
useAccentColor: true,

export const Horizontal = Template.bind({});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we disable the chromatic snapshot for the horizontal story? I'm assuming once we add the horizontal story to the test file, we'll probably do that anyways!

Horizontal.tags = ["!dev"];
Horizontal.args = {
isHorizontal: true
};
rise-erpelding marked this conversation as resolved.
Show resolved Hide resolved
AccentColor.parameters = {
Horizontal.parameters = {
chromatic: { disableSnapshot: true },
};

Expand Down
118 changes: 32 additions & 86 deletions components/illustratedmessage/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ export const Template = ({
heading,
description,
customClasses = [],
useAccentColor = false,
hasButtons = false,
isHorizontal = false,
orientation,
useAccentColor = false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need the useAccentColor arg? I know you said the accent color is mainly for when dropzone is in the dragged state, so can we remove the couple of references to useAccentColor, withAccentColorClass and the spectrum-IllustratedMessage-accent class? I believe it's possible, and I don't think I see any regressions in the dropzone.

If we can remove that class, we'll need to also remove that block Rise mentioned as well in the CSS..

size = "m",
}) => html`
customIllustration,
}) => {
const descriptionContent = Array.isArray(description)
? description
: [() => html`${description}`];
return html`
<div
class=${classMap({
[rootClass]: true,
[`${rootClass}--${orientation}`]: typeof orientation !== "undefined",
[`${rootClass}--horizontal`]: isHorizontal,
[`${rootClass}--size${size?.toUpperCase()}`]: typeof size !== "undefined" && size !== "m",
...customClasses.reduce((a, c) => ({ ...a, [c]: true }), {}),
})}
>
${illustrationSvgMarkup(useAccentColor)}
${customIllustration
? customIllustration()
: illustrationSvgMarkup(size, useAccentColor)}
<div class="${rootClass}--content">
${when(
heading,
Expand All @@ -37,17 +42,20 @@ export const Template = ({
</h2>`
)}
${when(
description,
() =>
html`<p
class="${rootClass}-description"
>
${description.map((c) => (typeof c === "function" ? c({}) : c))}
</p>`
)}
${when(hasButtons, () =>
descriptionContent,
() =>
html`<p
class="${rootClass}-description"
>
${descriptionContent.map((c) =>
typeof c === "function" ? c({}) : c
)}
</p>`
)}
${when(hasButtons, () =>
ButtonGroup({
size,
customClasses: ["spectrum-IllustratedMessage--actions"],
items: [
{
variant: "secondary",
Expand All @@ -66,77 +74,15 @@ export const Template = ({
</div>
</div>
`;
};

const illustrationSvgMarkup = (withAccentColorClass = false) => html`
<svg
class="spectrum-IllustratedMessage-illustration"
width="199"
height="98"
viewBox="0 0 199 97.7"
>
<defs>
<style>
.cls-1,
.cls-2 {
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
}

.cls-1 {
stroke-width: 3px;
}

.cls-2 {
stroke-width: 2px;
}
</style>
</defs>
<path
class="cls-1 ${withAccentColorClass
const illustrationSvgMarkup = (size = "m", withAccentColorClass = false) => {
const computedSize = size === "l" ? 160 : 96;
return html`
<svg class="spectrum-IllustratedMessage-illustration" xmlns="http://www.w3.org/2000/svg" width=${computedSize} height=${computedSize} viewBox="0 0 160 160" fill="none" preserveAspectRatio="xMinYMid slice">
<path className="${withAccentColorClass
? "spectrum-IllustratedMessage-accent"
: ""}"
d="M110.53,85.66,100.26,95.89a1.09,1.09,0,0,1-1.52,0L88.47,85.66"
/>
<line
class="cls-1 ${withAccentColorClass
? "spectrum-IllustratedMessage-accent"
: ""}"
x1="99.5"
y1="95.5"
x2="99.5"
y2="58.5"
/>
<path class="cls-1" d="M105.5,73.5h19a2,2,0,0,0,2-2v-43" />
<path
class="cls-1"
d="M126.5,22.5h-19a2,2,0,0,1-2-2V1.5h-31a2,2,0,0,0-2,2v68a2,2,0,0,0,2,2h19"
/>
<line class="cls-1" x1="105.5" y1="1.5" x2="126.5" y2="22.5" />
<path
class="cls-2"
d="M47.93,50.49a5,5,0,1,0-4.83-5A4.93,4.93,0,0,0,47.93,50.49Z"
/>
<path
class="cls-2"
d="M36.6,65.93,42.05,60A2.06,2.06,0,0,1,45,60l12.68,13.2"
/>
<path
class="cls-2"
d="M3.14,73.23,22.42,53.76a1.65,1.65,0,0,1,2.38,0l19.05,19.7"
/>
<path
class="cls-1"
d="M139.5,36.5H196A1.49,1.49,0,0,1,197.5,38V72A1.49,1.49,0,0,1,196,73.5H141A1.49,1.49,0,0,1,139.5,72V32A1.49,1.49,0,0,1,141,30.5H154a2.43,2.43,0,0,1,1.67.66l6,5.66"
/>
<rect
class="cls-1"
x="1.5"
y="34.5"
width="58"
height="39"
rx="2"
ry="2"
/>
</svg>
`;
: ""}" 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>
`;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
};
};
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>`;
})}
`;