cozy-ui 69.0.0 → 69.3.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 +27 -0
- package/assets/icons/ui/tag.svg +1 -0
- package/package.json +1 -1
- package/react/BottomDrawer/Readme.md +26 -17
- package/react/BottomDrawer/index.jsx +22 -20
- package/react/BottomDrawer/styles.styl +9 -8
- package/react/Chips/Readme.md +29 -18
- package/react/Chips/index.jsx +24 -17
- package/react/Icon/Readme.md +3 -1
- package/react/Icon/icons-sprite.js +1 -1
- package/react/Icons/Tag.jsx +16 -0
- package/react/Overlay/index.jsx +8 -4
- package/react/__snapshots__/examples.spec.jsx.snap +98 -65
- package/transpiled/react/BottomDrawer/index.js +25 -18
- package/transpiled/react/Chips/index.js +9 -8
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/Tag.js +17 -0
- package/transpiled/react/Overlay/index.js +11 -5
- package/transpiled/react/stylesheet.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# [69.3.0](https://github.com/cozy/cozy-ui/compare/v69.2.0...v69.3.0) (2022-07-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Chips:** Using classname doesn't break style anymore ([3272df1](https://github.com/cozy/cozy-ui/commit/3272df1))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **Chips:** Add ref forwarding ([8d7513e](https://github.com/cozy/cozy-ui/commit/8d7513e))
|
|
12
|
+
|
|
13
|
+
# [69.2.0](https://github.com/cozy/cozy-ui/compare/v69.1.0...v69.2.0) (2022-07-07)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **BottomDrawer:** Add possibility to use it with long content ([59296f0](https://github.com/cozy/cozy-ui/commit/59296f0))
|
|
19
|
+
* **Overlay:** Add ref propagation ([6a0b3f0](https://github.com/cozy/cozy-ui/commit/6a0b3f0))
|
|
20
|
+
|
|
21
|
+
# [69.1.0](https://github.com/cozy/cozy-ui/compare/v69.0.0...v69.1.0) (2022-07-05)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **Icon:** Add new tag icon ([514402f](https://github.com/cozy/cozy-ui/commit/514402f))
|
|
27
|
+
|
|
1
28
|
# [69.0.0](https://github.com/cozy/cozy-ui/compare/v68.9.1...v69.0.0) (2022-07-01)
|
|
2
29
|
|
|
3
30
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/><path clip-rule="evenodd" d="M2 0a2 2 0 0 0-2 2v5.89a2 2 0 0 0 .586 1.415l5.98 5.973a2.462 2.462 0 0 0 3.481 0l5.236-5.237.002-.002a2.461 2.461 0 0 0 0-3.47L9.303.587A2 2 0 0 0 7.888 0H2Zm0 2h5.888l5.978 5.98a.461.461 0 0 1 0 .649l-5.234 5.236a.46.46 0 0 1-.652 0L2 7.89V2Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
Displays content coming up from the bottom of the screen.
|
|
2
2
|
|
|
3
3
|
```jsx
|
|
4
|
-
import BottomDrawer from 'cozy-ui/transpiled/react/BottomDrawer'
|
|
5
|
-
import
|
|
6
|
-
import Button from 'cozy-ui/transpiled/react/
|
|
7
|
-
import Typography from "cozy-ui/transpiled/react/Typography"
|
|
4
|
+
import BottomDrawer from 'cozy-ui/transpiled/react/BottomDrawer'
|
|
5
|
+
import Paper from 'cozy-ui/transpiled/react/Paper'
|
|
6
|
+
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
7
|
+
import Typography from "cozy-ui/transpiled/react/Typography"
|
|
8
|
+
import Variants from 'cozy-ui/docs/components/Variants'
|
|
8
9
|
|
|
9
|
-
initialState = { isDrawerDisplayed: isTesting() }
|
|
10
|
+
const initialState = { isDrawerDisplayed: isTesting() }
|
|
11
|
+
const initialVariants = [{ longText: false }]
|
|
10
12
|
|
|
11
13
|
const showDrawer = () => setState({ isDrawerDisplayed: true });
|
|
12
|
-
const hideDrawer = () => setState({ isDrawerDisplayed: false })
|
|
14
|
+
const hideDrawer = () => setState({ isDrawerDisplayed: false })
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
16
|
+
;
|
|
17
|
+
|
|
18
|
+
<Variants initialVariants={initialVariants}>
|
|
19
|
+
{variant => (
|
|
20
|
+
<>
|
|
21
|
+
<Button variant="ghost" size="small" onClick={showDrawer} label="Open drawer" />
|
|
22
|
+
|
|
23
|
+
{state.isDrawerDisplayed &&
|
|
24
|
+
<BottomDrawer onClose={hideDrawer}>
|
|
25
|
+
<Paper className="u-p-1" style={{ borderRadius: '1rem 1rem 0 0' }}>
|
|
26
|
+
<Typography variant="h5" paragraph>This is a paper in a drawer</Typography>
|
|
27
|
+
<Typography paragraph>{variant.longText ? content.ada.long : content.ada.short}</Typography>
|
|
28
|
+
<Button label="Demo button" onClick={() => console.info('huhu')} />
|
|
29
|
+
</Paper>
|
|
30
|
+
</BottomDrawer>}
|
|
31
|
+
</>
|
|
32
|
+
)}
|
|
33
|
+
</Variants>
|
|
25
34
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component } from 'react'
|
|
1
|
+
import React, { Component, createRef } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import Hammer from 'hammerjs'
|
|
4
4
|
import once from 'lodash/once'
|
|
@@ -13,6 +13,8 @@ class BottomDrawer extends Component {
|
|
|
13
13
|
constructor(props) {
|
|
14
14
|
super(props)
|
|
15
15
|
this.state = { closing: false }
|
|
16
|
+
this.menuRef = createRef()
|
|
17
|
+
this.wrapperRef = createRef()
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
componentDidMount() {
|
|
@@ -22,7 +24,7 @@ class BottomDrawer extends Component {
|
|
|
22
24
|
|
|
23
25
|
componentWillUnmount() {
|
|
24
26
|
this.gesturesHandler.destroy()
|
|
25
|
-
this.
|
|
27
|
+
this.menuRef.current.style = '' // Drops the node style in case it gets recycled, see https://github.com/cozy/cozy-ui/pull/602
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
initialAppear() {
|
|
@@ -35,21 +37,21 @@ class BottomDrawer extends Component {
|
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
turnTransitionsOn() {
|
|
38
|
-
this.
|
|
40
|
+
this.menuRef.current.classList.add(styles['with-transition'])
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
turnTransitionsOff() {
|
|
42
|
-
this.
|
|
44
|
+
this.menuRef.current.classList.remove(styles['with-transition'])
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
attachEvents() {
|
|
46
|
-
this.gesturesHandler = new Hammer.Manager(this.
|
|
48
|
+
this.gesturesHandler = new Hammer.Manager(this.wrapperRef.current, {
|
|
47
49
|
recognizers: [[Hammer.Pan, { direction: Hammer.DIRECTION_VERTICAL }]]
|
|
48
50
|
})
|
|
49
51
|
|
|
50
52
|
// to be completely accurate, `maximumGestureDelta` should be the difference between the top of the menu and the
|
|
51
53
|
// bottom of the page; but using the height is much easier to compute and accurate enough.
|
|
52
|
-
const maximumGestureDistance = this.
|
|
54
|
+
const maximumGestureDistance = this.menuRef.current.getBoundingClientRect()
|
|
53
55
|
.height
|
|
54
56
|
// between 0 and 1, how far down the gesture must be to be considered complete upon release
|
|
55
57
|
const minimumCloseDistance = 0.6
|
|
@@ -97,47 +99,47 @@ class BottomDrawer extends Component {
|
|
|
97
99
|
applyTransformation(progress) {
|
|
98
100
|
// constrain between 0 and 1.1 (go a bit further than 1 to be hidden completely)
|
|
99
101
|
const progressToApply = Math.min(1.1, Math.max(0, progress))
|
|
100
|
-
this.
|
|
102
|
+
this.menuRef.current.style.transform =
|
|
101
103
|
'translateY(' + progressToApply * 100 + '%)'
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
animateClose = () => {
|
|
107
|
+
const { current: menuNode } = this.menuRef
|
|
105
108
|
this.setState({ closing: true })
|
|
106
109
|
|
|
107
110
|
// we need to transition the menu to the bottom before dismissing it
|
|
108
|
-
const close =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
const close = menuNode =>
|
|
112
|
+
once(() => {
|
|
113
|
+
menuNode?.removeEventListener('transitionend', close(menuNode))
|
|
114
|
+
this.close()
|
|
115
|
+
})
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
this.menuNode.current.addEventListener('transitionend', close, false)
|
|
117
|
+
menuNode?.addEventListener('transitionend', close(menuNode), false)
|
|
116
118
|
// in case transitionend is not called, for example if the element is removed
|
|
117
|
-
setTimeout(close, TRANSITION_DURATION)
|
|
119
|
+
setTimeout(close(menuNode), TRANSITION_DURATION)
|
|
118
120
|
|
|
119
121
|
this.applyTransformation(1.1)
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
close = () => {
|
|
125
|
+
const { onClose } = this.props
|
|
123
126
|
this.setState({ closing: true })
|
|
124
|
-
|
|
127
|
+
onClose && onClose()
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
render() {
|
|
128
131
|
const { children } = this.props
|
|
129
132
|
const { closing } = this.state
|
|
130
|
-
|
|
131
|
-
this.wrapperNode = React.createRef()
|
|
133
|
+
|
|
132
134
|
return (
|
|
133
135
|
<RemoveScroll>
|
|
134
|
-
<div ref={this.
|
|
136
|
+
<div ref={this.wrapperRef}>
|
|
135
137
|
<Overlay
|
|
136
138
|
style={{ opacity: closing ? 0 : 1 }}
|
|
137
139
|
onClick={this.animateClose}
|
|
138
140
|
onEscape={this.animateClose}
|
|
139
141
|
>
|
|
140
|
-
<div ref={this.
|
|
142
|
+
<div ref={this.menuRef} className={styles['BottomDrawer-content']}>
|
|
141
143
|
{children}
|
|
142
144
|
</div>
|
|
143
145
|
</Overlay>
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
@extends $transition-transform-ease-out
|
|
9
9
|
|
|
10
10
|
.BottomDrawer-content
|
|
11
|
-
z-index
|
|
12
|
-
position
|
|
13
|
-
bottom
|
|
14
|
-
left
|
|
15
|
-
right
|
|
16
|
-
width
|
|
17
|
-
margin
|
|
18
|
-
|
|
11
|
+
z-index $drawer-index
|
|
12
|
+
position fixed
|
|
13
|
+
bottom 0
|
|
14
|
+
left 0
|
|
15
|
+
right 0
|
|
16
|
+
width 100%
|
|
17
|
+
margin 0
|
|
18
|
+
max-height 100vh
|
|
19
|
+
overflow-y auto
|
package/react/Chips/Readme.md
CHANGED
|
@@ -27,14 +27,14 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
27
27
|
<Grid item xs={12} sm={6} className="u-mb-1" key={JSON.stringify(column)}>
|
|
28
28
|
<Stack spacing="s">
|
|
29
29
|
<Typography>{Object.values(column)[0]}</Typography>
|
|
30
|
-
<
|
|
30
|
+
<div>
|
|
31
31
|
<Chip
|
|
32
32
|
label="Simple chip"
|
|
33
33
|
disabled={Object.values(column)[1]}
|
|
34
34
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
35
35
|
/>
|
|
36
|
-
</
|
|
37
|
-
<
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
38
|
<Chip
|
|
39
39
|
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
40
40
|
label="Clickable chip"
|
|
@@ -42,16 +42,16 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
42
42
|
disabled={Object.values(column)[1]}
|
|
43
43
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
44
44
|
/>
|
|
45
|
-
</
|
|
46
|
-
<
|
|
45
|
+
</div>
|
|
46
|
+
<div>
|
|
47
47
|
<Chip
|
|
48
48
|
avatar={<Avatar textId="Ada Lovelace" text="AL" size='xsmall' />}
|
|
49
49
|
label="Avatar chip"
|
|
50
50
|
disabled={Object.values(column)[1]}
|
|
51
51
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
52
52
|
/>
|
|
53
|
-
</
|
|
54
|
-
<
|
|
53
|
+
</div>
|
|
54
|
+
<div>
|
|
55
55
|
<Chip
|
|
56
56
|
label="Deletable chip"
|
|
57
57
|
clickable
|
|
@@ -59,8 +59,8 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
59
59
|
disabled={Object.values(column)[1]}
|
|
60
60
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
61
61
|
/>
|
|
62
|
-
</
|
|
63
|
-
<
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
64
|
<Chip
|
|
65
65
|
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
66
66
|
label="Deletable chip with icon"
|
|
@@ -69,8 +69,8 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
69
69
|
disabled={Object.values(column)[1]}
|
|
70
70
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
71
71
|
/>
|
|
72
|
-
</
|
|
73
|
-
<
|
|
72
|
+
</div>
|
|
73
|
+
<div>
|
|
74
74
|
<Chip
|
|
75
75
|
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
76
76
|
label="1 invoice"
|
|
@@ -81,14 +81,25 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
81
81
|
disabled={Object.values(column)[1]}
|
|
82
82
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
83
83
|
/>
|
|
84
|
-
</
|
|
85
|
-
<
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<Chip
|
|
87
|
+
className="u-ml-1"
|
|
88
|
+
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
89
|
+
label="Deletable chip with icon and class"
|
|
90
|
+
clickable
|
|
91
|
+
onDelete={() => alert('You clicked on delete icon')}
|
|
92
|
+
disabled={Object.values(column)[1]}
|
|
93
|
+
variant={Object.keys(variant).find(key => variant[key])}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
<div>
|
|
86
97
|
<Chip
|
|
87
98
|
icon={<Icon icon={RightIcon} />}
|
|
88
99
|
disabled={Object.values(column)[1]}
|
|
89
100
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
90
101
|
/>
|
|
91
|
-
</
|
|
102
|
+
</div>
|
|
92
103
|
</Stack>
|
|
93
104
|
</Grid>
|
|
94
105
|
)}
|
|
@@ -124,7 +135,7 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
124
135
|
<Grid item xs={12} sm={6} md={3} className="u-mb-1" key={JSON.stringify(color)}>
|
|
125
136
|
<Stack spacing="s">
|
|
126
137
|
<Typography>{color}</Typography>
|
|
127
|
-
<
|
|
138
|
+
<div>
|
|
128
139
|
<Chip
|
|
129
140
|
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
130
141
|
label="1 invoice"
|
|
@@ -135,8 +146,8 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
135
146
|
color={color}
|
|
136
147
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
137
148
|
/>
|
|
138
|
-
</
|
|
139
|
-
<
|
|
149
|
+
</div>
|
|
150
|
+
<div>
|
|
140
151
|
<Chip
|
|
141
152
|
icon={<Icon icon={FileOutlineIcon} className="u-ml-half" />}
|
|
142
153
|
label="1 invoice"
|
|
@@ -148,7 +159,7 @@ const initialVariants = [{ default: true, active: false, ghost: false }]
|
|
|
148
159
|
disabled
|
|
149
160
|
variant={Object.keys(variant).find(key => variant[key])}
|
|
150
161
|
/>
|
|
151
|
-
</
|
|
162
|
+
</div>
|
|
152
163
|
</Stack>
|
|
153
164
|
</Grid>
|
|
154
165
|
)}
|
package/react/Chips/index.jsx
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
2
|
import cx from 'classnames'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
4
|
import MuiChip from '@material-ui/core/Chip'
|
|
5
5
|
|
|
6
|
-
const Chips = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
6
|
+
const Chips = forwardRef(
|
|
7
|
+
(
|
|
8
|
+
{ label, variant = 'default', color = 'primary', className, ...props },
|
|
9
|
+
ref
|
|
10
|
+
) => {
|
|
11
|
+
return (
|
|
12
|
+
<MuiChip
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cx(className, {
|
|
15
|
+
noLabel: !label,
|
|
16
|
+
ghost: variant === 'ghost',
|
|
17
|
+
[`customColor-${color}`]: color
|
|
18
|
+
})}
|
|
19
|
+
label={label}
|
|
20
|
+
variant={variant === 'active' ? 'default' : 'outlined'}
|
|
21
|
+
color={variant === 'active' ? 'primary' : 'default'}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
)
|
|
21
27
|
|
|
22
28
|
Chips.propTypes = {
|
|
23
29
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
24
30
|
variant: PropTypes.oneOf(['default', 'active', 'ghost']),
|
|
25
|
-
color: PropTypes.oneOf(['primary', 'success', 'error', 'warning', 'info'])
|
|
31
|
+
color: PropTypes.oneOf(['primary', 'success', 'error', 'warning', 'info']),
|
|
32
|
+
className: PropTypes.string
|
|
26
33
|
}
|
|
27
34
|
|
|
28
35
|
export default Chips
|
package/react/Icon/Readme.md
CHANGED
|
@@ -214,6 +214,7 @@ import Stats from 'cozy-ui/transpiled/react/Icons/Stats'
|
|
|
214
214
|
import Subway from 'cozy-ui/transpiled/react/Icons/Subway'
|
|
215
215
|
import Sync from 'cozy-ui/transpiled/react/Icons/Sync'
|
|
216
216
|
import SyncCozy from 'cozy-ui/transpiled/react/Icons/SyncCozy'
|
|
217
|
+
import Tag from 'cozy-ui/transpiled/react/Icons/Tag'
|
|
217
218
|
import Target from 'cozy-ui/transpiled/react/Icons/Target'
|
|
218
219
|
import Team from 'cozy-ui/transpiled/react/Icons/Team'
|
|
219
220
|
import Telephone from 'cozy-ui/transpiled/react/Icons/Telephone'
|
|
@@ -426,6 +427,7 @@ const icons = [
|
|
|
426
427
|
Subway,
|
|
427
428
|
Sync,
|
|
428
429
|
SyncCozy,
|
|
430
|
+
Tag,
|
|
429
431
|
Target,
|
|
430
432
|
Team,
|
|
431
433
|
Telephone,
|
|
@@ -704,7 +706,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
704
706
|
|
|
705
707
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
706
708
|
let i = 0
|
|
707
|
-
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','attachment','attention','bank','banking-add','banking','bell','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','categories','certified','check-circle','check-list','check-square','check','checkbox','circle-filled','clock','cloud-happy','cloud','collect','comment','company','compass','connector','contract','contrast','cozy-laugh','cozy-text','credit-card-add','credit-card','credit','crop','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','email-notification','email','eu','euro','exchange','eye-closed','eye','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder','forbidden','from-user','gear','globe','graph-circle','grid','group-list','groups','hand','heart','help','history','home','hourglass','image','info-outlined','info','key','laptop','left','lightbulb','link-out','link','list','location','lock','logout','magic-trick','magnet','magnifier','merge','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online','openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus','previous','printer','qualify','radio-checked','radio-unchecked','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','select-all','setting','share-circle','share','shield','shop','sound','spinner','stack','star','stats','subway','sync-cozy','sync','target','team','telephone','to-the-cloud','top','train','trash','trophy','unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','wrench-circle']
|
|
709
|
+
const availableIcons = ['album-add','album-remove','album','answer','apple','archive','attachment','attention','bank','banking-add','banking','bell','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','categories','certified','check-circle','check-list','check-square','check','checkbox','circle-filled','clock','cloud-happy','cloud','collect','comment','company','compass','connector','contract','contrast','cozy-laugh','cozy-text','credit-card-add','credit-card','credit','crop','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','email-notification','email','eu','euro','exchange','eye-closed','eye','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder','forbidden','from-user','gear','globe','graph-circle','grid','group-list','groups','hand','heart','help','history','home','hourglass','image','info-outlined','info','key','laptop','left','lightbulb','link-out','link','list','location','lock','logout','magic-trick','magnet','magnifier','merge','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online','openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus','previous','printer','qualify','radio-checked','radio-unchecked','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','select-all','setting','share-circle','share','shield','shop','sound','spinner','stack','star','stats','subway','sync-cozy','sync','tag','target','team','telephone','to-the-cloud','top','train','trash','trophy','unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','wrench-circle']
|
|
708
710
|
;
|
|
709
711
|
<div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
|
|
710
712
|
<Sprite />
|
|
@@ -526,7 +526,7 @@ module.exports = `<svg><defs>
|
|
|
526
526
|
<path d="M8 2c2.21 0 4 1.79 4 4 2.21 0 4 1.79 4 4s-1.79 4-4 4H4c-2.21 0-4-1.79-4-4s1.79-4 4-4c0-2.21 1.79-4 4-4zM4.6 9.014c-.12-.025-.242-.004-.345.055l-.038.024c-.042.029-.08.063-.112.104l-.012.014c-.034.047-.059.1-.074.16l-.006.04C4.008 9.441 4 9.469 4 9.5v2c0 .276.224.5.5.5.237 0 .426-.168.478-.39C5.728 12.459 6.818 13 8 13c1.547 0 2.956-.899 3.632-2.268.122-.247.02-.547-.228-.67-.248-.121-.547-.02-.67.228C10.227 11.322 9.162 12 8 12c-.74 0-1.436-.286-1.976-.754.135-.007.267-.064.36-.176.177-.212.148-.527-.064-.704l-1.5-1.25c-.005-.005-.012-.006-.017-.011l-.04-.024c-.04-.025-.08-.045-.124-.057zM8 5c-1.57 0-2.992.906-3.653 2.291-.119.25-.013.548.236.667.25.118.548.013.667-.236C5.746 6.682 6.817 6 8 6c.769 0 1.477.287 2.017.758-.149-.005-.298.048-.401.172-.177.212-.148.527.064.704l1.5 1.25.011.007c.01.008.023.013.034.02.04.028.083.05.127.063l.04.01c.054.012.11.017.163.01.005 0 .009.002.013.001.063-.01.118-.031.17-.059.014-.007.025-.016.038-.024.04-.027.076-.059.107-.097l.02-.021c.034-.047.06-.1.077-.158.003-.01.002-.02.004-.03.008-.034.016-.068.016-.106v-2c0-.276-.224-.5-.5-.5-.226 0-.41.152-.471.357C10.284 5.523 9.196 5 7.999 5z"/>
|
|
527
527
|
</g>
|
|
528
528
|
</g>
|
|
529
|
-
</symbol><symbol id="sync" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M16 7.2V3c0-.6-.4-1-1-1-.5 0-.8.3-.9.7A8.09 8.09 0 0 0 8 0C4.9 0 2 1.8.7 4.6c-.2.5 0 1.1.5 1.3.5.2 1.1 0 1.3-.5C3.5 3.4 5.6 2 8 2c1.5 0 3 .6 4 1.5-.3 0-.6.1-.8.3-.4.4-.3 1.1.1 1.4l3 2.5h.1c.1.1.2.1.3.1h.4c.1 0 .2-.1.3-.1h.1c.1-.1.2-.1.2-.2.2 0 .2-.1.3-.3 0 .1 0 0 0 0m-1.2 2.9c-.5-.2-1.1 0-1.3.5A6 6 0 0 1 8 14c-1.5 0-2.9-.6-4-1.5.3 0 .5-.1.7-.4.4-.4.3-1.1-.1-1.4l-3-2.5h-.1L1.3 8h-.1c-.2 0-.5 0-.7.1H.4c-.1.1-.1.2-.2.3-.1.1-.1.2-.2.3V13c0 .6.4 1 1 1 .5 0 .9-.3 1-.8C3.5 14.9 5.6 16 8 16c3.1 0 5.9-1.8 7.3-4.5.2-.5 0-1.1-.5-1.4"/></symbol><symbol id="target" viewBox="0 0 16 16">
|
|
529
|
+
</symbol><symbol id="sync" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M16 7.2V3c0-.6-.4-1-1-1-.5 0-.8.3-.9.7A8.09 8.09 0 0 0 8 0C4.9 0 2 1.8.7 4.6c-.2.5 0 1.1.5 1.3.5.2 1.1 0 1.3-.5C3.5 3.4 5.6 2 8 2c1.5 0 3 .6 4 1.5-.3 0-.6.1-.8.3-.4.4-.3 1.1.1 1.4l3 2.5h.1c.1.1.2.1.3.1h.4c.1 0 .2-.1.3-.1h.1c.1-.1.2-.1.2-.2.2 0 .2-.1.3-.3 0 .1 0 0 0 0m-1.2 2.9c-.5-.2-1.1 0-1.3.5A6 6 0 0 1 8 14c-1.5 0-2.9-.6-4-1.5.3 0 .5-.1.7-.4.4-.4.3-1.1-.1-1.4l-3-2.5h-.1L1.3 8h-.1c-.2 0-.5 0-.7.1H.4c-.1.1-.1.2-.2.3-.1.1-.1.2-.2.3V13c0 .6.4 1 1 1 .5 0 .9-.3 1-.8C3.5 14.9 5.6 16 8 16c3.1 0 5.9-1.8 7.3-4.5.2-.5 0-1.1-.5-1.4"/></symbol><symbol id="tag" viewBox="0 0 16 16"><path d="M5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"/><path clip-rule="evenodd" d="M2 0a2 2 0 0 0-2 2v5.89a2 2 0 0 0 .586 1.415l5.98 5.973a2.462 2.462 0 0 0 3.481 0l5.236-5.237.002-.002a2.461 2.461 0 0 0 0-3.47L9.303.587A2 2 0 0 0 7.888 0H2Zm0 2h5.888l5.978 5.98a.461.461 0 0 1 0 .649l-5.234 5.236a.46.46 0 0 1-.652 0L2 7.89V2Z"/></symbol><symbol id="target" viewBox="0 0 16 16">
|
|
530
530
|
<path fill-rule="evenodd" d="M9 12.899V12a1 1 0 0 0-2 0v.899A5.016 5.016 0 0 1 3.101 9H4a1 1 0 0 0 0-2h-.899A5.016 5.016 0 0 1 7 3.101V4a1 1 0 0 0 2 0v-.899A5.016 5.016 0 0 1 12.899 7H12a1 1 0 0 0 0 2h.899A5.016 5.016 0 0 1 9 12.899zM16 7h-1.08A7.005 7.005 0 0 0 9 1.08V1a1 1 0 0 0-2 0v.08A7.005 7.005 0 0 0 1.08 7H1a1 1 0 0 0 0 2h.08A7.004 7.004 0 0 0 7 14.92V15a1 1 0 0 0 2 0v-.08A7.004 7.004 0 0 0 14.92 9H16V7z"/>
|
|
531
531
|
</symbol><symbol id="team" viewBox="0 0 16 16">
|
|
532
532
|
<path fill-rule="evenodd" d="M11.145 7.75C10.263 7.285 9.647 6.23 9.647 5c0-1.657 1.12-3 2.5-3 1.381 0 2.5 1.343 2.5 3 0 1.231-.618 2.29-1.502 2.752V9l1.105.553c.49.245 1.095.848 1.342 1.342l.106.21c.245.49 0 .895-.55.895H9.142c-.544 0-.797-.4-.55-.895l.106-.21c.245-.49.848-1.095 1.342-1.342L11.145 9V7.75zM4.647 10.8c-1.165-.48-2-1.776-2-3.3 0-1.933 1.343-3.5 3-3.5s3 1.567 3 3.5c0 1.524-.835 2.82-2 3.3V12l2.051.684c.532.177 1.15.717 1.397 1.21l.105.211c.245.49.002.895-.548.895h-8.01c-.539 0-.794-.4-.547-.895l.105-.21c.245-.49.872-1.037 1.397-1.211L4.647 12v-1.2z"/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/tag.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgTag(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" fill="none" {...props}>
|
|
7
|
+
<path d="M5 6a1 1 0 100-2 1 1 0 000 2z" />
|
|
8
|
+
<path
|
|
9
|
+
clipRule="evenodd"
|
|
10
|
+
d="M2 0a2 2 0 00-2 2v5.89a2 2 0 00.586 1.415l5.98 5.973a2.462 2.462 0 003.481 0l5.236-5.237.002-.002a2.461 2.461 0 000-3.47L9.303.587A2 2 0 007.888 0H2zm0 2h5.888l5.978 5.98a.461.461 0 010 .649l-5.234 5.236a.46.46 0 01-.652 0L2 7.89V2z"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default SvgTag
|
package/react/Overlay/index.jsx
CHANGED
|
@@ -7,7 +7,7 @@ import { RemoveScroll } from 'react-remove-scroll'
|
|
|
7
7
|
|
|
8
8
|
const ESC_KEYCODE = 27
|
|
9
9
|
|
|
10
|
-
const nonDOMProps = ['onEscape', 'children', 'className']
|
|
10
|
+
const nonDOMProps = ['onEscape', 'children', 'className', 'innerRef']
|
|
11
11
|
|
|
12
12
|
const bodyTallerThanWindow = () => {
|
|
13
13
|
return document.body.getBoundingClientRect().height > window.innerHeight
|
|
@@ -45,7 +45,7 @@ class Overlay extends Component {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
render() {
|
|
48
|
-
const { children, className } = this.props
|
|
48
|
+
const { children, className, innerRef } = this.props
|
|
49
49
|
const domProps = omit(this.props, nonDOMProps)
|
|
50
50
|
// We use Overlay when opening an ActionMenu.
|
|
51
51
|
// We don't want to block the scroll on Desktop if the ActionMenu
|
|
@@ -53,10 +53,12 @@ class Overlay extends Component {
|
|
|
53
53
|
// @todo Overlay should not RemoveScroll by itself. It should
|
|
54
54
|
// be done by lower component (like ActionMenu / Dialog / Modal...)
|
|
55
55
|
const Wrapper = bodyTallerThanWindow() ? React.Fragment : RemoveScroll
|
|
56
|
+
|
|
56
57
|
return (
|
|
57
58
|
<div
|
|
58
|
-
|
|
59
|
+
ref={innerRef}
|
|
59
60
|
className={cx(styles['c-overlay'], className)}
|
|
61
|
+
onClick={this.handleClick}
|
|
60
62
|
{...domProps}
|
|
61
63
|
>
|
|
62
64
|
<Wrapper>{children}</Wrapper>
|
|
@@ -71,4 +73,6 @@ Overlay.propTypes = {
|
|
|
71
73
|
onEscape: PropTypes.func
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
export default
|
|
76
|
+
export default React.forwardRef((props, ref) => (
|
|
77
|
+
<Overlay innerRef={ref} {...props} />
|
|
78
|
+
))
|