Skip to content

Commit 2200f09

Browse files
committed
chore(many): remove hash symbol from internal links
INSTUI-4750
1 parent 93f129b commit 2200f09

File tree

67 files changed

+417
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+417
-163
lines changed

docs/contributor-docs/api-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ order: 4
88

99
### Component Properties
1010

11-
- All components should pass through additional props down to the root DOM element using the `passthroughProps` utility. (e.g. `<div {...passthroughProps(this.props)}>`). Note that in addition to allowing only valid DOM node attributes, `passthroughProps` will remove the `className` and `style` props to prevent unexpected style issues. These need to be set explicitly and used with caution. It also removes the `styles` and `makesStyles` properties added by the [withStyle](#withStyle) decorator.
11+
- All components should pass through additional props down to the root DOM element using the `passthroughProps` utility. (e.g. `<div {...passthroughProps(this.props)}>`). Note that in addition to allowing only valid DOM node attributes, `passthroughProps` will remove the `className` and `style` props to prevent unexpected style issues. These need to be set explicitly and used with caution. It also removes the `styles` and `makesStyles` properties added by the [withStyle](withStyle) decorator.
1212
- Avoid props that could be computed from other props. (e.g. prefer `<Select filter={handleFilter} />` over `<Select shouldFilter filter={handleFilter} />`. Prefer determining whether filtering should happen based on the presence of the `filter` function prop.)
1313
- Avoid situations where certain prop combinations are not supported. Prefer splitting the component into separate components with fewer props.
1414
- Set default prop values for non-required props when possible.
@@ -47,7 +47,7 @@ order: 4
4747

4848
- In the `styles.ts`, use the name of the component in camelCase (e.g. `appNav`) as the key of the root element's style object. Use camelCase for the keys of child elements as well (e.g. `list` and `listItem`).
4949
- All style object names should be semantic (describe the content, not what it looks like).
50-
- We make use of the `label` property of [Emotion.js](https://emotion.sh/) so that it gets displayed in the generated class name for easy readability and targetability. We use a naming convention based on [BEM naming convention](#http://getbem.com/naming/):
50+
- We make use of the `label` property of [Emotion.js](https://emotion.sh/) so that it gets displayed in the generated class name for easy readability and targetability. We use a naming convention based on [BEM naming convention](http://getbem.com/naming/):
5151
- For the root element, add a label with the name of the component in camelCase \
5252
(e.g. `appNav: { label: 'appNav' }`).
5353
- For the child elements, use the double underscore separator to indicate the parent-child relation with the `[rootElementName]__[childName}` format \

docs/contributor-docs/contributing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ constructed from the existing ones. For these reasons adding a new component has
2323

2424
### Building InstUI from the source
2525

26-
Please follow the steps on the [how to build guide page](#building-instui).
26+
Please follow the steps on the [how to build guide page](building-instui).
2727

2828
### Running the documentation app
2929

@@ -41,7 +41,7 @@ Please follow the steps on the [how to build guide page](#building-instui).
4141

4242
### Testing
4343

44-
See the [testing documentation](#testing-overview) for details.
44+
See the [testing documentation](testing-components) for details.
4545

4646
### Linters and Code Formatting
4747

@@ -75,6 +75,6 @@ Run `git commit` to commit your changes and follow our commit message format.
7575

7676
All components should:
7777

78-
1. Be accessible (See the [accessibility requirements](#accessibility) for more information).
78+
1. Be accessible (See the [accessibility requirements](accessibility) for more information).
7979
1. Support RTL languages.
8080
1. Localize all dates, times, numbers and strings (or require localized content passed in via props).

docs/contributor-docs/theming/theming-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ It accepts a `theme` prop, which should be an Instructure UI theme.
3232

3333
It can be used in two ways. On the top level, you can provide the theme for the whole application or nested anywhere inside it. You can also provide an object with theme or component theme overrides.
3434

35-
**For detailed usage info and examples, see the [InstUISettingsProvider](#InstUISettingsProvider) documentation page.**
35+
**For detailed usage info and examples, see the [InstUISettingsProvider](InstUISettingsProvider) documentation page.**
3636

3737
```jsx
3838
---
@@ -53,13 +53,13 @@ const RenderApp = () => {
5353

5454
### Theme overrides
5555

56-
A themeable component’s theme can be configured by wrapping it in an [InstUISettingsProvider](#InstUISettingsProvider) component, and/or set explicitly via its `themeOverride` prop.
56+
A themeable component’s theme can be configured by wrapping it in an [InstUISettingsProvider](InstUISettingsProvider) component, and/or set explicitly via its `themeOverride` prop.
5757

5858
#### themeOverride prop
5959

6060
The themeable components accept a `themeOverride` prop which lets you override it's component theme object. It accepts an override object or a function, which has the current `componentTheme` as its parameter.
6161

62-
**See more on the [withStyle](#withStyle/#applying-themes) and [Using theme overrides](/#using-theme-overrides) doc pages for more info.**
62+
**See more on the [withStyle](withStyle/#applying-themes) and [Using theme overrides](/#using-theme-overrides) doc pages for more info.**
6363

6464
```js
6565
---

docs/contributor-docs/theming/theming-class-based.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 3
66

77
## Making class-based themed components
88

9-
Make a component themeable with the [withStyle](#withStyle) decorator. It adds a `makeStyles` function and the generated `styles` object to the decorated Component's props.
9+
Make a component themeable with the [withStyle](withStyle) decorator. It adds a `makeStyles` function and the generated `styles` object to the decorated Component's props.
1010

1111
Import the style generator (`generateStyle`) from `styles.js` and the component theme generator (`generateComponentTheme`) from `theme.js`, and pass them to the decorator.
1212

@@ -80,14 +80,14 @@ const generateComponentTheme = (theme) => {
8080
export default generateComponentTheme
8181
```
8282
83-
The arguments to the generator function are the [global theme variables](#canvas). In the above example, we've defined the default theme for the Button component.
83+
The arguments to the generator function are the [global theme variables](canvas). In the above example, we've defined the default theme for the Button component.
8484
8585
The purpose of the generator function is to take the global variables and apply them as values to the functional component level variables.
8686
When coming up with names for the component level variables, try to make them describe how they are used in the component (vs describing the variable value).
8787
8888
### Supporting multiple themes
8989
90-
If we want to make the Button transform the global theme variables differently with another theme, (e.g. [canvas-high-contrast](#canvas-high-contrast)) we can make specific styling for that theme:
90+
If we want to make the Button transform the global theme variables differently with another theme, (e.g. [canvas-high-contrast](canvas-high-contrast)) we can make specific styling for that theme:
9191
9292
```js
9393
---
@@ -127,7 +127,7 @@ The rest of the variables will pick up from the default Button theme generator (
127127
128128
In the `styles.js` file, the `generateStyle` method receives the theme variable object (`componentTheme`) generated by `theme.js`.
129129
130-
Add your styling for each element in the component, and give them [labels](https://emotion.sh/docs/labels#gatsby-focus-wrapper) for easy readability and targetability. _Naming convention_: similar to [BEM naming convention](#http://getbem.com/naming/), use the name of the component in camelCase for the root element ('button'), and the double underscore suffix for children ('button\_\_icon').
130+
Add your styling for each element in the component, and give them [labels](https://emotion.sh/docs/labels#gatsby-focus-wrapper) for easy readability and targetability. _Naming convention_: similar to [BEM naming convention](http://getbem.com/naming/), use the name of the component in camelCase for the root element ('button'), and the double underscore suffix for children ('button\_\_icon').
131131
132132
Use [Emotion's Object Styles documentation](https://emotion.sh/docs/object-styles) as a guide to add styles.
133133

docs/contributor-docs/theming/theming-functional.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ order: 2
77
## Making InstUI-like components with theming
88

99
InstUI uses [Emotion](https://emotion.sh/docs/introduction) under the hood to theme and style its components.
10-
If you want to read about the design behind the system and how to build `class-based` components with InstUI, please read [this](#theming-class-based).
10+
If you want to read about the design behind the system and how to build `class-based` components with InstUI, please read [this](theming-class-based).
1111

1212
This page will show you how to build `functional` react components with InstUI.
1313

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Upgrade Guide for Version 10.0
3+
category: Guides
4+
order: 98
5+
---
6+
7+
# Upgrade Guide for Version 10
8+
9+
## Introduction
10+
11+
InstUI v10 is a major release with a new theming color system. It has been simplified and rewritten to make our design language easier to understand and more uniform.
12+
13+
With the new system some old designs could be more challenging or very hard to implement. This is intentional, we wanted
14+
to avoid situations when someone really changes the look and feel of their application.
15+
In these cases, make sure you talk with your designer and update the UI according to the new designs.
16+
17+
The revised designs should result in better accessibility ([WCAG 2.1](https://www.w3.org/TR/WCAG21/) compliance!), less theming code and more uniform look and feel.
18+
19+
## Step-by-step guide
20+
21+
We recommend upgrading your application for each major version gradually, e.g. if you plan to update from 8.x to 10.x,
22+
then migrate first to the latest 9.x and then to version 10.
23+
24+
The places where your code can break during the upgrade are related to theme overrides, color props and color utilities.
25+
Please check the [theming components](theming-components) guide to understand the new color system.
26+
27+
If you override the theme colors, you must use the new colors provided either in the `canvas-high-contrast` or in the `canvas` theme object.
28+
The previous color system has been removed, the old color names are no longer available.
29+
30+
### `Instructure` theme is removed
31+
32+
Instructure theme (`@instructure/instructure-theme`) is no longer maintained and not compatible with InstUI v10.
33+
If you were using it, you need to switch to the `canvas` or the `canvas-high-contrast` theme.
34+
35+
### Component level color overrides
36+
37+
If you had component level overrides of colors you need to migrate using the following table:
38+
39+
| Old | New (v10) |
40+
| ------------------ | ----------------------------- |
41+
| `colors.brand` | `colors.contrasts.blue4570` |
42+
| `colors.link` | `colors.contrasts.blue4570` |
43+
| `colors.electric` | `colors.contrasts.blue4570` |
44+
| `colors.shamrock` | `colors.contrasts.green4570` |
45+
| `colors.barney` | `colors.contrasts.blue4570` |
46+
| `colors.crimson` | `colors.contrasts.red4570` |
47+
| `colors.fire` | `colors.contrasts.orange4570` |
48+
| `colors.licorice` | `colors.contrasts.grey125125` |
49+
| `colors.oxford` | `colors.contrasts.grey100100` |
50+
| `colors.ash` | `colors.contrasts.grey4570` |
51+
| `colors.slate` | `colors.contrasts.grey4570` |
52+
| `colors.tiara` | `colors.contrasts.grey1214` |
53+
| `colors.porcelain` | `colors.contrasts.grey1111` |
54+
| `colors.white` | `colors.contrasts.white1010` |
55+
56+
You can use the latest [codemod](ui-codemods) to automate this process.
57+
58+
InstUI v9:
59+
60+
```jsx
61+
---
62+
type: code
63+
---
64+
<Heading level="h3" color="primary"
65+
themeOverride={{primaryColor: canvas.colors.brand}}>
66+
I have nice color!
67+
</Heading>
68+
```
69+
70+
InstUI v10:
71+
72+
```jsx
73+
---
74+
type: code
75+
---
76+
<Heading level="h3" margin="small small" color="primary"
77+
themeOverride={{primaryColor: canvas.colors.contrasts.blue4570}}>
78+
some nice blue text.
79+
</Heading>
80+
```
81+
82+
Notice, that the new values use `colors.contrasts`. Please do not use `colors.primitives` for anything.
83+
84+
### Theme level color overrides
85+
86+
InstUI v9 theme level properties `text`, `background`, `border` (for example `backgroundLightest` or `textDarkest`) have been removed.
87+
To upgrade these props you need to find and override component level theme variables for each component that used the replaced property.
88+
**This is heavily discouraged, upcoming designs should not necessitate theme overrides.**
89+
90+
For example, if you had `backgroundLightest` overridden on the theme level, you need to find every component whose theme
91+
utilizes `backgroundLightest` and override them individually in each component. Some of these components are `Alert`, `Avatar`, `Billboard`, `View` and many more.
92+
93+
InstUI v9:
94+
95+
```jsx
96+
---
97+
type: code
98+
---
99+
100+
<InstUISettingsProvider
101+
theme={{
102+
themeOverrides: {
103+
canvas: {
104+
colors: { backgroundLightest: 'orange' }
105+
}
106+
}
107+
}}
108+
>
109+
```
110+
111+
InstUI v10:
112+
113+
```jsx
114+
---
115+
type: code
116+
---
117+
118+
<Alert themeOverride={{background: 'orange'}}></Alert>
119+
<Avatar themeOverride={{background: 'orange'}}></Avatar>
120+
<Billboard themeOverride={{background: 'orange'}}></Billboard>
121+
<Tabs themeOverride={{defaultBackground: 'orange', scrollFadeColor:'orange'}}></Tabs>
122+
//...and all other components that use color.backgroundLightest
123+
```
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Upgrade Guide for Version 11
3+
category: Guides
4+
order: 99
5+
isWIP: true
6+
---
7+
8+
# Upgrade Guide for Version 11 (WIP)
9+
10+
## Removal of deprecated props/components/APIs
11+
12+
### InstUISettingsProvider
13+
14+
[InstUISettingsProvider](/#InstUISettingsProvider)'s `as` prop was removed, it will always render as a `<span>` (note: it will only render anything to the DOM if you provide a value to the `dir` prop.). The provided codemod will remove this prop automatically (see below).
15+
16+
### Table
17+
18+
[Table](/#Table) is now using [TableContext](TableContext) to pass down data to its child components, the following props are no longer passed down to their children (This should only affect you if you wild custom table rows or cells):
19+
20+
| Component | prop | Substitute / Notes |
21+
| --------- | ----------- | ------------------------------- |
22+
| `Row` | `isStacked` | is now stored in `TableContext` |
23+
| `Body` | `isStacked` | is now stored in `TableContext` |
24+
| `Body` | `hover` | is now stored in `TableContext` |
25+
| `Body` | `headers` | is now stored in `TableContext` |
26+
27+
### Theming engine changes
28+
29+
| Deprecation | What to use instead? |
30+
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
31+
| `canvas.use()`, `canvasHighContrast.use()` | Wrap all your application roots in `<InstUISettingsProvider>` |
32+
| `variables` field on theme objects | Use `canvas.borders` instead of `canvas.variables.borders` (same for all othere fields) |
33+
| `@instructure/theme-registry` package | This added the removed functions above. Wrap all your application roots in `<InstUISettingsProvider>` |
34+
35+
## API Changes
36+
37+
- `ui-dom-utils`/`getComputedStyle` can now return `undefined`: In previous versions sometimes returned an empty object which could lead to runtime exceptions when one tried to call methods of `CSSStyleDeclaration` on it.
38+
- TO-DO: [TimeSelect](/#TimeSelect) as a controlled component can now return an '' instead of a valid date when its input field is cleared. In previous versions it always reverted to the last selected value when the input field was cleared and lost focus.
39+
40+
## Codemods
41+
42+
To ease the upgrade we provide codemods that will automate most of the changes. Pay close attention to its output, it cannot refactor complex code! The codemod scripts can be run via the following commands:
43+
44+
```sh
45+
---
46+
type: code
47+
---
48+
npm install @instructure/ui-codemods@11
49+
npx [email protected] -t node_modules/@instructure/ui-codemods/lib/instUIv11Codemods.ts <path> --usePrettier=false
50+
```
51+
52+
Options for the codemod:
53+
54+
- `filename`: if specified then emitted warnings are written to this file.
55+
- `usePrettier`: if `true` the transformed code will be run through Prettier. You can customize this through a [Prettier
56+
config file](https://prettier.io/docs/configuration.html)

docs/getting-started/accessibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ We aim to make our software accessible to everyone, including those with vision,
1111

1212
### Color Contrast
1313

14-
Our [default theme](#canvas) colors meet meets WCAG 2.1 AA rules for color contrast, and our [high contrast theme](#canvas-high-contrast) meets WCAG 2.1 AAA rules for color contrast. This ensures sufficient color contrast between elements so that users with low vision or color blindness can view and use our components.
14+
Our [default theme](canvas) colors meet meets WCAG 2.1 AA rules for color contrast, and our [high contrast theme](canvas-high-contrast) meets WCAG 2.1 AAA rules for color contrast. This ensures sufficient color contrast between elements so that users with low vision or color blindness can view and use our components.
1515

1616
### Keyboard Navigation
1717

docs/getting-started/theming-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ relevantForAI: true
77

88
## Themes
99

10-
Instructure UI ships with two built-in themes: [canvas theme](#canvas) (default), [high contrast canvas theme](#canvas-high-contrast).
10+
Instructure UI ships with two built-in themes: [canvas theme](canvas) (default), [high contrast canvas theme](canvas-high-contrast).
1111
They are meant to be used together, `canvas` provides 4.5:1 contrast, while `canvas-high-contrast` 7.0:1.
1212

13-
You can change the theme used with the [InstUISettingsProvider](#InstUISettingsProvider) component:
13+
You can change the theme used with the [InstUISettingsProvider](InstUISettingsProvider) component:
1414

1515
```jsx
1616
---
@@ -29,7 +29,7 @@ render() {
2929
For more details on how to customize themes or apply different ones to parts of you application see [Using Theme Overrides](/#using-theme-overrides).
3030

3131
If you are interested in how InstUI's theming engine works and/or you want to make your own components that use the themes,
32-
read our documentation on the theming engine [here](#theming-basics).
32+
read our documentation on the theming engine [here](theming-basics).
3333

3434
## Colors
3535

0 commit comments

Comments
 (0)