You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.1KB

  1. export const semanticStatusColors = {
  2. success: '#2E7D32',
  3. warning: '#B45309',
  4. error: '#B91C1C',
  5. info: '#2563EB',
  6. overdue: '#7F1D1D',
  7. secondary: '#0F766E',
  8. } as const
  9. export const workspaceThemeTokens = {
  10. colorPrimary: '#1F4E79',
  11. colorSuccess: semanticStatusColors.success,
  12. colorWarning: semanticStatusColors.warning,
  13. colorError: semanticStatusColors.error,
  14. colorInfo: semanticStatusColors.info,
  15. colorBgBase: '#F7F9FC',
  16. colorText: '#111827',
  17. colorTextSecondary: '#4B5563',
  18. colorBorder: '#D0D7E2',
  19. borderRadius: 4,
  20. fontFamily: 'Public Sans, Segoe UI, Arial, sans-serif',
  21. fontSize: 14,
  22. controlHeight: 28,
  23. } as const
  24. export const workspaceDensityProfile = {
  25. compact: true,
  26. controlHeight: workspaceThemeTokens.controlHeight,
  27. baseUnit: 8,
  28. } as const
  29. export type WorkspaceViewportMode =
  30. | 'read-reduced'
  31. | 'compact-tri-pane'
  32. | 'full-tri-pane'
  33. export type WorkspaceStatus =
  34. | 'onTrack'
  35. | 'atRisk'
  36. | 'blocked'
  37. | 'inProgress'
  38. | 'overdue'
  39. export const statusDefinitions: Record<
  40. WorkspaceStatus,
  41. { color: string; label: string; iconLabel: string }
  42. > = {
  43. onTrack: {
  44. color: semanticStatusColors.success,
  45. label: 'On track',
  46. iconLabel: 'Success status',
  47. },
  48. atRisk: {
  49. color: semanticStatusColors.warning,
  50. label: 'At risk',
  51. iconLabel: 'Warning status',
  52. },
  53. blocked: {
  54. color: semanticStatusColors.error,
  55. label: 'Blocked',
  56. iconLabel: 'Blocked status',
  57. },
  58. inProgress: {
  59. color: semanticStatusColors.info,
  60. label: 'In progress',
  61. iconLabel: 'Progress status',
  62. },
  63. overdue: {
  64. color: semanticStatusColors.overdue,
  65. label: 'Overdue',
  66. iconLabel: 'Critical overdue status',
  67. },
  68. }
  69. export function getWorkspaceViewportMode(width: number): WorkspaceViewportMode {
  70. if (width < 1280) {
  71. return 'read-reduced'
  72. }
  73. if (width < 1600) {
  74. return 'compact-tri-pane'
  75. }
  76. return 'full-tri-pane'
  77. }
  78. export function isEditingAvailable(width: number) {
  79. return getWorkspaceViewportMode(width) !== 'read-reduced'
  80. }
  81. export function isRightPanelCollapsible(width: number) {
  82. return getWorkspaceViewportMode(width) === 'compact-tri-pane'
  83. }

Powered by TurnKey Linux.