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(infield-progress-cirlce): new component, sharing tokens from progress circle #3430

Open
wants to merge 14 commits into
base: spectrum-two
Choose a base branch
from

Conversation

aramos-adobe
Copy link
Collaborator

Description

The infield progresscirlce is a subcomponent of the progress circle which is used in button, combobox, and picker. It's smaller in block size and has its own tshirt sizing.

Mods

--mod-progress-cirlce-stroke-width

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

  1. Open the storybook for the infield progress circle:
    - [x] Toggle Intedeterminate mode
    - [x] Exists in combobox, button, picker components isLoading states

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

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. ✨

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: 2730b96

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/infieldprogresscircle 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 self-assigned this Dec 5, 2024
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css763-progress-circle-s2-tokens branch from 13e35a1 to c97dee1 Compare January 8, 2025 01:07
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css1035-infield-progress-cirlce-s2-migration branch 2 times, most recently from 4d277c7 to 221c244 Compare January 9, 2025 22:19
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.

I know I left a barrage of comments! This is moving along nicely, most of comments are just clean up after the rebase.

Now that spectrum-two is up to date, we have all of our test files, so we'll need a brand new infieldprogresscircle.test.js file and tests written 🥳 We should also update the documentation page with the new stories and docs.

...ProgressCircle.args,
},
parameters: {
...ProgressCircle.parameters
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about adding the tokens design file?

parameters: {
    ...ProgressCircle.parameters,
    design: {
        type: "figma",
        url: "https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-token-specs?node-id=14970-6050",
    }
}

That way, the design add-on tab will have the in-field progress circle designs that are maybe more relevant. Is that more valuable than just the regular progress circle desktop designs...I'm not sure. I think most of the other components in s2-foundations-redux are linked to the desktop design files (not the tokens design files), but I wanted to call it out just in case. 🤷‍♀️

Screenshot 2025-01-16 at 4 04 54 PM

.changeset/flat-snails-admire.md Outdated Show resolved Hide resolved
components/infieldprogresscircle/index.css Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the hope for spectrum-two is that there are no more themes! Looks like the rest of the components have had their express.css and spectrum.css files deleted.

components/infieldprogresscircle/package.json Show resolved Hide resolved
components/infieldprogresscircle/stories/template.js Outdated Show resolved Hide resolved
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css763-progress-circle-s2-tokens branch 2 times, most recently from aa3e105 to b4c24e8 Compare January 22, 2025 20:48
Base automatically changed from aramos-adobe/css763-progress-circle-s2-tokens to spectrum-two January 24, 2025 19:49
Copy link
Contributor

github-actions bot commented Jan 24, 2025

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

Copy link
Contributor

github-actions bot commented Jan 24, 2025

File metrics

Summary

Total size: 2.23 MB*
Total change (Δ): 🔴 ⬆ 2.28 KB (0.10%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Δ
infieldprogresscircle 1.46 KB 🎉 new

Details

infieldprogresscircle

Filename Head Compared to base
index.css 1.46 KB 🔴 ⬆ 1.46 KB (Infinity%)
metadata.json 0.84 KB 🔴 ⬆ 0.84 KB (Infinity%)
* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css1035-infield-progress-cirlce-s2-migration branch from 3748245 to 33da0e2 Compare January 27, 2025 22:09
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 is getting close- thanks for splitting this off from the other progress circle migration!

My main set of concerns I think is just related to this not being an already-published NPM package. So the ComponentDetails cards don't render at the top of this page since we can't fetch the data from NPM. There's also no metadata.json in the dist output for this component. I'm not sure where to start with that unfortunately (it might be a @castastrophe question)

If I could be really picky, I'd like to request a change to the regular progress circle controls. I noticed that the value control in progresscircle.stories.js doesn't have maybe all of the usual settings, like name, description, etc. Could we update that so it matches the other controls better? This is the same control in progress bar:

value: {
	name: "Percent filled",
	type: { name: "number" },
	table: {
		type: { summary: "number" },
		category: "Content",
	},
	control: { type: "range", min: 0, max: 100,},
	if: { arg: "isIndeterminate", truthy: false },
},

It's a little more descriptive for users, categorizesvalue into the "Content" set of controls, and adds that conditional, so it won't even show for a default story if you wanted to get real fancy.

Screenshot 2025-01-28 at 5 51 01 PM

)
InfieldProgressCircle({
size: size,
staticColor,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for removing the testId: "progress-circle" line? Do we no longer need it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can delete both the express.css and spectrum.css theme files for S2 components! 🥳

"spectrum": [
{
"guidelines": "https://spectrum.adobe.com/page/progress-circle",
"rootClass": "spectrum-InfieldProgresscircle",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh excellent- thanks for adding this spectrum data! Looks like we just need to capitalize the first c in "Circle" to match the CSS and root class declarations in the other files.

import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { size } from "@spectrum-css/preview/types";
import { default as ProgressCircle } from "@spectrum-css/progresscircle/stories/progresscircle.stories.js";
import packageJson from "../package.json";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh! We need the metadata.json stuff.

Suggested change
import packageJson from "../package.json";
import metadata from "../dist/metadata.json";
import packageJson from "../package.json";

Copy link
Collaborator

Choose a reason for hiding this comment

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

Something might be missing somewhere. It doesn't look like infield progress circle is correctly building the metadata.json in its dist file.

@@ -0,0 +1,43 @@
{
"name": "@spectrum-css/infieldprogresscircle",
"version": "0.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe get a second opinion, but should this version number be 1.0.0? Or does that happen when changesets creates a release for us to merge?

*/

.spectrum-InfieldProgressCircle {
--mod-progress-circle-thickness: var(--mod-progress-cirlce-stroke-width, 2px);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This 2px- I see in Figma that there's a token progress-circle-thickness-small. Should we be using that instead of the hardcoded 2px?

Also, do we want to introduce a mod for this? Are we creating a mod for a mod? 🙃 I don't know the answer to that question, but is this infield progress circle supposed to just overwrite any of the progress circle mods, including --mod-progress-circle-stroke-width? Should this line just be --mod-progress-circle-thickness: var(--spectrum-progress-circle-thickness-small)?

And if not- I caught another misspelling of circle in that --mod-progress-circle-stroke-width. Those pesky L's and C's 😆

// ********* DOCS ONLY ********* //

export const Sizing = (args, context) => Sizes({
Template: Template,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can just write Template, here, as opposed to Template: Template if you want to reduce some repetitiveness.

Same thing for the Indeterminate story.

StaticWhiteDeterminate.storyName = "Static white, default";
StaticWhiteDeterminate.args = {
staticColor: "white",
isIndeterminate: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any time we have isIndeterminate: false, we can just rely on progress circle's default arg, where isIndeterminate is already false. We don't need to redeclare it!

isIndeterminate: true,
size: "s",
size: size,
customClasses: customProgressCircleClasses,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be customInfieldProgressCircleClasses? Is that the intention here?

rootClass = "spectrum-InfieldProgressCircle",
size = "m",
staticColor,
...item
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the ...item for here? Is that referencing the parent component that infield PC would be in, like the picker or button?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just to spread the rest of props nested in Progress Circle.

"clean": {},
"compare": {},
"format": {},
"lint": {},
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
"lint": {},
"lint": {},
"report": {},

Looking at some other project.jsons, I think we need a "report": {} line.

@aramos-adobe aramos-adobe changed the title Aramos-adobe/css1035-infield-progress-cirlce-s2-migration feat(infield-progress-cirlce): new component, sharing tokens from progress circle Jan 29, 2025
@aramos-adobe aramos-adobe force-pushed the aramos-adobe/css1035-infield-progress-cirlce-s2-migration branch from de1cc68 to 5a38f63 Compare January 29, 2025 16:35
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.

2 participants