@iress-oss/ids-mcp-server 0.0.1-dev.0
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/LICENSE.txt +201 -0
- package/README.md +93 -0
- package/dist/componentHandlers.js +241 -0
- package/dist/componentHandlers.test.js +380 -0
- package/dist/config.js +16 -0
- package/dist/index.js +53 -0
- package/dist/iressHandlers.js +144 -0
- package/dist/iressHandlers.test.js +316 -0
- package/dist/resourceHandlers.js +67 -0
- package/dist/resourceHandlers.test.js +352 -0
- package/dist/searchHandlers.js +287 -0
- package/dist/searchHandlers.test.js +524 -0
- package/dist/toolHandler.js +31 -0
- package/dist/toolHandler.test.js +369 -0
- package/dist/tools.js +165 -0
- package/dist/types.js +4 -0
- package/dist/utils.js +59 -0
- package/dist/utils.test.js +286 -0
- package/generated/docs/components-alert-docs.md +130 -0
- package/generated/docs/components-autocomplete-docs.md +754 -0
- package/generated/docs/components-autocomplete-recipes-docs.md +104 -0
- package/generated/docs/components-badge-docs.md +148 -0
- package/generated/docs/components-button-docs.md +362 -0
- package/generated/docs/components-button-recipes-docs.md +76 -0
- package/generated/docs/components-buttongroup-docs.md +310 -0
- package/generated/docs/components-card-docs.md +494 -0
- package/generated/docs/components-card-recipes-docs.md +89 -0
- package/generated/docs/components-checkbox-docs.md +193 -0
- package/generated/docs/components-checkboxgroup-docs.md +692 -0
- package/generated/docs/components-checkboxgroup-recipes-docs.md +119 -0
- package/generated/docs/components-col-docs.md +466 -0
- package/generated/docs/components-combobox-docs.md +1016 -0
- package/generated/docs/components-container-docs.md +91 -0
- package/generated/docs/components-divider-docs.md +176 -0
- package/generated/docs/components-expander-docs.md +215 -0
- package/generated/docs/components-field-docs.md +675 -0
- package/generated/docs/components-filter-docs.md +1109 -0
- package/generated/docs/components-form-docs.md +2442 -0
- package/generated/docs/components-form-recipes-docs.md +892 -0
- package/generated/docs/components-hide-docs.md +265 -0
- package/generated/docs/components-icon-docs.md +553 -0
- package/generated/docs/components-inline-docs.md +868 -0
- package/generated/docs/components-input-docs.md +335 -0
- package/generated/docs/components-input-recipes-docs.md +140 -0
- package/generated/docs/components-inputcurrency-docs.md +157 -0
- package/generated/docs/components-inputcurrency-recipes-docs.md +116 -0
- package/generated/docs/components-label-docs.md +135 -0
- package/generated/docs/components-menu-docs.md +704 -0
- package/generated/docs/components-menu-menuitem-docs.md +193 -0
- package/generated/docs/components-modal-docs.md +587 -0
- package/generated/docs/components-navbar-docs.md +291 -0
- package/generated/docs/components-navbar-recipes-docs.md +413 -0
- package/generated/docs/components-panel-docs.md +380 -0
- package/generated/docs/components-placeholder-docs.md +27 -0
- package/generated/docs/components-popover-docs.md +464 -0
- package/generated/docs/components-popover-recipes-docs.md +245 -0
- package/generated/docs/components-progress-docs.md +104 -0
- package/generated/docs/components-radio-docs.md +107 -0
- package/generated/docs/components-radiogroup-docs.md +683 -0
- package/generated/docs/components-readonly-docs.md +89 -0
- package/generated/docs/components-richselect-docs.md +2433 -0
- package/generated/docs/components-row-docs.md +877 -0
- package/generated/docs/components-select-docs.md +456 -0
- package/generated/docs/components-skeleton-docs.md +214 -0
- package/generated/docs/components-skeleton-recipes-docs.md +76 -0
- package/generated/docs/components-skiplink-docs.md +66 -0
- package/generated/docs/components-slideout-docs.md +538 -0
- package/generated/docs/components-slider-docs.md +346 -0
- package/generated/docs/components-spinner-docs.md +59 -0
- package/generated/docs/components-stack-docs.md +265 -0
- package/generated/docs/components-table-ag-grid-docs.md +2666 -0
- package/generated/docs/components-table-docs.md +1305 -0
- package/generated/docs/components-tabset-docs.md +341 -0
- package/generated/docs/components-tabset-tab-docs.md +86 -0
- package/generated/docs/components-tag-docs.md +115 -0
- package/generated/docs/components-text-docs.md +394 -0
- package/generated/docs/components-toaster-docs.md +294 -0
- package/generated/docs/components-toaster-toast-docs.md +157 -0
- package/generated/docs/components-toggle-docs.md +158 -0
- package/generated/docs/components-tooltip-docs.md +311 -0
- package/generated/docs/components-validationmessage-docs.md +241 -0
- package/generated/docs/contact-us-docs.md +27 -0
- package/generated/docs/extensions-editor-docs.md +288 -0
- package/generated/docs/extensions-editor-recipes-docs.md +39 -0
- package/generated/docs/foundations-accessibility-docs.md +62 -0
- package/generated/docs/foundations-colours-docs.md +257 -0
- package/generated/docs/foundations-consistency-docs.md +52 -0
- package/generated/docs/foundations-content-docs.md +23 -0
- package/generated/docs/foundations-introduction-docs.md +17 -0
- package/generated/docs/foundations-principles-docs.md +70 -0
- package/generated/docs/foundations-typography-docs.md +191 -0
- package/generated/docs/foundations-user-experience-docs.md +63 -0
- package/generated/docs/foundations-visual-design-docs.md +46 -0
- package/generated/docs/frequently-asked-questions-docs.md +53 -0
- package/generated/docs/get-started-develop-docs.md +48 -0
- package/generated/docs/get-started-using-storybook-docs.md +68 -0
- package/generated/docs/guidelines.md +812 -0
- package/generated/docs/introduction-docs.md +43 -0
- package/generated/docs/patterns-loading-docs.md +1304 -0
- package/generated/docs/resources-changelog-docs.md +6 -0
- package/generated/docs/resources-code-katas-docs.md +29 -0
- package/generated/docs/resources-migration-guides-from-v4-to-v5-docs.md +437 -0
- package/generated/docs/themes-available-themes-docs.md +66 -0
- package/generated/docs/themes-introduction-docs.md +121 -0
- package/generated/docs/themes-tokens-docs.md +1200 -0
- package/generated/docs/versions-docs.md +17 -0
- package/package.json +81 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[](#toast)Toast
|
|
2
|
+
===============
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Toast are a compact way to provide users with important information, usually within a toaster.
|
|
8
|
+
|
|
9
|
+
This documentation is for the standalone `IressToast` component, and has been exposed for complex use cases where you are unable to use the `useToaster` hook. For most use cases, please use the hook and provider documented at [Toaster documentation](./?path=/docs/components-toaster--docs).
|
|
10
|
+
|
|
11
|
+
Error
|
|
12
|
+
-----
|
|
13
|
+
|
|
14
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
15
|
+
|
|
16
|
+
Hide code
|
|
17
|
+
|
|
18
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
19
|
+
|
|
20
|
+
<IressToast
|
|
21
|
+
heading\="Error"
|
|
22
|
+
status\="error"
|
|
23
|
+
\>
|
|
24
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
25
|
+
</IressToast\>
|
|
26
|
+
|
|
27
|
+
Copy
|
|
28
|
+
|
|
29
|
+
[](#examples)Examples
|
|
30
|
+
---------------------
|
|
31
|
+
|
|
32
|
+
### [](#status)Status
|
|
33
|
+
|
|
34
|
+
The toast offers three status that set a distinctive colour and icon. They can be set using the `status` prop. Their different use cases are described here.
|
|
35
|
+
|
|
36
|
+
Success
|
|
37
|
+
-------
|
|
38
|
+
|
|
39
|
+
Use to communicate that an action has been successfully completed, such as saving changes in a form.
|
|
40
|
+
|
|
41
|
+
Error
|
|
42
|
+
-----
|
|
43
|
+
|
|
44
|
+
Error toasts are useful for when a user has tried to submit some data but the submit has failed, due to an api error or loss of internet connection, for example.
|
|
45
|
+
|
|
46
|
+
Info
|
|
47
|
+
----
|
|
48
|
+
|
|
49
|
+
Ideal for conveying updates or notifications that do not require immediate action, as well as gently inform users about events or changes within an application or interface.
|
|
50
|
+
|
|
51
|
+
Hide code
|
|
52
|
+
|
|
53
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
54
|
+
|
|
55
|
+
<IressStack gutter\="lg"\>
|
|
56
|
+
<IressToast
|
|
57
|
+
heading\="Success"
|
|
58
|
+
status\="success"
|
|
59
|
+
\>
|
|
60
|
+
Use to communicate that an action has been successfully completed, such as saving changes in a form. </IressToast\>
|
|
61
|
+
<IressToast
|
|
62
|
+
heading\="Error"
|
|
63
|
+
status\="error"
|
|
64
|
+
\>
|
|
65
|
+
Error toasts are useful for when a user has tried to submit some data but the submit has failed, due to an api error or loss of internet connection, for example. </IressToast\>
|
|
66
|
+
<IressToast
|
|
67
|
+
heading\="Info"
|
|
68
|
+
status\="info"
|
|
69
|
+
\>
|
|
70
|
+
Ideal for conveying updates or notifications that do not require immediate action, as well as gently inform users about events or changes within an application or interface. </IressToast\>
|
|
71
|
+
</IressStack\>
|
|
72
|
+
|
|
73
|
+
Copy
|
|
74
|
+
|
|
75
|
+
### [](#heading)Heading
|
|
76
|
+
|
|
77
|
+
Use the `heading` prop to add a header to the toast. The header can be any component you like, but it is designed to support a simple heading element. If provided a string, it will display a `<h2 />` element with the string as its content.
|
|
78
|
+
|
|
79
|
+
**Note:** `headingText` and `headingLevel` props have been replaced with the `heading` render prop to give you more control over the `heading` element and its content. To use the previous behaviour, you can pass a string which will automatically create a `h2` element, or pass a `h*` element with the text as a child.
|
|
80
|
+
|
|
81
|
+
Toast with a h2 tag
|
|
82
|
+
-------------------
|
|
83
|
+
|
|
84
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
85
|
+
|
|
86
|
+
Hide code
|
|
87
|
+
|
|
88
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
89
|
+
|
|
90
|
+
<IressToast
|
|
91
|
+
heading\={<h2\>Toast with a h2 tag</h2\>}
|
|
92
|
+
status\="error"
|
|
93
|
+
\>
|
|
94
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
95
|
+
</IressToast\>
|
|
96
|
+
|
|
97
|
+
Copy
|
|
98
|
+
|
|
99
|
+
### [](#footer)Footer
|
|
100
|
+
|
|
101
|
+
The `footer` prop allows for content to be placed below the header and body of the alert. This can be useful for displaying call to actions.
|
|
102
|
+
|
|
103
|
+
Error
|
|
104
|
+
-----
|
|
105
|
+
|
|
106
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
107
|
+
|
|
108
|
+
Try Again
|
|
109
|
+
|
|
110
|
+
Hide code
|
|
111
|
+
|
|
112
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
113
|
+
|
|
114
|
+
<IressToast
|
|
115
|
+
actions\={<IressButton key\="test" mode\="danger"\>Try Again</IressButton\>}
|
|
116
|
+
heading\="Error"
|
|
117
|
+
status\="error"
|
|
118
|
+
\>
|
|
119
|
+
Connection failure. Longer text description should wrap and look like this. Try to limit to 3 lines or less.
|
|
120
|
+
</IressToast\>
|
|
121
|
+
|
|
122
|
+
Copy
|
|
123
|
+
|
|
124
|
+
### [](#dismiss-button)Dismiss Button
|
|
125
|
+
|
|
126
|
+
Dismiss Button is on the top right corner and it's showing/hiding based on `dismissible` prop.
|
|
127
|
+
|
|
128
|
+
**Note:** When it's `true`, `onClose` event is going to be available.
|
|
129
|
+
|
|
130
|
+
Information
|
|
131
|
+
-----------
|
|
132
|
+
|
|
133
|
+
Information toast with dismiss button
|
|
134
|
+
|
|
135
|
+
Hide code
|
|
136
|
+
|
|
137
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
138
|
+
|
|
139
|
+
<IressToast
|
|
140
|
+
dismissible
|
|
141
|
+
heading\="Information"
|
|
142
|
+
status\="info"
|
|
143
|
+
\>
|
|
144
|
+
Information toast with dismiss button
|
|
145
|
+
</IressToast\>
|
|
146
|
+
|
|
147
|
+
Copy
|
|
148
|
+
|
|
149
|
+
On this page
|
|
150
|
+
|
|
151
|
+
* [Overview](#overview)
|
|
152
|
+
* [Props](#props)
|
|
153
|
+
* [Examples](#examples)
|
|
154
|
+
* [Status](#status)
|
|
155
|
+
* [Heading](#heading)
|
|
156
|
+
* [Footer](#footer)
|
|
157
|
+
* [Dismiss Button](#dismiss-button)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
[](#toggle)Toggle
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Toggles allow users to turn things on or off. When toggled, the associated change happens straight away.
|
|
8
|
+
|
|
9
|
+
Toggle
|
|
10
|
+
|
|
11
|
+
Hide code
|
|
12
|
+
|
|
13
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
14
|
+
|
|
15
|
+
<IressToggle
|
|
16
|
+
layout\="inline"
|
|
17
|
+
\>
|
|
18
|
+
Toggle
|
|
19
|
+
</IressToggle\>
|
|
20
|
+
|
|
21
|
+
Copy
|
|
22
|
+
|
|
23
|
+
[](#usage)Usage
|
|
24
|
+
---------------
|
|
25
|
+
|
|
26
|
+
Toggles are typically on / off switches, similar to a household light switch. They allow users to choose between two mutually exclusive options, and will always have a default value.
|
|
27
|
+
|
|
28
|
+
The `IressToggle` component should only be used for actions that happen immediately, for example switching a device's WiFi connection on or off.
|
|
29
|
+
|
|
30
|
+
Don't use Toggles in forms
|
|
31
|
+
--------------------------
|
|
32
|
+
|
|
33
|
+
Toggles shouldn’t be used as part of a form as they don’t have the correct semantics, and won’t submit a value when the form data is submitted. If you need a toggleable component in a form, use a checkbox or radio group instead.
|
|
34
|
+
|
|
35
|
+
### [](#labels)Labels
|
|
36
|
+
|
|
37
|
+
Toggles should always have a label, which is set via its `children`.
|
|
38
|
+
|
|
39
|
+
Toggle
|
|
40
|
+
|
|
41
|
+
Hide code
|
|
42
|
+
|
|
43
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
44
|
+
|
|
45
|
+
<IressToggle
|
|
46
|
+
layout\="inline"
|
|
47
|
+
\>
|
|
48
|
+
Toggle
|
|
49
|
+
</IressToggle\>
|
|
50
|
+
|
|
51
|
+
Copy
|
|
52
|
+
|
|
53
|
+
### [](#hidden-labels)Hidden labels
|
|
54
|
+
|
|
55
|
+
Labels can be hidden via the `hiddenLabel` prop; this will hide the label from view, but it'll still be available to screen reader users.
|
|
56
|
+
|
|
57
|
+
Toggle
|
|
58
|
+
|
|
59
|
+
Hide code
|
|
60
|
+
|
|
61
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
62
|
+
|
|
63
|
+
<IressToggle
|
|
64
|
+
hiddenLabel
|
|
65
|
+
layout\="inline"
|
|
66
|
+
\>
|
|
67
|
+
Toggle
|
|
68
|
+
</IressToggle\>
|
|
69
|
+
|
|
70
|
+
Copy
|
|
71
|
+
|
|
72
|
+
### [](#checked)Checked
|
|
73
|
+
|
|
74
|
+
The on / off state of the toggle can be controlled by setting the `checked` prop.
|
|
75
|
+
|
|
76
|
+
Toggle
|
|
77
|
+
|
|
78
|
+
Hide code
|
|
79
|
+
|
|
80
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
81
|
+
|
|
82
|
+
<IressToggle
|
|
83
|
+
checked
|
|
84
|
+
layout\="inline"
|
|
85
|
+
\>
|
|
86
|
+
Toggle
|
|
87
|
+
</IressToggle\>
|
|
88
|
+
|
|
89
|
+
Copy
|
|
90
|
+
|
|
91
|
+
### [](#layout)Layout
|
|
92
|
+
|
|
93
|
+
The `layout` prop allows you to control the position of the label in relation to the control. The default layout is `inline`, but you can also choose the following options:',
|
|
94
|
+
|
|
95
|
+
* `inline-between` similar to inline, but this positions the label and control at opposite ends of their container
|
|
96
|
+
* `inline-reverse` renders the label after the control instead of before the control
|
|
97
|
+
* `stack` positions the label above the control
|
|
98
|
+
|
|
99
|
+
Toggle
|
|
100
|
+
|
|
101
|
+
Toggle
|
|
102
|
+
|
|
103
|
+
Toggle
|
|
104
|
+
|
|
105
|
+
Toggle
|
|
106
|
+
|
|
107
|
+
Hide code
|
|
108
|
+
|
|
109
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
110
|
+
|
|
111
|
+
<IressRow gutter\="lg"\>
|
|
112
|
+
<IressCol span\="12"\>
|
|
113
|
+
<IressPanel background\="alt"\>
|
|
114
|
+
<IressToggle
|
|
115
|
+
layout\="inline"
|
|
116
|
+
\>
|
|
117
|
+
Toggle </IressToggle\>
|
|
118
|
+
</IressPanel\>
|
|
119
|
+
</IressCol\>
|
|
120
|
+
<IressCol span\="12"\>
|
|
121
|
+
<IressPanel background\="alt"\>
|
|
122
|
+
<IressToggle
|
|
123
|
+
checked
|
|
124
|
+
layout\="inline-between"
|
|
125
|
+
\>
|
|
126
|
+
Toggle </IressToggle\>
|
|
127
|
+
</IressPanel\>
|
|
128
|
+
</IressCol\>
|
|
129
|
+
<IressCol span\="12"\>
|
|
130
|
+
<IressPanel background\="alt"\>
|
|
131
|
+
<IressToggle
|
|
132
|
+
layout\="inline-reverse"
|
|
133
|
+
\>
|
|
134
|
+
Toggle </IressToggle\>
|
|
135
|
+
</IressPanel\>
|
|
136
|
+
</IressCol\>
|
|
137
|
+
<IressCol span\="12"\>
|
|
138
|
+
<IressPanel background\="alt"\>
|
|
139
|
+
<IressToggle
|
|
140
|
+
checked
|
|
141
|
+
layout\="stack"
|
|
142
|
+
\>
|
|
143
|
+
Toggle </IressToggle\>
|
|
144
|
+
</IressPanel\>
|
|
145
|
+
</IressCol\>
|
|
146
|
+
</IressRow\>
|
|
147
|
+
|
|
148
|
+
Copy
|
|
149
|
+
|
|
150
|
+
On this page
|
|
151
|
+
|
|
152
|
+
* [Overview](#overview)
|
|
153
|
+
* [Props](#props)
|
|
154
|
+
* [Usage](#usage)
|
|
155
|
+
* [Labels](#labels)
|
|
156
|
+
* [Hidden labels](#hidden-labels)
|
|
157
|
+
* [Checked](#checked)
|
|
158
|
+
* [Layout](#layout)
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
[](#tooltip)Tooltip
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
A component that shows concise, informative text about an element when focussed upon, hovered over or on a long touch.
|
|
8
|
+
|
|
9
|
+
Hover me
|
|
10
|
+
|
|
11
|
+
Hide code
|
|
12
|
+
|
|
13
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
14
|
+
|
|
15
|
+
<IressTooltip tooltipText\="Hello! This is a really long tooltip to try and see if it goes behind the scrollbar"\>
|
|
16
|
+
<IressButton\>
|
|
17
|
+
Hover me </IressButton\>
|
|
18
|
+
</IressTooltip\>
|
|
19
|
+
|
|
20
|
+
Copy
|
|
21
|
+
|
|
22
|
+
[](#usage)Usage
|
|
23
|
+
---------------
|
|
24
|
+
|
|
25
|
+
The content that will be displayed in the tooltip is passed using the `tooltipText` prop.
|
|
26
|
+
|
|
27
|
+
This content can only be plain text; there is no parsing of any markup or styling. This is by design as we do not allow complex structures in a tooltip as they are meant to be concise, informative pieces of text.
|
|
28
|
+
|
|
29
|
+
Text content will wrap on to a new line if it exceeds the tooltip's maximum width. You can also manually format your content into multiple lines by passing an array of strings into the `tooltipText` prop.
|
|
30
|
+
|
|
31
|
+
Single line
|
|
32
|
+
|
|
33
|
+
Multi line
|
|
34
|
+
|
|
35
|
+
Hide code
|
|
36
|
+
|
|
37
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
style\={{
|
|
41
|
+
paddingTop: '30px'
|
|
42
|
+
}}
|
|
43
|
+
\>
|
|
44
|
+
<IressInline gutter\="md"\>
|
|
45
|
+
<IressTooltip tooltipText\="Single line Hello! This is a really long tooltip to try and see if it goes behind the scrollbar"\>
|
|
46
|
+
<IressButton\>
|
|
47
|
+
Single line </IressButton\>
|
|
48
|
+
</IressTooltip\>
|
|
49
|
+
<IressTooltip
|
|
50
|
+
tooltipText\={\[
|
|
51
|
+
'This tooltip',
|
|
52
|
+
'has multiple lines'
|
|
53
|
+
\]}
|
|
54
|
+
\>
|
|
55
|
+
<IressButton\>
|
|
56
|
+
Multi line </IressButton\>
|
|
57
|
+
</IressTooltip\>
|
|
58
|
+
</IressInline\>
|
|
59
|
+
</div\>
|
|
60
|
+
|
|
61
|
+
Copy
|
|
62
|
+
|
|
63
|
+
[](#behaviour)Behaviour
|
|
64
|
+
-----------------------
|
|
65
|
+
|
|
66
|
+
The behaviour of tooltips varies according to how they're shown:
|
|
67
|
+
|
|
68
|
+
* When a pointer is moved over the activator the tooltip will be shown, and will remain visible for a short period of time after the pointer has moved away (500ms is the default time)
|
|
69
|
+
* If the activator receives keyboard focus the tooltip will be visible. The tooltip will hide immediately after the focus moves away from the activator.
|
|
70
|
+
* If the user long presses on the activator (on a touch device). The tooltip will remain visible until the user taps somewhere else on the screen
|
|
71
|
+
|
|
72
|
+
If the user activates a tooltip via a pointing device and then moves the pointer over the tooltip, it will remain on screen until the pointer is moved away. This is for accessibility purposes where a user may be using magnifying software for example.
|
|
73
|
+
|
|
74
|
+
[](#accessibility)Accessibility
|
|
75
|
+
-------------------------------
|
|
76
|
+
|
|
77
|
+
The WCAG guidelines for content that is displayed on hover or focus can be found here: [WCAG 2.1 - 1.4.13 (AA)](https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus).
|
|
78
|
+
|
|
79
|
+
Other things to keep in mind:
|
|
80
|
+
|
|
81
|
+
* For best accessibility, you should only use tooltips on focusable items (eg. `IressButton` and `IressMenuItem`), allowing them to be seen when navigating to the tooltip activator by keyboard
|
|
82
|
+
|
|
83
|
+
**Notes:**
|
|
84
|
+
|
|
85
|
+
* If the text you wish to display is more than a handful of words then consider using an IressModal with an information button.
|
|
86
|
+
* Tooltips must not be used for help text as they are not immediately visible to the user. We suggest adding hint text to assist the user when filling out forms.
|
|
87
|
+
* Also think about placement using the align prop. The tooltip should not obscure any critical screen content. Another reason to keep them short.
|
|
88
|
+
|
|
89
|
+
[](#examples)Examples
|
|
90
|
+
---------------------
|
|
91
|
+
|
|
92
|
+
### [](#align)Align
|
|
93
|
+
|
|
94
|
+
The tooltip can be aligned in one of 12 positions relative to the activator element.
|
|
95
|
+
|
|
96
|
+
The tooltip's position will change dynamically based on the amount of space available in its container window, so that it doesn't overflow the edge. For example, if the tooltip is about to scroll off the top of the screen, it will change its position to bottom. Likewise with left and right scrolling.
|
|
97
|
+
|
|
98
|
+
Top Start
|
|
99
|
+
|
|
100
|
+
Top
|
|
101
|
+
|
|
102
|
+
Top End
|
|
103
|
+
|
|
104
|
+
Left Start
|
|
105
|
+
|
|
106
|
+
Left
|
|
107
|
+
|
|
108
|
+
Left End
|
|
109
|
+
|
|
110
|
+
Right Start
|
|
111
|
+
|
|
112
|
+
Right
|
|
113
|
+
|
|
114
|
+
Right End
|
|
115
|
+
|
|
116
|
+
Bottom Start
|
|
117
|
+
|
|
118
|
+
Bottom
|
|
119
|
+
|
|
120
|
+
Bottom End
|
|
121
|
+
|
|
122
|
+
Hide code
|
|
123
|
+
|
|
124
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
125
|
+
|
|
126
|
+
<div
|
|
127
|
+
style\={{
|
|
128
|
+
padding: '80px 150px'
|
|
129
|
+
}}
|
|
130
|
+
\>
|
|
131
|
+
<IressStack gutter\="md"\>
|
|
132
|
+
<IressInline
|
|
133
|
+
gutter\="sm"
|
|
134
|
+
horizontalAlign\="center"
|
|
135
|
+
\>
|
|
136
|
+
<IressTooltip
|
|
137
|
+
align\="top-start"
|
|
138
|
+
tooltipText\="Hello!"
|
|
139
|
+
\>
|
|
140
|
+
<IressButton\>
|
|
141
|
+
Top Start </IressButton\>
|
|
142
|
+
</IressTooltip\>
|
|
143
|
+
<IressTooltip
|
|
144
|
+
align\="top"
|
|
145
|
+
tooltipText\="Hello!"
|
|
146
|
+
\>
|
|
147
|
+
<IressButton\>
|
|
148
|
+
Top </IressButton\>
|
|
149
|
+
</IressTooltip\>
|
|
150
|
+
<IressTooltip
|
|
151
|
+
align\="top-end"
|
|
152
|
+
tooltipText\="Hello!"
|
|
153
|
+
\>
|
|
154
|
+
<IressButton\>
|
|
155
|
+
Top End </IressButton\>
|
|
156
|
+
</IressTooltip\>
|
|
157
|
+
</IressInline\>
|
|
158
|
+
<IressInline horizontalAlign\="between"\>
|
|
159
|
+
<IressStack gutter\="sm"\>
|
|
160
|
+
<IressInline horizontalAlign\="left"\>
|
|
161
|
+
<IressTooltip
|
|
162
|
+
align\="left-start"
|
|
163
|
+
tooltipText\="Hello!"
|
|
164
|
+
\>
|
|
165
|
+
<IressButton\>
|
|
166
|
+
Left Start </IressButton\>
|
|
167
|
+
</IressTooltip\>
|
|
168
|
+
</IressInline\>
|
|
169
|
+
<IressInline horizontalAlign\="left"\>
|
|
170
|
+
<IressTooltip
|
|
171
|
+
align\="left"
|
|
172
|
+
tooltipText\="Hello!"
|
|
173
|
+
\>
|
|
174
|
+
<IressButton\>
|
|
175
|
+
Left </IressButton\>
|
|
176
|
+
</IressTooltip\>
|
|
177
|
+
</IressInline\>
|
|
178
|
+
<IressInline horizontalAlign\="left"\>
|
|
179
|
+
<IressTooltip
|
|
180
|
+
align\="left-end"
|
|
181
|
+
tooltipText\="Hello!"
|
|
182
|
+
\>
|
|
183
|
+
<IressButton\>
|
|
184
|
+
Left End </IressButton\>
|
|
185
|
+
</IressTooltip\>
|
|
186
|
+
</IressInline\>
|
|
187
|
+
</IressStack\>
|
|
188
|
+
<IressStack gutter\="sm"\>
|
|
189
|
+
<IressInline horizontalAlign\="right"\>
|
|
190
|
+
<IressTooltip
|
|
191
|
+
align\="right-start"
|
|
192
|
+
tooltipText\="Hello!"
|
|
193
|
+
\>
|
|
194
|
+
<IressButton\>
|
|
195
|
+
Right Start </IressButton\>
|
|
196
|
+
</IressTooltip\>
|
|
197
|
+
</IressInline\>
|
|
198
|
+
<IressInline horizontalAlign\="right"\>
|
|
199
|
+
<IressTooltip
|
|
200
|
+
align\="right"
|
|
201
|
+
tooltipText\="Hello!"
|
|
202
|
+
\>
|
|
203
|
+
<IressButton\>
|
|
204
|
+
Right </IressButton\>
|
|
205
|
+
</IressTooltip\>
|
|
206
|
+
</IressInline\>
|
|
207
|
+
<IressInline horizontalAlign\="right"\>
|
|
208
|
+
<IressTooltip
|
|
209
|
+
align\="right-end"
|
|
210
|
+
tooltipText\="Hello!"
|
|
211
|
+
\>
|
|
212
|
+
<IressButton\>
|
|
213
|
+
Right End </IressButton\>
|
|
214
|
+
</IressTooltip\>
|
|
215
|
+
</IressInline\>
|
|
216
|
+
</IressStack\>
|
|
217
|
+
</IressInline\>
|
|
218
|
+
<IressInline
|
|
219
|
+
gutter\="sm"
|
|
220
|
+
horizontalAlign\="center"
|
|
221
|
+
\>
|
|
222
|
+
<IressTooltip
|
|
223
|
+
align\="bottom-start"
|
|
224
|
+
tooltipText\="Hello!"
|
|
225
|
+
\>
|
|
226
|
+
<IressButton\>
|
|
227
|
+
Bottom Start </IressButton\>
|
|
228
|
+
</IressTooltip\>
|
|
229
|
+
<IressTooltip
|
|
230
|
+
align\="bottom"
|
|
231
|
+
tooltipText\="Hello!"
|
|
232
|
+
\>
|
|
233
|
+
<IressButton\>
|
|
234
|
+
Bottom </IressButton\>
|
|
235
|
+
</IressTooltip\>
|
|
236
|
+
<IressTooltip
|
|
237
|
+
align\="bottom-end"
|
|
238
|
+
tooltipText\="Hello!"
|
|
239
|
+
\>
|
|
240
|
+
<IressButton\>
|
|
241
|
+
Bottom End </IressButton\>
|
|
242
|
+
</IressTooltip\>
|
|
243
|
+
</IressInline\>
|
|
244
|
+
</IressStack\>
|
|
245
|
+
</div\>
|
|
246
|
+
|
|
247
|
+
Copy
|
|
248
|
+
|
|
249
|
+
### [](#delay)Delay
|
|
250
|
+
|
|
251
|
+
The `delay` prop requires a number that is the number of milliseconds that pass after the activator has received a `mouseEnter` event and the display of the tooltip.
|
|
252
|
+
|
|
253
|
+
0ms (no delay)
|
|
254
|
+
|
|
255
|
+
500ms (default)
|
|
256
|
+
|
|
257
|
+
2000ms
|
|
258
|
+
|
|
259
|
+
Hide code
|
|
260
|
+
|
|
261
|
+
\[data-radix-scroll-area-viewport\] { scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } \[data-radix-scroll-area-viewport\]::-webkit-scrollbar { display: none; } :where(\[data-radix-scroll-area-viewport\]) { display: flex; flex-direction: column; align-items: stretch; } :where(\[data-radix-scroll-area-content\]) { flex-grow: 1; }
|
|
262
|
+
|
|
263
|
+
<div
|
|
264
|
+
style\={{
|
|
265
|
+
paddingTop: '30px'
|
|
266
|
+
}}
|
|
267
|
+
\>
|
|
268
|
+
<IressInline
|
|
269
|
+
gutter\="sm"
|
|
270
|
+
horizontalAlign\="center"
|
|
271
|
+
\>
|
|
272
|
+
<IressTooltip
|
|
273
|
+
delay\={0}
|
|
274
|
+
tooltipText\="Hello!"
|
|
275
|
+
\>
|
|
276
|
+
<IressButton\>
|
|
277
|
+
0ms (no delay) </IressButton\>
|
|
278
|
+
</IressTooltip\>
|
|
279
|
+
<IressTooltip tooltipText\="Hello!"\>
|
|
280
|
+
<IressButton\>
|
|
281
|
+
500ms (default) </IressButton\>
|
|
282
|
+
</IressTooltip\>
|
|
283
|
+
<IressTooltip
|
|
284
|
+
delay\={2000}
|
|
285
|
+
tooltipText\="Hello!"
|
|
286
|
+
\>
|
|
287
|
+
<IressButton\>
|
|
288
|
+
2000ms </IressButton\>
|
|
289
|
+
</IressTooltip\>
|
|
290
|
+
</IressInline\>
|
|
291
|
+
</div\>
|
|
292
|
+
|
|
293
|
+
Copy
|
|
294
|
+
|
|
295
|
+
### [](#the-title-attribute)The title attribute
|
|
296
|
+
|
|
297
|
+
The component will not make any provision for existing title HTML attributes. If one exists, it will be activated along with the tooltip, potentially overlaying it making it difficult to ascertain the information being imparted. The title could also contain different content to the tooltip increasing the chance of confusing the end user.
|
|
298
|
+
|
|
299
|
+
We suggest removing the title attribute on elements that will use tooltip.
|
|
300
|
+
|
|
301
|
+
On this page
|
|
302
|
+
|
|
303
|
+
* [Overview](#overview)
|
|
304
|
+
* [Props](#props)
|
|
305
|
+
* [Usage](#usage)
|
|
306
|
+
* [Behaviour](#behaviour)
|
|
307
|
+
* [Accessibility](#accessibility)
|
|
308
|
+
* [Examples](#examples)
|
|
309
|
+
* [Align](#align)
|
|
310
|
+
* [Delay](#delay)
|
|
311
|
+
* [The title attribute](#the-title-attribute)
|