patternfly / patternfly-elements

PatternFly Elements. A set of community-created web components based on PatternFly design.
https://patternflyelements.org/
MIT License
377 stars 91 forks source link

pf-text-input property validated missing options #2818

Open yaacov opened 1 month ago

yaacov commented 1 month ago

Component name: pf-text-input

property validated missing options

Design specification updates

Elements allow:

/**
   * Value to indicate if the input is modified to show that validation state.
   * If set to success, input will be modified to indicate valid state.
   * If set to warning,  input will be modified to indicate warning state.
   * Invalid inputs will display an error state
   */
  @property({ reflect: true }) validated?: 'success' | 'warning';

Ref: https://github.com/patternfly/patternfly-elements/blob/main/elements/pf-text-input/pf-text-input.ts#L160

React 4 allow:

/** Variant styling of the helper text item. */
 variant?: 'default' | 'indeterminate' | 'warning' | 'success' | 'error';

Ref: https://github.com/patternfly/patternfly-react/blob/v4/packages/react-core/src/components/TextInput/TextInput.tsx#L44

bennypowers commented 1 month ago

some context: previously we determined that the built-in :invalid pseudo selector should be prefered, but developer feedback has shown that adding a pattern regex is not desired or ergonomic in all cases where error state should be presented, so this is an acceptable criteria.

@yaacov you're welcome to grab this one, and thank you for the issue :)