initializeGlobalComponentStyles.ts 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 { initializeBadgeClasses } from '#shared/initializer/initializeBadgeClasses.ts'
  6. import { initializeFilePreviewClasses } from '#shared/initializer/initializeFilePreviewClasses.ts'
  7. import { initializeLinkClasses } from '#shared/initializer/initializeLinkClasses.ts'
  8. import { initializeNotificationClasses } from '#shared/initializer/initializeNotificationClasses.ts'
  9. import { initializeOrganizationAvatarClasses } from '#shared/initializer/initializeOrganizationAvatarClasses.ts'
  10. import { initializePopoverClasses } from '#shared/initializer/initializePopover.ts'
  11. import { initializeUserAvatarClasses } from '#shared/initializer/initializeUserAvatarClasses.ts'
  12. export const initializeGlobalComponentStyles = () => {
  13. initializeBadgeClasses({
  14. base: '-:inline-flex justify-center items-center border-0',
  15. success:
  16. 'bg-green-300 text-green-500 dark:bg-green-900 dark:text-green-500',
  17. info: 'bg-blue-500 text-blue-800 dark:bg-blue-950 dark:text-blue-800',
  18. tertiary:
  19. 'bg-blue-200 text-stone-200 dark:bg-gray-700 dark:text-neutral-500',
  20. warning:
  21. 'bg-yellow-50 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-600',
  22. danger: 'bg-pink-100 text-red-500 dark:bg-red-900 dark:text-red-500',
  23. neutral:
  24. 'text-gray-100 bg-neutral-50 dark:text-neutral-400 dark:bg-gray-500',
  25. custom: 'badge-custom',
  26. })
  27. initializeAlertClasses({
  28. base: 'grid gap-1.5 text-center md:text-start text-sm items-start justify-center md:justify-start grid-flow-row md:grid-flow-col md:grid-cols-[auto_minmax(auto,_1fr)] w-full md:w-auto',
  29. success: 'bg-green-300 dark:bg-green-900 text-green-500',
  30. info: 'bg-blue-500 dark:bg-blue-950 text-blue-800',
  31. warning: 'bg-yellow-50 dark:bg-yellow-900 text-yellow-600',
  32. danger: 'bg-pink-100 dark:bg-red-900 text-red-500',
  33. })
  34. initializeAvatarClasses({
  35. base: 'border -:border-neutral-100 dark:-:border-gray-900 text-black',
  36. vipOrganization: 'text-neutral-400',
  37. vipUser: 'text-yellow-300',
  38. })
  39. initializeUserAvatarClasses({
  40. backgroundColors: [
  41. 'bg-neutral-500',
  42. 'bg-red-500',
  43. 'bg-yellow-300',
  44. 'bg-blue-700',
  45. 'bg-green-500',
  46. 'bg-pink-300',
  47. 'bg-yellow-600',
  48. ],
  49. })
  50. initializeOrganizationAvatarClasses({
  51. base: 'bg-green-100 dark:bg-gray-200 text-stone-200 dark:text-gray-700',
  52. inactive: 'opacity-30',
  53. })
  54. initializeLinkClasses({
  55. base: 'cursor-pointer no-underline hover:underline text-blue-800 focus-visible:rounded-sm focus-visible:outline-1 focus-visible:outline-none focus-visible:outline-offset-1 focus-visible:outline-blue-800',
  56. })
  57. initializeNotificationClasses({
  58. 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',
  59. baseContainer: 'mx-auto',
  60. error: 'bg-pink-100 dark:bg-red-900 text-red-500',
  61. info: 'bg-blue-500 dark:bg-blue-950 text-blue-800',
  62. message: '',
  63. success: 'bg-green-300 dark:bg-green-900 text-green-500',
  64. warn: 'bg-yellow-50 dark:bg-yellow-900 text-yellow-600',
  65. })
  66. initializePopoverClasses({
  67. base: 'min-h-9 rounded-xl border border-neutral-100 bg-neutral-50 antialiased dark:border-gray-900 dark:bg-gray-500',
  68. arrow:
  69. 'h-[22px] w-[22px] border border-neutral-100 bg-neutral-50 dark:border-gray-900 dark:bg-gray-500',
  70. })
  71. initializeEditorColorMenuClasses({
  72. colorSchemeList: {
  73. base: 'border-b border-stone-200 dark:border-neutral-500 pb-1',
  74. button: 'p-2',
  75. },
  76. })
  77. initializeFilePreviewClasses({
  78. base: 'dark:text-white text-black text-sm leading-snug',
  79. wrapper: 'p-2.5',
  80. preview:
  81. 'hover:outline hover:outline-1 hover:outline-offset-1 hover:outline-blue-600 focus:outline-none focus:outline-0 focus:outline-offset-0 focus:hover:outline-1 focus:hover:outline-offset-1 focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-blue-800 dark:hover:outline-blue-900',
  82. link: 'hover:rounded-sm hover:no-underline hover:outline-1 hover:outline-offset-1 hover:outline-blue-600 dark:hover:outline-blue-900',
  83. size: '-:dark:text-neutral-500 -:text-stone-400 text-xs leading-snug',
  84. icon: '-:dark:text-neutral-500 -:text-stone-400',
  85. })
  86. }