cozy-ui 109.1.1 → 109.2.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,10 @@
1
+ # [109.2.0](https://github.com/cozy/cozy-ui/compare/v109.1.1...v109.2.0) (2024-06-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add Task icon ([2f9d2bc](https://github.com/cozy/cozy-ui/commit/2f9d2bc))
7
+
1
8
  ## [109.1.1](https://github.com/cozy/cozy-ui/compare/v109.1.0...v109.1.1) (2024-06-10)
2
9
 
3
10
 
@@ -0,0 +1 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5 4a1 1 0 0 0 0 2h6a1 1 0 1 0 0-2H5ZM4 8a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1ZM5 10a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H5Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2Zm2 0h12v12H2V2Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "109.1.1",
3
+ "version": "109.2.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -50,7 +50,7 @@
50
50
  "test": "jest",
51
51
  "test:noSnapshots": "jest --testPathIgnorePatterns 'react/examples.spec.jsx'",
52
52
  "test:snapshots": "jest react/examples.spec.jsx",
53
- "test:update:snapshots": "jest react/examples.spec.jsx -u",
53
+ "test:snapshots:update": "jest react/examples.spec.jsx -u",
54
54
  "screenshots:server": "nodemon ./scripts/pixelmatch-server/server.js -e js,hbs",
55
55
  "postbuild": "postcss transpiled/react/stylesheet.css --replace",
56
56
  "travis-deploy-once": "travis-deploy-once",
@@ -185,11 +185,11 @@ const toggleMenu = () => setState(state => ({ showMenu: !state.showMenu }))
185
185
  getContentAnchorEl={null}
186
186
  anchorOrigin={{
187
187
  vertical: 'bottom',
188
- horizontal: 'left'
188
+ horizontal: 'right'
189
189
  }}
190
190
  transformOrigin={{
191
191
  vertical: 'top',
192
- horizontal: 'left'
192
+ horizontal: 'right'
193
193
  }}
194
194
  keepMounted
195
195
  autoClose
@@ -32,10 +32,10 @@ const initialVariants = [
32
32
  ### With custom image
33
33
 
34
34
  ```jsx
35
- import CozyIcon from 'cozy-ui/transpiled/react/Icons/Cozy'
36
- import PeopleSVGIcon from '../../assets/icons/ui/people.svg'
37
35
  import Empty from 'cozy-ui/transpiled/react/Empty'
38
36
  import Icon from 'cozy-ui/transpiled/react/Icon'
37
+ import CloudWallpaper from 'cozy-ui/docs/cloud-wallpaper.jpg'
38
+ import CozyIcon from 'cozy-ui/transpiled/react/Icons/Cozy'
39
39
 
40
40
  ;
41
41
 
@@ -46,7 +46,7 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
46
46
  text="Try adding some content to this list"
47
47
  />
48
48
  <Empty
49
- icon={<img src='https://viewerdemo.cozycloud.cc/IMG_0062.PNG' />}
49
+ icon={<img src={CloudWallpaper} />}
50
50
  title="With IMG"
51
51
  text="Try adding some content to this list"
52
52
  />
@@ -9,6 +9,7 @@ import FileImageLoader from 'cozy-ui/transpiled/react/FileImageLoader'
9
9
  import Icon from 'cozy-ui/transpiled/react/Icon'
10
10
  import FileDuotoneIcon from "cozy-ui/transpiled/react/Icons/FileDuotone"
11
11
  import BankIcon from "cozy-ui/transpiled/react/Icons/Bank"
12
+ import CloudWallpaper from 'cozy-ui/docs/cloud-wallpaper.jpg'
12
13
 
13
14
  const file = {
14
15
  _id: 'image',
@@ -16,7 +17,7 @@ const file = {
16
17
  name: 'Demo.img',
17
18
  mime: 'application/jpeg',
18
19
  links: {
19
- large: 'https://viewerdemo.cozycloud.cc/IMG_0062.PNG'
20
+ large: CloudWallpaper
20
21
  }
21
22
  }
22
23
 
@@ -294,6 +294,7 @@ import Sync from 'cozy-ui/transpiled/react/Icons/Sync'
294
294
  import SyncCozy from 'cozy-ui/transpiled/react/Icons/SyncCozy'
295
295
  import Tag from 'cozy-ui/transpiled/react/Icons/Tag'
296
296
  import Target from 'cozy-ui/transpiled/react/Icons/Target'
297
+ import Task from 'cozy-ui/transpiled/react/Icons/Task'
297
298
  import Team from 'cozy-ui/transpiled/react/Icons/Team'
298
299
  import Telecom from 'cozy-ui/transpiled/react/Icons/Telecom'
299
300
  import Telephone from 'cozy-ui/transpiled/react/Icons/Telephone'
@@ -553,6 +554,7 @@ const icons = [
553
554
  SyncCozy,
554
555
  Tag,
555
556
  Target,
557
+ Task,
556
558
  Team,
557
559
  Telecom,
558
560
  Telephone,
@@ -917,7 +919,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
917
919
 
918
920
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
919
921
  let i = 0
920
- 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','stats','subway', 'support', 'swap', 'sync-cozy','sync','tag','target','team','telecom','telephone','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']
922
+ 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','stats','subway', 'support', 'swap', 'sync-cozy','sync','tag','target','task','team','telecom','telephone','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']
921
923
  ;
922
924
  <div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
923
925
  <Sprite />
@@ -578,7 +578,7 @@ animation: checkmark 0.5s ease-in-out 0.16s backwards
578
578
  </g>
579
579
  </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">
580
580
  <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"/>
581
- </symbol><symbol id="team" viewBox="0 0 16 16">
581
+ </symbol><symbol id="task" viewBox="0 0 16 16"><path d="M5 4a1 1 0 0 0 0 2h6a1 1 0 1 0 0-2H5ZM4 8a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1ZM5 10a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H5Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2Zm2 0h12v12H2V2Z"/></symbol><symbol id="team" viewBox="0 0 16 16">
582
582
  <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"/>
583
583
  </symbol><symbol id="telecom" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 6.04c1.08 0 1.96.878 1.96 1.96 0 1.08-.88 1.96-1.96 1.96S6.04 9.08 6.04 8c0-1.082.88-1.96 1.96-1.96ZM8 0C3.59 0 0 3.588 0 8c0 4.41 3.59 8 8 8 1.778 0 3.46-.572 4.865-1.65l.138-.106-1.079-1.404-.137.106A6.167 6.167 0 0 1 8 14.228 6.236 6.236 0 0 1 1.77 8 6.236 6.236 0 0 1 8 1.77 6.236 6.236 0 0 1 14.23 8v.711a1.25 1.25 0 0 1-2.498 0v-.174h-.04a3.75 3.75 0 0 0 .04-.537V4.98h-1.565A3.688 3.688 0 0 0 8 4.268 3.736 3.736 0 0 0 4.268 8 3.735 3.735 0 0 0 8 11.73c.986 0 1.938-.405 2.642-1.118a3.02 3.02 0 0 0 2.338 1.119A3.023 3.023 0 0 0 16 8.71V8c0-4.412-3.59-8-8-8Z"/></symbol><symbol id="telephone" viewBox="0 0 16 16">
584
584
  <path fill-rule="evenodd" d="M5.88 4.655a1.68 1.68 0 0 0 .001-2.377L4.097.492a1.685 1.685 0 0 0-2.38 0l-.98.979A2.521 2.521 0 0 0 .42 4.646 39.038 39.038 0 0 0 11.356 15.58c.999.662 2.328.53 3.175-.316l.979-.979a1.681 1.681 0 0 0 0-2.379l-1.785-1.784a1.679 1.679 0 0 0-2.379 0l-.594.593A40.017 40.017 0 0 1 5.285 5.25l.595-.595z"/>
@@ -0,0 +1,17 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/task.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgTask(props) {
5
+ return (
6
+ <svg viewBox="0 0 16 16" {...props}>
7
+ <path d="M5 4a1 1 0 000 2h6a1 1 0 100-2H5zM4 8a1 1 0 011-1h6a1 1 0 110 2H5a1 1 0 01-1-1zm1 2a1 1 0 100 2h6a1 1 0 100-2H5z" />
8
+ <path
9
+ fillRule="evenodd"
10
+ clipRule="evenodd"
11
+ d="M0 2a2 2 0 012-2h12a2 2 0 012 2v12a2 2 0 01-2 2H2a2 2 0 01-2-2V2zm2 0h12v12H2V2z"
12
+ />
13
+ </svg>
14
+ )
15
+ }
16
+
17
+ export default SvgTask
@@ -4,6 +4,7 @@ import Skeleton from 'cozy-ui/transpiled/react/Skeleton'
4
4
  import Icon from 'cozy-ui/transpiled/react/Icon'
5
5
  import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People'
6
6
  import Box from 'cozy-ui/transpiled/react/Box'
7
+ import CloudWallpaper from 'cozy-ui/docs/cloud-wallpaper.jpg'
7
8
 
8
9
  ;
9
10
 
@@ -15,10 +16,10 @@ import Box from 'cozy-ui/transpiled/react/Box'
15
16
  <Skeleton variant="rect" animation="wave" />
16
17
  </Thumbnail>
17
18
  <Thumbnail className="u-mb-1">
18
- <img src="https://viewerdemo.cozycloud.cc/IMG_0062.PNG" alt="" />
19
+ <img src={CloudWallpaper} alt="" />
19
20
  </Thumbnail>
20
21
  <Thumbnail className="u-mb-1" isStacked={true}>
21
- <img src="https://viewerdemo.cozycloud.cc/IMG_0062.PNG" alt="" />
22
+ <img src={CloudWallpaper} alt="" />
22
23
  </Thumbnail>
23
24
  <Thumbnail className="u-mb-1" isStacked={true}>
24
25
  <Icon icon={PeopleIcon} />
@@ -2511,7 +2511,7 @@ exports[`Empty should render examples: Empty 2`] = `
2511
2511
  <p class=\\"MuiTypography-root MuiTypography-body1 MuiTypography-colorTextSecondary MuiTypography-gutterBottom\\">Try adding some content to this list</p>
2512
2512
  <div class=\\"styles__c-empty-text___3HnvR\\"></div>
2513
2513
  </div>
2514
- <div class=\\"styles__c-empty___3w5oV\\"><img src=\\"https://viewerdemo.cozycloud.cc/IMG_0062.PNG\\" class=\\"styles__c-empty-img___2GC4d\\">
2514
+ <div class=\\"styles__c-empty___3w5oV\\"><img src=\\"test-file-stub\\" class=\\"styles__c-empty-img___2GC4d\\">
2515
2515
  <h3 class=\\"MuiTypography-root MuiTypography-h3 MuiTypography-colorTextPrimary MuiTypography-gutterBottom\\">With IMG</h3>
2516
2516
  <p class=\\"MuiTypography-root MuiTypography-body1 MuiTypography-colorTextSecondary MuiTypography-gutterBottom\\">Try adding some content to this list</p>
2517
2517
  <div class=\\"styles__c-empty-text___3HnvR\\"></div>
@@ -4,6 +4,19 @@
4
4
  "desktop": "1200x700"
5
5
  }
6
6
  },
7
+ "BottomSheet": {
8
+ "viewports": {
9
+ "desktop": "1200x700",
10
+ "mobile": "390x840"
11
+ },
12
+ "fullPage": false
13
+ },
14
+ "ActionsMenu": {
15
+ "viewports": {
16
+ "mobile": "390x840"
17
+ },
18
+ "fullPage": false
19
+ },
7
20
  "ActionMenu": {
8
21
  "perExampleScreenshot": true
9
22
  },
@@ -24,13 +24,14 @@ const getComponentNameFromTestId = testId => {
24
24
  const fetchAllComponents = async (page, args, config) => {
25
25
  const styleguideIndexURL = `${args.styleguideUrl}/index.html`
26
26
 
27
- console.log(`Opening styleguide ${styleguideIndexURL}`)
27
+ console.log(`➡️ Opening styleguide ${styleguideIndexURL}`)
28
28
  await page.goto(styleguideIndexURL, {
29
29
  waitUntil: 'load',
30
30
  timeout: 0
31
31
  })
32
32
 
33
- console.log('Extracting links')
33
+ console.log('➡️ Extracting links')
34
+
34
35
  // We want to take screenshot for individual example, so we :
35
36
  // - extract categories (link from the side menu with no ?id=)
36
37
  // - go to category's page
@@ -51,8 +52,10 @@ const fetchAllComponents = async (page, args, config) => {
51
52
  })),
52
53
  x => x.name
53
54
  )
55
+
54
56
  const allLinks = []
55
57
  const parsedStyleguideURL = new URL(args.styleguideUrl)
58
+
56
59
  for (const cate of sortedCategoriesNames) {
57
60
  await page.goto(cate.link, { waitUntil: 'load', timeout: 0 })
58
61
  await sleep(100)
@@ -82,8 +85,10 @@ const fetchAllComponents = async (page, args, config) => {
82
85
  : componentToolbarSelector
83
86
  } ${openIsolatedButtonSelector}`
84
87
  )
88
+
85
89
  return Array.from(isolateButtons).map(btn => {
86
90
  const testId = btn.dataset.testid.replace('-isolate-button', '')
91
+
87
92
  return {
88
93
  testId,
89
94
  link: btn.getAttribute('href')
@@ -102,6 +107,7 @@ const fetchAllComponents = async (page, args, config) => {
102
107
  }))
103
108
  )
104
109
  }
110
+
105
111
  return allLinks
106
112
  }
107
113
 
@@ -5,7 +5,7 @@ const rootDirectory = path.join(__dirname, '../')
5
5
 
6
6
  const formatViewport = viewport => `${viewport.width}x${viewport.height}`
7
7
 
8
- const defaultGetScreenshotName = ({
8
+ const getDefaultScreenshotName = ({
9
9
  component,
10
10
  viewport,
11
11
  suffix,
@@ -22,14 +22,21 @@ const defaultGetScreenshotName = ({
22
22
  * component.
23
23
  */
24
24
  const screenshotComponent = async (page, options) => {
25
- const { component, screenshotDir, viewport, type, variant } = options
25
+ const {
26
+ component,
27
+ screenshotDir,
28
+ viewport,
29
+ type,
30
+ variant,
31
+ componentConfig
32
+ } = options
26
33
  const { link, name } = component
27
34
 
28
35
  await page.goto(link)
29
36
  await sleep(200) // to be sure the page is entirely loaded
30
37
 
31
38
  const getScreenshotName =
32
- options.getScreenshotName || defaultGetScreenshotName
39
+ options.getScreenshotName || getDefaultScreenshotName
33
40
 
34
41
  const screenshot = async suffix => {
35
42
  await page.screenshot({
@@ -37,7 +44,8 @@ const screenshotComponent = async (page, options) => {
37
44
  screenshotDir,
38
45
  getScreenshotName({ component, viewport, suffix, type, variant })
39
46
  ),
40
- fullPage: true,
47
+ fullPage: componentConfig?.fullPage ?? true,
48
+ optimizeForSpeed: true,
41
49
  captureBeyondViewport: false
42
50
  })
43
51
  }