Coder Social home page Coder Social logo

Create <Text /> component about orbit HOT 10 CLOSED

kiwicom avatar kiwicom commented on May 15, 2024
Create component

from orbit.

Comments (10)

fallion avatar fallion commented on May 15, 2024 3

The issue is that it gets pretty long and it's extra typing that will not be necessary half the time.

Example:
import { OrbitButton, OrbitTypography, OrbitInput, OrbitTable } from '@kiwicom/orbit-components'

from orbit.

fallion avatar fallion commented on May 15, 2024 1

I would check with the devs whether they run into this issue or not, because if they are then the team leads should solve this knowledge issue.

from orbit.

FilipMessa avatar FilipMessa commented on May 15, 2024 1

I don't like this prefix, always when I I need to know which component is from where I can just look on the import. It is unnecessary verbose

from orbit.

git-toni avatar git-toni commented on May 15, 2024

We've got Typography, should we rename it to Text?

from orbit.

honzatmn avatar honzatmn commented on May 15, 2024

Yes, if it's possible. It will be synced not only with Orbit UI for Sketch but mostly with names of design tokens (colorTextPrimary, colorTextSecondary, etc.) If I am not mistaken, now Typography covers all texts from body texts and headlines to any other text you can imagine.

I explained why we should have this separated in the original Dropbox Paper document, I am copying it here too:

Why have a specific component for text and a second one for the heading?
Because in the design system, they both have a totally different purpose (and as you can see in specifications, also very different possibilities of configuration).

Also, in the code, reading will be much easier, for example:

<Heading Element=”h1” Size=”Size 1”>Very important heading</Heading>
​​<Text>Loooong paragraphs of text</Text>
​​<Text>Another loooong paragraphs of text</Text>
​​<Heading Element=”h2” Size=”Size 2”>Not so important header</Heading>
​​<Text>Just another paragraph of text</Text>

Hope it make sense :)

from orbit.

honzatmn avatar honzatmn commented on May 15, 2024

Actually, I was thinking if we shouldn't have all the Orbit components prefixed with "Orbit", e.g. <OrbitText />, <OrbitHeadline />, <OrbitTable />, <OrbitWhatever />. If we do it, it will be totally clear which components in the code are from design system and which are specific for every project. It also probably solve the issue with component from old Kiwi repo and new from Orbit repo (not sure if that's even issue though).

What do you think about it? @jaroslav-kubicek @michalsanger @fallion @infi-pc

from orbit.

michalsanger avatar michalsanger commented on May 15, 2024

Does other component libraries have naming like this?

from orbit.

fallion avatar fallion commented on May 15, 2024

Developers know (or should know/ can ask their team leads) how to rename imports when using them in code.

I don't think it's a good practice to prefix stuff like this. You can already see it on the import level where the components are coming from.

Example:
import { Input } from 'frontendcomponents'
import { Input as OrbitInput } from '@kiwicom/orbit-components'

What the alternative would look like for everything else:
import { OrbitInput } from '@kiwicom/orbit-components'

I can't think of any library that does this.

from orbit.

honzatmn avatar honzatmn commented on May 15, 2024

Not majority but there are few, yes. For example Skyscanner with "Bpk" (Backpack) or Hubsport prefixes UI for every component. Others, that have component libraries based on SASS, prefix their classes with something (Salesforce with "slds", etc.)

My idea behind it was to make clear what's from Orbit and what's not. @fallion's example is solving this issue too, we just need to tell devs to rename imports when importing something. I believe that this can really help to have better clarity.

from orbit.

git-toni avatar git-toni commented on May 15, 2024

@jaroslav-kubicek Any final decision on this?

from orbit.

Related Issues (20)

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.