@telus-uds/components-base 1.59.1 → 1.60.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/CHANGELOG.md +26 -2
- package/component-docs.json +245 -6
- package/lib/Button/ButtonLink.js +7 -3
- package/lib/ExpandCollapse/Panel.js +7 -0
- package/lib/IconButton/IconButton.js +8 -0
- package/lib/Link/ChevronLink.js +9 -2
- package/lib/Link/LinkBase.js +14 -0
- package/lib/Link/TextButton.js +12 -1
- package/lib/Listbox/PressableItem.js +1 -3
- package/lib/Pagination/dictionary.js +3 -3
- package/lib/Progress/ProgressBarBackground.js +2 -2
- package/lib/SideNav/Item.js +15 -5
- package/lib/Tags/Tags.js +6 -1
- package/lib/Tooltip/Tooltip.js +6 -1
- package/lib/Tooltip/Tooltip.native.js +6 -1
- package/lib/Tooltip/shared.js +5 -0
- package/lib-module/Button/ButtonLink.js +4 -1
- package/lib-module/ExpandCollapse/Panel.js +7 -0
- package/lib-module/IconButton/IconButton.js +8 -0
- package/lib-module/Link/ChevronLink.js +10 -3
- package/lib-module/Link/LinkBase.js +14 -0
- package/lib-module/Link/TextButton.js +11 -1
- package/lib-module/Listbox/PressableItem.js +1 -3
- package/lib-module/Pagination/dictionary.js +3 -3
- package/lib-module/Progress/ProgressBarBackground.js +2 -2
- package/lib-module/SideNav/Item.js +15 -5
- package/lib-module/Tags/Tags.js +6 -1
- package/lib-module/Tooltip/Tooltip.js +6 -1
- package/lib-module/Tooltip/Tooltip.native.js +6 -1
- package/lib-module/Tooltip/shared.js +5 -0
- package/package.json +2 -2
- package/src/Button/ButtonLink.jsx +4 -1
- package/src/ExpandCollapse/Panel.jsx +11 -1
- package/src/IconButton/IconButton.jsx +7 -0
- package/src/Link/ChevronLink.jsx +10 -3
- package/src/Link/LinkBase.jsx +11 -0
- package/src/Link/TextButton.jsx +8 -2
- package/src/Listbox/PressableItem.jsx +1 -3
- package/src/Pagination/dictionary.js +3 -3
- package/src/Progress/ProgressBarBackground.jsx +2 -2
- package/src/SideNav/Item.jsx +13 -5
- package/src/Tags/Tags.jsx +5 -1
- package/src/Tooltip/Tooltip.jsx +16 -2
- package/src/Tooltip/Tooltip.native.jsx +15 -2
- package/src/Tooltip/shared.js +4 -0
package/src/Tooltip/Tooltip.jsx
CHANGED
|
@@ -82,7 +82,10 @@ const defaultControl = (pressableState, variant) => (
|
|
|
82
82
|
* - Tooltips may also be useful when vertical space is an issue.
|
|
83
83
|
*/
|
|
84
84
|
const Tooltip = forwardRef(
|
|
85
|
-
(
|
|
85
|
+
(
|
|
86
|
+
{ children, content, position = 'auto', copy = 'en', tokens, variant, inline = false, ...rest },
|
|
87
|
+
ref
|
|
88
|
+
) => {
|
|
86
89
|
const [isOpen, setIsOpen] = useState(false)
|
|
87
90
|
const arrowRef = useRef()
|
|
88
91
|
|
|
@@ -157,7 +160,18 @@ const Tooltip = forwardRef(
|
|
|
157
160
|
control === defaultControl ? { top: 10, bottom: 10, left: 10, right: 10 } : undefined
|
|
158
161
|
|
|
159
162
|
return (
|
|
160
|
-
<View
|
|
163
|
+
<View
|
|
164
|
+
style={[
|
|
165
|
+
staticStyles.container,
|
|
166
|
+
Platform.select({
|
|
167
|
+
web: {
|
|
168
|
+
display: inline ? 'inline-block' : 'flex'
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
]}
|
|
172
|
+
{...selectProps(rest)}
|
|
173
|
+
ref={ref}
|
|
174
|
+
>
|
|
161
175
|
<Pressable
|
|
162
176
|
onPress={toggleIsOpen}
|
|
163
177
|
ref={reference}
|
|
@@ -108,7 +108,10 @@ const defaultControl = (pressableState, variant) => (
|
|
|
108
108
|
* - Tooltips may also be useful when vertical space is an issue.
|
|
109
109
|
*/
|
|
110
110
|
const Tooltip = forwardRef(
|
|
111
|
-
(
|
|
111
|
+
(
|
|
112
|
+
{ children, content, position = 'auto', copy = 'en', tokens, variant, inline = false, ...rest },
|
|
113
|
+
ref
|
|
114
|
+
) => {
|
|
112
115
|
const [isOpen, setIsOpen] = useState(false)
|
|
113
116
|
|
|
114
117
|
const controlRef = useRef()
|
|
@@ -217,7 +220,17 @@ const Tooltip = forwardRef(
|
|
|
217
220
|
control === defaultControl ? { top: 10, bottom: 10, left: 10, right: 10 } : undefined
|
|
218
221
|
|
|
219
222
|
return (
|
|
220
|
-
<View
|
|
223
|
+
<View
|
|
224
|
+
style={[
|
|
225
|
+
staticStyles.container,
|
|
226
|
+
Platform.select({
|
|
227
|
+
web: {
|
|
228
|
+
display: inline ? 'inline-block' : 'flex'
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
]}
|
|
232
|
+
{...selectProps(rest)}
|
|
233
|
+
>
|
|
221
234
|
<Pressable
|
|
222
235
|
onPress={toggleIsOpen}
|
|
223
236
|
ref={controlRef}
|
package/src/Tooltip/shared.js
CHANGED
|
@@ -20,6 +20,10 @@ const propTypes = {
|
|
|
20
20
|
* Use to place the tooltip in a specific location (only if it fits within viewport).
|
|
21
21
|
*/
|
|
22
22
|
position: PropTypes.oneOf(['auto', 'above', 'right', 'below', 'left']),
|
|
23
|
+
/**
|
|
24
|
+
* Display tooltip icon button as an inline element.
|
|
25
|
+
*/
|
|
26
|
+
inline: PropTypes.bool,
|
|
23
27
|
tokens: getTokensPropType('Tooltip'),
|
|
24
28
|
variant: variantProp.propType
|
|
25
29
|
}
|