Coder Social home page Coder Social logo

thumbtack / thumbprint Goto Github PK

View Code? Open in Web Editor NEW
197.0 103.0 27.0 37.62 MB

Thumbprint is the design system at Thumbtack.

Home Page: https://thumbprint.design

License: Apache License 2.0

JavaScript 7.57% TypeScript 46.99% SCSS 15.92% MDX 29.52%

thumbprint's Introduction

Test build status

Thumbprint

Thumbprint is the design system at Thumbtack. Though its primary purpose to support Thumbtack projects, we have open-sourced it for those interested in how we build and manage our documentation and code.

Documentation

Thumbprint is documented at thumbprint.design.

Screenshot of Thumbprint documentation

The documentation is hosted on Netlify and built with Gatsby and Gatsby MDX.

Overview

The Thumbprint codebase is a monorepo containing individually versioned NPM packages. These packges include:

Package Version Size
@thumbtack/thumbprint-atomic npm version Bundle size
@thumbtack/thumbprint-react npm version Bundle size
@thumbtack/thumbprint-scss npm version Bundle size
@thumbtack/thumbprint-global-css npm version Bundle size

Contributing

Thumbprint accepts issues and pull requests. Take at look at our contribution guidelines if you'd like to contribute. We also maintain a CONTRIBUTING.md file that contains developer-specific instructions.

License

Thumbprint is licensed under the terms of the Apache License 2.0.

thumbprint's People

Contributors

abdul-moiz avatar bawjensen avatar bgando avatar bhoomikasorathiya avatar ccornelis avatar danoc avatar davidboominkim avatar dependabot[bot] avatar dwroth avatar efujimoto avatar egoens avatar fow5040 avatar jichan-thumbtack avatar kevinmbeaulieu avatar lasya-tack avatar lavelle avatar leea1985 avatar mallikapotter avatar mateo42 avatar mattybow avatar omoralesvivo avatar parsatt avatar prufect avatar senseiurata avatar tt-pkaminski avatar ttblee avatar volanstudio avatar willmee avatar xanderwebs avatar zhaotongpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thumbprint's Issues

List of Carousel improvements

  • Support items of variable width
  • Make it easier to not use infinite scroll
  • Make it easier to update visibleCount as the width of the Carousel changes (page is resized, for example). Use case: Carousel items must be a fixed pixel width and can't just rely on percentages.
  • Add tabIndex, aria-hidden, and other attributes to improve accessibility.

Thanks @georgeashworth for the feedback!

Update React checkbox to use icon from Thumbprint

We should update this so that it points to an icon in packages/thumbprint-react/icons:

<svg
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
width="18"
height="18"
viewBox="0 0 18 18"
data-thumbprint-id="contentactions-check--small"
>
<path
fillRule="evenodd"
d="M14.5810763,3.19812449 C14.132085,2.85681117 13.5060971,2.96739243 13.1851033,3.44586905 L8.01720309,11.1408364 L4.52827048,8.83245251 C4.05827956,8.52197434 3.44229146,8.67402358 3.1502971,9.17270255 C2.85930272,9.67138151 3.00329993,10.3274261 3.47229088,10.6379043 L8.55419272,14 L14.8130718,4.68246529 C15.1350656,4.20398867 15.0300676,3.53943781 14.5810763,3.19812449"
/>
</svg>

Add three sizes to `Title` component

Problem

There are two problems:

  1. We sometimes want 16px bold text to render as an h1-h6. While possible with the Text component (use className and elementName), we've received feedback that this isn't ideal.
  2. The terminology in React and Figma don't match.

Current state

  • The Title component currently supports five sizes ranging from 40px to 18px. All of these are bold.
  • The Text component can render three sizes: 16px, 14px, and 12px. None of these are bold by default, but the className prop makes it possible to make them bold.
  • When designers are using the type styles, they're not often thinking about the semantics of h1-h6.

Proposal

Add three sizes to <Title />. The result would be:

  • <Title size={6} />: 16px, bold, block-level element
  • <Title size={7} />: 14px, bold, block-level element
  • <Title size={8} />: 12px, bold, block-level element

This would be helpful because:

  • Developers that want bold 16px text would no longer need className="b".
  • It encourages semantic HTML since Title components have the headingLevel prop. (In Text, you'd need to use the elementName prop.)
  • It allows us to align the terminology in Figma and React. Figma would have 8 Title styles and 3 Text styles. Titles are all bold and Text are all normal (non-bold).

Thanks @webbower for the initial idea/proposal.

cc: @tomgenoni @jonpkerwin

[@thumbtack/tp-ui-react-list]: Add `size` and `className` props from Type components

Because List and ListItem are text-centric components (even though ul/ol/li can be used for other things), they should probably support type-related props used on the Text and Title components.

Add support for the size prop to both List and ListItem that maps to the size classes applied to the Text component and add support for className to both List and ListItem components to support margin, padding, and text styling variations (bold, alignment, etc).

[tp-ui-react-grid]: Add example for single column layout

Chatted with Dan about this offline. The React Grid has been simplified and doesn't support a common use case where a single Column of content should be centered in the grid. The recommendation is to use Atomic width and margin classes instead of a Grid.

Create `thumbprint-scss` and `thumbprint-global-css` package

Following the recent consolidation of our React components into a single package, we're planning the same for our SCSS components. This has a few advantages:

  • Simplifies dependencies in React and SCSS files
  • Enables distribution of Thumbprint CSS files for non-React work
  • Simplifies change, release, and update processโ€”freeing up time to for Design Systems to build components.

Notes:

  • This work does not introduce any breaking changes. These are all code consolidations and swaps. No code will be removed.
  • The font-face package will remain separate.
  • The names/paths of packages may change slightly.

New packages

We're creating the following 2 packages:

  • thumbprint-global-css: Distributes:
  1. thumbprint-global.css Contains global styling for our reset, body, and default anchor styles.
  • thumbprint-scss: Distributes:
  1. thumbprint-mixin.scss Contains only mixins and our lone (deprecated) function.
  2. thumbprint-components.css Contains the output of all SCSS components โ€” e.g., buttons, type, form elements.

Related tasks

  • Update documentation to work with the new file structure. (#37)
  • Update documentation to explain how to include CSS and SCSS dependencies.

Carousel flickering during drag in some scenarios

The Carousel component is flickering on our Careers page in this code. It happens because the rect.width is flickering from the correct value to a larger incorrect value when the temporary DOM nodes are added during drag.

import React from 'react';
import { ThemedLink } from '@thumbtack/tp-ui-react-link';
import { NavigationCaretLeftMedium, NavigationCaretRightMedium } from '@thumbtack/thumbprint-icons';
import ThumbprintCarousel from '@thumbtack/tp-ui-react-carousel';
import classNames from 'classnames';

import './styles/carousel.scss';

/**
 * Compute modulo in JavaScript. This is needed because `%` doesn't handle negative numbers.
 * https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e
 */
const mod = (x, n) => (x % n + n) % n;

export default class Carousel extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            selectedIndex: 0,
        };

        this.goToSlide = this.goToSlide.bind(this);
    }

    goToSlide(newIndex) {
        this.setState({
            selectedIndex: Math.round(newIndex),
        });
    }

    render() {
        const { selectedIndex } = this.state;
        // TODODODO: This number is needed for the dots to work. Change it before merging.
        const numItems = 3;

        return (
            <div className="carousel ph4 s_ph6 m_ph7 bg-black">
                <ThumbprintCarousel
                    selectedIndex={selectedIndex}
                    onSelectedIndexChange={this.goToSlide}
                >
                    <div className="carousel-pane">
                        <div className="mw8">
                            <div className="b white mb3">Whatโ€™s special about working here?</div>
                            <div className="carousel-quote tp-title-1 white mb4">
                                I think itโ€™s amazing that I just said, โ€˜I want to try mobileโ€™ and
                                people were willing to make that happen.
                            </div>
                            <div className="b white mb4">
                                Heidy Hernandez Breton, Mobile Engineer
                            </div>
                            <ThemedLink
                                theme="primary"
                                size="small"
                                to="https://medium.com/life-thumbtack/get-to-know-heidy-hernandez-breton-mobile-engineer-at-thumbtack-71f909b5cb61"
                            >
                                Meet Heidy
                            </ThemedLink>
                        </div>
                    </div>
                    <div className="carousel-pane">
                        <div className="mw8">
                            <div className="b white mb3">Whatโ€™s special about working here?</div>
                            <div className="carousel-quote tp-title-1 white mb4">
                                I think itโ€™s amazing that I just said, โ€˜I want to try mobileโ€™ and
                                people were willing to make that happen.
                            </div>
                            <div className="b white mb4">
                                Heidy Hernandez Breton, Mobile Engineer
                            </div>
                            <ThemedLink
                                theme="primary"
                                size="small"
                                to="https://medium.com/life-thumbtack/get-to-know-heidy-hernandez-breton-mobile-engineer-at-thumbtack-71f909b5cb61"
                            >
                                Meet Heidy
                            </ThemedLink>
                        </div>
                    </div>
                    <div className="carousel-pane">
                        <div className="mw8">
                            <div className="b white mb3">Whatโ€™s special about working here?</div>
                            <div className="carousel-quote tp-title-1 white mb4">
                                I think itโ€™s amazing that I just said, โ€˜I want to try mobileโ€™ and
                                people were willing to make that happen.
                            </div>
                            <div className="b white mb4">
                                Heidy Hernandez Breton, Mobile Engineer
                            </div>
                            <ThemedLink
                                theme="primary"
                                size="small"
                                to="https://medium.com/life-thumbtack/get-to-know-heidy-hernandez-breton-mobile-engineer-at-thumbtack-71f909b5cb61"
                            >
                                Meet Heidy
                            </ThemedLink>
                        </div>
                    </div>
                </ThumbprintCarousel>
                <div className="carousel-nav">
                    <button
                        aria-label="Previous slide"
                        className="carousel-button carousel-nav carousel-nav-left"
                        onClick={() => {
                            this.goToSlide(selectedIndex - 1);
                        }}
                    >
                        <NavigationCaretLeftMedium className="white db" />
                    </button>
                    <button
                        aria-label="Next slide"
                        className="carousel-button carousel-nav carousel-nav-right"
                        onClick={() => {
                            this.goToSlide(selectedIndex + 1);
                        }}
                    >
                        <NavigationCaretRightMedium className="white db" />
                    </button>
                </div>
                <div className="carousel-dot-wrap">
                    <button
                        aria-label="Go to first slide"
                        className={classNames({
                            'carousel-button carousel-dot': true,
                            'is-active': mod(selectedIndex, numItems) === 0,
                        })}
                        onClick={() => {
                            this.goToSlide(0);
                        }}
                    />
                    <button
                        aria-label="Go to second slide"
                        className={classNames({
                            'carousel-button carousel-dot': true,
                            'is-active': mod(selectedIndex, numItems) === 1,
                        })}
                        onClick={() => {
                            this.goToSlide(1);
                        }}
                    />
                    <button
                        aria-label="Go to third slide"
                        className={classNames({
                            'carousel-button carousel-dot': true,
                            'is-active': mod(selectedIndex, numItems) === 2,
                        })}
                        onClick={() => {
                            this.goToSlide(2);
                        }}
                    />
                </div>
            </div>
        );
    }
}

Tooltip tests are throwing errors because of Popper

These are the errors:

(node:53668) UnhandledPromiseRejectionWarning: TypeError: document.createRange is not a function
(node:53668) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:53668) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:53668) UnhandledPromiseRejectionWarning: TypeError: document.createRange is not a function
(node:53668) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:53668) UnhandledPromiseRejectionWarning: TypeError: document.createRange is not a function
(node:53668) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)

This issue is about this: floating-ui/floating-ui#478

Adding this code made the first error message go away:

if (global.document) {
  document.createRange = () => ({
    setStart: () => {},
    setEnd: () => {},
    commonAncestorContainer: {
      nodeName: 'BODY',
      ownerDocument: document,
    },
  });
}

But then it left a console error in the test logs:

Warning: NaN is an invalid value for the left css style property.

Seems like there's no good way to fix this using a tool like Jest.

[@thumbtack/tp-ui-core-mixin]: Reconsider current values

Issue

Currently the small and large breakpoints used in our media query mixins are outputting confusing numbers :

  • $tp-breakpoint__small outputs min-width: 481px & max-width: 482px
  • $tp-breakpoint__large outputs min-width: 1025 & max-width: 1026px

when the expected values should probably be:

  • $tp-breakpoint__small outputs min-width: 480px & max-width: 481px
  • $tp-breakpoint__large outputs min-width: 1024 & max-width: 1025px

This happens because the min-width value is incremented by 1 to avoid overlap.

Fix

  • Change $tp-breakpoint__small to 480
  • Change $tp-breakpoint__large to 1024

This is a breaking change but with no anticipated changes needed by consumers. We should check for any hardcoded instances of breakpoints.

React Select dropdown color should change if disabled option is selected by default

@georgeashworth Is working on a feature where we want a "Placeholder" option to be selected at first. We can achieve that by adding disabled to an option element, BUT, the color of the select text does not change. This looks odd when used next to input fields that have placeholders:

screen shot 2018-05-30 at 3 53 11 pm

(In this screenshot, "Month" is a disabled option.)

There are three ways that I think we can approach this:

  1. Add a isDisabledOptionSelected prop that changes the color of the Select text to a lighter gray.
  2. Make the text color gray if value refers to an option that is disabled.
  3. Add a placeholder prop that, when provided, inserts a disabled option right before the children are passed.

Make it possible to pass in margin to Thumbprint React components

As @tomgenoni builds out revamped Thumbprint Utility classes and Jon K. revisits our spacing system, I think this would be a good opportunity to make it possible to add margins to our Thumbprint React components.

This has been a common pain point that folks have worked around by:

a. Adding a wrapper div.
b. Avoiding the React components and using their Sass counterparts

Proposal:

<Button u="mb2 s:ms2">
  Click Me
</Button>

The prop u (for "utility"), added to all of our React components, will allow developers to pass in a whitelisted set of utility classes.

We'd start with margin classes, potentially expanding this to support other classes that affect the space around the component.

Change Button's `secondary` theme, add `tertiary` theme

Our buttons are getting a small makeover. The secondary theme (gray text) will become tertiary. There is a new secondary theme that has blue text.


Here are the new styles:

image


Migration plan

  1. Create the tertiary theme that is exactly the same as our current secondary style. Use warning package to show that secondary is deprecated. Release as a non-breaking change. #93
  2. Write script to replace <Button theme="secondary" /> and <ThemedLink theme="secondary" /> with <Button theme="tertiary" /> and <ThemedLink theme="tertiary" />. (Started work in the daniel/codemod branch.)
  3. Perform the migration.
  4. Create Thumbprint PR to change secondary theme from the old gray to the new blue. Release as breaking change.
  5. In websites using Thumbprint, ensure no more theme="secondary" exists. Upgrade the @thumbtack/thumbprint-react package.

Create `thumbprint-global-css` package

It will contain:

  • Reset
  • <body> styles
  • <a> styles

One thing I'm unsure about is to distribute the font-face. Would be good to distribute here, but it requires setting the $thumbprint-font-url variable: https://github.com/thumbtack/thumbprint/blob/master/packages/tp-ui-core-font-face/_index.scss#L6

Is it better to distribute this as a CSS-only package that we can host on a CDN? Or should we ship it as a SCSS package that requires the variable as a config step?


We can additionally create this as a React component called <ThumbprintGlobal />. It would be used like this:

<ThumbprintGlobal fontUrl="https://example.com/">
  <header />
  <main>
    <Button />
  </main>
</ThumbprintGlobal>

fontUrl would be a required step to get Mark loaded. Button could even throw a console error if it is not used within a ThumbprintGlobal component.

Edit: An issue with this approach is that we need the reset to load first. I'm not sure that can be guaranteed if it's getting imported by ThumbprintGlobal.


cc: @tomgenoni

Move Thumbprint `README.mdx` files to the `www/src/pages` folder

The Thumbprint README.mdx files are the only ones that are not defined in www/src/pages. Instead, they are created dynamically in gatsby-node.js. This complicates our infrastructure and can be simplified now that we've fully adopted MDX.

The proposal is to move all of the README.mdx files into src/www/pages so that each page on the site is represented by a file in src/www/pages that maps to the URL.

This will allow us to delete this code:

exports.createPages = ({ actions, graphql }) => {
const { createPage } = actions;
return new Promise((resolve, reject) => {
resolve(
graphql(`
query ThumprintPages {
allComponentApi: allMdx(
filter: { frontmatter: { mdxType: { eq: "componentApi" } } }
) {
edges {
node {
frontmatter {
package
kit
url
platform
}
parent {
... on File {
absolutePath
relativeDirectory
}
}
}
}
}
# These are all of the kits. We use this to create pages for the ones that have
# design documentation.
allKits: allMdx(filter: { frontmatter: { mdxType: { eq: "kit" } } }) {
edges {
node {
frontmatter {
url
}
parent {
... on File {
relativePath
}
}
}
}
}
}
`).then(result => {
if (result.errors) {
reject(result.errors);
}
result.data.allKits.edges.forEach(({ node }) => {
const { url } = node.frontmatter;
if (url) {
createPage({
path: url,
component: path.resolve(
'./src/components/thumbprint-components/page/index.jsx',
),
context: {
// Example: `button/index.mdx`
kitPath: node.parent.relativePath,
isDesignGuidelinesPage: true,
},
});
}
});
// Create API documentation for Thumbprint components
result.data.allComponentApi.edges.forEach(({ node }) => {
const { frontmatter } = node;
createPage({
path: frontmatter.url,
component: path.resolve(
'./src/components/thumbprint-components/page/index.jsx',
),
context: {
isDesignGuidelinesPage: false,
// Example: `@thumbtack/thumbprint-react`
package: frontmatter.package,
// Example: `thumbprint-react/components/Button`
pathToReactComponentFolder:
frontmatter.platform === 'react'
? node.parent.relativeDirectory
: null,
// Example: `button/index.mdx`
kitPath: frontmatter.kit,
// Example: /components/button/react/
url: frontmatter.url,
},
});
});
return undefined;
}),
);
});
};

Remove `lazysizes` usage

Developers are getting this error in website since it forces a specific version of lazysizes that is different than Thumbprint.

โ”œโ”€โ”ฌ @thumbtack/[email protected]
โ”‚ โ””โ”€โ”€ UNMET DEPENDENCY lazysizes@^4.1.5
โ””โ”€โ”€ [email protected]

npm ERR! missing: lazysizes@^4.1.5, required by @thumbtack/[email protected]

We should:

  1. Understand why website forces a specific version. (Perhaps it's unsafe to load twice on a page?)
  2. Consider downgrading the Thumbprint version, if needed. Or upgrading the website version.

Thanks @xanderwebs for the report!

Find a better way to document "Unlisted" components

There are some "Unlisted" components such as ModalBase and UIAction that currently don't appear in the navigation. As @lavelle pointed out, it's sometimes necessary to access these components.

Instead of excluding the component from the navigation, we should include it and give it a different design treatment such a making the link light-gray, for example.

We should probably wait until the Thumbprint Guide documentation launches to do this since it includes a new visual design.

TextArea `value` prop should default to `''`, similarly to TextInput

The TextInput component sets '' as the default value for the value prop. This ensures that consumers use the component as a controlled component.

The TextArea component should do the same.

This would be a breaking change. The upgrade path is to search a codebase for TextArea and make sure that all instances of TextArea have a value prop.

`yarn start` is failing sometimes

Here's an error that @benknight got when trying to start the repo.

$ ../../scripts/should-build-package.js -- rollup -c=../../rollup.config.js
$ ../../scripts/should-build-package.js -- rollup -c=../../rollup.config.js
$ ../../scripts/should-build-package.js -- rollup -c=../../rollup.config.js
$ ../../scripts/should-build-package.js -- rollup -c=../../rollup.config.js
lerna success run Ran npm script 'prepublishOnly' in packages:
lerna success - @thumbtack/thumbprint-atomic
lerna success - @thumbtack/thumbprint-tokens
lerna success - @thumbtack/tp-ui-react-avatar
lerna success - @thumbtack/tp-ui-react-button-row
lerna success - @thumbtack/tp-ui-react-button
lerna success - @thumbtack/tp-ui-react-carousel
lerna success - @thumbtack/tp-ui-react-checkbox
lerna success - @thumbtack/tp-ui-react-date-picker
lerna success - @thumbtack/tp-ui-react-form-note
lerna success - @thumbtack/tp-ui-react-grid
lerna success - @thumbtack/tp-ui-react-input-row
lerna success - @thumbtack/tp-ui-react-input
lerna success - @thumbtack/tp-ui-react-label
lerna success - @thumbtack/tp-ui-react-link
lerna success - @thumbtack/tp-ui-react-list
lerna success - @thumbtack/tp-ui-react-loader-dots
lerna success - @thumbtack/tp-ui-react-modal-base
lerna success - @thumbtack/tp-ui-react-modal-curtain
lerna success - @thumbtack/tp-ui-react-modal-default
lerna success - @thumbtack/tp-ui-react-modal-standard
lerna success - @thumbtack/tp-ui-react-progress-bar-base
lerna success - @thumbtack/tp-ui-react-progress-bar
lerna success - @thumbtack/tp-ui-react-radio
lerna success - @thumbtack/tp-ui-react-select
lerna success - @thumbtack/tp-ui-react-service-card
lerna success - @thumbtack/tp-ui-react-star-rating
lerna success - @thumbtack/tp-ui-react-textarea
lerna success - @thumbtack/tp-ui-react-tooltip
lerna success - @thumbtack/tp-ui-react-type
lerna success - @thumbtack/tp-ui-react-ui-action
lerna success - @thumbtack/tp-ui-react-wrap

โ„น๏ธ  Need a hand? Reach out on #design-systems for help.

$ gatsby develop --port 8090
success open and validate gatsby-config โ€” 0.121 s
success load plugins โ€” 0.305 s
success onPreInit โ€” 1.048 s
success delete html and css files from previous builds โ€” 0.055 s
success initialize cache โ€” 0.006 s
success copy gatsby files โ€” 0.261 s
success onPreBootstrap โ€” 0.021 s
error Cannot read property 'children' of undefined


  TypeError: Cannot read property 'children' of undefined

  - actions.js:50 children.concat.children.map.child
    [www]/[gatsby]/dist/redux/actions.js:50:39

  - Array.map

  - actions.js:49 findChildrenRecursively
    [www]/[gatsby]/dist/redux/actions.js:49:42

  - actions.js:300 actions.deleteNode.args
    [www]/[gatsby]/dist/redux/actions.js:300:29

  - bindActionCreators.js:7
    [thumbtack-thumbprint]/[redux]/lib/bindActionCreators.js:7:35

  - source-nodes.js:74 staleNodes.forEach.node
    [www]/[gatsby]/dist/utils/source-nodes.js:74:34

  - Array.forEach

  - source-nodes.js:74
    [www]/[gatsby]/dist/utils/source-nodes.js:74:18

  - Generator.next

  - util.js:16 tryCatcher
    [thumbtack-thumbprint]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:694:18


error UNHANDLED REJECTION


  TypeError: Cannot read property 'children' of undefined

  - actions.js:50 children.concat.children.map.child
    [www]/[gatsby]/dist/redux/actions.js:50:39

  - Array.map

  - actions.js:49 findChildrenRecursively
    [www]/[gatsby]/dist/redux/actions.js:49:42

  - actions.js:300 actions.deleteNode.args
    [www]/[gatsby]/dist/redux/actions.js:300:29

  - bindActionCreators.js:7
    [thumbtack-thumbprint]/[redux]/lib/bindActionCreators.js:7:35

  - source-nodes.js:74 staleNodes.forEach.node
    [www]/[gatsby]/dist/utils/source-nodes.js:74:34

  - Array.forEach

  - source-nodes.js:74
    [www]/[gatsby]/dist/utils/source-nodes.js:74:18

  - Generator.next

  - util.js:16 tryCatcher
    [thumbtack-thumbprint]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [thumbtack-thumbprint]/[bluebird]/js/release/promise.js:694:18


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Add `elementName` to certain TUI components

Some of the TUI components are made for layout purposes with no visual UI displayed. These typically output a <div> plus whatever class. However, if you want to use a semantic sectioning element like <article>, <footer>, <header>, etc, you need to use the TUI component and your semantic element of choice, creating extra unnecessary DOM nodes.

The Body component supports the elementName prop which allows you to choose the rendered HTML element for the component. I propose that this property should be added (with a proptypes whitelist of allowed elements) to the following TUI components:

  • ButtonRow
  • Grid and Column (in a two column layout, one column could be an <article> for the main content and the other could be an <aside> for support content)
  • Wrap
  • FormNote (maybe)
  • InputRow (maybe)

Use Thumbprint icon for Select component

The comment here is no longer relevant:

{/**
Should be using Thumbprint Icons but blocked by:
https://github.com/thumbtack/thumbprint-archive/issues/687
*/}
<svg
className={styles.caret}
fill={iconColor[uiState]}
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 18 18"
data-thumbprint-id="navigation-caret-down--small"
>
<path d="M14.646 6.764L9 13 3.311 6.725a1 1 0 0 1 1.342-1.482L9 10l4.285-4.699c.2-.187.435-.301.715-.301a1 1 0 0 1 1 1c0 .306-.151.537-.354.764z" />
</svg>

This should be updated to use an icon in packages/thumbprint-react/icons.

Implement Avatar toolkit

๐ŸŽจ Designs

https://www.figma.com/file/YrpLNWoOwvEADbyFBWzuKv0V/Thumbprint-Global?node-id=2%3A0

โœ… Tasks

Renames and deprecations

  • [Breaking] Change default Avatar export to be a named UserAvatar export. The package will ultimately export two components: UserAvatar and EntityAvatar.
  • Indicate that avatar badges (hasUnreadNotifications, isChecked, and isOnline) are deprecated.

Color changes

These two can be done together and, IMO, can be released as a minor version bump.

Size changes

  • [Breaking] Change extra-large size to 140px (currently 124px).
  • [Breaking] Rename large to medium (remains 72px), medium to small, and small to xsmall.
  • Add a new large size that is 104px.

Other potential tasks

  • We use object-fit to center align the image. How can we do this in a way that works in IE 11 and doesn't sacrifice lazy-loading or accessibility? (#1328)
  • Can we use this with the image service?

[@thumbtack/tp-ui-react-button-row]: ButtonRow doesn't allow for full width buttons.

This is perhaps intentional, but filing here just in case it's not. When there are two full width buttons, I expected the component to render two 50% full buttons. Instead I got two small buttons.

<ButtonRow>
    <Button width="full" onClick={this.onClickSubmit}>
        Continue
    </Button>
    <Button width="full" onClick={onCloseClick} theme="secondary">
        Cancel
    </Button>
</ButtonRow>

Expected:
screen shot 2019-01-08 at 4 16 01 pm

Actual:
screen shot 2019-01-08 at 4 13 41 pm

cc @danoc

Remove need for reset by baking the CSS into packages

This is a proposal to remove the need for a reset package in favor of baking the CSS rules into the respective React components and tp-* classes.

How does it work?

We'd move all of the <button> code in tp-ui-core-reset into the Button React and SCSS components. Instead of using the global button selector (as the reset does), the components would come with those rules baked in.

What's wrong with resets?

The reset has a few issues:

  • It's a requirement for using our components but it can be scary to set up on an existing codebase since the global reset styles may conflict with other global styles or existing resets.
  • It has to be loaded before all of the other code. Relying on source order is dangerous and can make it scary to make changes. This is especially true if importing CSS in a JS file (via webpack) since few developers know how webpack orders the outputted CSS.
  • It means that the React and SCSS components technically have a peerDepedency on the reset. Yet they don't directly use or import the reset themselves.
  • We don't actually know how much of the reset is needed or used. Parts of it can become obsolete as browsers evolve and fix inconsistencies.

So, no resets needed ever?

Not necessarily. Websites that use Thumbprint could still use a reset or normalize if they'd like. It could be helpful for their custom components. This proposal is about "strengthening" the Thumbprint components so that:

  1. They don't have a dependency on a reset.
  2. Their styles don't get overridden by a reset, normalize, or other global CSS that exists on a site.

Migration plan:

  • Move reset rules into React components
  • Move reset rules into SCSS components
  • Remove reset from Thumbtack codebases (with a lot of manual QA).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.