Files
supabase/apps/studio/components/ui/Charts/Charts.constants.ts
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00

53 lines
1.3 KiB
TypeScript

// Just extracting the color configuration to a single file so that it's easier to observe
// Needs better naming to be honest, but just to get things going
// For ChartHandler
export const CHART_COLORS = {
TICK: 'hsl(var(--background-overlay-hover))',
AXIS: 'hsl(var(--background-overlay-hover))',
GREEN_1: 'hsl(var(--brand-default))', // #3ECF8E
GREEN_2: 'hsl(var(--brand-500))',
}
// refer to packages/ui/radix-colors.js for full list of colors
export type ValidStackColor =
| 'brand'
| 'blue'
| 'red'
| 'yellow'
| 'green'
| 'slate'
| 'indigo'
| 'tomato'
| 'orange'
| 'amber'
export const genStackColorScales = (colors: ValidStackColor[]) =>
colors.map((color) => {
// override default base scale for certain colors that do not have good contrast
const scale =
(
{
slate: 11,
} as any
)[color] ?? 9
return {
lighter: `var(--colors-${color}${(scale as number) - 1})`,
base: `var(--colors-${color}${scale})`,
darker: `var(--colors-${color}${(scale as number) + 1})`,
}
})
export const DEFAULT_STACK_COLORS: ValidStackColor[] = [
'brand',
'slate',
'blue',
'yellow',
'indigo',
]
export enum DateTimeFormats {
FULL = 'MMM D, YYYY, hh:mma',
DATE_ONLY = 'MMM D, YYYY',
}