initializeGlobalComponentStyles.ts 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { initializeAlertClasses } from '#shared/initializer/initializeAlertClasses.ts'
  3. import { initializeAvatarClasses } from '#shared/initializer/initializeAvatarClasses.ts'
  4. import { initializeBadgeClasses } from '#shared/initializer/initializeBadgeClasses.ts'
  5. import { initializeLinkClasses } from '#shared/initializer/initializeLinkClasses.ts'
  6. import { initializeNotificationClasses } from '#shared/initializer/initializeNotificationClasses.ts'
  7. import { initializeOrganizationAvatarClasses } from '#shared/initializer/initializeOrganizationAvatarClasses.ts'
  8. import { initializeUserAvatarClasses } from '#shared/initializer/initializeUserAvatarClasses.ts'
  9. export const initializeGlobalComponentStyles = () => {
  10. initializeBadgeClasses({
  11. base: '-:inline-flex justify-center items-center border-0',
  12. success:
  13. 'bg-green-300 text-green-500 dark:bg-green-900 dark:text-green-500',
  14. info: 'bg-blue-500 text-blue-800 dark:bg-blue-950 dark:text-blue-800',
  15. warning:
  16. 'bg-yellow-50 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-600',
  17. danger: 'bg-pink-100 text-red-500 dark:bg-red-900 dark:text-red-500',
  18. neutral: 'text-gray-100 bg-white dark:text-neutral-400 dark:bg-gray-500',
  19. custom: 'badge-custom',
  20. })
  21. initializeAlertClasses({
  22. base: 'grid gap-1.5 text-center md:text-start text-sm items-center justify-center md:justify-start grid-flow-row md:grid-flow-col md:grid-cols-[auto_minmax(auto,_1fr)] w-full md:w-auto',
  23. success: 'bg-green-300 dark:bg-green-900 text-green-500',
  24. info: 'bg-blue-500 dark:bg-blue-950 text-blue-800',
  25. warning: 'bg-yellow-50 dark:bg-yellow-900 text-yellow-600',
  26. danger: 'bg-pink-100 dark:bg-red-900 text-red-500',
  27. link: 'hover:underline',
  28. })
  29. // TODO: check correct classes
  30. initializeAvatarClasses({
  31. base: 'border -:border-neutral-100 dark:-:border-gray-900 text-black',
  32. vipOrganization: 'text-neutral-400',
  33. vipUser: 'text-yellow-300',
  34. })
  35. initializeUserAvatarClasses({
  36. backgroundColors: [
  37. 'bg-neutral-500',
  38. 'bg-red-500',
  39. 'bg-yellow-300',
  40. 'bg-blue-700',
  41. 'bg-green-500',
  42. 'bg-pink-300',
  43. 'bg-yellow-600',
  44. ],
  45. })
  46. initializeOrganizationAvatarClasses({
  47. base: 'bg-green-100 dark:bg-gray-200 text-stone-200 dark:text-gray-700',
  48. inactive: 'opacity-30',
  49. })
  50. initializeLinkClasses({
  51. base: 'link link-hover text-blue-800 focus-visible:rounded-sm focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-blue-800',
  52. })
  53. initializeNotificationClasses({
  54. base: 'grid gap-1.5 text-center md:text-start text-sm items-center justify-center md:justify-start grid-flow-row md:grid-flow-col md:grid-cols-[auto_minmax(auto,_1fr)] w-full rounded-lg p-2 border-transparent',
  55. baseContainer: 'mx-auto',
  56. error: 'bg-pink-100 dark:bg-red-900 text-red-500',
  57. info: 'bg-blue-500 dark:bg-blue-950 text-blue-800',
  58. message: '',
  59. success: 'bg-green-300 dark:bg-green-900 text-green-500',
  60. warn: 'bg-yellow-50 dark:bg-yellow-900 text-yellow-600',
  61. })
  62. }