operational-ui icon indicating copy to clipboard operation
operational-ui copied to clipboard

Icon instance vs class in Input component.

Open ImogenF opened this issue 5 years ago • 5 comments

At the moment, there are 2 Input props concerning icons: statusIcon and placeholderIcon.

statusIcon is passed in as an icon instance, so that the user has more control over styling. placeholderIcon is currently the same, for consistency within the component, but it would make more sense for its size, colour etc. to be fixed.

The proposal is to remove statusIcon entirely from Input (Input already has too many options, and the user could just position an icon next to the input) and change placeholderIcon to a React component (type: IconComponentType).

ImogenF avatar Jun 21 '19 08:06 ImogenF

As well I would throw ID fields into the discussion. Do we really need them in library? Can't they be crafted in user land instead?

stereobooster avatar Jun 21 '19 09:06 stereobooster

We're using it across the product in quite a few places. Might be nice to have it in the library then.

micha-f avatar Jun 21 '19 09:06 micha-f

In that case maybe we could have ID fields as a separate component that extends Input, rather than having an isUniqueId prop on the Input component.

ImogenF avatar Jun 21 '19 09:06 ImogenF

As well I would throw ID fields into the discussion. Do we really need them in library? Can't they be crafted in user land instead?

AFAIK, ID fields are optional props that are crafted in userland, but filled in for a11y if users omit them.

https://github.com/contiamo/operational-ui/blob/04839de96951539912661b54d6ea8653a3f610af/src/Input/Input.tsx#L95

Passing an argument to useUniqueId just uses whatever it's given (from userland) instead of generating one. I don't see your point, @stereobooster.

In that case maybe we could have ID fields as a separate component that extends Input, rather than having an isUniqueId prop on the Input component.

I like this. A new UniqueInput component or similar that's a thin wrapper around Input. 👌

TejasQ avatar Jun 21 '19 16:06 TejasQ

image

I mean those

stereobooster avatar Jun 21 '19 16:06 stereobooster