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(downstate): docs + implementation for example components #2520

Merged
merged 9 commits into from
Mar 19, 2024

Conversation

mdt2
Copy link
Collaborator

@mdt2 mdt2 commented Feb 13, 2024

Description

This one was a bit of a doozy in that I tried a lot of different approaches. TLDR, we landed on down state needing to be implemented in each component that requires it in S2. The short story for that is that each component is slightly different, and an overall custom property for the transform value wasn't an option because custom props have to be defined before they're used (which doesn't play nicely with our dynamic width and height).

More details about what led to this approach I started with looking at a purely class based implementation of down state and ran into complications. For components like Button where the whole component is interactable, class based works fine because you can apply the class to the root/parent of the component. But with a more complex component like Checkbox, you have to apply the styles to the box itself, but the `active` state that we're targeting happens at the root/parent level.

So then I experimented with this mix of utility class and placeholder approaches, but it felt a bit ick to keep both because it could lead to confusion for users. We also ran into issues with a placeholder approach when working on tooltip after which we landed on not using the placeholders at all. At this point I'm thinking that users shouldn't really need utility classes since this feature should be shipped with the components that need it anyway, and placeholders that rely on custom props haven't worked well in the past.

Then Josh suggested that I try creating a custom token for the transform value, to keep the code DRY. Custom properties have to be defined before they're used, so I had to define --spectrum-downstate-width and --spectrum-downstate-height as 0px each in custom-vars.css for the transform value (perspective(max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down))) translateZ(var(--spectrum-component-size-difference-down));) to be considered defined by the browser. The problem is that even when I was updating those width/height custom props using the style tag, the global custom token wasn't picking up those new values, it would always use 0px. So this option was also, unfortunately, ruled out.

And that brings us to the solution detailed in the most recent commit of this PR, which is to implement this transform within the components that need the feature in S2. Button and checkbox are the ones I included in this work to demo because Lynn asked to see those as examples in our Storybook (she also asked us to show Select Box since it's like 200x200px, but this is an S2 component we haven't built yet so I'm waiting to hear back from Lynn on if there is a large size S1 component we can use as an example in the meantime). As we pick up cards to migrate components to S2, adding down state to those that require it should be included in the work on those cards. The documentation provided in the docs site as part of this PR is intended to help guide that work.

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 @jawinn

  • In storybook, down state has a foundations docs page with docs that (you will have to click on a component story to load global styles for this for now due to an issue that will be handled in another PR):
    • Make sense
    • Include working examples of down state for a checkbox and a button
  • In storybook, the checkbox story has the downstate
  • In storybook, the button story has the downstate

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • 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. ✨

@mdt2 mdt2 changed the title feat(downstate): utility class/placeholder mixed implementation feat(downstate): docs + implementation for example components Feb 15, 2024
Copy link
Contributor

github-actions bot commented Feb 15, 2024

File metrics

Summary

Total size: 3.93 MB*
Total change (Δ): ⬇ 32.46 KB (-0.80%)
Table reports on changes to a package's main file. Other changes can be found in the collapsed "Details" below.

Package Size Δ
actionbutton 40.78 KB ⬇ 0.20 KB
actiongroup 5.73 KB ⬇ 2.79 KB
button 82.43 KB ⬇ 0.65 KB
buttongroup 1.38 KB ⬇ 0.53 KB
checkbox 25.20 KB ⬆ 0.26 KB
closebutton 12.08 KB ⬇ 4.06 KB
dial 11.56 KB ⬇ < 0.01 KB
fieldlabel 6.42 KB ⬇ 0.24 KB
logicbutton 9.00 KB ⬇ 0.38 KB
modal 5.23 KB ⬇ < 0.01 KB
page 0.72 KB ⬇ < 0.01 KB
picker 30.62 KB ⬇ 0.25 KB
progresscircle 11.33 KB ⬇ 0.04 KB
slider 33.27 KB ⬇ 0.01 KB
splitview 11.42 KB ⬇ < 0.01 KB
table 47.17 KB ⬇ < 0.01 KB
tokens 197.69 KB ⬇ 2.04 KB
Details

actionbutton

File Head Base Δ
index-base.css 29.70 KB 29.90 KB ⬇ 0.20 KB (-0.66%)
index-theme.css 11.65 KB 11.65 KB -
index-vars.css 40.78 KB 40.97 KB ⬇ 0.20 KB (-0.48%)
index.css 40.78 KB 40.97 KB ⬇ 0.20 KB (-0.48%)
mods.json 2.53 KB 2.63 KB ⬇ 0.10 KB (-3.75%)
themes/express.css 8.92 KB 8.92 KB -
themes/spectrum.css 9.20 KB 9.20 KB -

actiongroup

File Head Base Δ
index-base.css 5.73 KB 8.04 KB ⬇ 2.31 KB (-28.75%)
index-theme.css 0.59 KB 1.06 KB ⬇ 0.49 KB (-45.10%)
index-vars.css 5.73 KB 8.52 KB ⬇ 2.79 KB (-32.74%)
index.css 5.73 KB 8.52 KB ⬇ 2.79 KB (-32.74%)
mods.json 0.25 KB 0.40 KB ⬇ 0.15 KB (-37.47%)
themes/express.css 0.59 KB 0.89 KB ⬇ 0.29 KB (-32.96%)
themes/spectrum.css 0.59 KB 0.79 KB ⬇ 0.20 KB (-24.91%)

button

File Head Base Δ
index-base.css 52.48 KB 53.11 KB ⬇ 0.65 KB (-1.19%)
index-theme.css 30.53 KB 30.53 KB -
index-vars.css 82.43 KB 83.06 KB ⬇ 0.65 KB (-0.76%)
index.css 82.43 KB 83.06 KB ⬇ 0.65 KB (-0.76%)
mods.json 1.67 KB 1.77 KB ⬇ 0.10 KB (-5.57%)
themes/express.css 29.33 KB 29.33 KB -
themes/spectrum.css 29.71 KB 29.71 KB -

buttongroup

File Head Base Δ
index-base.css 1.38 KB 1.90 KB ⬇ 0.53 KB (-27.32%)
index-vars.css 1.38 KB 1.90 KB ⬇ 0.53 KB (-27.32%)
index.css 1.38 KB 1.90 KB ⬇ 0.53 KB (-27.32%)
mods.json 0.15 KB 0.15 KB -

checkbox

File Head Base Δ
index-base.css 24.57 KB 24.32 KB ⬆ 0.26 KB (1.05%)
index-theme.css 1.20 KB 1.20 KB -
index-vars.css 25.20 KB 24.94 KB ⬆ 0.26 KB (1.02%)
index.css 25.20 KB 24.94 KB ⬆ 0.26 KB (1.02%)
mods.json 1.62 KB 1.62 KB -
themes/express.css 0.92 KB 0.92 KB -
themes/spectrum.css 0.91 KB 0.91 KB -

closebutton

File Head Base Δ
index-base.css 11.44 KB 15.50 KB ⬇ 4.06 KB (-26.19%)
index-theme.css 1.22 KB 1.22 KB -
index-vars.css 12.08 KB 16.14 KB ⬇ 4.06 KB (-25.14%)
index.css 12.08 KB 16.14 KB ⬇ 4.06 KB (-25.14%)
mods.json 0.97 KB 1.29 KB ⬇ 0.35 KB (-26.55%)
themes/express.css 0.93 KB 0.93 KB -
themes/spectrum.css 0.92 KB 0.92 KB -

dial

File Head Base Δ
index-base.css 11.56 KB 11.56 KB ⬇ < 0.01 KB (-0.01%)
index-vars.css 11.56 KB 11.56 KB ⬇ < 0.01 KB (-0.01%)
index.css 11.56 KB 11.56 KB ⬇ < 0.01 KB (-0.01%)
mods.json 1.15 KB 1.15 KB -

fieldlabel

File Head Base Δ
index-base.css 6.42 KB 6.65 KB ⬇ 0.24 KB (-3.48%)
index-vars.css 6.42 KB 6.65 KB ⬇ 0.24 KB (-3.48%)
index.css 6.42 KB 6.65 KB ⬇ 0.24 KB (-3.48%)
mods.json 0.72 KB 0.80 KB ⬇ 0.09 KB (-10.60%)

logicbutton

File Head Base Δ
index-base.css 9.00 KB 9.37 KB ⬇ 0.38 KB (-3.91%)
index-vars.css 9.00 KB 9.37 KB ⬇ 0.38 KB (-3.91%)
index.css 9.00 KB 9.37 KB ⬇ 0.38 KB (-3.91%)
mods.json 1.50 KB 1.63 KB ⬇ 0.13 KB (-8.02%)

modal

File Head Base Δ
index-base.css 5.23 KB 5.23 KB ⬇ < 0.01 KB (-0.02%)
index-vars.css 5.23 KB 5.23 KB ⬇ < 0.01 KB (-0.02%)
index.css 5.23 KB 5.23 KB ⬇ < 0.01 KB (-0.02%)
mods.json 0.58 KB 0.58 KB -

page

File Head Base Δ
index-base.css 0.72 KB 0.72 KB ⬇ < 0.01 KB (-0.14%)
index-vars.css 0.72 KB 0.72 KB ⬇ < 0.01 KB (-0.14%)
index.css 0.72 KB 0.72 KB ⬇ < 0.01 KB (-0.14%)

picker

File Head Base Δ
index-base.css 28.74 KB 28.98 KB ⬇ 0.25 KB (-0.84%)
index-theme.css 2.46 KB 2.46 KB -
index-vars.css 30.62 KB 30.87 KB ⬇ 0.25 KB (-0.78%)
index.css 30.62 KB 30.87 KB ⬇ 0.25 KB (-0.78%)
mods.json 2.71 KB 2.86 KB ⬇ 0.15 KB (-5.23%)
themes/express.css 1.47 KB 1.47 KB -
themes/spectrum.css 1.58 KB 1.58 KB -

progresscircle

File Head Base Δ
index-base.css 11.33 KB 11.37 KB ⬇ 0.04 KB (-0.32%)
index-vars.css 11.33 KB 11.37 KB ⬇ 0.04 KB (-0.32%)
index.css 11.33 KB 11.37 KB ⬇ 0.04 KB (-0.32%)
mods.json 0.36 KB 0.40 KB ⬇ 0.04 KB (-9.50%)

slider

File Head Base Δ
index-base.css 30.96 KB 30.96 KB ⬇ < 0.01 KB (-0.01%)
index-theme.css 2.89 KB 2.89 KB ⬇ < 0.01 KB (-0.10%)
index-vars.css 33.27 KB 33.27 KB ⬇ 0.01 KB (-0.01%)
index.css 33.27 KB 33.27 KB ⬇ 0.01 KB (-0.01%)
mods.json 2.19 KB 2.19 KB -
themes/express.css 1.75 KB 1.75 KB -
themes/spectrum.css 1.73 KB 1.74 KB ⬇ < 0.01 KB (-0.17%)

splitview

File Head Base Δ
index-base.css 11.42 KB 11.42 KB ⬇ < 0.01 KB (-0.01%)
index-vars.css 11.42 KB 11.42 KB ⬇ < 0.01 KB (-0.01%)
index.css 11.42 KB 11.42 KB ⬇ < 0.01 KB (-0.01%)
mods.json 0.71 KB 0.71 KB -

table

File Head Base Δ
index-base.css 47.17 KB 47.17 KB ⬇ < 0.01 KB (-0.00%)
index-vars.css 47.17 KB 47.17 KB ⬇ < 0.01 KB (-0.00%)
index.css 47.17 KB 47.17 KB ⬇ < 0.01 KB (-0.00%)
mods.json 4.01 KB 4.01 KB -

tokens

File Head Base Δ
css/dark-vars.css 36.07 KB 24.57 KB ⬆ 11.50 KB (46.80%)
css/express/custom-dark-vars.css 0.59 KB 0.59 KB -
css/express/custom-darkest-vars.css 0.59 KB 0.59 KB -
css/express/custom-large-vars.css 0.50 KB 0.50 KB -
css/express/custom-light-vars.css 0.63 KB 0.63 KB -
css/express/custom-medium-vars.css 0.48 KB 0.48 KB -
css/express/custom-vars.css 0.04 KB 0.04 KB -
css/global-vars.css 46.43 KB 38.23 KB ⬆ 8.21 KB (21.47%)
css/large-vars.css 27.28 KB 24.40 KB ⬆ 2.88 KB (11.79%)
css/light-vars.css 36.07 KB 24.55 KB ⬆ 11.52 KB (46.91%)
css/medium-vars.css 27.20 KB 24.33 KB ⬆ 2.87 KB (11.79%)
css/spectrum/custom-dark-vars.css 3.40 KB 3.40 KB -
css/spectrum/custom-darkest-vars.css 3.40 KB 3.40 KB -
css/spectrum/custom-large-vars.css 4.94 KB 4.94 KB -
css/spectrum/custom-light-vars.css 3.40 KB 3.40 KB -
css/spectrum/custom-medium-vars.css 5.18 KB 5.18 KB -
css/spectrum/custom-vars.css 2.04 KB 2.04 KB -
index.css 197.69 KB 199.73 KB ⬇ 2.04 KB (-1.02%)
* 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.

Copy link
Contributor

github-actions bot commented Feb 15, 2024

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

@mdt2 mdt2 marked this pull request as ready for review February 15, 2024 16:56
@jenndiaz
Copy link
Contributor

I don't necessarily thing this is something that should be addressed but I did notice on Safari and Windows(via assistive labs) that the checkbox active state squares out the checkbox borders while other browsers do not.

Safari Active

Screenshot 2024-02-15 at 10 13 59 AM

@jenndiaz
Copy link
Contributor

should the down state have a prefers-reduced-motion alternative?

@@ -0,0 +1,82 @@
name: Down state
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll need to add the max-perspective token setup here once it's available, but design hasn't defined the token yet and therefore it's not in the token system at this time.

@mdt2
Copy link
Collaborator Author

mdt2 commented Feb 15, 2024

should the down state have a prefers-reduced-motion alternative?

There isn't anything for this in the design docs so I reached out to PJ on Slack to ask 👍

@@ -147,6 +147,11 @@ governing permissions and limitations under the License.
box-shadow: none;
}

&:active {
/* stylelint-disable-next-line spectrum-tools/no-unknown-custom-properties */
transform: perspective(max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down))) translateZ(var(--spectrum-component-size-difference-down));
Copy link
Collaborator Author

@mdt2 mdt2 Feb 26, 2024

Choose a reason for hiding this comment

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

If we're expecting users to dynamically fetch this width/height data, will we need to namespace these to the component?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Any use cases you have in mind where a user will do it from their end?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Originally when we were exploring a class-based approach, users were be expected to set these width and height variables in their implementation. But if we go with the component-based approach shown in this PR, we may be able to set these and ship them as part of the CSS instead.

Copy link
Collaborator

@jawinn jawinn Mar 7, 2024

Choose a reason for hiding this comment

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

Namespacing might be necessary if there are cases where a component with a down state is nested within another component that has a down state? I'm not sure if this is a possibility.

One possible route would be to use --mod naming on these? --mod-button-downstate-height?

@mdt2 mdt2 force-pushed the mdt2/css-612-down-state branch 2 times, most recently from aa7165e to 42629dc Compare February 29, 2024 21:09
@Rajdeepc
Copy link
Collaborator

Rajdeepc commented Mar 1, 2024

Great start!! A couple of questions:

  1. Is an :active state not considered as a part of down state of an element?
  2. Is down state same as :pressed state? I hope adding the name down state enhances usability and does not cause confusion.
    Should we also think and test this concept in mobile devices too with different themes?

@mdt2
Copy link
Collaborator Author

mdt2 commented Mar 1, 2024

@Rajdeepc Good questions!

  1. Yes, :active is the way we can simulate a "down state" in CSS. From the design docs: down state is the concept to make a component look "pressed in" when activated by a user. We're using that phrase "down state" to align with design.
  2. We don't have a :pressed pseudo class available in CSS, so we're using the :active CSS pseudo class. It should be equivalent to the idea of a pressed state, but let me know if that's not the case with web components

I agree, we should do some testing on mobile as well once the team agrees on the approach.

Let me know if this answers your questions 🙂

@mdt2
Copy link
Collaborator Author

mdt2 commented Mar 1, 2024

should the down state have a prefers-reduced-motion alternative?

There isn't anything for this in the design docs so I reached out to PJ on Slack to ask 👍

After talking with Damian and PJ in Slack, this down state motion isn't jarring or problematic from an accessibility perspective, so we don't need a reduced motion alternative.

Comment on lines 354 to 361
DownStateDocs.args = {
variant: "accent",
customStyles: {
"--spectrum-downstate-width": "72px",
"--spectrum-downstate-height": "32px"
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a WIP and I don't love the direction it's going so far...if the team agrees on this approach (to setup down state in each component's index.css), then we should do this in the template.js, and make it compatible with changing t-shirt sizing and platform scale. But this was the first step to just see it working on the new Foundations/Down state page.

Checkbox doesn't need this because it uses the component-size-minimum-perspective-down token, which is already defined. But for components that are larger than 24px, we have to calculate the perspective based on width and height. We've thought from the beginning that consumers would have to create their own implementation for setting the values of those width and height variables, and in button's case I think that's still true, because we don't statically set a width and height in the CSS...

Comment on lines 23 to 24
<Story of={CheckboxStories.Default} />
<Story of={ButtonStories.DownStateDocs} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's an outstanding issue with these where the global styles don't load unless you first go to a component page, so the buttons look wonky. Not sure yet if that will be a fix in this PR or a separate, more global one

Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this a known issue before or something you discovered for the first time adding this story? I noticed this when creating a new story for the Checkboxes and Action Buttons in Foundations for corner-rounding as well.

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 think it has to do with the existing setup and where we're importing global tokens (probably in preview.js). It can probably be its own Jira card to work on.

@castastrophe castastrophe added the S2 Spectrum 2 label Mar 4, 2024
Copy link
Collaborator

@jawinn jawinn left a 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 a problem with defining these in each component. I think it makes sense to keep it simple like this, with it being a single line of CSS, that may need to be slightly customized per component.

But if we go with the component-based approach shown in this PR, we may be able to set these and ship them as part of the CSS instead.

For the max formula, you mentioned that maybe we could set these for some components. What if we had fallback default values for the components, for when the width and height variables aren't set? Button for example might use the defined minimum component height as another fallback on downstate height. This could vary per component. Some might be able to be set directly if the component has a fixed size. Just a thought. It may not be necessary if we are expecting the consumer to always set the width and height variables.

I think you're on the right track with the docs page, and would just make some minor formatting adjustments noted below.

@@ -147,6 +147,11 @@ governing permissions and limitations under the License.
box-shadow: none;
}

&:active {
/* stylelint-disable-next-line spectrum-tools/no-unknown-custom-properties */
transform: perspective(max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down))) translateZ(var(--spectrum-component-size-difference-down));
Copy link
Collaborator

@jawinn jawinn Mar 7, 2024

Choose a reason for hiding this comment

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

Namespacing might be necessary if there are cases where a component with a down state is nested within another component that has a down state? I'm not sure if this is a possibility.

One possible route would be to use --mod naming on these? --mod-button-downstate-height?

.storybook/foundations/down-state.mdx Outdated Show resolved Hide resolved
.storybook/foundations/down-state.mdx Outdated Show resolved Hide resolved
@Rajdeepc
Copy link
Collaborator

@Rajdeepc Good questions!

  1. Yes, :active is the way we can simulate a "down state" in CSS. From the design docs: down state is the concept to make a component look "pressed in" when activated by a user. We're using that phrase "down state" to align with design.
  2. We don't have a :pressed pseudo class available in CSS, so we're using the :active CSS pseudo class. It should be equivalent to the idea of a pressed state, but let me know if that's not the case with web components

I agree, we should do some testing on mobile as well once the team agrees on the approach.

Let me know if this answers your questions 🙂

Sure thanks. This make sense. Also curious to know how are you shipping javascript? We haven't had a chance to discuss this but if you had any discussion do let me know. Since we are building a logic to tackle this from SWC side we would love to see an example.

castastrophe pushed a commit that referenced this pull request Apr 11, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 11, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request Apr 12, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request Apr 15, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 18, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 18, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request Apr 19, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request Apr 19, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 24, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 24, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 26, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
@@ -150,6 +150,12 @@ governing permissions and limitations under the License.
}
}

&:not(.is-readOnly):active {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This approach will not work in case the SWC wants to disable downstate for checkbox. This is tightly coupled with the css transform. We need to cascade the --spectrum-downstate-width and --spectrum-downstate-height to this css.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey Rajdeep! Can you help me understand what needs to change? One piece of context that might be helpful is for components like Checkbox which are smaller than 24px, the transform perspective is not based on the width and height of the component, it is based on a set value per the design spec.

castastrophe pushed a commit that referenced this pull request Apr 30, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 30, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 30, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 30, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
castastrophe pushed a commit that referenced this pull request Apr 30, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request May 1, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request May 3, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
rise-erpelding pushed a commit that referenced this pull request May 7, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
pfulton pushed a commit that referenced this pull request May 10, 2024
* feat(downstate): docs + implementation for example components

* docs: update mdx

* docs: reorg, stories live within foundations

* docs: decorator for down state dimension tokens

* docs: fix mdx hierarchy console error

* fix: small iconOnly button gets min perspective

* docs: use markdown, update language

* fix: disabled, readonly checkbox doesnt have down state

* chore(button,checkbox): update package versions
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.

7 participants