@coorpacademy/components 11.6.1 → 11.7.3

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.
Files changed (114) hide show
  1. package/es/atom/loader/index.native.d.ts +10 -0
  2. package/es/atom/loader/index.native.d.ts.map +1 -0
  3. package/es/atom/loader/index.native.js +192 -0
  4. package/es/atom/loader/index.native.js.map +1 -0
  5. package/es/atom/select/index.d.ts.map +1 -1
  6. package/es/atom/select/index.js +48 -11
  7. package/es/atom/select/index.js.map +1 -1
  8. package/es/molecule/answer/index.d.ts.map +1 -1
  9. package/es/molecule/answer/index.js +1 -9
  10. package/es/molecule/answer/index.js.map +1 -1
  11. package/es/molecule/empty-state-dashboard/index.d.ts +23 -0
  12. package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -0
  13. package/es/molecule/empty-state-dashboard/index.js +31 -0
  14. package/es/molecule/empty-state-dashboard/index.js.map +1 -0
  15. package/es/molecule/empty-state-dashboard/style.css +55 -0
  16. package/es/molecule/empty-state-dashboard/types.d.ts +19 -0
  17. package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -0
  18. package/es/molecule/empty-state-dashboard/types.js +19 -0
  19. package/es/molecule/empty-state-dashboard/types.js.map +1 -0
  20. package/es/organism/list-item/index.d.ts +8 -6
  21. package/es/organism/list-item/index.d.ts.map +1 -1
  22. package/es/organism/list-item/index.js +16 -2
  23. package/es/organism/list-item/index.js.map +1 -1
  24. package/es/organism/list-item/style.css +18 -0
  25. package/es/organism/list-items/index.d.ts +2 -0
  26. package/es/organism/list-items/index.js +5 -1
  27. package/es/organism/list-items/index.js.map +1 -1
  28. package/es/template/activity/index.d.ts +36 -40
  29. package/es/template/activity/index.d.ts.map +1 -1
  30. package/es/template/activity/index.js +89 -111
  31. package/es/template/activity/index.js.map +1 -1
  32. package/es/template/activity/stars-summary.d.ts +9 -18
  33. package/es/template/activity/stars-summary.d.ts.map +1 -1
  34. package/es/template/activity/stars-summary.js +94 -122
  35. package/es/template/activity/stars-summary.js.map +1 -1
  36. package/es/template/back-office/brand-update/index.d.ts +20 -0
  37. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  38. package/es/template/back-office/brand-update/index.js +12 -3
  39. package/es/template/back-office/brand-update/index.js.map +1 -1
  40. package/es/template/back-office/brand-update/style.css +5 -1
  41. package/es/util/button-icons.d.ts +1 -0
  42. package/es/util/button-icons.d.ts.map +1 -1
  43. package/es/util/button-icons.js +3 -2
  44. package/es/util/button-icons.js.map +1 -1
  45. package/lib/atom/loader/index.native.d.ts +10 -0
  46. package/lib/atom/loader/index.native.d.ts.map +1 -0
  47. package/lib/atom/loader/index.native.js +205 -0
  48. package/lib/atom/loader/index.native.js.map +1 -0
  49. package/lib/atom/select/index.d.ts.map +1 -1
  50. package/lib/atom/select/index.js +46 -9
  51. package/lib/atom/select/index.js.map +1 -1
  52. package/lib/molecule/answer/index.d.ts.map +1 -1
  53. package/lib/molecule/answer/index.js +1 -10
  54. package/lib/molecule/answer/index.js.map +1 -1
  55. package/lib/molecule/empty-state-dashboard/index.d.ts +23 -0
  56. package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -0
  57. package/lib/molecule/empty-state-dashboard/index.js +42 -0
  58. package/lib/molecule/empty-state-dashboard/index.js.map +1 -0
  59. package/lib/molecule/empty-state-dashboard/style.css +55 -0
  60. package/lib/molecule/empty-state-dashboard/types.d.ts +19 -0
  61. package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -0
  62. package/lib/molecule/empty-state-dashboard/types.js +29 -0
  63. package/lib/molecule/empty-state-dashboard/types.js.map +1 -0
  64. package/lib/organism/list-item/index.d.ts +8 -6
  65. package/lib/organism/list-item/index.d.ts.map +1 -1
  66. package/lib/organism/list-item/index.js +16 -2
  67. package/lib/organism/list-item/index.js.map +1 -1
  68. package/lib/organism/list-item/style.css +18 -0
  69. package/lib/organism/list-items/index.d.ts +2 -0
  70. package/lib/organism/list-items/index.js +5 -1
  71. package/lib/organism/list-items/index.js.map +1 -1
  72. package/lib/template/activity/index.d.ts +36 -40
  73. package/lib/template/activity/index.d.ts.map +1 -1
  74. package/lib/template/activity/index.js +95 -110
  75. package/lib/template/activity/index.js.map +1 -1
  76. package/lib/template/activity/stars-summary.d.ts +9 -18
  77. package/lib/template/activity/stars-summary.d.ts.map +1 -1
  78. package/lib/template/activity/stars-summary.js +90 -119
  79. package/lib/template/activity/stars-summary.js.map +1 -1
  80. package/lib/template/back-office/brand-update/index.d.ts +20 -0
  81. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  82. package/lib/template/back-office/brand-update/index.js +13 -3
  83. package/lib/template/back-office/brand-update/index.js.map +1 -1
  84. package/lib/template/back-office/brand-update/style.css +5 -1
  85. package/lib/util/button-icons.d.ts +1 -0
  86. package/lib/util/button-icons.d.ts.map +1 -1
  87. package/lib/util/button-icons.js +2 -1
  88. package/lib/util/button-icons.js.map +1 -1
  89. package/locales/bs/global.json +8 -1
  90. package/locales/cs/global.json +8 -1
  91. package/locales/de/global.json +8 -1
  92. package/locales/en/global.json +0 -1
  93. package/locales/es/global.json +8 -1
  94. package/locales/et/global.json +8 -1
  95. package/locales/fr/global.json +0 -1
  96. package/locales/hr/global.json +8 -1
  97. package/locales/hu/global.json +8 -1
  98. package/locales/hy/global.json +0 -1
  99. package/locales/it/global.json +8 -1
  100. package/locales/ja/global.json +8 -1
  101. package/locales/ko/global.json +8 -1
  102. package/locales/nl/global.json +8 -1
  103. package/locales/pl/global.json +8 -1
  104. package/locales/pt/global.json +8 -1
  105. package/locales/ro/global.json +8 -1
  106. package/locales/ru/global.json +0 -1
  107. package/locales/sk/global.json +8 -1
  108. package/locales/tl/global.json +8 -1
  109. package/locales/tr/global.json +8 -1
  110. package/locales/uk/global.json +8 -1
  111. package/locales/vi/global.json +8 -1
  112. package/locales/zh/global.json +8 -1
  113. package/locales/zh_TW/global.json +8 -1
  114. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAerB,CAAC;AAEF,oBAAY,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import PropTypes from 'prop-types';
2
+ import Picture from '../../atom/picture';
3
+ export const propTypes = {
4
+ mainText: PropTypes.string,
5
+ subText: PropTypes.string,
6
+ imageUrl: Picture.propTypes.src,
7
+ buttonLink: PropTypes.shape({
8
+ type: PropTypes.string,
9
+ label: PropTypes.string,
10
+ ariaLabel: PropTypes.string,
11
+ dataName: PropTypes.string,
12
+ icon: PropTypes.shape({
13
+ position: PropTypes.string,
14
+ type: PropTypes.string
15
+ }),
16
+ onClick: PropTypes.func
17
+ })
18
+ };
19
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":["PropTypes","Picture","propTypes","mainText","string","subText","imageUrl","src","buttonLink","shape","type","label","ariaLabel","dataName","icon","position","onClick","func"],"sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Picture from '../../atom/picture';\n\nexport const propTypes = {\n mainText: PropTypes.string,\n subText: PropTypes.string,\n imageUrl: Picture.propTypes.src,\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n })\n};\n\nexport type Props = PropTypes.InferProps<typeof propTypes>;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,QAAQ,EAAEH,SAAS,CAACI,MADG;EAEvBC,OAAO,EAAEL,SAAS,CAACI,MAFI;EAGvBE,QAAQ,EAAEL,OAAO,CAACC,SAAR,CAAkBK,GAHL;EAIvBC,UAAU,EAAER,SAAS,CAACS,KAAV,CAAgB;IAC1BC,IAAI,EAAEV,SAAS,CAACI,MADU;IAE1BO,KAAK,EAAEX,SAAS,CAACI,MAFS;IAG1BQ,SAAS,EAAEZ,SAAS,CAACI,MAHK;IAI1BS,QAAQ,EAAEb,SAAS,CAACI,MAJM;IAK1BU,IAAI,EAAEd,SAAS,CAACS,KAAV,CAAgB;MACpBM,QAAQ,EAAEf,SAAS,CAACI,MADA;MAEpBM,IAAI,EAAEV,SAAS,CAACI;IAFI,CAAhB,CALoB;IAS1BY,OAAO,EAAEhB,SAAS,CAACiB;EATO,CAAhB;AAJW,CAAlB"}
@@ -1,8 +1,8 @@
1
1
  export default ListItem;
2
2
  declare function ListItem(props: any): JSX.Element;
3
3
  declare namespace ListItem {
4
- namespace propTypes {
5
- const bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
4
+ const propTypes: {
5
+ bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
6
6
  buttonAriaLabel: PropTypes.Requireable<string>;
7
7
  menuAriaLabel: PropTypes.Requireable<string>;
8
8
  buttons: PropTypes.Requireable<(PropTypes.InferProps<{
@@ -13,7 +13,7 @@ declare namespace ListItem {
13
13
  }> | null | undefined)[]>;
14
14
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
15
15
  }>>;
16
- const buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
16
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
17
17
  type: PropTypes.Requireable<string>;
18
18
  label: PropTypes.Requireable<string>;
19
19
  ariaLabel: PropTypes.Requireable<string>;
@@ -24,12 +24,14 @@ declare namespace ListItem {
24
24
  }>>;
25
25
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
26
26
  }>>;
27
- const tags: PropTypes.Requireable<(PropTypes.InferProps<{
27
+ tags: PropTypes.Requireable<(PropTypes.InferProps<{
28
28
  label: PropTypes.Requireable<string>;
29
29
  type: PropTypes.Requireable<string>;
30
30
  }> | null | undefined)[]>;
31
- const title: PropTypes.Validator<string>;
32
- }
31
+ title: PropTypes.Validator<string>;
32
+ order: PropTypes.Requireable<number>;
33
+ 'aria-label': PropTypes.Requireable<string>;
34
+ };
33
35
  }
34
36
  import PropTypes from "prop-types";
35
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAuBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAqCC"}
@@ -7,16 +7,20 @@ import BulletPointMenuButton from '../../molecule/bullet-point-menu-button';
7
7
  import style from './style.css';
8
8
 
9
9
  const ListItem = props => {
10
+ let isPublished = false;
10
11
  const {
11
12
  bulletPointMenuButton,
12
13
  buttonLink,
13
14
  tags,
14
- title
15
+ title,
16
+ order,
17
+ 'aria-label': ariaLabel
15
18
  } = props;
16
19
 
17
20
  const tagsView = _map.convert({
18
21
  cap: false
19
22
  })((tag, index) => {
23
+ isPublished = tag.type === 'published';
20
24
  return /*#__PURE__*/React.createElement("div", {
21
25
  key: index,
22
26
  className: style.tag
@@ -25,7 +29,15 @@ const ListItem = props => {
25
29
 
26
30
  return /*#__PURE__*/React.createElement("div", {
27
31
  className: style.wrapper
32
+ }, isPublished ? /*#__PURE__*/React.createElement("div", {
33
+ className: style.orderWrapper
28
34
  }, /*#__PURE__*/React.createElement("div", {
35
+ className: style.order,
36
+ "aria-label": ariaLabel
37
+ }, order + 1), /*#__PURE__*/React.createElement("div", {
38
+ className: style.title,
39
+ title: title
40
+ }, title)) : /*#__PURE__*/React.createElement("div", {
29
41
  className: style.title,
30
42
  title: title
31
43
  }, title), /*#__PURE__*/React.createElement("div", {
@@ -62,7 +74,9 @@ ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
62
74
  label: PropTypes.string,
63
75
  type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])
64
76
  })),
65
- title: PropTypes.string.isRequired
77
+ title: PropTypes.string.isRequired,
78
+ order: PropTypes.number,
79
+ 'aria-label': PropTypes.string
66
80
  } : {};
67
81
  export default ListItem;
68
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","bulletPointMenuButton","buttonLink","tags","title","tagsView","convert","cap","tag","index","wrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","type","onClick","func","ariaLabel","dataName","icon","position","oneOf","isRequired"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n const {bulletPointMenuButton, buttonLink, tags, title} = props;\n const tagsView = map.convert({cap: false})((tag, index) => {\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n <div className={style.title} title={title}>\n {title}\n </div>\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,qBAAD;IAAwBC,UAAxB;IAAoCC,IAApC;IAA0CC;EAA1C,IAAmDJ,KAAzD;;EACA,MAAMK,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzD,oBACE;MAAK,GAAG,EAAEA,KAAV;MAAiB,SAAS,EAAEX,KAAK,CAACU;IAAlC,gBACE,oBAAC,GAAD,EAASA,GAAT,CADF,CADF;EAKD,CANgB,EAMdL,IANc,CAAjB;;EAOA,oBACE;IAAK,SAAS,EAAEL,KAAK,CAACY;EAAtB,gBACE;IAAK,SAAS,EAAEZ,KAAK,CAACM,KAAtB;IAA6B,KAAK,EAAEA;EAApC,GACGA,KADH,CADF,eAIE;IAAK,SAAS,EAAEN,KAAK,CAACa;EAAtB,GACGN,QADH,eAEE;IAAK,SAAS,EAAEP,KAAK,CAACc;EAAtB,gBACE,oBAAC,UAAD,EAAgBV,UAAhB,CADF,CAFF,eAKE,oBAAC,qBAAD,EAA2BD,qBAA3B,CALF,CAJF,CADF;AAcD,CAvBD;;AAyBAF,QAAQ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 {"version":3,"file":"index.js","names":["React","PropTypes","Tag","ButtonLink","BulletPointMenuButton","style","ListItem","props","isPublished","bulletPointMenuButton","buttonLink","tags","title","order","ariaLabel","tagsView","convert","cap","tag","index","type","wrapper","orderWrapper","settings","edit","propTypes","shape","buttonAriaLabel","string","menuAriaLabel","buttons","arrayOf","label","onClick","func","dataName","icon","position","oneOf","isRequired","number"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map} from 'lodash/fp';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport style from './style.css';\n\nconst ListItem = props => {\n let isPublished = false;\n const {bulletPointMenuButton, buttonLink, tags, title, order, 'aria-label': ariaLabel} = props;\n\n const tagsView = map.convert({cap: false})((tag, index) => {\n isPublished = tag.type === 'published';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} />\n </div>\n );\n })(tags);\n return (\n <div className={style.wrapper}>\n {isPublished ? (\n <div className={style.orderWrapper}>\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n <div className={style.title} title={title}>\n {title}\n </div>\n </div>\n ) : (\n <div className={style.title} title={title}>\n {title}\n </div>\n )}\n <div className={style.settings}>\n {tagsView}\n <div className={style.edit}>\n <ButtonLink {...buttonLink} />\n </div>\n <BulletPointMenuButton {...bulletPointMenuButton} />\n </div>\n </div>\n );\n};\n\nListItem.propTypes = {\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['published', 'draft', 'archived', 'revised', 'default'])\n })\n ),\n title: PropTypes.string.isRequired,\n order: PropTypes.number,\n 'aria-label': PropTypes.string\n};\n\nexport default ListItem;\n"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,qBAAP,MAAkC,yCAAlC;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,IAAIC,WAAW,GAAG,KAAlB;EACA,MAAM;IAACC,qBAAD;IAAwBC,UAAxB;IAAoCC,IAApC;IAA0CC,KAA1C;IAAiDC,KAAjD;IAAwD,cAAcC;EAAtE,IAAmFP,KAAzF;;EAEA,MAAMQ,QAAQ,GAAG,KAAIC,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EAA0B,CAACC,GAAD,EAAMC,KAAN,KAAgB;IACzDX,WAAW,GAAGU,GAAG,CAACE,IAAJ,KAAa,WAA3B;IACA,oBACE;MAAK,GAAG,EAAED,KAAV;MAAiB,SAAS,EAAEd,KAAK,CAACa;IAAlC,gBACE,oBAAC,GAAD,EAASA,GAAT,CADF,CADF;EAKD,CAPgB,EAOdP,IAPc,CAAjB;;EAQA,oBACE;IAAK,SAAS,EAAEN,KAAK,CAACgB;EAAtB,GACGb,WAAW,gBACV;IAAK,SAAS,EAAEH,KAAK,CAACiB;EAAtB,gBACE;IAAK,SAAS,EAAEjB,KAAK,CAACQ,KAAtB;IAA6B,cAAYC;EAAzC,GACGD,KAAK,GAAG,CADX,CADF,eAIE;IAAK,SAAS,EAAER,KAAK,CAACO,KAAtB;IAA6B,KAAK,EAAEA;EAAp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EAyBnBvB,IAAI,EAAEV,SAAS,CAAC8B,OAAV,CACJ9B,SAAS,CAACyB,KAAV,CAAgB;IACdM,KAAK,EAAE/B,SAAS,CAAC2B,MADH;IAEdR,IAAI,EAAEnB,SAAS,CAACqC,KAAV,CAAgB,CAAC,WAAD,EAAc,OAAd,EAAuB,UAAvB,EAAmC,SAAnC,EAA8C,SAA9C,CAAhB;EAFQ,CAAhB,CADI,CAzBa;EA+BnB1B,KAAK,EAAEX,SAAS,CAAC2B,MAAV,CAAiBW,UA/BL;EAgCnB1B,KAAK,EAAEZ,SAAS,CAACuC,MAhCE;EAiCnB,cAAcvC,SAAS,CAAC2B;AAjCL,CAArB;AAoCA,eAAetB,QAAf"}
@@ -4,6 +4,7 @@
4
4
  @value xtraLightGrey from colors;
5
5
  @value cm_grey_900 from colors;
6
6
  @value primaryAdd1 from colors;
7
+ @value cm_grey_400 from colors;
7
8
 
8
9
  .wrapper {
9
10
  align-items: center;
@@ -51,3 +52,20 @@
51
52
  margin: 0 16px 0 0;
52
53
  min-width: 93px;
53
54
  }
55
+
56
+ .order {
57
+ width: 6px;
58
+ height: 20px;
59
+ font-family: 'Gilroy';
60
+ font-style: normal;
61
+ font-weight: 600;
62
+ font-size: 14px;
63
+ line-height: 20px;
64
+ color: cm_grey_400;
65
+ margin: 0 16px 0 0;
66
+ }
67
+ .orderWrapper {
68
+ align-items: center;
69
+ display: flex;
70
+ width: 100%;
71
+ }
@@ -56,6 +56,8 @@ declare namespace ListItems {
56
56
  type: PropTypes.Requireable<string>;
57
57
  }> | null | undefined)[]>;
58
58
  title: PropTypes.Validator<string>;
59
+ order: PropTypes.Requireable<number>;
60
+ 'aria-label': PropTypes.Requireable<string>;
59
61
  }> | null | undefined)[]>;
60
62
  title: PropTypes.Requireable<string>;
61
63
  };
@@ -1,3 +1,5 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
1
3
  import React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import ListItem from '../list-item';
@@ -15,7 +17,9 @@ const ListItems = ({
15
17
  key: item.id,
16
18
  className: style.item,
17
19
  "data-name": `content-${index}`
18
- }, /*#__PURE__*/React.createElement(ListItem, item)));
20
+ }, /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
21
+ order: index
22
+ }))));
19
23
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
20
24
  className: style.header
21
25
  }, /*#__PURE__*/React.createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","PropTypes","ListItem","Title","ButtonLink","style","ListItems","title","buttonLink","items","ariaLabel","itemsView","map","item","index","id","header","buttonCreate","list","propTypes","string","shape","arrayOf"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ListItems = ({title, buttonLink, items, 'aria-label': ariaLabel}) => {\n const itemsView = items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} />\n </li>\n ));\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n <ul className={style.list} aria-label={ariaLabel} data-name={'content-list'}>\n {itemsView}\n </ul>\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,S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Aed,SAAf"}
1
+ {"version":3,"file":"index.js","names":["React","PropTypes","ListItem","Title","ButtonLink","style","ListItems","title","buttonLink","items","ariaLabel","itemsView","map","item","index","id","header","buttonCreate","list","propTypes","string","shape","arrayOf"],"sources":["../../../src/organism/list-items/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport ListItem from '../list-item';\nimport Title from '../../atom/title';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\n\nconst ListItems = ({title, buttonLink, items, 'aria-label': ariaLabel}) => {\n const itemsView = items.map((item, index) => (\n <li key={item.id} className={style.item} data-name={`content-${index}`}>\n <ListItem {...item} order={index} />\n </li>\n ));\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.title}>\n <Title title={title} type={'form-group'} data-name={'list-title'} />\n </div>\n <div className={style.buttonCreate}>\n <ButtonLink {...buttonLink} />\n </div>\n </div>\n <ul className={style.list} aria-label={ariaLabel} data-name={'content-list'}>\n {itemsView}\n </ul>\n </div>\n );\n};\n\nListItems.propTypes = {\n 'aria-label': PropTypes.string,\n buttonLink: PropTypes.shape(ButtonLink.propTypes),\n items: PropTypes.arrayOf(PropTypes.shape(ListItem.propTypes)),\n title: PropTypes.string\n};\n\nexport default ListItems;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,SAAS,GAAG,CAAC;EAACC,KAAD;EAAQC,UAAR;EAAoBC,KAApB;EAA2B,cAAcC;AAAzC,CAAD,KAAyD;EACzE,MAAMC,SAAS,GAAGF,KAAK,CAACG,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,kBAC1B;IAAI,GAAG,EAAED,IAAI,CAACE,EAAd;IAAkB,SAAS,EAAEV,KAAK,CAACQ,IAAnC;IAAyC,aAAY,WAAUC,KAAM;EAArE,gBACE,oBAAC,QAAD,eAAcD,IAAd;IAAoB,KAAK,EAAEC;EAA3B,GADF,CADgB,CAAlB;EAMA,oBACE,8CACE;IAAK,SAAS,EAAET,KAAK,CAACW;EAAtB,gBACE;IAAK,SAAS,EAAEX,KAAK,CAACE;EAAtB,gBACE,oBAAC,KAAD;IAAO,KAAK,EAAEA,KAAd;IAAqB,IAAI,EAAE,YAA3B;IAAyC,aAAW;EAApD,EADF,CADF,eAIE;IAAK,SAAS,EAAEF,KAAK,CAACY;EAAtB,gBACE,oBAAC,UAAD,EAAgBT,UAAhB,CADF,CAJF,CADF,eASE;IAAI,SAAS,EAAEH,KAAK,CAACa,IAArB;IAA2B,cAAYR,SAAvC;IAAkD,aAAW;EAA7D,GACGC,SADH,CATF,CADF;AAeD,CAtBD;;AAwBAL,SAAS,CAACa,SAAV,2CAAsB;EACpB,cAAclB,SAAS,CAACmB,MADJ;EAEpBZ,UAAU,EAAEP,SAAS,CAACoB,KAAV,CAAgBjB,UAAU,CAACe,SAA3B,CAFQ;EAGpBV,KAAK,EAAER,SAAS,CAACqB,OAAV,CAAkBrB,SAAS,CAACoB,KAAV,CAAgBnB,QAAQ,CAACiB,SAAzB,CAAlB,CAHa;EAIpBZ,KAAK,EAAEN,SAAS,CAACmB;AAJG,CAAtB;AAOA,eAAed,SAAf"}
@@ -1,14 +1,38 @@
1
1
  export default Progression;
2
- declare class Progression extends React.Component<any, any, any> {
3
- static propTypes: {
4
- mainTitle: PropTypes.Validator<string>;
5
- mainSubtitle: PropTypes.Validator<string>;
6
- adaptiveAriaLabel: PropTypes.Requireable<string>;
7
- total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
2
+ declare function Progression(props: any, legacyContext: any): JSX.Element;
3
+ declare namespace Progression {
4
+ namespace contextTypes {
5
+ const skin: PropTypes.Requireable<PropTypes.InferProps<{
6
+ common: PropTypes.Requireable<{
7
+ [x: string]: any;
8
+ }>;
9
+ images: PropTypes.Requireable<PropTypes.InferProps<{
10
+ 'logo-mobile': PropTypes.Requireable<any>;
11
+ logo: PropTypes.Requireable<any>;
12
+ 'logo-email': PropTypes.Requireable<any>;
13
+ login: PropTypes.Requireable<any>;
14
+ }>>;
15
+ icons: PropTypes.Requireable<{
16
+ [x: string]: any;
17
+ }>;
18
+ mod: PropTypes.Requireable<{
19
+ [x: string]: any;
20
+ }>;
21
+ courses: PropTypes.Requireable<any[]>;
22
+ texts: PropTypes.Requireable<{
23
+ [x: string]: any;
24
+ }>;
25
+ }>>;
26
+ }
27
+ namespace propTypes {
28
+ const mainTitle: PropTypes.Validator<string>;
29
+ const mainSubtitle: PropTypes.Validator<string>;
30
+ const adaptiveAriaLabel: PropTypes.Requireable<string>;
31
+ const total: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
8
32
  label: PropTypes.Validator<string>;
9
33
  stars: PropTypes.Validator<number>;
10
34
  }>>>;
11
- engines: PropTypes.Requireable<(PropTypes.InferProps<{
35
+ const engines: PropTypes.Requireable<(PropTypes.InferProps<{
12
36
  type: PropTypes.Validator<string>;
13
37
  stars: PropTypes.Validator<number>;
14
38
  title: PropTypes.Validator<string>;
@@ -22,8 +46,8 @@ declare class Progression extends React.Component<any, any, any> {
22
46
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
23
47
  }>>;
24
48
  }> | null | undefined)[]>;
25
- loading: PropTypes.Validator<boolean>;
26
- progressions: PropTypes.Requireable<(PropTypes.InferProps<{
49
+ const loading: PropTypes.Validator<boolean>;
50
+ const progressions: PropTypes.Requireable<(PropTypes.InferProps<{
27
51
  ref: PropTypes.Validator<string>;
28
52
  completion: PropTypes.Validator<number>;
29
53
  stars: PropTypes.Validator<number>;
@@ -38,7 +62,7 @@ declare class Progression extends React.Component<any, any, any> {
38
62
  adaptive: PropTypes.Validator<boolean>;
39
63
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
40
64
  }> | null | undefined)[]>;
41
- themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
65
+ const themeFilter: PropTypes.Requireable<PropTypes.InferProps<{
42
66
  options: PropTypes.Validator<(PropTypes.InferProps<{
43
67
  name: PropTypes.Validator<string>;
44
68
  value: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
@@ -47,42 +71,14 @@ declare class Progression extends React.Component<any, any, any> {
47
71
  }> | null | undefined)[]>;
48
72
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
49
73
  }>>;
50
- recommendation: PropTypes.Requireable<PropTypes.InferProps<{
74
+ const recommendation: PropTypes.Requireable<PropTypes.InferProps<{
51
75
  cta: PropTypes.Validator<string>;
52
76
  title: PropTypes.Validator<string>;
53
77
  subtitle: PropTypes.Validator<string>;
54
78
  courseTitle: PropTypes.Validator<string>;
55
79
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
56
80
  }>>;
57
- };
58
- static contextTypes: {
59
- skin: PropTypes.Requireable<PropTypes.InferProps<{
60
- common: PropTypes.Requireable<{
61
- [x: string]: any;
62
- }>;
63
- images: PropTypes.Requireable<PropTypes.InferProps<{
64
- 'logo-mobile': PropTypes.Requireable<any>;
65
- logo: PropTypes.Requireable<any>;
66
- 'logo-email': PropTypes.Requireable<any>;
67
- login: PropTypes.Requireable<any>;
68
- }>>;
69
- icons: PropTypes.Requireable<{
70
- [x: string]: any;
71
- }>;
72
- mod: PropTypes.Requireable<{
73
- [x: string]: any;
74
- }>;
75
- courses: PropTypes.Requireable<any[]>;
76
- texts: PropTypes.Requireable<{
77
- [x: string]: any;
78
- }>;
79
- }>>;
80
- };
81
- constructor(props: any, context: any);
82
- handleClick: (e: any) => void;
83
- handleSelectTheme: (e: any) => void;
84
- render(): JSX.Element;
81
+ }
85
82
  }
86
- import React from "react";
87
83
  import PropTypes from "prop-types";
88
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAaA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,sCAIC;IAED,8BAME;IAEF,oCAKE;IAEF,sBAoFC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/activity/index.js"],"names":[],"mappings":";AAeA,0EAuGC"}
@@ -1,13 +1,12 @@
1
- import _isEmpty from "lodash/fp/isEmpty";
2
- import _omit from "lodash/fp/omit";
3
- import _get from "lodash/fp/get";
4
-
5
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
2
 
7
- import React from 'react';
3
+ import React, { useCallback } from 'react';
4
+ import get from 'lodash/fp/get';
5
+ import isEmpty from 'lodash/fp/isEmpty';
6
+ import omit from 'lodash/fp/omit';
8
7
  import PropTypes from 'prop-types';
9
8
  import classnames from 'classnames';
10
- import Provider from '../../atom/provider';
9
+ import Provider, { GetSkinFromContext } from '../../atom/provider';
11
10
  import Button from '../../atom/button';
12
11
  import Select from '../../atom/select';
13
12
  import Loader from '../../atom/loader';
@@ -16,112 +15,91 @@ import EngineStars from './engine-stars';
16
15
  import StarsSummary from './stars-summary';
17
16
  import style from './style.css';
18
17
 
19
- class Progression extends React.Component {
20
- constructor(props, context) {
21
- super(props, context);
22
-
23
- this.handleClick = e => {
24
- const {
25
- recommendation
26
- } = this.props;
27
- e.stopPropagation();
28
- e.preventDefault();
29
- const {
30
- onClick
31
- } = recommendation;
32
- onClick && onClick(e);
33
- };
34
-
35
- this.handleSelectTheme = e => {
36
- const {
37
- themeFilter: {
38
- onChange
39
- }
40
- } = this.props;
41
- onChange && onChange(e);
42
- };
43
-
44
- this.handleClick = this.handleClick.bind(this);
45
- this.handleSelectTheme = this.handleSelectTheme.bind(this);
46
- }
47
-
48
- render() {
18
+ const Progression = (props, legacyContext) => {
19
+ const {
20
+ mainTitle,
21
+ mainSubtitle,
22
+ recommendation = {},
23
+ progressions = [],
24
+ adaptiveAriaLabel,
25
+ total,
26
+ engines = [],
27
+ themeFilter = {},
28
+ loading
29
+ } = props;
30
+ const skin = GetSkinFromContext(legacyContext);
31
+ const {
32
+ onChange: themeFilterOnChange
33
+ } = themeFilter;
34
+ const handleClick = useCallback(e => {
35
+ e.stopPropagation();
36
+ e.preventDefault();
49
37
  const {
50
- mainTitle,
51
- mainSubtitle,
52
- recommendation = {},
53
- progressions = [],
54
- adaptiveAriaLabel,
55
- total,
56
- engines = [],
57
- themeFilter = {},
58
- loading
59
- } = this.props;
60
- const {
61
- skin
62
- } = this.context;
63
-
64
- const primary = _get('common.primary', skin);
65
-
66
- const loader = loading ? /*#__PURE__*/React.createElement("div", {
67
- className: style.loader
68
- }, /*#__PURE__*/React.createElement(Loader, null)) : null;
69
- const allProgressions = progressions.map(progression => /*#__PURE__*/React.createElement(ProgressionItem, _extends({}, _omit(['ref'], progression), {
70
- key: progression.ref,
71
- adaptiveAriaLabel: adaptiveAriaLabel
72
- })));
73
- const coreProgression = /*#__PURE__*/React.createElement("div", {
74
- "data-name": "activityCore",
75
- className: style.core
76
- }, allProgressions);
77
- const themeSelect = !_isEmpty(themeFilter.options) ? /*#__PURE__*/React.createElement(Select, {
78
- borderClassName: style.selectBorder,
79
- className: style.select,
80
- theme: "thematiques",
81
- options: themeFilter.options,
82
- onChange: this.handleSelectTheme
83
- }) : null;
84
- const recommendationSection = !_isEmpty(recommendation) ? /*#__PURE__*/React.createElement("div", {
85
- className: style.recommendationWrapper
86
- }, /*#__PURE__*/React.createElement("p", {
87
- className: style.recommendationSection
88
- }, recommendation.title, " "), /*#__PURE__*/React.createElement("p", {
89
- className: style.recommendationSection
90
- }, /*#__PURE__*/React.createElement("span", null, recommendation.subtitle, " "), /*#__PURE__*/React.createElement("span", {
91
- className: classnames(style.course, style.innerHTML) // eslint-disable-next-line react/no-danger
92
- ,
93
- dangerouslySetInnerHTML: {
94
- __html: recommendation.courseTitle
95
- }
96
- })), /*#__PURE__*/React.createElement(Button, {
97
- type: "link",
98
- onClick: this.handleClick,
99
- submitValue: recommendation.cta,
100
- style: {
101
- backgroundColor: primary
102
- },
103
- className: style.cta
104
- })) : null;
105
- return /*#__PURE__*/React.createElement("div", {
106
- className: style.default
107
- }, /*#__PURE__*/React.createElement("div", {
108
- "data-name": "activity-header"
109
- }, /*#__PURE__*/React.createElement("div", {
110
- className: style.mainTitle
111
- }, /*#__PURE__*/React.createElement("span", null, mainTitle), " ", mainSubtitle), /*#__PURE__*/React.createElement("div", {
112
- className: style.headerProgression
113
- }, /*#__PURE__*/React.createElement("div", {
114
- className: style.wrapperCta
115
- }, themeSelect, recommendationSection), /*#__PURE__*/React.createElement(StarsSummary, {
116
- engines: engines,
117
- total: total
118
- }))), /*#__PURE__*/React.createElement("div", {
119
- className: style.wrapperProgression,
120
- "data-name": "activityList"
121
- }, coreProgression, loader));
122
- }
123
-
124
- }
38
+ onClick
39
+ } = recommendation;
40
+ onClick && onClick(e);
41
+ }, [recommendation]);
42
+ const handleSelectTheme = useCallback(e => {
43
+ themeFilterOnChange && themeFilterOnChange(e);
44
+ }, [themeFilterOnChange]);
45
+ const primary = get('common.primary', skin);
46
+ const loader = loading ? /*#__PURE__*/React.createElement("div", {
47
+ className: style.loader
48
+ }, /*#__PURE__*/React.createElement(Loader, null)) : null;
49
+ const allProgressions = progressions.map(progression => /*#__PURE__*/React.createElement(ProgressionItem, _extends({}, omit(['ref'], progression), {
50
+ key: progression.ref,
51
+ adaptiveAriaLabel: adaptiveAriaLabel
52
+ })));
53
+ const coreProgression = /*#__PURE__*/React.createElement("div", {
54
+ "data-name": "activityCore",
55
+ className: style.core
56
+ }, allProgressions);
57
+ const themeSelect = !isEmpty(themeFilter.options) ? /*#__PURE__*/React.createElement(Select, {
58
+ borderClassName: style.selectBorder,
59
+ className: style.select,
60
+ theme: "thematiques",
61
+ options: themeFilter.options,
62
+ onChange: handleSelectTheme
63
+ }) : null;
64
+ const recommendationSection = !isEmpty(recommendation) ? /*#__PURE__*/React.createElement("div", {
65
+ className: style.recommendationWrapper
66
+ }, /*#__PURE__*/React.createElement("p", {
67
+ className: style.recommendationSection
68
+ }, recommendation.title, " "), /*#__PURE__*/React.createElement("p", {
69
+ className: style.recommendationSection
70
+ }, /*#__PURE__*/React.createElement("span", null, recommendation.subtitle, " "), /*#__PURE__*/React.createElement("span", {
71
+ className: classnames(style.course, style.innerHTML) // eslint-disable-next-line react/no-danger
72
+ ,
73
+ dangerouslySetInnerHTML: {
74
+ __html: recommendation.courseTitle
75
+ }
76
+ })), /*#__PURE__*/React.createElement(Button, {
77
+ type: "link",
78
+ onClick: handleClick,
79
+ submitValue: recommendation.cta,
80
+ style: {
81
+ backgroundColor: primary
82
+ },
83
+ className: style.cta
84
+ })) : null;
85
+ return /*#__PURE__*/React.createElement("div", {
86
+ className: style.default
87
+ }, /*#__PURE__*/React.createElement("div", {
88
+ "data-name": "activity-header"
89
+ }, /*#__PURE__*/React.createElement("div", {
90
+ className: style.mainTitle
91
+ }, /*#__PURE__*/React.createElement("span", null, mainTitle), " ", mainSubtitle), /*#__PURE__*/React.createElement("div", {
92
+ className: style.headerProgression
93
+ }, /*#__PURE__*/React.createElement("div", {
94
+ className: style.wrapperCta
95
+ }, themeSelect, recommendationSection), /*#__PURE__*/React.createElement(StarsSummary, {
96
+ engines: engines,
97
+ total: total
98
+ }))), /*#__PURE__*/React.createElement("div", {
99
+ className: style.wrapperProgression,
100
+ "data-name": "activityList"
101
+ }, coreProgression, loader));
102
+ };
125
103
 
126
104
  Progression.contextTypes = {
127
105
  skin: Provider.childContextTypes.skin