cozy-ui 113.1.0 → 113.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [113.3.0](https://github.com/cozy/cozy-ui/compare/v113.2.0...v113.3.0) (2024-11-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * **SquareAppIcon:** Hide shortcut badges for a more app like feel ([49d8438](https://github.com/cozy/cozy-ui/commit/49d8438))
7
+
8
+ # [113.2.0](https://github.com/cozy/cozy-ui/compare/v113.1.0...v113.2.0) (2024-11-14)
9
+
10
+
11
+ ### Features
12
+
13
+ * Add server icon ([88b8161](https://github.com/cozy/cozy-ui/commit/88b8161))
14
+
1
15
  # [113.1.0](https://github.com/cozy/cozy-ui/compare/v113.0.0...v113.1.0) (2024-11-07)
2
16
 
3
17
 
@@ -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="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2Zm5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM0 11a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-3Zm5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "113.1.0",
3
+ "version": "113.3.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -276,6 +276,7 @@ import Safe from 'cozy-ui/transpiled/react/Icons/Safe'
276
276
  import School from 'cozy-ui/transpiled/react/Icons/School'
277
277
  import Scooter from 'cozy-ui/transpiled/react/Icons/Scooter'
278
278
  import SelectAll from 'cozy-ui/transpiled/react/Icons/SelectAll'
279
+ import Server from 'cozy-ui/transpiled/react/Icons/Server'
279
280
  import Setting from 'cozy-ui/transpiled/react/Icons/Setting'
280
281
  import Share from 'cozy-ui/transpiled/react/Icons/Share'
281
282
  import ShareCircle from 'cozy-ui/transpiled/react/Icons/ShareCircle'
@@ -540,6 +541,7 @@ const icons = [
540
541
  School,
541
542
  Scooter,
542
543
  SelectAll,
544
+ Server,
543
545
  Setting,
544
546
  Share,
545
547
  ShareCircle,
@@ -927,7 +929,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
927
929
 
928
930
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
929
931
  let i = 0
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']
932
+ 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','server','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']
931
933
  ;
932
934
  <div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
933
935
  <Sprite />
@@ -0,0 +1,16 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/server.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgServer(props) {
5
+ return (
6
+ <svg viewBox="0 0 16 16" {...props}>
7
+ <path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M0 2a2 2 0 012-2h12a2 2 0 012 2v3a2 2 0 01-2 2H2a2 2 0 01-2-2V2zm5 1.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM0 11a2 2 0 012-2h12a2 2 0 012 2v3a2 2 0 01-2 2H2a2 2 0 01-2-2v-3zm5 1.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"
11
+ />
12
+ </svg>
13
+ )
14
+ }
15
+
16
+ export default SvgServer
@@ -14,12 +14,14 @@ const { variant } = useCozyTheme()
14
14
  const app = { name: "Test App", slug: "testapp", type: "app" }
15
15
  const [isLoading, setLoading] = React.useState(false)
16
16
  const [isError, setIsError] = React.useState(false)
17
+ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
17
18
 
18
19
  ;
19
20
 
20
21
  <>
21
22
  <Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
22
- <Button className="u-mb-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
23
+ <Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
24
+ <Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
23
25
 
24
26
  <Grid container spacing={1} style={{ background: variant === 'inverted' ? `center / cover no-repeat url(${cloudWallpaper})` : 'white' }}
25
27
  >
@@ -39,7 +41,7 @@ const [isError, setIsError] = React.useState(false)
39
41
  <SquareAppIcon app="testapp" name="No Account long name very very very very long" variant="ghost" />
40
42
  </Grid>
41
43
  <Grid item>
42
- <SquareAppIcon name="Shortcut" variant="shortcut" />
44
+ <SquareAppIcon name="Shortcut" variant="shortcut" hideShortcutBadge={isShortcutBadgeHide} />
43
45
  </Grid>
44
46
  <Grid item>
45
47
  <SquareAppIcon IconContent={<Icon icon={CozyIcon} size="48" />} name="Loading" variant={isLoading ? 'loading' : 'default'} />
@@ -58,7 +60,7 @@ const [isError, setIsError] = React.useState(false)
58
60
  width={32}
59
61
  height={32}
60
62
  alt={"Shortcut"}
61
- />}/>
63
+ />} hideShortcutBadge={isShortcutBadgeHide} />
62
64
  </Grid>
63
65
  <Grid item>
64
66
  <SquareAppIcon name="Custom Icon" IconContent={<Icon icon={CozyIcon} size="48" />} />
@@ -103,40 +105,78 @@ const { variant } = useCozyTheme()
103
105
  const app = { name: "Test App", slug: "testapp", type: "app" }
104
106
  const [isLoading, setLoading] = React.useState(false)
105
107
  const [isError, setIsError] = React.useState(false)
108
+ const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
106
109
 
107
110
  ;
108
111
 
109
112
  <>
110
113
  <Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
111
- <Button className="u-mb-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
114
+ <Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
115
+ <Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
112
116
 
113
117
  <Grid container spacing={4}>
114
118
  <Grid item xs={4}>
115
- <SquareAppIcon display="detailed" name="Weather Wiz" description="Get real-time weather updates and forecasts" />
119
+ <SquareAppIcon
120
+ display="detailed"
121
+ name="Weather Wiz"
122
+ description="Get real-time weather updates and forecasts" />
116
123
  </Grid>
117
124
  <Grid item xs={4}>
118
- <SquareAppIcon display="detailed" name="Meal Planner" description="Plan your meals with nutrition tracking" variant="maintenance" />
125
+ <SquareAppIcon
126
+ display="detailed"
127
+ name="Meal Planner"
128
+ description="Plan your meals with nutrition tracking"
129
+ variant="maintenance" />
119
130
  </Grid>
120
131
  <Grid item xs={4}>
121
- <SquareAppIcon display="detailed" name="Travel Tracker" description="Explore and document your travel adventures" variant="error" />
132
+ <SquareAppIcon
133
+ display="detailed"
134
+ name="Travel Tracker"
135
+ description="Explore and document your travel adventures"
136
+ variant="error" />
122
137
  </Grid>
123
138
  <Grid item xs={4}>
124
- <SquareAppIcon display="detailed" name="Fitness Friend" variant="add" />
139
+ <SquareAppIcon
140
+ display="detailed"
141
+ name="Fitness Friend"
142
+ variant="add" />
125
143
  </Grid>
126
144
  <Grid item xs={4}>
127
- <SquareAppIcon display="detailed" name="Mindful Moments" description="Guided meditations for daily mindfulness" variant="ghost" />
145
+ <SquareAppIcon
146
+ display="detailed"
147
+ name="Mindful Moments"
148
+ description="Guided meditations for daily mindfulness"
149
+ variant="ghost" />
128
150
  </Grid>
129
151
  <Grid item xs={4}>
130
- <SquareAppIcon display="detailed" name="Study Space" description="Organize your study schedule and resources" variant="shortcut" />
152
+ <SquareAppIcon
153
+ display="detailed"
154
+ name="Study Space"
155
+ description="Organize your study schedule and resources"
156
+ variant="shortcut"
157
+ hideShortcutBadge={isShortcutBadgeHide} />
131
158
  </Grid>
132
159
  <Grid item xs={4}>
133
- <SquareAppIcon display="detailed" name="Quick Notes" IconContent={<Icon icon={CozyIcon} size="48" />} variant={isLoading ? 'loading' : 'default'} />
160
+ <SquareAppIcon
161
+ display="detailed"
162
+ name="Quick Notes"
163
+ IconContent={<Icon icon={CozyIcon} size="48" />}
164
+ variant={isLoading ? 'loading' : 'default'} />
134
165
  </Grid>
135
166
  <Grid item xs={4}>
136
- <SquareAppIcon display="detailed" name="Daily Budget" description="Manage your daily expenses and budgets" IconContent={<Icon icon={CozyIcon} size="48" />} variant={isError ? 'error' : 'loading'} />
167
+ <SquareAppIcon
168
+ display="detailed"
169
+ name="Daily Budget"
170
+ description="Manage your daily expenses and budgets"
171
+ IconContent={<Icon icon={CozyIcon} size="48" />}
172
+ variant={isError ? 'error' : 'loading'} />
137
173
  </Grid>
138
174
  <Grid item xs={4}>
139
- <SquareAppIcon display="detailed" name="Event Planner" description="Plan and schedule your events effectively" IconContent={<Icon icon={CozyIcon} size="48" />} />
175
+ <SquareAppIcon
176
+ display="detailed"
177
+ name="Event Planner"
178
+ description="Plan and schedule your events effectively"
179
+ IconContent={<Icon icon={CozyIcon} size="48" />} />
140
180
  </Grid>
141
181
  </Grid>
142
182
  </>
@@ -100,6 +100,7 @@ export const SquareAppIcon = ({
100
100
  variant,
101
101
  IconContent,
102
102
  description,
103
+ hideShortcutBadge = false,
103
104
  ...appIconProps
104
105
  }) => {
105
106
  const { variant: themeVariant } = useCozyTheme()
@@ -139,11 +140,13 @@ export const SquareAppIcon = ({
139
140
  <CozyTheme variant={squareTheme}>
140
141
  <InfosBadge
141
142
  badgeContent={
142
- variant === 'shortcut' ? <Icon size="10" icon={iconOut} /> : null
143
+ variant === 'shortcut' && !hideShortcutBadge ? (
144
+ <Icon size="10" icon={iconOut} />
145
+ ) : null
143
146
  }
144
147
  className={cx({ ['u-mr-1']: display === 'detailed' })}
145
148
  overlap="rectangular"
146
- invisible={variant !== 'shortcut'}
149
+ invisible={variant !== 'shortcut' || hideShortcutBadge}
147
150
  >
148
151
  <SquareAppIconSpinner
149
152
  variant={variant}