initializeGlobalComponentStyles.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { initializeEditorColorMenuClasses } from '#shared/components/Form/fields/FieldEditor/FieldEditorColorMenu/initializeEditorColorMenu.ts'
  3. import { initializeAlertClasses } from '#shared/initializer/initializeAlertClasses.ts'
  4. import { initializeAvatarClasses } from '#shared/initializer/initializeAvatarClasses.ts'
  5. import { initializeFilePreviewClasses } from '#shared/initializer/initializeFilePreviewClasses.ts'
  6. import { initializeLinkClasses } from '#shared/initializer/initializeLinkClasses.ts'
  7. import { initializeNotificationClasses } from '#shared/initializer/initializeNotificationClasses.ts'
  8. import { initializeOrganizationAvatarClasses } from '#shared/initializer/initializeOrganizationAvatarClasses.ts'
  9. import { initializePopoverClasses } from '#shared/initializer/initializePopover.ts'
  10. import { initializeUserAvatarClasses } from '#shared/initializer/initializeUserAvatarClasses.ts'
  11. export const initializeGlobalComponentStyles = () => {
  12. initializeLinkClasses({
  13. base: '',
  14. })
  15. initializeAlertClasses({
  16. base: 'grid w-full content-start items-center justify-items-center text-center grid-flow-col grid-cols-[auto_minmax(auto,1fr)] justify-items-start text-start border w-auto text-sm',
  17. success: 'alert-success bg-green text-white',
  18. info: 'alert-info bg-white text-black',
  19. warning: 'alert-warning bg-yellow text-black',
  20. danger: 'alert-error bg-red/60 text-white',
  21. })
  22. initializeAvatarClasses({
  23. base: 'text-black',
  24. vipUser: 'text-yellow',
  25. vipOrganization: 'text-gray-100',
  26. })
  27. initializeUserAvatarClasses({
  28. backgroundColors: [
  29. 'bg-gray',
  30. 'bg-red-bright',
  31. 'bg-yellow',
  32. 'bg-blue',
  33. 'bg-green',
  34. 'bg-pink',
  35. 'bg-orange',
  36. ],
  37. })
  38. initializeOrganizationAvatarClasses({
  39. base: 'bg-gray-200 text-black',
  40. inactive: 'opacity-30',
  41. })
  42. initializeNotificationClasses({
  43. base: 'rounded px-4 py-2',
  44. baseContainer: 'ltr:right-0 rtl:left-0',
  45. error: 'bg-red/60 text-white',
  46. info: 'bg-white text-black',
  47. message: 'ltr:ml-2 rtl:mr-2',
  48. success: 'bg-green text-white',
  49. warn: 'bg-yellow text-black',
  50. })
  51. initializePopoverClasses({
  52. base: 'min-h-9 rounded-xl max-w-[calc(100vw-8px)] text-white top-0 border border-gray-500 bg-gray-400 antialiased rtl:right-1/2 ltr:left-1/2 rtl:translate-x-1/2 ltr:-translate-x-1/2',
  53. arrow: 'hidden',
  54. })
  55. initializeEditorColorMenuClasses({
  56. colorSchemeList: {
  57. base: 'border-b pb-1',
  58. button: 'p-4',
  59. },
  60. })
  61. // Initialize editor classes
  62. // :TODO Sub Folder
  63. initializeFilePreviewClasses({
  64. base: 'leading-4',
  65. wrapper:
  66. 'focus-within:bg-blue-highlight mb-2 gap-2 rounded-2xl border p-3 outline-none last:mb-0 -:border-gray-300',
  67. preview: '',
  68. link: '',
  69. size: '-:text-white/80',
  70. icon: '-:border-gray-300',
  71. })
  72. }