Website for showcasing all features of Tesseract Web.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

philosophy.md 4.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Tesseract Web
  2. ## Rationale
  3. - Every component library makes their own conventions of component organization
  4. - Graceful degradation through backwards compatibility with HTML controls is not the main focus
  5. - In return, aspects such as accessibility may suffer since HTML controls are generally compliant to accessibility
  6. considerations suggested by approved standards
  7. - Emerging Web applications are at risk of deviating through said standards which can fragment the Web platform
  8. implementation
  9. - Hopefully we can inspire component development through the component organization we are proposing;
  10. everyone can have their own implementations
  11. - cf. Authoring (publishing interfaces) vs Dependency (coercing consumers to adapt to concrete implementations)
  12. ## Ground Rules
  13. - Each component is an enhanced version of an HTML control (see [HTML enhancement](#html-enhancement))
  14. - Each component should only do one thing and one thing only in terms of purpose and appearance (contrast to HTML's
  15. `<input>` where its function is overloaded depending on its `type` attribute)
  16. - Each component has decoupled styling, wherein each styling has their own API
  17. - This styling API is then made cross-framework compatible
  18. - This styling API allows use of dynamic styles (which then requires CSS-in-JS way of application)
  19. ## HTML enhancement
  20. | HTML element | Tesseract counterpart | Remarks |
  21. |----------------------------------------------------------------------------|-------------------------------|-----------------------------------------------------------------------|
  22. | `<button>` | `action/ActionButton` | |
  23. | `<input type="button">` | `action/ActionButton` | |
  24. | `<input type="reset">` | `action/ActionButton` | |
  25. | `<input type="submit">` | `action/ActionButton` | |
  26. | `<textarea>` | `freeform/MultilineTextInput` | |
  27. | `<input type="text">` | `freeform/TextInput` | |
  28. | `<input type="search">` | `freeform/TextInput` | |
  29. | `<input type="password">` | `freeform/MaskedTextInput` | |
  30. | `<a>` with button appearance | `navigation/LinkButton` | |
  31. | `<select>` without `multiple` attribute | `option/DropdownSelect` | |
  32. | `<input type="checkbox">` with `indeterminate` state | `option/ToggleTickBox` | |
  33. | `<input type="checkbox">` with `indeterminate` state and button appearance | `option/ToggleButton` | |
  34. | `<input type="checkbox">` without `indeterminate` state | `option/ToggleSwitch` | Prefer using this component when indeterminate state is not expected. |
  35. | `<input type="radio">` | `option/RadioTickBox` | |
  36. | `<input type="radio">` with button appearance | `option/RadioButton` | |
  37. | `<input type="number">` | `number/Spinner` | Use this component for discrete values. |
  38. | `<input type="range">` | `number/Slider` | Use this component for continuous values. |