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: [FX-4259] add new spacing values to picasso #3835

Merged
merged 6 commits into from
Sep 1, 2023

Conversation

dmaklygin
Copy link
Contributor

@dmaklygin dmaklygin commented Aug 30, 2023

FX-4259

Description

Add new spacing values to Picasso, described in BASE.

RFC: https://github.com/toptal/picasso/blob/master/docs/decisions/18-spacings.md#technical-details

  • BASE spacings are exported according to RFC
  • BASE spacings are exported via theme, so they can be used in custom styles

How to test

  • Use temploy to play with SPACING variables

Example:

import { SPACING_4, SPACING_6 } from '@toptal/picasso/utils'

const Example = () => (
  <div>
    <Container bottom={SPACING_6}>Some text</Container>
    <Container left={SPACING_4}>Some more text with a small margin</Container>
  </div>
)

Example of new spacings variable coming from the theme:

export default ({ palette, sizes: { borderRadius }, spacings: { SPACING_6 } }: Theme) => {
  ...

}

Development checks

  • Add changeset according to guidelines (if needed)
  • Make sure that additions and changes on the design follow Toptal's BASE design, and it's been already discussed with designers at #-base-core
  • Ensure that deployed demo has expected results and good examples
  • Self reviewed

All development checks should be done and set checked to pass the
GitHub Bot: TODOLess action

PR commands

List of available commands:

  • @toptal-bot run package:alpha-release - Release alpha version
  • @toptal-anvil ping reviewers - Ping FX team for review
PR Review Guidelines

When to approve? ✅

You are OK with merging this PR and

  1. You have no extra requests.
  2. You have optional requests.
    1. Add nit: to your comment. (ex. nit: I'd rename this variable from makeCircle to getCircle)

When to request changes? ❌

You are not OK with merging this PR because

  1. Something is broken after the changes.
  2. Acceptance criteria is not reached.
  3. Code is dirty.

When to comment (neither ✅ nor ❌)

You want your comments to be addressed before merging this PR in cases like:

  1. There are leftovers like unnecessary logs, comments, etc.
  2. You have an opinionated comment regarding the code that requires a discussion.
  3. You have questions.

How to handle the comments?

  1. An owner of a comment is the only one who can resolve it.
  2. An owner of a comment must resolve it when it's addressed.
  3. A PR owner must reply with ✅ when a comment is addressed.

@dmaklygin dmaklygin self-assigned this Aug 30, 2023
@dmaklygin dmaklygin requested a review from a team as a code owner August 30, 2023 11:16
@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

🦋 Changeset detected

Latest commit: 3287cab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@toptal/picasso-provider Minor
@toptal/picasso Minor
@toptal/picasso-shared Minor

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

@dmaklygin
Copy link
Contributor Author

@toptal-bot run package:alpha-release

@toptal-devbot
Copy link
Collaborator

Your alpha package is ready 🎉
yarn add @topkit/analytics-charts@48.0.1-alpha-fx-4259-expose-base-spacing-3d286df9c.88+3d286df9c
yarn add @toptal/[email protected]+3d286df9c
yarn add @toptal/picasso-charts@51.0.1-alpha-fx-4259-expose-base-spacing-3d286df9c.88+3d286df9c
yarn add @toptal/picasso-codemod@5.5.3-alpha-fx-4259-expose-base-spacing-3d286df9c.99+3d286df9c
yarn add @toptal/picasso-forms@60.1.1-alpha-fx-4259-expose-base-spacing-3d286df9c.6+3d286df9c
yarn add @toptal/picasso-pictograms@1.1.2-alpha-fx-4259-expose-base-spacing-3d286df9c.174+3d286df9c
yarn add @toptal/picasso-provider@3.1.4-alpha-fx-4259-expose-base-spacing-3d286df9c.24+3d286df9c
yarn add @toptal/picasso-rich-text-editor@5.0.4-alpha-fx-4259-expose-base-spacing-3d286df9c.0+3d286df9c
yarn add @toptal/picasso-shared@12.0.1-alpha-fx-4259-expose-base-spacing-3d286df9c.219+3d286df9c

@toptal-devbot toptal-devbot temporarily deployed to staging August 30, 2023 11:29 Inactive
@dmaklygin
Copy link
Contributor Author

@toptal-anvil ping reviewers

@dmaklygin dmaklygin changed the base branch from master to feature/base-spacing August 30, 2023 12:09
@toptal-devbot toptal-devbot temporarily deployed to staging August 30, 2023 12:59 Inactive
@sashuk sashuk requested a review from a team August 30, 2023 15:24
Copy link
Member

@augustobmoura augustobmoura left a comment

Choose a reason for hiding this comment

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

The implementation should work, but I still think we are leaking too much information for users as of now. The intention of using classes is to prevent users from depending on the values directly, so we should keep the design of the API as poka-yoke as possible

packages/picasso-provider/src/Picasso/config/spacings.ts Outdated Show resolved Hide resolved
packages/picasso-provider/src/Picasso/config/spacings.ts Outdated Show resolved Hide resolved
packages/picasso-provider/src/Picasso/config/spacings.ts Outdated Show resolved Hide resolved
packages/picasso-provider/src/Picasso/config/spacings.ts Outdated Show resolved Hide resolved
packages/picasso-provider/src/Picasso/config/spacings.ts Outdated Show resolved Hide resolved
packages/picasso-provider/src/Picasso/utils/spacings.ts Outdated Show resolved Hide resolved
packages/picasso/src/Container/Container.tsx Show resolved Hide resolved
packages/picasso/src/utils/index.ts Outdated Show resolved Hide resolved
@toptal-devbot toptal-devbot temporarily deployed to staging August 31, 2023 15:48 Inactive
@dmaklygin
Copy link
Contributor Author

@toptal-anvil ping reviewers

Copy link
Contributor

@sashuk sashuk left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you for extending theme as well

@toptal-devbot toptal-devbot temporarily deployed to staging August 31, 2023 20:37 Inactive
Copy link
Member

@augustobmoura augustobmoura left a comment

Choose a reason for hiding this comment

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

LGTM!

@toptal-devbot toptal-devbot temporarily deployed to staging September 1, 2023 07:53 Inactive
@dmaklygin dmaklygin merged commit 40cf234 into feature/base-spacing Sep 1, 2023
14 checks passed
@dmaklygin dmaklygin deleted the fx-4259-expose-base-spacing branch September 1, 2023 07:56
sashuk pushed a commit that referenced this pull request Sep 20, 2023
* feat: add new spacing values to picasso

* chore: enhance spacings

* chore: update spacings

* chore: add unit tests for spacings

* chore: update changeset

* chore: fix story
sashuk pushed a commit that referenced this pull request Sep 22, 2023
* feat: add new spacing values to picasso

* chore: enhance spacings

* chore: update spacings

* chore: add unit tests for spacings

* chore: update changeset

* chore: fix story
sashuk pushed a commit that referenced this pull request Sep 25, 2023
* feat: add new spacing values to picasso

* chore: enhance spacings

* chore: update spacings

* chore: add unit tests for spacings

* chore: update changeset

* chore: fix story
sashuk pushed a commit that referenced this pull request Sep 25, 2023
* feat: add new spacing values to picasso

* chore: enhance spacings

* chore: update spacings

* chore: add unit tests for spacings

* chore: update changeset

* chore: fix story
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.

4 participants