@coorpacademy/components 11.6.1 → 11.7.3-alpha.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 (125) hide show
  1. package/es/atom/select/index.d.ts +1 -0
  2. package/es/atom/select/index.d.ts.map +1 -1
  3. package/es/atom/select/index.js +55 -14
  4. package/es/atom/select/index.js.map +1 -1
  5. package/es/molecule/answer/index.d.ts.map +1 -1
  6. package/es/molecule/answer/index.js +1 -9
  7. package/es/molecule/answer/index.js.map +1 -1
  8. package/es/molecule/brand-form-group/index.d.ts +2 -0
  9. package/es/molecule/empty-state-dashboard/index.d.ts +23 -0
  10. package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -0
  11. package/es/molecule/empty-state-dashboard/index.js +31 -0
  12. package/es/molecule/empty-state-dashboard/index.js.map +1 -0
  13. package/es/molecule/empty-state-dashboard/style.css +55 -0
  14. package/es/molecule/empty-state-dashboard/types.d.ts +19 -0
  15. package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -0
  16. package/es/molecule/empty-state-dashboard/types.js +19 -0
  17. package/es/molecule/empty-state-dashboard/types.js.map +1 -0
  18. package/es/molecule/filters/index.d.ts +1 -0
  19. package/es/molecule/filters/index.d.ts.map +1 -1
  20. package/es/molecule/setup-slide/index.d.ts +1 -0
  21. package/es/molecule/setup-slider/index.d.ts +1 -0
  22. package/es/organism/brand-form/index.d.ts +2 -0
  23. package/es/organism/list-item/index.d.ts +8 -6
  24. package/es/organism/list-item/index.d.ts.map +1 -1
  25. package/es/organism/list-item/index.js +16 -2
  26. package/es/organism/list-item/index.js.map +1 -1
  27. package/es/organism/list-item/style.css +18 -0
  28. package/es/organism/list-items/index.d.ts +2 -0
  29. package/es/organism/list-items/index.js +5 -1
  30. package/es/organism/list-items/index.js.map +1 -1
  31. package/es/organism/wizard-contents/index.d.ts +2 -0
  32. package/es/template/activity/index.d.ts +36 -40
  33. package/es/template/activity/index.d.ts.map +1 -1
  34. package/es/template/activity/index.js +89 -111
  35. package/es/template/activity/index.js.map +1 -1
  36. package/es/template/activity/stars-summary.d.ts +9 -18
  37. package/es/template/activity/stars-summary.d.ts.map +1 -1
  38. package/es/template/activity/stars-summary.js +94 -122
  39. package/es/template/activity/stars-summary.js.map +1 -1
  40. package/es/template/back-office/brand-update/index.d.ts +24 -0
  41. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  42. package/es/template/back-office/brand-update/index.js +12 -3
  43. package/es/template/back-office/brand-update/index.js.map +1 -1
  44. package/es/template/back-office/brand-update/style.css +5 -1
  45. package/es/template/common/search-page/index.d.ts +1 -0
  46. package/es/util/button-icons.d.ts +1 -0
  47. package/es/util/button-icons.d.ts.map +1 -1
  48. package/es/util/button-icons.js +3 -2
  49. package/es/util/button-icons.js.map +1 -1
  50. package/lib/atom/select/index.d.ts +1 -0
  51. package/lib/atom/select/index.d.ts.map +1 -1
  52. package/lib/atom/select/index.js +53 -12
  53. package/lib/atom/select/index.js.map +1 -1
  54. package/lib/molecule/answer/index.d.ts.map +1 -1
  55. package/lib/molecule/answer/index.js +1 -10
  56. package/lib/molecule/answer/index.js.map +1 -1
  57. package/lib/molecule/brand-form-group/index.d.ts +2 -0
  58. package/lib/molecule/empty-state-dashboard/index.d.ts +23 -0
  59. package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -0
  60. package/lib/molecule/empty-state-dashboard/index.js +42 -0
  61. package/lib/molecule/empty-state-dashboard/index.js.map +1 -0
  62. package/lib/molecule/empty-state-dashboard/style.css +55 -0
  63. package/lib/molecule/empty-state-dashboard/types.d.ts +19 -0
  64. package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -0
  65. package/lib/molecule/empty-state-dashboard/types.js +29 -0
  66. package/lib/molecule/empty-state-dashboard/types.js.map +1 -0
  67. package/lib/molecule/filters/index.d.ts +1 -0
  68. package/lib/molecule/filters/index.d.ts.map +1 -1
  69. package/lib/molecule/setup-slide/index.d.ts +1 -0
  70. package/lib/molecule/setup-slider/index.d.ts +1 -0
  71. package/lib/organism/brand-form/index.d.ts +2 -0
  72. package/lib/organism/list-item/index.d.ts +8 -6
  73. package/lib/organism/list-item/index.d.ts.map +1 -1
  74. package/lib/organism/list-item/index.js +16 -2
  75. package/lib/organism/list-item/index.js.map +1 -1
  76. package/lib/organism/list-item/style.css +18 -0
  77. package/lib/organism/list-items/index.d.ts +2 -0
  78. package/lib/organism/list-items/index.js +5 -1
  79. package/lib/organism/list-items/index.js.map +1 -1
  80. package/lib/organism/wizard-contents/index.d.ts +2 -0
  81. package/lib/template/activity/index.d.ts +36 -40
  82. package/lib/template/activity/index.d.ts.map +1 -1
  83. package/lib/template/activity/index.js +95 -110
  84. package/lib/template/activity/index.js.map +1 -1
  85. package/lib/template/activity/stars-summary.d.ts +9 -18
  86. package/lib/template/activity/stars-summary.d.ts.map +1 -1
  87. package/lib/template/activity/stars-summary.js +90 -119
  88. package/lib/template/activity/stars-summary.js.map +1 -1
  89. package/lib/template/back-office/brand-update/index.d.ts +24 -0
  90. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  91. package/lib/template/back-office/brand-update/index.js +13 -3
  92. package/lib/template/back-office/brand-update/index.js.map +1 -1
  93. package/lib/template/back-office/brand-update/style.css +5 -1
  94. package/lib/template/common/search-page/index.d.ts +1 -0
  95. package/lib/util/button-icons.d.ts +1 -0
  96. package/lib/util/button-icons.d.ts.map +1 -1
  97. package/lib/util/button-icons.js +2 -1
  98. package/lib/util/button-icons.js.map +1 -1
  99. package/locales/bs/global.json +8 -1
  100. package/locales/cs/global.json +8 -1
  101. package/locales/de/global.json +8 -1
  102. package/locales/en/global.json +0 -1
  103. package/locales/es/global.json +8 -1
  104. package/locales/et/global.json +8 -1
  105. package/locales/fr/global.json +0 -1
  106. package/locales/hr/global.json +8 -1
  107. package/locales/hu/global.json +8 -1
  108. package/locales/hy/global.json +0 -1
  109. package/locales/it/global.json +8 -1
  110. package/locales/ja/global.json +8 -1
  111. package/locales/ko/global.json +8 -1
  112. package/locales/nl/global.json +8 -1
  113. package/locales/pl/global.json +8 -1
  114. package/locales/pt/global.json +8 -1
  115. package/locales/ro/global.json +8 -1
  116. package/locales/ru/global.json +0 -1
  117. package/locales/sk/global.json +8 -1
  118. package/locales/tl/global.json +8 -1
  119. package/locales/tr/global.json +8 -1
  120. package/locales/uk/global.json +8 -1
  121. package/locales/vi/global.json +8 -1
  122. package/locales/zh/global.json +8 -1
  123. package/locales/zh_TW/global.json +8 -1
  124. package/package.json +2 -2
  125. package/locales/.mtslconfig.json +0 -1
@@ -51,6 +51,7 @@ declare namespace Select {
51
51
  modified: PropTypes.Requireable<boolean>;
52
52
  error: PropTypes.Requireable<boolean>;
53
53
  'aria-label': PropTypes.Requireable<string>;
54
+ 'aria-labelledby': PropTypes.Requireable<string>;
54
55
  };
55
56
  }
56
57
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AA6BA,qEA6JC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AAoDA,qEA+KC"}
@@ -1,6 +1,6 @@
1
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
2
 
3
- import React, { useMemo } from 'react';
3
+ import React, { useCallback, useMemo, useState } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classnames from 'classnames';
6
6
  import filter from 'lodash/fp/filter';
@@ -11,7 +11,7 @@ import includes from 'lodash/fp/includes';
11
11
  import keys from 'lodash/fp/keys';
12
12
  import map from 'lodash/fp/map';
13
13
  import size from 'lodash/fp/size';
14
- import { NovaCompositionNavigationArrowDown as ArrowDown } from '@coorpacademy/nova-icons';
14
+ import { NovaCompositionNavigationArrowDown as ArrowDown, NovaCompositionNavigationArrowTop as ArrowUp } from '@coorpacademy/nova-icons';
15
15
  import Provider, { GetSkinFromContext } from '../provider';
16
16
  import getClassState from '../../util/get-class-state';
17
17
  import style from './style.css';
@@ -28,6 +28,28 @@ const themeStyle = {
28
28
  coorpmanager: null
29
29
  };
30
30
 
31
+ const ArrowView = ({
32
+ shouldRender,
33
+ isArrowUp,
34
+ ariaLabel,
35
+ arrowClass,
36
+ arrowColor
37
+ }) => {
38
+ const props = useMemo(() => _extends({}, arrowColor & {
39
+ color: arrowColor
40
+ }, {
41
+ className: arrowClass
42
+ }), [ariaLabel, arrowClass, arrowColor]);
43
+
44
+ if (shouldRender) {
45
+ return isArrowUp ? /*#__PURE__*/React.createElement(ArrowUp, _extends({}, props, {
46
+ "data-testid": "select-arrow-up-icon"
47
+ })) : /*#__PURE__*/React.createElement(ArrowDown, _extends({}, props, {
48
+ "data-testid": "select-arrow-down-icon"
49
+ }));
50
+ } else return null;
51
+ };
52
+
31
53
  const Select = (props, legacyContext) => {
32
54
  const {
33
55
  name,
@@ -43,10 +65,14 @@ const Select = (props, legacyContext) => {
43
65
  modified = false,
44
66
  error = false,
45
67
  title: propTitle,
46
- 'aria-label': ariaLabel
68
+ 'aria-label': ariaLabel,
69
+ 'aria-labelledby': ariaLabelledBy
47
70
  } = props;
48
71
  const skin = GetSkinFromContext(legacyContext);
49
72
  const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
73
+ const [isArrowUp, setIsArrowUp] = useState(false);
74
+ const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);
75
+ const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);
50
76
  const optionList = options && options.map((option, index) => {
51
77
  return /*#__PURE__*/React.createElement("option", {
52
78
  key: index,
@@ -72,20 +98,17 @@ const Select = (props, legacyContext) => {
72
98
  selected: true
73
99
  }, options)), [options, theme]);
74
100
  const handleChange = useMemo(() => multiple ? e => {
101
+ setIsArrowUp(false);
75
102
  onChange(map(get('value'), e.target.selectedOptions));
76
103
  } : e => {
104
+ setIsArrowUp(false);
77
105
  onChange(e.target.value);
78
106
  }, [onChange, multiple]);
79
107
  const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);
80
108
  const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);
81
- const shouldUseSkinFontColor = useMemo(() => !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']), [isSelectedInValidOption, selected, theme]);
109
+ const isThemeOneOfQuestionTemplateOrPlayer = useMemo(() => includes(theme, ['question', 'template', 'player']), [theme]);
110
+ const shouldUseSkinFontColor = useMemo(() => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer, [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]);
82
111
  const arrowColor = selected ? color : undefined;
83
- const arrowView = !multiple ? /*#__PURE__*/React.createElement(ArrowDown, {
84
- color: includes(theme, ['question', 'template', 'player']) ? arrowColor : black,
85
- className: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
86
- "aria-label": ariaLabel,
87
- "data-testid": "select-arrow-down-icon"
88
- }) : null;
89
112
  const behaviorClassName = useMemo(() => getClassState(style.default, style.modified, style.error, modified, error), [error, modified]);
90
113
  const composedClassName = useMemo(() => classnames(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? style.selected : style.unselected, className), [behaviorClassName, className, selected, theme]);
91
114
  const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);
@@ -104,7 +127,17 @@ const Select = (props, legacyContext) => {
104
127
  style: _extends({}, shouldUseSkinFontColor && {
105
128
  color
106
129
  })
107
- }, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", {
130
+ }, selectedLabel), /*#__PURE__*/React.createElement(ArrowView, {
131
+ shouldRender: !multiple,
132
+ isArrowUp: isArrowUp,
133
+ ariaLabel: ariaLabel,
134
+ arrowClass: shouldUseSkinFontColor ? style.selectedArrow : style.arrow,
135
+ arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
136
+ }), /*#__PURE__*/React.createElement("select", _extends({}, ariaLabelledBy && !ariaLabel ? {
137
+ 'aria-labelledby': ariaLabelledBy
138
+ } : {}, ariaLabel && !ariaLabelledBy ? {
139
+ 'aria-label': ariaLabel
140
+ } : {}, {
108
141
  "data-name": "native-select",
109
142
  className: style.selectBox,
110
143
  title: selectedLabel,
@@ -112,8 +145,15 @@ const Select = (props, legacyContext) => {
112
145
  onChange: handleChange,
113
146
  value: selected,
114
147
  multiple: multiple,
115
- disabled: disabled
116
- }, optionList)), /*#__PURE__*/React.createElement("div", {
148
+ disabled: disabled,
149
+ onClick: handleSelectOnFocus,
150
+ onBlur: handleSelectOnBlur // onBlur does not handle completely an out of bounds click
151
+ // ex: select is Opened and a click is done outside, cancelling the select
152
+ // that doesn't count as a Blur, so an onMouseLeave is needed
153
+ ,
154
+ onMouseLeave: handleSelectOnBlur,
155
+ "data-testid": "native-select"
156
+ }), optionList)), /*#__PURE__*/React.createElement("div", {
117
157
  className: style.description
118
158
  }, description));
119
159
  };
@@ -141,7 +181,8 @@ Select.propTypes = process.env.NODE_ENV !== "production" ? {
141
181
  options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),
142
182
  modified: PropTypes.bool,
143
183
  error: PropTypes.bool,
144
- 'aria-label': PropTypes.string
184
+ 'aria-label': PropTypes.string,
185
+ 'aria-labelledby': PropTypes.string
145
186
  } : {};
146
187
  export default Select;
147
188
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,IAAkBC,k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;EAQjB3C,QAAQ,EAAEpC,SAAS,CAACmF,IARH;EASjBlD,QAAQ,EAAEjC,SAAS,CAACuF,IATH;EAUjBjD,KAAK,EAAEtC,SAAS,CAACwF,KAAV,CAAgBjF,IAAI,CAACS,UAAD,CAApB,CAVU;EAWjBc,OAAO,EAAE9B,SAAS,CAACyF,OAAV,CAAkBzF,SAAS,CAAC0F,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjBvC,QAAQ,EAAEvC,SAAS,CAACmF,IAZH;EAajB3C,KAAK,EAAExC,SAAS,CAACmF,IAbA;EAcjB,cAAcnF,SAAS,CAAC+E;AAdP,CAAnB;AAiBA,eAAerD,MAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","filter","find","get","getOr","includes","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","Select","legacyContext","name","options","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","optionList","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy && !ariaLabel ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\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ElE,SAAS,CAAC6F;AAJY,CAA9B;AAOPxD,MAAM,CAACyD,YAAP,GAAsB;EACpBzC,IAAI,EAAEvC,QAAQ,CAACiF,iBAAT,CAA2B1C;AADb,CAAtB;AAIAhB,MAAM,CAAC2D,SAAP,2CAAmB;EACjB9C,KAAK,EAAElD,SAAS,CAACyF,MADA;EAEjBlD,IAAI,EAAEvC,SAAS,CAACyF,MAFC;EAGjBrD,SAAS,EAAEpC,SAAS,CAACyF,MAHJ;EAIjBhD,eAAe,EAAEzC,SAAS,CAACyF,MAJV;EAKjB7C,QAAQ,EAAE5C,SAAS,CAAC6F,IALH;EAMjBlD,QAAQ,EAAE3C,SAAS,CAAC6F,IANH;EAOjB/C,WAAW,EAAE9C,SAAS,CAACyF,MAPN;EAQjB5C,QAAQ,EAAE7C,SAAS,CAAC6F,IARH;EASjBnD,QAAQ,EAAE1C,SAAS,CAACiG,IATH;EAUjBlD,KAAK,EAAE/C,SAAS,CAACkG,KAAV,CAAgB3F,IAAI,CAACW,UAAD,CAApB,CAVU;EAWjBsB,OAAO,EAAExC,SAAS,CAACmG,OAAV,CAAkBnG,SAAS,CAACoG,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;EAYjBxC,QAAQ,EAAEhD,SAAS,CAAC6F,IAZH;EAajB5C,KAAK,EAAEjD,SAAS,CAAC6F,IAbA;EAcjB,cAAc7F,SAAS,CAACyF,MAdP;EAejB,mBAAmBzF,SAAS,CAACyF;AAfZ,CAAnB;AAkBA,eAAepD,MAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDASC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAuEA,iDASC"}
@@ -14,7 +14,6 @@ import Qcm from '../questions/qcm';
14
14
  import QcmGraphic from '../questions/qcm-graphic';
15
15
  import QuestionRange from '../questions/question-range';
16
16
  import Template from '../questions/template';
17
- import Provider from '../../atom/provider';
18
17
  import Audio from '../audio';
19
18
  import style from './style.css';
20
19
  import propTypes, { MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from './prop-types';
@@ -64,8 +63,6 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes
64
63
  const Switch = ({
65
64
  model,
66
65
  help
67
- }, {
68
- translate
69
66
  }) => {
70
67
  const {
71
68
  type
@@ -87,9 +84,7 @@ const Switch = ({
87
84
  return /*#__PURE__*/React.createElement(FreeText, model);
88
85
 
89
86
  case 'dropDown':
90
- return /*#__PURE__*/React.createElement(DropDown, _extends({}, model, {
91
- "aria-label": translate('drop_down_icon')
92
- }));
87
+ return /*#__PURE__*/React.createElement(DropDown, model);
93
88
 
94
89
  case 'slider':
95
90
  return /*#__PURE__*/React.createElement(QuestionRange, model);
@@ -103,9 +98,6 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
103
98
  model: propTypes.model,
104
99
  help: propTypes.help
105
100
  } : {};
106
- Switch.contextTypes = {
107
- translate: Provider.childContextTypes.translate
108
- };
109
101
 
110
102
  const Answer = props => {
111
103
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Provider","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","translate","contextTypes","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Provider from '../../atom/provider';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, {translate}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} aria-label={translate('drop_down_icon')} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,O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1
+ {"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,kBAAnB,EAAuCC,UAAvC,EAAmDC,UAAnD,EAA+DC,UAA/D,QAAgF,cAAhF;;AAEA,MAAMC,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKL,UAAL;MACE,oBACE;QACE,SAAS,EAAEJ,KAAK,CAACO,KADnB;QAEE,KAAK,EAAE;UACLI,eAAe,EAAG,OAAMJ,KAAK,CAACK,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKP,UAAL;MACE,oBACE;QAAK,SAAS,EAAEL,KAAK,CAACa;MAAtB,gBACE,oBAAC,WAAD,eAAiB,MAAK,IAAL,EAAWH,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKL,UAAL;MACE,oBACE;QAAK,SAAS,EAA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,eAEE,oBAAC,MAAD;IAAQ,KAAK,EAAES,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EAFF,CADF;AAMD,CATD;;AAWAC,MAAM,CAACjB,SAAP,2CAAmBA,SAAnB;AAEA,eAAeiB,MAAf"}
@@ -99,6 +99,7 @@ declare namespace BrandFormGroup {
99
99
  modified: PropTypes.Requireable<boolean>;
100
100
  error: PropTypes.Requireable<boolean>;
101
101
  'aria-label': PropTypes.Requireable<string>;
102
+ 'aria-labelledby': PropTypes.Requireable<string>;
102
103
  }> | PropTypes.InferProps<{
103
104
  type: PropTypes.Requireable<string>;
104
105
  title: PropTypes.Validator<string>;
@@ -203,6 +204,7 @@ declare namespace BrandFormGroup {
203
204
  modified: PropTypes.Requireable<boolean>;
204
205
  error: PropTypes.Requireable<boolean>;
205
206
  'aria-label': PropTypes.Requireable<string>;
207
+ 'aria-labelledby': PropTypes.Requireable<string>;
206
208
  }> | PropTypes.InferProps<{
207
209
  type: PropTypes.Requireable<string>;
208
210
  title: PropTypes.Validator<string>;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import { Props } from './types';
3
+ declare const EmptyStateDashboard: {
4
+ ({ mainText, subText, imageUrl, buttonLink }: Props): JSX.Element;
5
+ propTypes: {
6
+ mainText: import("prop-types").Requireable<string>;
7
+ subText: import("prop-types").Requireable<string>;
8
+ imageUrl: import("prop-types").Requireable<any>;
9
+ buttonLink: import("prop-types").Requireable<import("prop-types").InferProps<{
10
+ type: import("prop-types").Requireable<string>;
11
+ label: import("prop-types").Requireable<string>;
12
+ ariaLabel: import("prop-types").Requireable<string>;
13
+ dataName: import("prop-types").Requireable<string>;
14
+ icon: import("prop-types").Requireable<import("prop-types").InferProps<{
15
+ position: import("prop-types").Requireable<string>;
16
+ type: import("prop-types").Requireable<string>;
17
+ }>>;
18
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
19
+ }>>;
20
+ };
21
+ };
22
+ export default EmptyStateDashboard;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,KAAK,EAAY,MAAM,SAAS,CAAC;AAEzC,QAAA,MAAM,mBAAmB;kDAA+C,KAAK;;;;;;;;;;;;;;;;;CAW5E,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,31 @@
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
+
3
+ import React from 'react';
4
+ import ButtonLink from '../../atom/button-link';
5
+ import style from './style.css';
6
+ import { propTypes } from './types';
7
+
8
+ const EmptyStateDashboard = ({
9
+ mainText,
10
+ subText,
11
+ imageUrl,
12
+ buttonLink
13
+ }) => /*#__PURE__*/React.createElement("div", {
14
+ className: style.container
15
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
16
+ className: style.img,
17
+ src: imageUrl,
18
+ "aria-hidden": "true"
19
+ })), /*#__PURE__*/React.createElement("p", {
20
+ className: style.mainText
21
+ }, mainText), /*#__PURE__*/React.createElement("p", {
22
+ className: style.subText
23
+ }, subText), /*#__PURE__*/React.createElement("div", {
24
+ className: style.buttonContainer
25
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLink, {
26
+ className: style.button
27
+ }))));
28
+
29
+ EmptyStateDashboard.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
30
+ export default EmptyStateDashboard;
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","ButtonLink","style","propTypes","EmptyStateDashboard","mainText","subText","imageUrl","buttonLink","container","img","buttonContainer","button"],"sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"sourcesContent":["import React from 'react';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport {Props, propTypes} from './types';\n\nconst EmptyStateDashboard = ({mainText, subText, imageUrl, buttonLink}: Props) => (\n <div className={style.container}>\n <div>\n <img className={style.img} src={imageUrl} aria-hidden=\"true\" />\n </div>\n <p className={style.mainText}>{mainText}</p>\n <p className={style.subText}>{subText}</p>\n <div className={style.buttonContainer}>\n <ButtonLink {...buttonLink} className={style.button} />\n </div>\n </div>\n);\n\nEmptyStateDashboard.propTypes = propTypes;\n\nexport default EmptyStateDashboard;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,SAAeC,SAAf,QAA+B,SAA/B;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;EAACC,QAAD;EAAWC,OAAX;EAAoBC,QAApB;EAA8BC;AAA9B,CAAD,kBAC1B;EAAK,SAAS,EAAEN,KAAK,CAACO;AAAtB,gBACE,8CACE;EAAK,SAAS,EAAEP,KAAK,CAACQ,GAAtB;EAA2B,GAAG,EAAEH,QAAhC;EAA0C,eAAY;AAAtD,EADF,CADF,eAIE;EAAG,SAAS,EAAEL,KAAK,CAACG;AAApB,GAA+BA,QAA/B,CAJF,eAKE;EAAG,SAAS,EAAEH,KAAK,CAACI;AAApB,GAA8BA,OAA9B,CALF,eAME;EAAK,SAAS,EAAEJ,KAAK,CAACS;AAAtB,gBACE,oBAAC,UAAD,eAAgBH,UAAhB;EAA4B,SAAS,EAAEN,KAAK,CAACU;AAA7C,GADF,CANF,CADF;;AAaAR,mBAAmB,CAACD,SAApB,2CAAgCA,SAAhC;AAEA,eAAeC,mBAAf"}
@@ -0,0 +1,55 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value cm_grey_500: from colors;
3
+ @value cm_grey_800: from colors;
4
+
5
+
6
+ .container {
7
+ display: flex;
8
+ flex-direction: column;
9
+ height: 100%;
10
+ justify-content: center;
11
+ overflow: hidden;
12
+ text-align: center;
13
+ width: 100%;
14
+ }
15
+
16
+ .img {
17
+ height: 170px;
18
+ width: 220px;
19
+ }
20
+
21
+ .text {
22
+ font-family: 'Gilroy';
23
+ margin: 0 auto 0 auto;
24
+ }
25
+
26
+ .mainText {
27
+ composes: text;
28
+ color: cm_grey_800;
29
+ font-weight: 600;
30
+ font-size: 24px;
31
+ line-height: 32px;
32
+ padding-top: 36px;
33
+ }
34
+
35
+ .subText {
36
+ composes: text;
37
+ color: cm_grey_500;
38
+ font-weight: 400;
39
+ font-size: 16px;
40
+ line-height: 24px;
41
+ padding-top: 4px;
42
+ ;
43
+ }
44
+
45
+ .buttonContainer {
46
+ display: flex;
47
+ justify-content: center;
48
+ padding-top: 32px;
49
+ width: 100%;
50
+ }
51
+
52
+ .button {
53
+ width: 152px;
54
+ height: 44px;
55
+ }
@@ -0,0 +1,19 @@
1
+ import PropTypes from 'prop-types';
2
+ export declare const propTypes: {
3
+ mainText: PropTypes.Requireable<string>;
4
+ subText: PropTypes.Requireable<string>;
5
+ imageUrl: PropTypes.Requireable<any>;
6
+ buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
7
+ type: PropTypes.Requireable<string>;
8
+ label: PropTypes.Requireable<string>;
9
+ ariaLabel: PropTypes.Requireable<string>;
10
+ dataName: PropTypes.Requireable<string>;
11
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
12
+ position: PropTypes.Requireable<string>;
13
+ type: PropTypes.Requireable<string>;
14
+ }>>;
15
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
16
+ }>>;
17
+ };
18
+ export declare type Props = PropTypes.InferProps<typeof propTypes>;
19
+ //# sourceMappingURL=types.d.ts.map
@@ -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"}
@@ -31,6 +31,7 @@ declare class Filters extends React.Component<any, any, any> {
31
31
  modified: PropTypes.Requireable<boolean>;
32
32
  error: PropTypes.Requireable<boolean>;
33
33
  'aria-label': PropTypes.Requireable<string>;
34
+ 'aria-labelledby': PropTypes.Requireable<string>;
34
35
  }>>;
35
36
  onSearch: PropTypes.Requireable<(...args: any[]) => any>;
36
37
  onToggleFilters: PropTypes.Requireable<(...args: any[]) => any>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/filters/index.js"],"names":[],"mappings":";AASA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF,wBASC;IAPC;;;MAGC;IAMH,yBAcC;IAED,uBAYC;IAED,qBAOC;IAED,sBAsFC;CACF"}
@@ -57,6 +57,7 @@ declare namespace SetupSlide {
57
57
  modified: PropTypes.Requireable<boolean>;
58
58
  error: PropTypes.Requireable<boolean>;
59
59
  'aria-label': PropTypes.Requireable<string>;
60
+ 'aria-labelledby': PropTypes.Requireable<string>;
60
61
  }> | PropTypes.InferProps<{
61
62
  type: PropTypes.Requireable<string>;
62
63
  title: PropTypes.Validator<string>;
@@ -70,6 +70,7 @@ declare namespace SetupSlider {
70
70
  modified: PropTypes.Requireable<boolean>;
71
71
  error: PropTypes.Requireable<boolean>;
72
72
  'aria-label': PropTypes.Requireable<string>;
73
+ 'aria-labelledby': PropTypes.Requireable<string>;
73
74
  }> | PropTypes.InferProps<{
74
75
  type: PropTypes.Requireable<string>;
75
76
  title: PropTypes.Validator<string>;
@@ -129,6 +129,7 @@ declare namespace BrandForm {
129
129
  modified: PropTypes.Requireable<boolean>;
130
130
  error: PropTypes.Requireable<boolean>;
131
131
  'aria-label': PropTypes.Requireable<string>;
132
+ 'aria-labelledby': PropTypes.Requireable<string>;
132
133
  }> | PropTypes.InferProps<{
133
134
  type: PropTypes.Requireable<string>;
134
135
  title: PropTypes.Validator<string>;
@@ -233,6 +234,7 @@ declare namespace BrandForm {
233
234
  modified: PropTypes.Requireable<boolean>;
234
235
  error: PropTypes.Requireable<boolean>;
235
236
  'aria-label': PropTypes.Requireable<string>;
237
+ 'aria-labelledby': PropTypes.Requireable<string>;
236
238
  }> | PropTypes.InferProps<{
237
239
  type: PropTypes.Requireable<string>;
238
240
  title: PropTypes.Validator<string>;
@@ -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