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

calcite-checkbox #68

Merged
merged 20 commits into from
Jul 18, 2019
Merged

calcite-checkbox #68

merged 20 commits into from
Jul 18, 2019

Conversation

vcolavin
Copy link
Contributor

@vcolavin vcolavin commented Jul 2, 2019

C'est fini! This PR addresses the following issues: #1, #67

It only took my first month working here at esri dot com to write this checkbox:
Screen Shot 2019-07-02 at 12 35 10 PM

I also fixed the tests.

Tests on master:
Screen Shot 2019-07-02 at 1 57 51 PM

Tests on this branch:
Screen Shot 2019-07-02 at 1 58 39 PM

});

// Not sure why this is failing; it works in real life
xit("toggles the checked attributes when the inner checkbox is toggled", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just want to call out this failing test. The behavior works in "real life" and I can't figure out what else to do here.

.map(count => {
let out: string = "";
for (let i = 0; i < count; i++) {
out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
Copy link
Contributor Author

@vcolavin vcolavin Jul 2, 2019

Choose a reason for hiding this comment

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

I edited this utility function because it was causing a test failure: window.crypto.getRandomValues() is not available in Jest, so I replaced it with plain old Math.random(). Math.random() is not as cryptographically secure but that doesn't matter for generating UUIDs; we're concerned here with uniqueness, not randomness.

@vcolavin vcolavin requested a review from paulcpederson July 8, 2019 16:55
}
}

@Listen("keydown") keyDownHandler({ keyCode }: KeyboardEvent) {
Copy link
Member

Choose a reason for hiding this comment

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

nifty destructuring 💯

display: none;
}

:host {
Copy link
Member

Choose a reason for hiding this comment

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

We should probably add the main blue color + hover/disabled as css variables here so that other apps can override with their spot color. Here are a couple examples:

https://github.com/ArcGIS/calcite-components/blob/paulcpederson/slider/src/components/calcite-slider/calcite-slider.scss#L8
https://github.com/ArcGIS/calcite-components/blob/master/src/components/calcite-tabs/calcite-tabs.scss#L4

@paulcpederson
Copy link
Member

Looks good. Couple comments, nothing major.

We should probably be using Sass variables from either calcite-base or calcite-colors for all our color work. That way we'll guarantee all the hex values are the same. I can open a pr with sass color vars later, though.

@paulcpederson
Copy link
Member

@julio8a or @macandcheese could probably deliver a spec of which calcite color variables should be used where for this component...

@julio8a
Copy link

julio8a commented Jul 8, 2019

@vcolavin I can work with you on the color variables.

@vcolavin
Copy link
Contributor Author

vcolavin commented Jul 8, 2019

@julio8a great! Here's the comp I was given to match:

https://user-images.githubusercontent.com/1031758/58721793-a2b4e380-838a-11e9-8da6-9dde92942d3e.png

I'm trying to match the various shades of blue to what is available in calcite-colors. Is there an easy system for matching the colors?

@julio8a
Copy link

julio8a commented Jul 8, 2019

image

^ We do have a Sketch UI kit. The color styles applied to text and elements are the same as on calcite-base repository variables.

I think calcite-components repository is referencing calcite-base.

These are the variables we should be using:
https://github.com/ArcGIS/calcite-base/blob/master/variables.scss

These match all styles on Sketch file.

@julio8a
Copy link

julio8a commented Jul 8, 2019

image

image

Copy link
Contributor

@patrickarlt patrickarlt left a comment

Choose a reason for hiding this comment

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

This LGTM. I'm going to merge this.

@patrickarlt patrickarlt merged commit 9fd2792 into master Jul 18, 2019
@paulcpederson paulcpederson deleted the vin10439/#1 branch November 12, 2019 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants