index.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { FormThemeClasses } from '#shared/types/form.ts'
  3. const defaultTextInput: Record<string, string> = {
  4. input: 'block focus:outline-none focus:ring-0',
  5. }
  6. const classes: FormThemeClasses = {
  7. global: {
  8. wrapper: 'formkit-disabled:opacity-30',
  9. label: 'formkit-label-hidden:sr-only',
  10. help: 'text-xs',
  11. messages: 'list-none',
  12. message: 'text-xs',
  13. },
  14. text: defaultTextInput,
  15. email: defaultTextInput,
  16. url: defaultTextInput,
  17. number: defaultTextInput,
  18. search: defaultTextInput,
  19. tel: defaultTextInput,
  20. time: defaultTextInput,
  21. date: defaultTextInput,
  22. datetime: defaultTextInput,
  23. textarea: defaultTextInput,
  24. password: defaultTextInput,
  25. checkbox: {
  26. wrapper: 'inline-flex items-center cursor-pointer',
  27. inner: 'flex',
  28. input:
  29. 'appearance-none focus:outline-none focus:ring-0 focus:ring-offset-0',
  30. decorator:
  31. 'relative invisible formkit-is-checked:visible rtl:-right-4 ltr:-left-4',
  32. decoratorIcon: 'absolute',
  33. },
  34. radio: {
  35. wrapper: 'inline-flex items-center cursor-pointer',
  36. inner: 'flex',
  37. input:
  38. 'appearance-none focus:outline-none focus:ring-0 focus:ring-offset-0',
  39. decorator:
  40. 'relative invisible formkit-is-checked:visible rtl:-right-4 ltr:-left-4',
  41. decoratorIcon: 'absolute',
  42. },
  43. button: {
  44. input: 'flex justify-center items-center',
  45. },
  46. submit: {
  47. input: 'flex justify-center items-center',
  48. },
  49. }
  50. export default classes