cozy-ui 111.18.1 → 111.20.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 CHANGED
@@ -1,3 +1,22 @@
1
+ # [111.20.0](https://github.com/cozy/cozy-ui/compare/v111.19.0...v111.20.0) (2024-10-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add tab icon ([4431b22](https://github.com/cozy/cozy-ui/commit/4431b22))
7
+
8
+ # [111.19.0](https://github.com/cozy/cozy-ui/compare/v111.18.1...v111.19.0) (2024-10-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **SearchBar:** Ref wasn't spread correctly ([15fc5fe](https://github.com/cozy/cozy-ui/commit/15fc5fe))
14
+
15
+
16
+ ### Features
17
+
18
+ * **SearchBar:** Add `onClear` and `disabledFocus` props ([6c8cabf](https://github.com/cozy/cozy-ui/commit/6c8cabf))
19
+
1
20
  ## [111.18.1](https://github.com/cozy/cozy-ui/compare/v111.18.0...v111.18.1) (2024-10-14)
2
21
 
3
22
 
@@ -0,0 +1 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13 12v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1V3a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-1Zm1-9H5v1h6a2 2 0 0 1 2 2v4h1V3ZM2 6h9v7H2V6Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "111.18.1",
3
+ "version": "111.20.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -294,6 +294,7 @@ import Support from 'cozy-ui/transpiled/react/Icons/Support'
294
294
  import Swap from 'cozy-ui/transpiled/react/Icons/Swap'
295
295
  import Sync from 'cozy-ui/transpiled/react/Icons/Sync'
296
296
  import SyncCozy from 'cozy-ui/transpiled/react/Icons/SyncCozy'
297
+ import Tab from 'cozy-ui/transpiled/react/Icons/Tab'
297
298
  import Tag from 'cozy-ui/transpiled/react/Icons/Tag'
298
299
  import Target from 'cozy-ui/transpiled/react/Icons/Target'
299
300
  import Task from 'cozy-ui/transpiled/react/Icons/Task'
@@ -557,6 +558,7 @@ const icons = [
557
558
  Swap,
558
559
  Sync,
559
560
  SyncCozy,
561
+ Tab,
560
562
  Tag,
561
563
  Target,
562
564
  Task,
@@ -925,7 +927,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
925
927
 
926
928
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
927
929
  let i = 0
928
- const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','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','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','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','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','eye-closed','eye','face-id','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','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','select-all','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tag','target','task','team','telecom','telephone','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
930
+ const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','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','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','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','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','eye-closed','eye','face-id','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','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','select-all','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','tag','target','task','team','telecom','telephone','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
929
931
  ;
930
932
  <div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
931
933
  <Sprite />
@@ -0,0 +1,16 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/tab.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgTab(props) {
5
+ return (
6
+ <svg viewBox="0 0 16 16" {...props}>
7
+ <path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M13 12v1a2 2 0 01-2 2H2a2 2 0 01-2-2V6a2 2 0 012-2h1V3a2 2 0 012-2h9a2 2 0 012 2v7a2 2 0 01-2 2h-1zm1-9H5v1h6a2 2 0 012 2v4h1V3zM2 6h9v7H2V6z"
11
+ />
12
+ </svg>
13
+ )
14
+ }
15
+
16
+ export default SvgTab
@@ -116,12 +116,14 @@ const SearchBar = forwardRef(
116
116
  label: labelProp,
117
117
  componentsProps,
118
118
  disabledClear,
119
+ disabledFocus,
119
120
  className,
120
121
  defaultValue,
121
122
  value,
122
123
  elevation,
123
124
  disabled,
124
125
  onChange,
126
+ onClear,
125
127
  onFocus,
126
128
  onBlur,
127
129
  ...props
@@ -155,6 +157,7 @@ const SearchBar = forwardRef(
155
157
 
156
158
  const handleClear = ev => {
157
159
  onChange({ ...ev, target: { ...ev.target, value: '' } })
160
+ onClear(ev)
158
161
  setCurrentValue('')
159
162
  }
160
163
 
@@ -175,7 +178,7 @@ const SearchBar = forwardRef(
175
178
  className={cx(className, classes.root, {
176
179
  [classes.flat]: !elevation,
177
180
  [classes.elevation]: elevation,
178
- [classes.focused]: isFocused,
181
+ [classes.focused]: isFocused && !disabledFocus,
179
182
  [classes.disabled]: disabled
180
183
  })}
181
184
  ref={ref}
@@ -233,9 +236,11 @@ SearchBar.defaultProps = {
233
236
  size: 'small',
234
237
  type: 'search',
235
238
  disabledClear: false,
239
+ disabledFocus: false,
236
240
  defaultValue: '',
237
241
  onChange: () => {},
238
242
  onFocus: () => {},
243
+ onClear: () => {},
239
244
  onBlur: () => {}
240
245
  }
241
246
 
@@ -253,6 +258,7 @@ SearchBar.propTypes = {
253
258
  /** Used only with self-controlled component */
254
259
  defaultValue: PropTypes.string,
255
260
  disabledClear: PropTypes.bool,
261
+ disabledFocus: PropTypes.bool,
256
262
  elevation: PropTypes.bool,
257
263
  placeholder: PropTypes.string,
258
264
  label: PropTypes.oneOfType([
@@ -263,13 +269,14 @@ SearchBar.propTypes = {
263
269
  disabled: PropTypes.bool,
264
270
  onChange: PropTypes.func,
265
271
  onFocus: PropTypes.func,
272
+ onClear: PropTypes.func,
266
273
  onBlur: PropTypes.func
267
274
  }
268
275
 
269
- const SearchBarWithLocales = props => {
276
+ const SearchBarWithLocales = forwardRef((props, ref) => {
270
277
  useExtendI18n(locales)
271
278
 
272
- return <SearchBar {...props} />
273
- }
279
+ return <SearchBar {...props} ref={ref} />
280
+ })
274
281
 
275
282
  export default SearchBarWithLocales