Skip to content

Commit

Permalink
chore(shared-types,ui-themes): rename datavizualization to camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrTopi committed Aug 16, 2024
1 parent 6c3755e commit af6e433
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 56 deletions.
49 changes: 49 additions & 0 deletions docs/guides/color-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Color System
category: Guides
order: 5
---

### Colors

Colors are divided into two main technical groups: primitive and semantic colors. Primitive colors store the pure hex values. The primitive colors are the building blocks of the semantic colors. Examples of semantic colors: ui, contrasts, dataVisualization.

### Primitives

These are here for reference only, usually not needed for InstUI development. Available from the themes and from `@instructure/ui-themes`

```jsx
---
type: example
---
<ThemeColors colors={canvas.colors.primitives} label="Color palette (Primitive colors)"></ThemeColors>
```

### Additional Primitives

These are here for reference only, usually not needed for InstUI development. Available from `@instructure/ui-themes`

```jsx
---
type: example
---
<ThemeColors colors={additionalPrimitives} label="Additional Primitive colors"></ThemeColors>
```

### Data visualization

The color names show their hue value and their contrast value on a white background. They don't tell how to use them or for what data they can be applied to. Each hue has 4 primary and 5 secondary colors.

- The data visualization color palette is for data representation only. Like graphs, chars and plots.
- These are solid colors and can not be used for creating gradients.
- First you have to use all 4 of the primary colors of a hue, then you can use the 5 secondary ones.
- Use them on a white background

Available from `@instructure/ui-themes`

```jsx
---
type: example
---
<ColorTable colors={dataVisualization} colorNames={additionalPrimitives}></ColorTable>
```
40 changes: 0 additions & 40 deletions docs/guides/colors.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/__docs__/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import ThemeColors from './src/ThemeColors'
// eslint-disable-next-line no-restricted-imports
import ColorTable from './src/ColorTable'

import { additionalPrimitives, datavisualization } from '@instructure/ui-themes'
import { additionalPrimitives, dataVisualization } from '@instructure/ui-themes'

const lorem = new LoremIpsum({
sentencesPerParagraph: {
Expand Down Expand Up @@ -87,7 +87,7 @@ const globals = {
useState,
useRef,
additionalPrimitives,
datavisualization,
dataVisualization,
ThemeColors,
ColorTable
}
Expand Down
2 changes: 1 addition & 1 deletion packages/__docs__/src/Theme/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class Theme extends Component<ThemeProps> {
if (
key === 'primitives' ||
key === 'additionalPrimitives' ||
key === 'datavisualization'
key === 'dataVisualization'
) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared-types/src/Colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ type UI = {
lineConnector: Contrasts['grey1424']
}

type Datavisualization = {
type DataVisualization = {
rose12Primary: AdditionalPrimitives['rose12']
rose30Primary: AdditionalPrimitives['rose30']
rose45Primary: AdditionalPrimitives['rose45']
Expand Down Expand Up @@ -395,5 +395,5 @@ export type {
AdditionalPrimitives,
Contrasts,
UI,
Datavisualization
DataVisualization
}
8 changes: 4 additions & 4 deletions packages/ui-themes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type {
BaseTheme,
Primitives,
AdditionalPrimitives,
Datavisualization,
DataVisualization,
UI
} from '@instructure/shared-types'

Expand All @@ -39,7 +39,7 @@ import {
primitives,
additionalPrimitives
} from './sharedThemeTokens/colors/primitives'
import datavisualization from './sharedThemeTokens/colors/datavisualization'
import dataVisualization from './sharedThemeTokens/colors/dataVisualization'

type ThemeMap = {
canvas: CanvasTheme
Expand All @@ -64,7 +64,7 @@ export {
canvasHighContrast,
primitives,
additionalPrimitives,
datavisualization
dataVisualization
}
export default canvas
export type {
Expand All @@ -78,6 +78,6 @@ export type {
CanvasHighContrastTheme,
Primitives,
AdditionalPrimitives,
Datavisualization,
DataVisualization,
UI
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*/

import { additionalPrimitives } from './primitives'
import type { Datavisualization } from '@instructure/shared-types'
import type { DataVisualization } from '@instructure/shared-types'

const datavisualization: Datavisualization = {
const dataVisualization: DataVisualization = {
rose12Primary: additionalPrimitives.rose12,
rose30Primary: additionalPrimitives.rose30,
rose45Primary: additionalPrimitives.rose45,
Expand Down Expand Up @@ -148,4 +148,4 @@ const datavisualization: Datavisualization = {
stone90Secondary: additionalPrimitives.stone90
}

export default datavisualization
export default dataVisualization
4 changes: 2 additions & 2 deletions packages/ui-themes/src/themes/canvas/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
primitives,
additionalPrimitives
} from '../../sharedThemeTokens/colors/primitives'
import datavisualization from '../../sharedThemeTokens/colors/datavisualization'
import dataVisualization from '../../sharedThemeTokens/colors/dataVisualization'
import getUIColors from '../../utils/getUIColors'

import type { Contrasts, UI } from '@instructure/shared-types'
Expand Down Expand Up @@ -70,7 +70,7 @@ const colors = {
additionalPrimitives,
contrasts,
ui,
datavisualization
dataVisualization
}
export default { primitives, contrasts, ui }
export { colors }
4 changes: 2 additions & 2 deletions packages/ui-themes/src/themes/canvasHighContrast/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
primitives,
additionalPrimitives
} from '../../sharedThemeTokens/colors/primitives'
import datavisualization from '../../sharedThemeTokens/colors/datavisualization'
import dataVisualization from '../../sharedThemeTokens/colors/dataVisualization'
import getUIColors from '../../utils/getUIColors'

import type { UI, Contrasts } from '@instructure/shared-types'
Expand Down Expand Up @@ -70,7 +70,7 @@ const colors = {
additionalPrimitives,
contrasts,
ui,
datavisualization
dataVisualization
}
export default { primitives, contrasts, ui }
export { colors }

0 comments on commit af6e433

Please sign in to comment.