@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Shadow
|
|
2
|
+
======
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
The shadow pattern allows you to wrap your content in the shadow DOM, allowing you to isolate your styles from the rest of the application. This is useful when you want to create a component that has its own styles, without affecting the rest of the application (such as microfrontends).
|
|
8
|
+
|
|
9
|
+
* * *
|
|
10
|
+
|
|
11
|
+
Beta
|
|
12
|
+
|
|
13
|
+
**New component**
|
|
14
|
+
|
|
15
|
+
This component is new, please provide feedback to the Frontend Enablement team if you encounter any issues.
|
|
16
|
+
|
|
17
|
+
[](./iframe.html?id=patterns-shadow--shadow)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressShadow\>
|
|
22
|
+
<IressPanel\>
|
|
23
|
+
Content inside shadow DOM </IressPanel\>
|
|
24
|
+
</IressShadow\>
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Props
|
|
29
|
+
-----
|
|
30
|
+
|
|
31
|
+
| Name | Description | Default | Control |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| children |
|
|
34
|
+
Children to be rendered inside the shadow DOM
|
|
35
|
+
|
|
36
|
+
ReactNode
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
| \- |
|
|
41
|
+
|
|
42
|
+
RAW
|
|
43
|
+
|
|
44
|
+
children :
|
|
45
|
+
|
|
46
|
+
{
|
|
47
|
+
|
|
48
|
+
* $$typeof : Symbol(react.transitional.element)
|
|
49
|
+
* type : ({ className, ...restProps }) => /\* @\_\_PURE\_\_ \*/ jsxDEV(Component, { ...restProps, className: cx(className, GlobalCSSClass.Panel) }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Panel/Panel.tsx", lineNumber: 26, columnNumber: 1 }, this)
|
|
50
|
+
* key : null
|
|
51
|
+
* props :
|
|
52
|
+
|
|
53
|
+
{...} 1 key
|
|
54
|
+
|
|
55
|
+
* \_owner : null
|
|
56
|
+
* \_store :
|
|
57
|
+
|
|
58
|
+
{...} 0 keys
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
|
70
|
+
| fontFaceUrls |
|
|
71
|
+
|
|
72
|
+
Optional array of font URLs to be included in the parent document head. By default it will include the default fonts from `@iress-oss/ids-tokens` (e.g., \['[https://fonts.googleapis.com/css?family=Roboto](https://fonts.googleapis.com/css?family=Roboto)'\]
|
|
73
|
+
|
|
74
|
+
string\[\]
|
|
75
|
+
|
|
76
|
+
| \[...defaultFonts\] | Set object |
|
|
77
|
+
| noIcons |
|
|
78
|
+
|
|
79
|
+
If true, the Iress icon stylesheet will not be included in the shadow DOM and the head.
|
|
80
|
+
|
|
81
|
+
boolean
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
| \- | Set boolean |
|
|
86
|
+
| stylesheetContents |
|
|
87
|
+
|
|
88
|
+
Optional array of stylesheet contents to be included in the shadow DOM (e.g. { styleId: '.my-class { color: red; }' })
|
|
89
|
+
|
|
90
|
+
Record<string, string>
|
|
91
|
+
|
|
92
|
+
| { } | Set object |
|
|
93
|
+
| stylesheetUrls |
|
|
94
|
+
|
|
95
|
+
Optional array of stylesheet URLs to be included in the shadow DOM (e.g., \['[https://example.com/style.css](https://example.com/style.css)'\])
|
|
96
|
+
|
|
97
|
+
string\[\]
|
|
98
|
+
|
|
99
|
+
| \[\] | Set object |
|
|
100
|
+
|
|
101
|
+
Usage
|
|
102
|
+
-----
|
|
103
|
+
|
|
104
|
+
This is a simple component that is an alternative to the `IressProvider`. To use it, simply wrap your content in the `IressShadow` component.
|
|
105
|
+
|
|
106
|
+
It has similar props to the `IressProvider`, however it will apply the styles to the correct area depending on where its needed.
|
|
107
|
+
|
|
108
|
+
* Font faces are injected into the document head, as they cannot be injected into the shadow DOM
|
|
109
|
+
* The IDS styles are injected into the shadow DOM
|
|
110
|
+
* The icon stylesheet is injected into both the document head and the shadow DOM, as the icon stylesheet includes both font face and icon styles
|
|
111
|
+
|
|
112
|
+
**Note:** The `IressShadow` component does not create a custom element, it simply creates a shadow root on a `div` element.
|
|
113
|
+
|
|
114
|
+
[](./iframe.html?id=patterns-shadow--shadow)
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
<IressShadow\>
|
|
119
|
+
<IressPanel\>
|
|
120
|
+
Content inside shadow DOM </IressPanel\>
|
|
121
|
+
</IressShadow\>
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Props
|
|
126
|
+
|
|
127
|
+
| Name | Description | Default | Control |
|
|
128
|
+
| --- | --- | --- | --- |
|
|
129
|
+
| children |
|
|
130
|
+
Children to be rendered inside the shadow DOM
|
|
131
|
+
|
|
132
|
+
ReactNode
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
| \- |
|
|
137
|
+
|
|
138
|
+
RAW
|
|
139
|
+
|
|
140
|
+
children :
|
|
141
|
+
|
|
142
|
+
{
|
|
143
|
+
|
|
144
|
+
* $$typeof : Symbol(react.transitional.element)
|
|
145
|
+
* type : ({ className, ...restProps }) => /\* @\_\_PURE\_\_ \*/ jsxDEV(Component, { ...restProps, className: cx(className, GlobalCSSClass.Panel) }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Panel/Panel.tsx", lineNumber: 26, columnNumber: 1 }, this)
|
|
146
|
+
* key : null
|
|
147
|
+
* props :
|
|
148
|
+
|
|
149
|
+
{...} 1 key
|
|
150
|
+
|
|
151
|
+
* \_owner : null
|
|
152
|
+
* \_store :
|
|
153
|
+
|
|
154
|
+
{...} 0 keys
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
|
166
|
+
| fontFaceUrls |
|
|
167
|
+
|
|
168
|
+
Optional array of font URLs to be included in the parent document head. By default it will include the default fonts from `@iress-oss/ids-tokens` (e.g., \['[https://fonts.googleapis.com/css?family=Roboto](https://fonts.googleapis.com/css?family=Roboto)'\]
|
|
169
|
+
|
|
170
|
+
string\[\]
|
|
171
|
+
|
|
172
|
+
| \[...defaultFonts\] | Set object |
|
|
173
|
+
| noIcons |
|
|
174
|
+
|
|
175
|
+
If true, the Iress icon stylesheet will not be included in the shadow DOM and the head.
|
|
176
|
+
|
|
177
|
+
boolean
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
| \- | Set boolean |
|
|
182
|
+
| stylesheetContents |
|
|
183
|
+
|
|
184
|
+
Optional array of stylesheet contents to be included in the shadow DOM (e.g. { styleId: '.my-class { color: red; }' })
|
|
185
|
+
|
|
186
|
+
Record<string, string>
|
|
187
|
+
|
|
188
|
+
| { } | Set object |
|
|
189
|
+
| stylesheetUrls |
|
|
190
|
+
|
|
191
|
+
Optional array of stylesheet URLs to be included in the shadow DOM (e.g., \['[https://example.com/style.css](https://example.com/style.css)'\])
|
|
192
|
+
|
|
193
|
+
string\[\]
|
|
194
|
+
|
|
195
|
+
| \[\] | Set object |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Code Katas
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
A code kata is an exercise in programming that helps a programmer hone their skills through practice and repetition. Code katas are a great way to learn a new language, practice a new technique, or just to keep your skills fresh. They are also a great way to get a team to practice working together.
|
|
5
|
+
|
|
6
|
+
In our case, we will be using code katas to help you practice using the Iress Design System (IDS) components.
|
|
7
|
+
|
|
8
|
+
1. Lightsaber Order Form: This code kata was created specifically to introduce version five to Iress product engineering teams. It allows you to practice using the latest `IressForm` and its controlled elements, as well as practice writing tests efficiently using React Testing Library out-of-the-box.
|
|
9
|
+
2. Pizza Ordering: This is an older kata that is great for practicing UI in general.
|
|
10
|
+
|
|
11
|
+
The code katas can be found in the Code Katas repository.
|
|
12
|
+
|
|
13
|
+
Want more code katas?
|
|
14
|
+
---------------------
|
|
15
|
+
|
|
16
|
+
If you want to do some more code katas, check out the following resources. You can even use IDS for the UI based ones to put in some more practice.
|
|
17
|
+
|
|
18
|
+
* Iress code katas
|
|
19
|
+
* [Codurance](https://www.codurance.com/katas)
|
|
20
|
+
* [TDD Buddy](https://tddbuddy.com/katas.html)
|
|
21
|
+
* [Code Kata](http://codekata.com/)
|
|
22
|
+
* [Awesome Katas](https://github.com/gamontal/awesome-katas)
|
|
23
|
+
* [CSS Battle](https://cssbattle.dev/)
|
|
24
|
+
* [Code Chef](https://www.codechef.com/)
|
|
25
|
+
* [Project Euler](https://projecteuler.net/)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Resources
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
These are additional resources to help you make the most of the Iress Design System.
|
|
5
|
+
|
|
6
|
+
Migration guides
|
|
7
|
+
----------------
|
|
8
|
+
|
|
9
|
+
These guides help you transition from previous versions of the Iress Design System to the latest version. They provide step-by-step instructions and highlight the changes made in each version.
|
|
10
|
+
|
|
11
|
+
1. [Version 5 to 6](https://docs.google.com/document/d/17K81rHBZjjF_tsrC8QFrSsmjrC0IJu_bpU4sB2N7PSQ/edit?usp=sharing)
|
|
12
|
+
2. [Version 4 to 5](/docs/resources-migration-guides-from-v4-to-v5--docs)
|
|
13
|
+
|
|
14
|
+
MCP Server
|
|
15
|
+
----------
|
|
16
|
+
|
|
17
|
+
The MCP Server provides AI agents with contextual information about the Iress Design System (IDS) components, allowing them to assist with development tasks such as writing code and UIs consistently, generating documentation, and answering questions about the design system, and all according to best practice.
|
|
18
|
+
|
|
19
|
+
[View MCP Server](/?path=/docs/resources-mcp-server--docs)
|
|
20
|
+
|
|
21
|
+
Code katas
|
|
22
|
+
----------
|
|
23
|
+
|
|
24
|
+
These are exercises to help you practice and improve your skills with the Iress Design System. They cover various components and patterns, providing a hands-on way to learn.
|
|
25
|
+
|
|
26
|
+
You can even try using the [MCP Server](/?path=/docs/resources-mcp-server--docs) to help you complete the code katas by asking questions about the components and patterns.
|
|
27
|
+
|
|
28
|
+
[View code katas](/?path=/docs/resources-code-katas--docs)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MCP Server
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
The MCP Server provides AI agents with contextual information about the Iress Design System (IDS) components, allowing them to assist with development tasks such as writing code and UIs consistently, generating documentation, and answering questions about the design system, and all according to best practice.
|
|
5
|
+
|
|
6
|
+
[
|
|
7
|
+
|
|
8
|
+
View MCP Server on NPM
|
|
9
|
+
|
|
10
|
+
](https://www.npmjs.com/package/@iress-oss/ids-mcp-server)
|
|
11
|
+
|
|
12
|
+
* * *
|
|
13
|
+
|
|
14
|
+
Installation
|
|
15
|
+
------------
|
|
16
|
+
|
|
17
|
+
[
|
|
18
|
+
|
|
19
|
+
Install on Visual Studio Code
|
|
20
|
+
|
|
21
|
+
](vscode:mcp/install?%7B%22name%22%3A%22iress-design-system%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40iress-oss%2Fids-mcp-server%22%5D%7D)
|
|
22
|
+
|
|
23
|
+
For other MCP clients or manual configuration, check the [MCP Server README](https://www.npmjs.com/package/@iress-oss/ids-mcp-server)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Migration from v4 to v5
|
|
2
|
+
=======================
|
|
3
|
+
|
|
4
|
+
This is a step-by-step guide for upgrading your application from IDS v4 to v5.
|
|
5
|
+
|
|
6
|
+
Updating your dependencies
|
|
7
|
+
--------------------------
|
|
8
|
+
|
|
9
|
+
### Upgrade IDS and themes
|
|
10
|
+
|
|
11
|
+
Update your dependencies in your `package.json` file to the following:
|
|
12
|
+
|
|
13
|
+
or run:
|
|
14
|
+
|
|
15
|
+
### Upgrade React
|
|
16
|
+
|
|
17
|
+
The minimum required version of React is 17. If you are using an older version of React, you will need to update it.
|
|
18
|
+
|
|
19
|
+
Updating imports
|
|
20
|
+
----------------
|
|
21
|
+
|
|
22
|
+
### Changing components
|
|
23
|
+
|
|
24
|
+
Update your imports to the new package name:
|
|
25
|
+
|
|
26
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { IressButton } from '@iress/components-react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { IressButton } from '@iress-oss/ids-components';</pre></td></tr></tbody></table>
|
|
27
|
+
|
|
28
|
+
You can run both packages together, so you can migrate components one by one.
|
|
29
|
+
|
|
30
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { IressModal, IressButton } from '@iress/components-react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { IressModal } from '@iress/components-react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { IressButton } from '@iress-oss/ids-components';</pre></td></tr></tbody></table>
|
|
31
|
+
|
|
32
|
+
### Importing component styles
|
|
33
|
+
|
|
34
|
+
IDS v5 no longer injects CSS into the DOM. You will need to import the stylesheet directly into your application.
|
|
35
|
+
|
|
36
|
+
Update Jest configuration
|
|
37
|
+
-------------------------
|
|
38
|
+
|
|
39
|
+
If you are using Jest, you will need to update your Jest configuration to add the new IDS package to your `transformIgnorePatterns`.
|
|
40
|
+
|
|
41
|
+
**Note:** If you are using version 4 and version 5 in parallel, you will need to keep the old IDS packages in your `transformIgnorePatterns` until you have completely migrated over your components.
|
|
42
|
+
|
|
43
|
+
If you are mocking CSS files for your tests, you'll also need to make sure the new stylesheet is matched by your `moduleNameMapper`:
|
|
44
|
+
|
|
45
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> "moduleNameMapper": {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> "^.+\.(scss|less)$": "<rootDir>/test/style-mock.ts",</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> "ids-web-components.css$": "<rootDir>/test/style-mock.ts",</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> "global.css$": "<rootDir>/test/style-mock.ts"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> "global.css$": "<rootDir>/test/style-mock.ts",</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> "@iress-oss/ids-components/(.*).css": "<rootDir>/test/style-mock.ts"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> },</pre></td></tr></tbody></table>
|
|
46
|
+
|
|
47
|
+
Handling breaking changes
|
|
48
|
+
-------------------------
|
|
49
|
+
|
|
50
|
+
### Components
|
|
51
|
+
|
|
52
|
+
Since the move to React, the majority of the components have been simplified to improve developer experience. We have listed the changes in this google doc by component, so you can attend to each component separately.
|
|
53
|
+
|
|
54
|
+
[Google doc](https://docs.google.com/document/d/1H3-zFDftCHDjwaFkwFxVo1uziPsOj8qJn7p3NFG3aUg/edit)
|
|
55
|
+
|
|
56
|
+
### Testing
|
|
57
|
+
|
|
58
|
+
Components are no longer loaded asynchronously, so you can test them as you would any other React component. The testing utilities have been removed from the package, so you will need to update your tests to use [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) or another testing library.
|
|
59
|
+
|
|
60
|
+
Below is an example of a changed test using React Testing Library.
|
|
61
|
+
|
|
62
|
+
Diff
|
|
63
|
+
|
|
64
|
+
Old
|
|
65
|
+
|
|
66
|
+
New
|
|
67
|
+
|
|
68
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { render } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import { render, fireEvent } from '@testing-library/react';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { idsFireEvent } from '@iress/ids-react-test-utils';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> </pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">test('login form', () => {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">test('login form', async () => {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> const loginMock = jest.fn();</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> const screen = render(<LoginForm loginUser={loginMock}/>);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const usernameInput = await screen.findByTestId('username__input');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const usernameInput = screen.getByRole('textbox', { name: 'Username' });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const passwordInput = await screen.findByTestId('password__input');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const passwordInput = screen.getByRole('textbox', { name: 'Password' });</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> const submitBtn = await screen.findByTestId('submit-btn__button');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> const submitBtn = screen.getByRole('button');</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.change(usernameInput, { target: { value: 'joe.bloggs' }});</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> fireEvent.change(usernameInput, { target: { value: 'joe.bloggs' }});</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.change(passwordInput, { target: { value: '1234' }});</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> fireEvent.change(passwordInput, { target: { value: '1234' }});</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> idsFireEvent.click(submitBtn);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> fireEvent.click(submitBtn);</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> expect(loginMock).toHaveBeenCalledWith("joe.bloggs", "1234");</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">});</pre></td></tr></tbody></table>
|
|
69
|
+
|
|
70
|
+
#### Component specific testing
|
|
71
|
+
|
|
72
|
+
Some components have additional testing requirements. The changed testing requirements will be listed on each component's docs page.
|
|
73
|
+
|
|
74
|
+
These include:
|
|
75
|
+
|
|
76
|
+
* [Form](/docs/components-form--docs#testing)
|
|
77
|
+
* [Modal](/docs/components-modal--docs#testing)
|
|
78
|
+
* [Slideout](/docs/components-slideout--docs#testing)
|
|
79
|
+
|
|
80
|
+
### Styling
|
|
81
|
+
|
|
82
|
+
The original CSS framework used for IDS was based on the Stencil library. It was lightly scoped (no shadow DOM) using CSS classes like: `sc-iress-radio-h sc-iress-radio-s`.
|
|
83
|
+
|
|
84
|
+
These classes have been removed from version 5. If you are targeting components using these classes, it will be good for you review if you should adapt the CSS in a different way (ie. using design tokens/CSS variables instead, which should work no matter the class name, or adding custom classes to the IDS components). If targeting elements is still required, the new classes will be formatted as: `.ids-radio-${ids-version}`, and nested elements will use a modified BEM naming convention: `.ids-radio--label-${ids-version}`. The version number will be exposed; you can import it via Javascript, SASS and CSS module values to make future upgrades easier.
|
|
85
|
+
|
|
86
|
+
#### Option 1: Use design tokens and custom classes
|
|
87
|
+
|
|
88
|
+
This is the recommended approach. You can use design tokens and custom classes to style the components.
|
|
89
|
+
|
|
90
|
+
#### Option 2: Target the new classes
|
|
91
|
+
|
|
92
|
+
This option is **not recommended** and should be used as a last resort, as the class names can change in future, in which case your stylesheet will no longer have any effect. It is recommended to use design tokens or custom classes instead.
|
|
93
|
+
|
|
94
|
+
### Theme tokens
|
|
95
|
+
|
|
96
|
+
There are a few token changes that have changed (though this has been relatively minor). The version 5 themes have been updated to use the new design tokens, however if you are using version 4 in parallel with version 5, you may notice that the version 4 styles can no longer find the removed/changed tokens.
|
|
97
|
+
|
|
98
|
+
To fix this issue, please backfill the tokens in your application until you have finished your migration.
|
|
99
|
+
|
|
100
|
+
AG grid theme
|
|
101
|
+
-------------
|
|
102
|
+
|
|
103
|
+
As of version 5, we only support the lite AG grid theme, which is used in conjunction with the default alpine theme. In version 5, its imports have changed slightly.
|
|
104
|
+
|
|
105
|
+
Run the following command to install the AG grid lite theme:
|
|
106
|
+
|
|
107
|
+
Then you can import the AG Grid theme CSS, import the relevant IDS theme, and hook up the styles by setting a class of ag-theme-alpine ag-theme-iress-lite on your grid wrapper.
|
|
108
|
+
|
|
109
|
+
Diff
|
|
110
|
+
|
|
111
|
+
Old
|
|
112
|
+
|
|
113
|
+
New
|
|
114
|
+
|
|
115
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">import "@iress/themes/build/css/iress-theme-dark.css";</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import "@iress/themes/global.css";</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">import 'ag-grid-community/styles/ag-grid.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">import 'ag-grid-community/styles/ag-theme-alpine.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import '@iress/ag-grid-theme/dist/lite/css/all.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">import '@iress/ag-grid-theme/dist/ag-theme-iress-lite.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">// You can also include variables, styles and utilities separately for easy debugging</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/lite/css/variables.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/css/variables.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/lite/css/styles.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/css/styles.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/lite/css/utilities.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">// import '@iress/ag-grid-theme/dist/css/utilities.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-10regm7-empty-line"><pre></pre></td><td class="css-vl0irh-content css-10regm7-empty-line"><pre class="css-o1u8iu-content-text"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"><div className="ag-theme-alpine ag-theme-iress-lite"></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"> <AgGridReact /></pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text"></div></pre></td></tr></tbody></table>
|
|
116
|
+
|
|
117
|
+
Removing version 4
|
|
118
|
+
------------------
|
|
119
|
+
|
|
120
|
+
Version 5 and version 4 can be run in parallel, but it is recommended to remove version 4 to avoid any conflicts once you have completely migrated over your components.
|
|
121
|
+
|
|
122
|
+
Run the following to remove version 4 and its related packages:
|
|
123
|
+
|
|
124
|
+
### Remove `global.css`
|
|
125
|
+
|
|
126
|
+
The `global.css` file has been removed, it is now recommended to include the Roboto font directly using Google Fonts.
|
|
127
|
+
|
|
128
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import '@iress/themes/global.css';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"><link</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;700&display=swap"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> rel="stylesheet"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text">/></pre></td></tr></tbody></table>
|
|
129
|
+
|
|
130
|
+
### Remove from Jest configuration
|
|
131
|
+
|
|
132
|
+
If you are using Jest, you will need to update your Jest configuration to remove the old IDS packages from your `transformIgnorePatterns`.
|
|
133
|
+
|
|
134
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">"transformIgnorePatterns": [</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> "node_modules/(?!(@iress/components-react|@iress/components|@iress/components-react-custom-elements|@stencil/core)/)"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-cnnxkz-diff-added"><pre>+</pre></td><td class="css-vl0irh-content css-cnnxkz-diff-added"><pre class="css-o1u8iu-content-text"> "/node_modules/(?!@iress-oss/ids-components)"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker"><pre></pre></td><td class="css-vl0irh-content"><pre class="css-o1u8iu-content-text">]</pre></td></tr></tbody></table>
|
|
135
|
+
|
|
136
|
+
You can also remove the `mockLazyLoadedComponents` function from your Jest setup.
|
|
137
|
+
|
|
138
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">import { mockLazyLoadedComponents } from '@iress/ids-react-test-utils/dist/react-test-utils/src/mocks/mockLazyLoadedComponents';</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">mockLazyLoadedComponents();</pre></td></tr></tbody></table>
|
|
139
|
+
|
|
140
|
+
You should also be able to remove the style mocks from your Jest configuration's `moduleNameMapper`, unless you are using CSS-in-JS, as IDS no longer injects CSS into the DOM.
|
|
141
|
+
|
|
142
|
+
<table class="css-1n5o7vh-diff-container"><tbody><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">"moduleNameMapper": {</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text"> "\.css$": "<rootDir>/PATH/TO/style-mock.ts"</pre></td></tr><tr class="css-1n7ec1i-line"><td class="css-17vezug-marker css-rq9a2a-diff-removed"><pre>-</pre></td><td class="css-vl0irh-content css-rq9a2a-diff-removed"><pre class="css-o1u8iu-content-text">}</pre></td></tr></tbody></table>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Colour
|
|
2
|
+
======
|
|
3
|
+
|
|
4
|
+
These are all styling props related to changing the foreground and background colours of a component.
|
|
5
|
+
|
|
6
|
+
`bg`
|
|
7
|
+
----
|
|
8
|
+
|
|
9
|
+
The `bg` prop allows you to change the background of any component to the value of a colour token. It should be used sparingly, and usually alongside the `color` prop to ensure accessibility.
|
|
10
|
+
|
|
11
|
+
Below is an example of a component using `bg` and `color` to create a featured panel that changes colour depending on the theme.
|
|
12
|
+
|
|
13
|
+
[](./iframe.html?id=styling-props-colour--bg)
|
|
14
|
+
|
|
15
|
+
##### Featured panel
|
|
16
|
+
|
|
17
|
+
This is a featured panel, in case you want to highlight something important or draw attention to a specific piece of content.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressPanel
|
|
22
|
+
bg\="colour.primary.fill"
|
|
23
|
+
color\="colour.primary.onFill"
|
|
24
|
+
\>
|
|
25
|
+
<h5\>
|
|
26
|
+
Featured panel </h5\>
|
|
27
|
+
<p\>
|
|
28
|
+
This is a featured panel, in case you want to highlight something important or draw attention to a specific piece of content. </p\>
|
|
29
|
+
</IressPanel\>
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Props
|
|
34
|
+
|
|
35
|
+
| Name | Description | Default | Control |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| bg |
|
|
38
|
+
string
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
| \- | colour.primary.fill |
|
|
43
|
+
| color |
|
|
44
|
+
|
|
45
|
+
string
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
| \- |
|
|
50
|
+
|
|
51
|
+
|
|
|
52
|
+
|
|
53
|
+
`color`
|
|
54
|
+
-------
|
|
55
|
+
|
|
56
|
+
The `color` prop allows you to change the foreground of any component to the value of a colour token. It should be used sparingly, and usually alongside the `bg` prop to ensure accessibility.
|
|
57
|
+
|
|
58
|
+
Below is an example of using the `color` prop to highlight text throughout a component.
|
|
59
|
+
|
|
60
|
+
[](./iframe.html?id=styling-props-colour--color)
|
|
61
|
+
|
|
62
|
+
Sometimes actions are **successful**, and sometimes they are **dangerous**.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
<IressPanel\>
|
|
67
|
+
<p\>
|
|
68
|
+
Sometimes actions are{' '}
|
|
69
|
+
<IressText
|
|
70
|
+
color\="colour.system.success.text"
|
|
71
|
+
element\="strong"
|
|
72
|
+
\>
|
|
73
|
+
successful </IressText\>
|
|
74
|
+
, and sometimes they are{' '}
|
|
75
|
+
<IressText
|
|
76
|
+
color\="colour.system.danger.text"
|
|
77
|
+
element\="strong"
|
|
78
|
+
\>
|
|
79
|
+
dangerous </IressText\>
|
|
80
|
+
. </p\>
|
|
81
|
+
</IressPanel\>
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### Props
|
|
86
|
+
|
|
87
|
+
Args table with interactive controls couldn't be auto-generated
|
|
88
|
+
|
|
89
|
+
Controls give you an easy to use interface to test your components. Set your story args and you'll see controls appearing here automatically.
|
|
90
|
+
|
|
91
|
+
[Learn how to set that up](https://storybook.js.org/docs/essentials/controls?ref=ui)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Elevation
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
These are all styling props related to changing the elevation of a component to help guide visual hierarchy.
|
|
5
|
+
|
|
6
|
+
`layerStyle`
|
|
7
|
+
------------
|
|
8
|
+
|
|
9
|
+
The `layerStyle` prop allows you to draw attention to certain parts of the screen, making a screen easier to scan. The following styles are available:
|
|
10
|
+
|
|
11
|
+
* `elevation.raised`: Raised elevations sit slightly higher than other content. They are reserved for cards that can be moved, such as Jira issue cards and Trello cards. In special circumstances, they can be used for cards as a way to provide additional heirarchy or emphasis.
|
|
12
|
+
* `elevation.floating`: Floating is the highest elevation available. It is reserved for a UI that sits over another UI, such as modals, dialogs, dropdown menus, floating toolbars, and floating single-action buttons.
|
|
13
|
+
* `elevation.overflow`: Overflow is a shadow indicating content has scrolled outside a view. It can be used for vertical or horizontal scroll. An example of overflow shadows is the horizontal scroll in tables on a Confluence page.
|
|
14
|
+
|
|
15
|
+
[](./iframe.html?id=styling-props-elevation--layer-style)
|
|
16
|
+
|
|
17
|
+
This panel is raised. This is useful for creating a visual hierarchy and drawing attention to important content.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
<IressPanel layerStyle\="elevation.raised"\>
|
|
22
|
+
This panel is raised. This is useful for creating a visual hierarchy and drawing attention to important content.
|
|
23
|
+
</IressPanel\>
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Props
|
|
28
|
+
|
|
29
|
+
| Name | Description | Default | Control |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
| layerStyle |
|
|
32
|
+
string
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
| \- | elevation.raised |
|
|
37
|
+
|
|
38
|
+
`focusable`
|
|
39
|
+
-----------
|
|
40
|
+
|
|
41
|
+
The `focusable` prop allows you to set the focus state of a component. This is useful for components that need to be interactive via keyboard, but are not necessarily a button or input.
|
|
42
|
+
|
|
43
|
+
It can be set to `true` to enable focus styles when the element is focused using keyboard navigation, or `within` to show focus styles when an element within is focused.
|
|
44
|
+
|
|
45
|
+
[](./iframe.html?id=styling-props-elevation--focusable)
|
|
46
|
+
|
|
47
|
+
This element will have focus styles applied when it is focused. This is useful for accessibility and keyboard navigation.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
<IressPanel
|
|
52
|
+
focusable\="true"
|
|
53
|
+
tabIndex\={0}
|
|
54
|
+
\>
|
|
55
|
+
This element will have focus styles applied when it is focused. This is useful for accessibility and keyboard navigation.
|
|
56
|
+
</IressPanel\>
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Props
|
|
61
|
+
|
|
62
|
+
| Name | Description | Default | Control |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| focusable |
|
|
65
|
+
string
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
| \- | true |
|