@coorpacademy/components 11.35.2-alpha.13 → 11.35.2-alpha.4

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 (78) hide show
  1. package/es/molecule/translation-modal/index.d.ts +0 -1
  2. package/es/molecule/translation-modal/index.d.ts.map +1 -1
  3. package/es/molecule/translation-modal/index.js +24 -7
  4. package/es/molecule/translation-modal/index.js.map +1 -1
  5. package/es/organism/header-with-actions/index.d.ts +22 -8
  6. package/es/organism/header-with-actions/index.d.ts.map +1 -1
  7. package/es/organism/header-with-actions/index.js +85 -7
  8. package/es/organism/header-with-actions/index.js.map +1 -1
  9. package/es/organism/header-with-actions/types.d.ts +44 -13
  10. package/es/organism/header-with-actions/types.d.ts.map +1 -1
  11. package/es/organism/header-with-actions/types.js +22 -6
  12. package/es/organism/header-with-actions/types.js.map +1 -1
  13. package/es/organism/list-items/style.css +1 -0
  14. package/es/organism/mooc-header/index.d.ts.map +1 -1
  15. package/es/organism/mooc-header/index.js +7 -9
  16. package/es/organism/mooc-header/index.js.map +1 -1
  17. package/es/organism/mooc-header/style.css +18 -22
  18. package/es/organism/skill-edition/index.d.ts +1230 -51
  19. package/es/organism/skill-edition/index.d.ts.map +1 -1
  20. package/es/organism/skill-edition/index.js +3 -224
  21. package/es/organism/skill-edition/index.js.map +1 -1
  22. package/es/organism/skill-edition/types.d.ts +1237 -117
  23. package/es/organism/skill-edition/types.d.ts.map +1 -1
  24. package/es/organism/skill-edition/types.js +7 -59
  25. package/es/organism/skill-edition/types.js.map +1 -1
  26. package/es/template/back-office/brand-update/index.d.ts +1642 -1099
  27. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  28. package/es/template/back-office/brand-update/index.js +4 -14
  29. package/es/template/back-office/brand-update/index.js.map +1 -1
  30. package/es/template/back-office/brand-update/style.css +4 -1
  31. package/es/template/back-office/brand-update/utils.d.ts +38 -10
  32. package/es/template/back-office/brand-update/utils.js +19 -0
  33. package/es/template/back-office/brand-update/utils.js.map +1 -1
  34. package/es/variables/colors.css +1 -4
  35. package/es/variables/colors.d.ts +1 -4
  36. package/es/variables/colors.d.ts.map +1 -1
  37. package/es/variables/colors.js +1 -4
  38. package/es/variables/colors.js.map +1 -1
  39. package/lib/molecule/translation-modal/index.d.ts +0 -1
  40. package/lib/molecule/translation-modal/index.d.ts.map +1 -1
  41. package/lib/molecule/translation-modal/index.js +23 -6
  42. package/lib/molecule/translation-modal/index.js.map +1 -1
  43. package/lib/organism/header-with-actions/index.d.ts +22 -8
  44. package/lib/organism/header-with-actions/index.d.ts.map +1 -1
  45. package/lib/organism/header-with-actions/index.js +85 -7
  46. package/lib/organism/header-with-actions/index.js.map +1 -1
  47. package/lib/organism/header-with-actions/types.d.ts +44 -13
  48. package/lib/organism/header-with-actions/types.d.ts.map +1 -1
  49. package/lib/organism/header-with-actions/types.js +22 -6
  50. package/lib/organism/header-with-actions/types.js.map +1 -1
  51. package/lib/organism/list-items/style.css +1 -0
  52. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  53. package/lib/organism/mooc-header/index.js +6 -8
  54. package/lib/organism/mooc-header/index.js.map +1 -1
  55. package/lib/organism/mooc-header/style.css +18 -22
  56. package/lib/organism/skill-edition/index.d.ts +1230 -51
  57. package/lib/organism/skill-edition/index.d.ts.map +1 -1
  58. package/lib/organism/skill-edition/index.js +3 -224
  59. package/lib/organism/skill-edition/index.js.map +1 -1
  60. package/lib/organism/skill-edition/types.d.ts +1237 -117
  61. package/lib/organism/skill-edition/types.d.ts.map +1 -1
  62. package/lib/organism/skill-edition/types.js +7 -59
  63. package/lib/organism/skill-edition/types.js.map +1 -1
  64. package/lib/template/back-office/brand-update/index.d.ts +1642 -1099
  65. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  66. package/lib/template/back-office/brand-update/index.js +4 -14
  67. package/lib/template/back-office/brand-update/index.js.map +1 -1
  68. package/lib/template/back-office/brand-update/style.css +4 -1
  69. package/lib/template/back-office/brand-update/utils.d.ts +38 -10
  70. package/lib/template/back-office/brand-update/utils.js +19 -0
  71. package/lib/template/back-office/brand-update/utils.js.map +1 -1
  72. package/lib/variables/colors.css +1 -4
  73. package/lib/variables/colors.d.ts +1 -4
  74. package/lib/variables/colors.d.ts.map +1 -1
  75. package/lib/variables/colors.js +1 -4
  76. package/lib/variables/colors.js.map +1 -1
  77. package/locales/.mtslconfig.json +1 -0
  78. package/package.json +2 -2
@@ -9,7 +9,6 @@ declare namespace TranslationModal {
9
9
  const onCancel: PropTypes.Requireable<(...args: any[]) => any>;
10
10
  const onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
11
11
  const onClose: PropTypes.Requireable<(...args: any[]) => any>;
12
- const disabled: PropTypes.Requireable<boolean>;
13
12
  const source: PropTypes.Requireable<PropTypes.InferProps<{
14
13
  inputText: PropTypes.Requireable<PropTypes.InferProps<{
15
14
  theme: PropTypes.Requireable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/translation-modal/index.js"],"names":[],"mappings":";AAmBA,gFA8EC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/translation-modal/index.js"],"names":[],"mappings":";AAmBA,gFAoGC"}
@@ -1,5 +1,5 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useMemo, useCallback } from 'react';
2
+ import React, { useMemo, useCallback, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import BaseModal from '../base-modal';
5
5
  import Provider from '../../atom/provider';
@@ -29,7 +29,6 @@ const TranslationModal = (props, context) => {
29
29
  onCancel,
30
30
  onConfirm,
31
31
  onClose,
32
- disabled = false,
33
32
  source: {
34
33
  inputText: sourceInputText,
35
34
  textArea: sourceTextArea,
@@ -46,12 +45,23 @@ const TranslationModal = (props, context) => {
46
45
  translate
47
46
  } = context;
48
47
  const detectScrollbar = true;
48
+ const [inputValue, setInputValue] = useState(targetInputText?.value || '');
49
+ const [textAreaValue, setTextAreaValue] = useState(targetTextArea?.value || '');
49
50
  const handleCancel = useCallback(() => {
50
51
  onCancel();
51
52
  }, [onCancel]);
52
53
  const handleClose = useCallback(() => {
53
54
  onClose();
54
55
  }, [onClose]);
56
+ const handleInputChange = useCallback(e => {
57
+ setInputValue(e.target.value);
58
+ }, []);
59
+ const handleTextAreaChange = useCallback(e => {
60
+ setTextAreaValue(e.target.value);
61
+ }, []);
62
+ const isConfirmDisabled = useMemo(() => {
63
+ return !inputValue.trim() || !textAreaValue.trim();
64
+ }, [inputValue, textAreaValue]);
55
65
  const footer = useMemo(() => {
56
66
  const cancelButton = {
57
67
  onCancel: handleCancel,
@@ -64,12 +74,12 @@ const TranslationModal = (props, context) => {
64
74
  onConfirm,
65
75
  label: translate('confirm'),
66
76
  iconName: 'plus',
67
- disabled,
77
+ disabled: isConfirmDisabled,
68
78
  color: COLORS.cm_primary_blue
69
79
  }
70
80
  })
71
81
  };
72
- }, [handleCancel, onConfirm, translate, readOnly, disabled]);
82
+ }, [handleCancel, onConfirm, translate, isConfirmDisabled, readOnly]);
73
83
  if (!isOpen) return null;
74
84
  return /*#__PURE__*/React.createElement(BaseModal, {
75
85
  title: translate('translation_title'),
@@ -95,8 +105,16 @@ const TranslationModal = (props, context) => {
95
105
  className: style.separator
96
106
  }), renderInputGroup({
97
107
  title: outputLanguage,
98
- inputProps: targetInputText,
99
- textAreaProps: targetTextArea,
108
+ inputProps: {
109
+ ...targetInputText,
110
+ value: inputValue,
111
+ onChange: handleInputChange
112
+ },
113
+ textAreaProps: {
114
+ ...targetTextArea,
115
+ value: textAreaValue,
116
+ onChange: handleTextAreaChange
117
+ },
100
118
  disabled: readOnly
101
119
  }))));
102
120
  };
@@ -108,7 +126,6 @@ TranslationModal.propTypes = process.env.NODE_ENV !== "production" ? {
108
126
  onCancel: PropTypes.func,
109
127
  onConfirm: PropTypes.func,
110
128
  onClose: PropTypes.func,
111
- disabled: PropTypes.bool,
112
129
  source: PropTypes.shape({
113
130
  inputText: PropTypes.shape({
114
131
  ...InputText.propTypes,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","useCallback","PropTypes","BaseModal","Provider","COLORS","InputText","TextArea","style","renderInputGroup","title","inputProps","textAreaProps","disabled","createElement","className","inputGroup","_extends","TranslationModal","props","context","isOpen","onCancel","onConfirm","onClose","source","inputText","sourceInputText","textArea","sourceTextArea","inputLanguage","target","targetInputText","targetTextArea","language","outputLanguage","readOnly","translate","detectScrollbar","handleCancel","handleClose","footer","cancelButton","label","confirmButton","iconName","color","cm_primary_blue","description","headerIcon","name","backgroundColor","translationModal","horizontalSection","separator","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","bool","func","shape","theme","string"],"sources":["../../../src/molecule/translation-modal/index.js"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport BaseModal from '../base-modal';\nimport Provider from '../../atom/provider';\nimport {COLORS} from '../../variables/colors';\nimport InputText from '../../atom/input-text';\nimport TextArea from '../../atom/input-textarea';\nimport style from './style.css';\n\nconst renderInputGroup = ({title, inputProps, textAreaProps, disabled}) => {\n return (\n <div className={style.inputGroup}>\n <div className={style.title}>{title}</div>\n <InputText {...inputProps} disabled={disabled} />\n <TextArea {...textAreaProps} disabled={disabled} />\n </div>\n );\n};\n\nconst TranslationModal = (props, context) => {\n const {\n isOpen,\n onCancel,\n onConfirm,\n onClose,\n disabled = false,\n source: {inputText: sourceInputText, textArea: sourceTextArea, inputLanguage},\n target: {inputText: targetInputText, textArea: targetTextArea, language: outputLanguage},\n readOnly = false\n } = props;\n const {translate} = context;\n\n const detectScrollbar = true;\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n const handleClose = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const footer = useMemo(() => {\n const cancelButton = {\n onCancel: handleCancel,\n label: translate(readOnly ? 'close' : 'cancel')\n };\n return {\n cancelButton,\n ...(!readOnly && {\n confirmButton: {\n onConfirm,\n label: translate('confirm'),\n iconName: 'plus',\n disabled,\n color: COLORS.cm_primary_blue\n }\n })\n };\n }, [handleCancel, onConfirm, translate, readOnly, disabled]);\n\n if (!isOpen) return null;\n\n return (\n <BaseModal\n title={translate('translation_title')}\n description={translate('translation_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'language',\n backgroundColor: '#D6E6FF'\n }}\n detectScrollbar={detectScrollbar}\n >\n <div className={style.translationModal}>\n <div className={style.horizontalSection}>\n {renderInputGroup({\n title: inputLanguage,\n inputProps: sourceInputText,\n textAreaProps: sourceTextArea,\n disabled: true\n })}\n\n <div className={style.separator} />\n\n {renderInputGroup({\n title: outputLanguage,\n inputProps: targetInputText,\n textAreaProps: targetTextArea,\n disabled: readOnly\n })}\n </div>\n </div>\n </BaseModal>\n );\n};\n\nTranslationModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nTranslationModal.propTypes = {\n isOpen: PropTypes.bool,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func,\n disabled: PropTypes.bool,\n source: PropTypes.shape({\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string\n }),\n textArea: PropTypes.shape({\n ...TextArea.propTypes,\n theme: PropTypes.string\n }),\n inputLanguage: PropTypes.string\n }),\n target: PropTypes.shape({\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string\n }),\n textArea: PropTypes.shape({\n ...TextArea.propTypes,\n theme: PropTypes.string\n }),\n language: PropTypes.string\n }),\n readOnly: PropTypes.bool\n};\n\nexport default TranslationModal;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,WAAW,QAAO,OAAO;AACjD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAA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;MACzB,GAAGzD,SAAS,CAACmD,SAAS;MACtBO,KAAK,EAAE9D,SAAS,CAAC+D;IACnB,CAAC,CAAC;IACFrC,QAAQ,EAAE1B,SAAS,CAAC6D,KAAK,CAAC;MACxB,GAAGxD,QAAQ,CAACkD,SAAS;MACrBO,KAAK,EAAE9D,SAAS,CAAC+D;IACnB,CAAC,CAAC;IACF/B,QAAQ,EAAEhC,SAAS,CAAC+D;EACtB,CAAC,CAAC;EACF7B,QAAQ,EAAElC,SAAS,CAAC2D;AACtB,CAAC;AAED,eAAe3C,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","useCallback","useState","PropTypes","BaseModal","Provider","COLORS","InputText","TextArea","style","renderInputGroup","title","inputProps","textAreaProps","disabled","createElement","className","inputGroup","_extends","TranslationModal","props","context","isOpen","onCancel","onConfirm","onClose","source","inputText","sourceInputText","textArea","sourceTextArea","inputLanguage","target","targetInputText","targetTextArea","language","outputLanguage","readOnly","translate","detectScrollbar","inputValue","setInputValue","value","textAreaValue","setTextAreaValue","handleCancel","handleClose","handleInputChange","e","handleTextAreaChange","isConfirmDisabled","trim","footer","cancelButton","label","confirmButton","iconName","color","cm_primary_blue","description","headerIcon","name","backgroundColor","translationModal","horizontalSection","separator","onChange","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","bool","func","shape","theme","string"],"sources":["../../../src/molecule/translation-modal/index.js"],"sourcesContent":["import React, {useMemo, useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport BaseModal from '../base-modal';\nimport Provider from '../../atom/provider';\nimport {COLORS} from '../../variables/colors';\nimport InputText from '../../atom/input-text';\nimport TextArea from '../../atom/input-textarea';\nimport style from './style.css';\n\nconst renderInputGroup = ({title, inputProps, textAreaProps, disabled}) => {\n return (\n <div className={style.inputGroup}>\n <div className={style.title}>{title}</div>\n <InputText {...inputProps} disabled={disabled} />\n <TextArea {...textAreaProps} disabled={disabled} />\n </div>\n );\n};\n\nconst TranslationModal = (props, context) => {\n const {\n isOpen,\n onCancel,\n onConfirm,\n onClose,\n source: {inputText: sourceInputText, textArea: sourceTextArea, inputLanguage},\n target: {inputText: targetInputText, textArea: targetTextArea, language: outputLanguage},\n readOnly = false\n } = props;\n const {translate} = context;\n\n const detectScrollbar = true;\n\n const [inputValue, setInputValue] = useState(targetInputText?.value || '');\n const [textAreaValue, setTextAreaValue] = useState(targetTextArea?.value || '');\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n const handleClose = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const handleInputChange = useCallback(e => {\n setInputValue(e.target.value);\n }, []);\n\n const handleTextAreaChange = useCallback(e => {\n setTextAreaValue(e.target.value);\n }, []);\n\n const isConfirmDisabled = useMemo(() => {\n return !inputValue.trim() || !textAreaValue.trim();\n }, [inputValue, textAreaValue]);\n\n const footer = useMemo(() => {\n const cancelButton = {\n onCancel: handleCancel,\n label: translate(readOnly ? 'close' : 'cancel')\n };\n return {\n cancelButton,\n ...(!readOnly && {\n confirmButton: {\n onConfirm,\n label: translate('confirm'),\n iconName: 'plus',\n disabled: isConfirmDisabled,\n color: COLORS.cm_primary_blue\n }\n })\n };\n }, [handleCancel, onConfirm, translate, isConfirmDisabled, readOnly]);\n\n if (!isOpen) return null;\n\n return (\n <BaseModal\n title={translate('translation_title')}\n description={translate('translation_description')}\n isOpen={isOpen}\n onClose={handleClose}\n footer={footer}\n headerIcon={{\n name: 'language',\n backgroundColor: '#D6E6FF'\n }}\n detectScrollbar={detectScrollbar}\n >\n <div className={style.translationModal}>\n <div className={style.horizontalSection}>\n {renderInputGroup({\n title: inputLanguage,\n inputProps: sourceInputText,\n textAreaProps: sourceTextArea,\n disabled: true\n })}\n\n <div className={style.separator} />\n\n {renderInputGroup({\n title: outputLanguage,\n inputProps: {\n ...targetInputText,\n value: inputValue,\n onChange: handleInputChange\n },\n textAreaProps: {\n ...targetTextArea,\n value: textAreaValue,\n onChange: handleTextAreaChange\n },\n disabled: readOnly\n })}\n </div>\n </div>\n </BaseModal>\n );\n};\n\nTranslationModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nTranslationModal.propTypes = {\n isOpen: PropTypes.bool,\n onCancel: PropTypes.func,\n onConfirm: PropTypes.func,\n onClose: PropTypes.func,\n source: PropTypes.shape({\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string\n }),\n textArea: PropTypes.shape({\n ...TextArea.propTypes,\n theme: PropTypes.string\n }),\n inputLanguage: PropTypes.string\n }),\n target: PropTypes.shape({\n inputText: PropTypes.shape({\n ...InputText.propTypes,\n theme: PropTypes.string\n }),\n textArea: PropTypes.shape({\n ...TextArea.propTypes,\n theme: PropTypes.string\n }),\n language: PropTypes.string\n }),\n readOnly: PropTypes.bool\n};\n\nexport default TranslationModal;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,WAAW,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,gBAAgB,GAAGA,CAAC;EAACC,KAAK;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAQ,CAAC,KAAK;EACzE,oBACEf,KAAA,CAAAgB,aAAA;IAAKC,SAAS,EAAEP,KAAK,CAACQ;EAAW,gBAC/BlB,KAAA,CAAAgB,aAAA;IAAKC,SAAS,EAAEP,KAAK,CAACE;EAAM,GAAEA,KAAW,CAAC,eAC1CZ,KAAA,CAAAgB,aAAA,CAACR,SAAS,EAAAW,QAAA,KAAKN,UAAU;IAAEE,QAAQ,EAAEA;EAAS,EAAE,CAAC,eACjDf,KAAA,CAAAgB,aAAA,CAACP,QAAQ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KAAK,EAAEzE,SAAS,CAAC0E;IACnB,CAAC,CAAC;IACF9C,aAAa,EAAE5B,SAAS,CAAC0E;EAC3B,CAAC,CAAC;EACF7C,MAAM,EAAE7B,SAAS,CAACwE,KAAK,CAAC;IACtBhD,SAAS,EAAExB,SAAS,CAACwE,KAAK,CAAC;MACzB,GAAGpE,SAAS,CAAC8D,SAAS;MACtBO,KAAK,EAAEzE,SAAS,CAAC0E;IACnB,CAAC,CAAC;IACFhD,QAAQ,EAAE1B,SAAS,CAACwE,KAAK,CAAC;MACxB,GAAGnE,QAAQ,CAAC6D,SAAS;MACrBO,KAAK,EAAEzE,SAAS,CAAC0E;IACnB,CAAC,CAAC;IACF1C,QAAQ,EAAEhC,SAAS,CAAC0E;EACtB,CAAC,CAAC;EACFxC,QAAQ,EAAElC,SAAS,CAACsE;AACtB,CAAC;AAED,eAAetD,gBAAgB","ignoreList":[]}
@@ -4,10 +4,7 @@ declare const HeaderWithActions: {
4
4
  (props: HeaderWithActionsProps): JSX.Element;
5
5
  propTypes: {
6
6
  closeButton: import("prop-types").Requireable<import("prop-types").InferProps<{
7
- size: import("prop-types").Validator<string>;
8
- icon: import("prop-types").Validator<string>;
9
- 'data-name': import("prop-types").Validator<string>;
10
- 'aria-label': import("prop-types").Validator<string>;
7
+ 'aria-label': import("prop-types").Requireable<string>;
11
8
  onClick: import("prop-types").Validator<(...args: any[]) => any>;
12
9
  }>>;
13
10
  title: import("prop-types").Validator<string>;
@@ -20,7 +17,7 @@ declare const HeaderWithActions: {
20
17
  display: import("prop-types").Validator<boolean>;
21
18
  label: import("prop-types").Requireable<string>;
22
19
  }>>>;
23
- bulletPointMenuButton: import("prop-types").Requireable<import("prop-types").InferProps<{
20
+ bulletPointMenuButtonPropTypes: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
24
21
  'data-name': import("prop-types").Requireable<string>;
25
22
  disabled: import("prop-types").Requireable<boolean>;
26
23
  buttonAriaLabel: import("prop-types").Requireable<string>;
@@ -53,8 +50,18 @@ declare const HeaderWithActions: {
53
50
  onClick: import("prop-types").Requireable<(...args: any[]) => any>;
54
51
  menuButtonClassName: import("prop-types").Requireable<string>;
55
52
  isBulkMenu: import("prop-types").Requireable<boolean>;
56
- }>>;
57
- actionButtons: import("prop-types").Validator<(import("prop-types").InferProps<{
53
+ }> | import("prop-types").InferProps<{
54
+ buttons: import("prop-types").Validator<(import("prop-types").InferProps<{
55
+ dataName: import("prop-types").Requireable<string>;
56
+ label: import("prop-types").Validator<string>;
57
+ iconName: import("prop-types").Validator<string>;
58
+ iconColor: import("prop-types").Validator<string>;
59
+ onClick: import("prop-types").Validator<(...args: any[]) => any>;
60
+ }> | null | undefined)[]>;
61
+ onClick: import("prop-types").Validator<(...args: any[]) => any>;
62
+ buttonAriaLabel: import("prop-types").Requireable<string>;
63
+ }> | null | undefined>>;
64
+ actionButtons: import("prop-types").Validator<NonNullable<NonNullable<(import("prop-types").InferProps<{
58
65
  type: import("prop-types").Requireable<string>;
59
66
  usage: import("prop-types").Requireable<string>;
60
67
  label: import("prop-types").Requireable<string>;
@@ -90,7 +97,14 @@ declare const HeaderWithActions: {
90
97
  customStyle: import("prop-types").Requireable<{
91
98
  [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
92
99
  }>;
93
- }> | null | undefined)[]>;
100
+ }> | null | undefined)[] | (import("prop-types").InferProps<{
101
+ type: import("prop-types").Validator<string>;
102
+ label: import("prop-types").Validator<string>;
103
+ onClick: import("prop-types").Validator<(...args: any[]) => any>;
104
+ disabled: import("prop-types").Requireable<boolean>;
105
+ iconName: import("prop-types").Validator<string>;
106
+ iconColor: import("prop-types").Validator<string>;
107
+ }> | null | undefined)[] | null | undefined>>>;
94
108
  };
95
109
  };
96
110
  export default HeaderWithActions;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/header-with-actions/index.tsx"],"names":[],"mappings":";AAQA,OAAmC,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAO3E,QAAA,MAAM,iBAAiB;YAAW,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCvD,CAAC;AAIF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/header-with-actions/index.tsx"],"names":[],"mappings":";AAQA,OAAmC,EACjC,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAsEjB,QAAA,MAAM,iBAAiB;YAAW,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDvD,CAAC;AAIF,eAAe,iBAAiB,CAAC"}
@@ -13,6 +13,78 @@ const getDataName = suffix => `header-with-actions-${suffix}`;
13
13
  const uncappedMap = map.convert({
14
14
  cap: false
15
15
  });
16
+ const buildCloseButton = ({
17
+ onClick,
18
+ ariaLabel
19
+ }) => {
20
+ return {
21
+ size: 'default',
22
+ icon: 'close',
23
+ 'data-name': 'close-button',
24
+ 'aria-label': ariaLabel,
25
+ onClick
26
+ };
27
+ };
28
+ const buildButtonMenu = ({
29
+ dataName,
30
+ label,
31
+ iconName,
32
+ iconColor,
33
+ onClick
34
+ }) => {
35
+ return {
36
+ 'data-name': dataName,
37
+ label,
38
+ buttonLinkType: 'tertiary',
39
+ icon: {
40
+ position: 'left',
41
+ faIcon: {
42
+ name: iconName,
43
+ color: iconColor,
44
+ size: 14,
45
+ customStyle: {
46
+ padding: 0
47
+ }
48
+ }
49
+ },
50
+ onClick,
51
+ type: 'defaultLeft'
52
+ };
53
+ };
54
+ const buildActionButton = ({
55
+ type,
56
+ label,
57
+ onClick,
58
+ disabled,
59
+ iconName,
60
+ iconColor
61
+ }) => {
62
+ return {
63
+ type,
64
+ label,
65
+ onClick,
66
+ disabled,
67
+ icon: {
68
+ position: 'left',
69
+ faIcon: {
70
+ name: iconName,
71
+ color: iconColor,
72
+ size: 14,
73
+ customStyle: {
74
+ padding: 0
75
+ }
76
+ }
77
+ },
78
+ customStyle: {
79
+ fontWeight: '600',
80
+ borderRadius: '12px',
81
+ padding: '0 8px 0 16px'
82
+ }
83
+ };
84
+ };
85
+ const isButtonActionProps = action => {
86
+ return typeof action.iconName === 'string' && typeof action.iconColor === 'string';
87
+ };
16
88
  const HeaderWithActions = props => {
17
89
  const {
18
90
  closeButton,
@@ -22,13 +94,23 @@ const HeaderWithActions = props => {
22
94
  bulletPointMenuButton,
23
95
  actionButtons
24
96
  } = props;
97
+ const renderedActionButtons = uncappedMap((action, key) => {
98
+ return isButtonActionProps(action) ? /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buildActionButton(action), {
99
+ key: key
100
+ })) : /*#__PURE__*/React.createElement(ButtonLink, _extends({}, action, {
101
+ key: key
102
+ }));
103
+ }, actionButtons);
25
104
  return /*#__PURE__*/React.createElement("div", {
26
105
  className: style.headerWrapper,
27
106
  "data-name": getDataName('wrapper')
28
107
  }, /*#__PURE__*/React.createElement("div", {
29
108
  className: style.titleAndButtonWrapper,
30
109
  "data-name": getDataName('title-and-button-wrapper')
31
- }, /*#__PURE__*/React.createElement(ButtonLinkIcon, _extends({}, closeButton, {
110
+ }, /*#__PURE__*/React.createElement(ButtonLinkIcon, _extends({}, buildCloseButton({
111
+ onClick: closeButton.onClick,
112
+ ariaLabel: closeButton['aria-label']
113
+ }), {
32
114
  className: style.button
33
115
  })), /*#__PURE__*/React.createElement("div", {
34
116
  className: style.titleWrapper
@@ -44,12 +126,8 @@ const HeaderWithActions = props => {
44
126
  className: style.buttonsWrapper,
45
127
  "data-name": getDataName('buttons-wrapper')
46
128
  }, bulletPointMenuButton && !isEmpty(bulletPointMenuButton.buttons) ? /*#__PURE__*/React.createElement(BulletPointMenuButton, _extends({}, bulletPointMenuButton, {
47
- buttonAriaLabel: "More actions"
48
- })) : null, uncappedMap((action, key) => {
49
- return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, action, {
50
- key: key
51
- }));
52
- }, actionButtons)));
129
+ buttons: uncappedMap(buildButtonMenu, bulletPointMenuButton.buttons)
130
+ })) : null, renderedActionButtons));
53
131
  };
54
132
  HeaderWithActions.propTypes = process.env.NODE_ENV !== "production" ? headerWithActionsPropTypes : {};
55
133
  export default HeaderWithActions;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","isEmpty","map","ButtonLink","ButtonLinkIcon","Tag","BulletPointMenuButton","headerWithActionsPropTypes","style","getDataName","suffix","uncappedMap","convert","cap","HeaderWithActions","props","closeButton","title","tag","saveStatus","bulletPointMenuButton","actionButtons","createElement","className","headerWrapper","titleAndButtonWrapper","_extends","button","titleWrapper","statusWrapper","display","label","buttonsWrapper","buttons","buttonAriaLabel","action","key","propTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/header-with-actions/index.tsx"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Tag from '../../atom/tag';\nimport {ButtonLinkProps} from '../../atom/button-link/types';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport headerWithActionsPropTypes, {HeaderWithActionsProps} from './types';\nimport style from './style.css';\n\nconst getDataName = (suffix: string) => `header-with-actions-${suffix}`;\n// @ts-expect-error (need to get the index)\nconst uncappedMap = map.convert({cap: false});\n\nconst HeaderWithActions = (props: HeaderWithActionsProps) => {\n const {closeButton, title, tag, saveStatus, bulletPointMenuButton, actionButtons} = props;\n\n return (\n <div className={style.headerWrapper} data-name={getDataName('wrapper')}>\n <div\n className={style.titleAndButtonWrapper}\n data-name={getDataName('title-and-button-wrapper')}\n >\n <ButtonLinkIcon {...closeButton} className={style.button} />\n <div className={style.titleWrapper}>\n <div className={style.statusWrapper}>\n <Tag {...tag} />\n {saveStatus.display && saveStatus.label ? (\n <p className={style.saveStatus}>{saveStatus.label}</p>\n ) : null}\n </div>\n <h3 className={style.title} aria-label={title} data-name={getDataName('title')}>\n {title}\n </h3>\n </div>\n </div>\n <div className={style.buttonsWrapper} data-name={getDataName('buttons-wrapper')}>\n {bulletPointMenuButton && !isEmpty(bulletPointMenuButton.buttons) ? (\n <BulletPointMenuButton {...bulletPointMenuButton} buttonAriaLabel=\"More actions\" />\n ) : null}\n {uncappedMap((action: ButtonLinkProps, key: string) => {\n return <ButtonLink {...action} key={key} />;\n }, actionButtons)}\n </div>\n </div>\n );\n};\n\nHeaderWithActions.propTypes = headerWithActionsPropTypes;\n\nexport default HeaderWithActions;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,OAAOC,qBAAqB,MAAM,yCAAyC;AAC3E,OAAOC,0BAA0B,MAAgC,SAAS;AAC1E,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAIC,MAAc,IAAK,uBAAuBA,MAAM,EAAE;AACvE;AACA,MAAMC,WAAW,GAAGT,GAAG,CAACU,OAAO,CAAC;EAACC,GAAG,EAAE;AAAK,CAAC,CAAC;AAE7C,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAC3D,MAAM;IAACC,WAAW;IAAEC,KAAK;IAAEC,GAAG;IAAEC,UAAU;IAAEC,qBAAqB;IAAEC;EAAa,CAAC,GAAGN,KAAK;EAEzF,oBACEf,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAEf,KAAK,CAACgB,aAAc;IAAC,aAAWf,WAAW,CAAC,SAAS;EAAE,gBACrET,KAAA,CAAAsB,aAAA;IACEC,SAAS,EAAEf,K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AAEDP,iBAAiB,CAACuB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGjC,0BAA0B;AAExD,eAAeO,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","isEmpty","map","ButtonLink","ButtonLinkIcon","Tag","BulletPointMenuButton","headerWithActionsPropTypes","style","getDataName","suffix","uncappedMap","convert","cap","buildCloseButton","onClick","ariaLabel","size","icon","buildButtonMenu","dataName","label","iconName","iconColor","buttonLinkType","position","faIcon","name","color","customStyle","padding","type","buildActionButton","disabled","fontWeight","borderRadius","isButtonActionProps","action","HeaderWithActions","props","closeButton","title","tag","saveStatus","bulletPointMenuButton","actionButtons","renderedActionButtons","key","createElement","_extends","className","headerWrapper","titleAndButtonWrapper","button","titleWrapper","statusWrapper","display","buttonsWrapper","buttons","propTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/header-with-actions/index.tsx"],"sourcesContent":["import React from 'react';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport Tag from '../../atom/tag';\nimport {ButtonLinkProps} from '../../atom/button-link/types';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport headerWithActionsPropTypes, {\n HeaderWithActionsProps,\n ButtonMenuProps,\n ButtonActionProps\n} from './types';\nimport style from './style.css';\n\nconst getDataName = (suffix: string) => `header-with-actions-${suffix}`;\n// @ts-expect-error (need to get the index)\nconst uncappedMap = map.convert({cap: false});\n\nconst buildCloseButton = ({onClick, ariaLabel}: {onClick: () => void; ariaLabel: string}) => {\n return {\n size: 'default',\n icon: 'close',\n 'data-name': 'close-button',\n 'aria-label': ariaLabel,\n onClick\n };\n};\n\nconst buildButtonMenu = ({dataName, label, iconName, iconColor, onClick}: ButtonMenuProps) => {\n return {\n 'data-name': dataName,\n label,\n buttonLinkType: 'tertiary',\n icon: {\n position: 'left' as const,\n faIcon: {\n name: iconName,\n color: iconColor,\n size: 14,\n customStyle: {padding: 0}\n }\n },\n onClick,\n type: 'defaultLeft'\n };\n};\n\nconst buildActionButton = ({\n type,\n label,\n onClick,\n disabled,\n iconName,\n iconColor\n}: ButtonActionProps) => {\n return {\n type,\n label,\n onClick,\n disabled,\n icon: {\n position: 'left' as const,\n faIcon: {\n name: iconName,\n color: iconColor,\n size: 14,\n customStyle: {padding: 0}\n }\n },\n customStyle: {\n fontWeight: '600',\n borderRadius: '12px',\n padding: '0 8px 0 16px'\n }\n };\n};\n\nconst isButtonActionProps = (action: any): action is ButtonActionProps => {\n return typeof action.iconName === 'string' && typeof action.iconColor === 'string';\n};\n\nconst HeaderWithActions = (props: HeaderWithActionsProps) => {\n const {closeButton, title, tag, saveStatus, bulletPointMenuButton, actionButtons} = props;\n\n const renderedActionButtons = uncappedMap(\n (action: ButtonLinkProps | ButtonActionProps, key: string) => {\n return isButtonActionProps(action) ? (\n <ButtonLink {...buildActionButton(action)} key={key} />\n ) : (\n <ButtonLink {...action} key={key} />\n );\n },\n actionButtons\n );\n\n return (\n <div className={style.headerWrapper} data-name={getDataName('wrapper')}>\n <div\n className={style.titleAndButtonWrapper}\n data-name={getDataName('title-and-button-wrapper')}\n >\n <ButtonLinkIcon\n {...buildCloseButton({\n onClick: closeButton.onClick,\n ariaLabel: closeButton['aria-label']\n })}\n className={style.button}\n />\n <div className={style.titleWrapper}>\n <div className={style.statusWrapper}>\n <Tag {...tag} />\n {saveStatus.display && saveStatus.label ? (\n <p className={style.saveStatus}>{saveStatus.label}</p>\n ) : null}\n </div>\n <h3 className={style.title} aria-label={title} data-name={getDataName('title')}>\n {title}\n </h3>\n </div>\n </div>\n <div className={style.buttonsWrapper} data-name={getDataName('buttons-wrapper')}>\n {bulletPointMenuButton && !isEmpty(bulletPointMenuButton.buttons) ? (\n <BulletPointMenuButton\n {...bulletPointMenuButton}\n buttons={uncappedMap(buildButtonMenu, bulletPointMenuButton.buttons)}\n />\n ) : null}\n {renderedActionButtons}\n </div>\n </div>\n );\n};\n\nHeaderWithActions.propTypes = headerWithActionsPropTypes;\n\nexport default HeaderWithActions;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,GAAG,MAAM,gBAAgB;AAEhC,OAAOC,qBAAqB,MAAM,yCAAyC;AAC3E,OAAOC,0BAA0B,MAI1B,SAAS;AAChB,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAIC,MAAc,IAAK,uBAAuBA,MAAM,EAAE;AACvE;AACA,MAAMC,WAAW,GAAGT,GAAG,CAACU,OAAO,CAAC;EAACC,GAAG,EAAE;AAAK,CAAC,CAAC;AAE7C,MAAMC,gBAAgB,GAAGA,CAAC;EAACC,OAAO;EAAEC;AAAmD,CAAC,KAAK;EAC3F,OAAO;IACLC,IAAI,EAAE,SAAS;IACfC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAEF,SAAS;IACvBD;EACF,CAAC;AACH,CAAC;AAED,MAAMI,eAAe,GAAGA,CAAC;EAACC,QAAQ;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,SAAS;EAAER;AAAwB,CAAC,KAAK;EAC5F,OAAO;IACL,WAAW,EAAEK,QAAQ;IACrBC,KAAK;IACLG,cAAc,EAAE,UAAU;IAC1BN,IAAI,EAAE;MACJO,QAAQ,EAAE,MAAe;MACzBC,MAAM,EAAE;QACNC,IAAI,EAAEL,QAAQ;QACdM,KAAK,EAAEL,SAAS;QAChBN,IAAI,EAAE,EAAE;QACRY,WAAW,EAAE;UAACC,OAAO,EAAE;QAAC;MAC1B;IACF,CAAC;IACDf,OAAO;IACPgB,IAAI,EAAE;EACR,CAAC;AACH,CAAC;AAED,MAAMC,iBAAiB,G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AAe,EAAEyB,qBAAqB,CAACc,OAAO;EAAE,EACtE,CAAC,GACA,IAAI,EACPZ,qBACE,CACF,CAAC;AAEV,CAAC;AAEDR,iBAAiB,CAACqB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGvD,0BAA0B;AAExD,eAAe+B,iBAAiB","ignoreList":[]}
@@ -3,10 +3,7 @@ import { BulletPointMenuButtonProps } from '../../molecule/bullet-point-menu-but
3
3
  import { ButtonLinkProps } from '../../atom/button-link/types';
4
4
  declare const headerWithActionsPropTypes: {
5
5
  closeButton: PropTypes.Requireable<PropTypes.InferProps<{
6
- size: PropTypes.Validator<string>;
7
- icon: PropTypes.Validator<string>;
8
- 'data-name': PropTypes.Validator<string>;
9
- 'aria-label': PropTypes.Validator<string>;
6
+ 'aria-label': PropTypes.Requireable<string>;
10
7
  onClick: PropTypes.Validator<(...args: any[]) => any>;
11
8
  }>>;
12
9
  title: PropTypes.Validator<string>;
@@ -19,7 +16,7 @@ declare const headerWithActionsPropTypes: {
19
16
  display: PropTypes.Validator<boolean>;
20
17
  label: PropTypes.Requireable<string>;
21
18
  }>>>;
22
- bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
19
+ bulletPointMenuButtonPropTypes: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
23
20
  'data-name': PropTypes.Requireable<string>;
24
21
  disabled: PropTypes.Requireable<boolean>;
25
22
  buttonAriaLabel: PropTypes.Requireable<string>;
@@ -52,8 +49,18 @@ declare const headerWithActionsPropTypes: {
52
49
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
53
50
  menuButtonClassName: PropTypes.Requireable<string>;
54
51
  isBulkMenu: PropTypes.Requireable<boolean>;
55
- }>>;
56
- actionButtons: PropTypes.Validator<(PropTypes.InferProps<{
52
+ }> | PropTypes.InferProps<{
53
+ buttons: PropTypes.Validator<(PropTypes.InferProps<{
54
+ dataName: PropTypes.Requireable<string>;
55
+ label: PropTypes.Validator<string>;
56
+ iconName: PropTypes.Validator<string>;
57
+ iconColor: PropTypes.Validator<string>;
58
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
59
+ }> | null | undefined)[]>;
60
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
61
+ buttonAriaLabel: PropTypes.Requireable<string>;
62
+ }> | null | undefined>>;
63
+ actionButtons: PropTypes.Validator<NonNullable<NonNullable<(PropTypes.InferProps<{
57
64
  type: PropTypes.Requireable<string>;
58
65
  usage: PropTypes.Requireable<string>;
59
66
  label: PropTypes.Requireable<string>;
@@ -89,7 +96,14 @@ declare const headerWithActionsPropTypes: {
89
96
  customStyle: PropTypes.Requireable<{
90
97
  [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
91
98
  }>;
92
- }> | null | undefined)[]>;
99
+ }> | null | undefined)[] | (PropTypes.InferProps<{
100
+ type: PropTypes.Validator<string>;
101
+ label: PropTypes.Validator<string>;
102
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
103
+ disabled: PropTypes.Requireable<boolean>;
104
+ iconName: PropTypes.Validator<string>;
105
+ iconColor: PropTypes.Validator<string>;
106
+ }> | null | undefined)[] | null | undefined>>>;
93
107
  };
94
108
  export default headerWithActionsPropTypes;
95
109
  declare type TagProps = {
@@ -102,19 +116,36 @@ declare type SaveStatusProps = {
102
116
  label?: 'Unsaved changes' | 'Saved';
103
117
  };
104
118
  declare type CloseButtonProps = {
105
- size: 'default' | 'small' | 'responsive';
106
- icon: string;
107
- 'data-name': string;
108
119
  'aria-label': string;
109
120
  onClick: () => void;
110
121
  };
122
+ export declare type ButtonMenuProps = {
123
+ dataName: string;
124
+ label: string;
125
+ iconName: string;
126
+ iconColor: string;
127
+ onClick: () => void;
128
+ };
129
+ declare type BulletPointMenuButtonCustomProps = {
130
+ buttons: ButtonMenuProps[];
131
+ onClick: () => void;
132
+ buttonAriaLabel: string;
133
+ };
134
+ export declare type ButtonActionProps = {
135
+ type: 'primary' | 'secondary';
136
+ label: string;
137
+ onClick: () => void;
138
+ disabled?: boolean;
139
+ iconName: string;
140
+ iconColor: string;
141
+ };
111
142
  export declare type HeaderWithActionsProps = {
112
143
  closeButton: CloseButtonProps;
113
144
  title: string;
114
145
  tag: TagProps;
115
146
  saveStatus: SaveStatusProps;
116
- actionButtons: ButtonLinkProps[];
117
- bulletPointMenuButton?: BulletPointMenuButtonProps;
147
+ actionButtons: ButtonLinkProps[] | ButtonActionProps[];
148
+ bulletPointMenuButton?: BulletPointMenuButtonProps | BulletPointMenuButtonCustomProps;
118
149
  };
119
150
  export declare type HeaderWithActionsPropsFixture = {
120
151
  props: HeaderWithActionsProps;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/header-with-actions/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAuC,EACrC,0BAA0B,EAC3B,MAAM,+CAA+C,CAAC;AACvD,OAA4B,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AASlF,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc/B,CAAC;AAEF,eAAe,0BAA0B,CAAC;AAE1C,aAAK,QAAQ,GAAG;IACd,KAAK,EAAE,WAAW,GAAG,iBAAiB,GAAG,OAAO,GAAG,UAAU,CAAC;IAC9D,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,eAAe,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;CACrC,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;I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eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,aAAK,gCAAgC,GAAG;IACtC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,QAAQ,CAAC;IACd,UAAU,EAAE,eAAe,CAAC;IAC5B,aAAa,EAAE,eAAe,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACvD,qBAAqB,CAAC,EAAE,0BAA0B,GAAG,gCAAgC,CAAC;CACvF,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAAC,KAAK,EAAE,sBAAsB,CAAA;CAAC,CAAC"}
@@ -2,12 +2,24 @@ import PropTypes from 'prop-types';
2
2
  import bulletPointMenuButtonPropTypes from '../../molecule/bullet-point-menu-button/types';
3
3
  import ButtonLinkPropTypes from '../../atom/button-link/types';
4
4
  const closeButtonPropTypes = {
5
- size: PropTypes.oneOf(['default', 'small', 'responsive']).isRequired,
6
- icon: PropTypes.string.isRequired,
7
- 'data-name': PropTypes.string.isRequired,
8
- 'aria-label': PropTypes.string.isRequired,
5
+ 'aria-label': PropTypes.string,
9
6
  onClick: PropTypes.func.isRequired
10
7
  };
8
+ const ButtonMenuPropTypes = {
9
+ dataName: PropTypes.string,
10
+ label: PropTypes.string.isRequired,
11
+ iconName: PropTypes.string.isRequired,
12
+ iconColor: PropTypes.string.isRequired,
13
+ onClick: PropTypes.func.isRequired
14
+ };
15
+ const ButtonActionPropTypes = {
16
+ type: PropTypes.string.isRequired,
17
+ label: PropTypes.string.isRequired,
18
+ onClick: PropTypes.func.isRequired,
19
+ disabled: PropTypes.bool,
20
+ iconName: PropTypes.string.isRequired,
21
+ iconColor: PropTypes.string.isRequired
22
+ };
11
23
  const headerWithActionsPropTypes = {
12
24
  closeButton: PropTypes.shape(closeButtonPropTypes),
13
25
  title: PropTypes.string.isRequired,
@@ -20,8 +32,12 @@ const headerWithActionsPropTypes = {
20
32
  display: PropTypes.bool.isRequired,
21
33
  label: PropTypes.oneOf(['Unsaved changes', 'Saved'])
22
34
  }).isRequired,
23
- bulletPointMenuButton: PropTypes.shape(bulletPointMenuButtonPropTypes),
24
- actionButtons: PropTypes.arrayOf(PropTypes.shape(ButtonLinkPropTypes)).isRequired
35
+ bulletPointMenuButtonPropTypes: PropTypes.oneOfType([PropTypes.shape(bulletPointMenuButtonPropTypes), PropTypes.shape({
36
+ buttons: PropTypes.arrayOf(PropTypes.shape(ButtonMenuPropTypes)).isRequired,
37
+ onClick: PropTypes.func.isRequired,
38
+ buttonAriaLabel: PropTypes.string
39
+ })]),
40
+ actionButtons: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape(ButtonLinkPropTypes)), PropTypes.arrayOf(PropTypes.shape(ButtonActionPropTypes))]).isRequired
25
41
  };
26
42
  export default headerWithActionsPropTypes;
27
43
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","bulletPointMenuButtonPropTypes","ButtonLinkPropTypes","closeButtonPropTypes","size","oneOf","isRequired","icon","string","onClick","func","headerWithActionsPropTypes","closeButton","shape","title","tag","label","type","saveStatus","display","bool","bulletPointMenuButton","actionButtons","arrayOf"],"sources":["../../../src/organism/header-with-actions/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport bulletPointMenuButtonPropTypes, {\n BulletPointMenuButtonProps\n} from '../../molecule/bullet-point-menu-button/types';\nimport ButtonLinkPropTypes, {ButtonLinkProps} from '../../atom/button-link/types';\n\nconst closeButtonPropTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']).isRequired,\n icon: PropTypes.string.isRequired,\n 'data-name': PropTypes.string.isRequired,\n 'aria-label': PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired\n};\nconst headerWithActionsPropTypes = {\n closeButton: PropTypes.shape(closeButtonPropTypes),\n title: PropTypes.string.isRequired,\n tag: PropTypes.shape({\n label: PropTypes.oneOf(['Published', 'Ongoing changes', 'Draft', 'Archived']).isRequired,\n type: PropTypes.oneOf(['success', 'progress', 'warning']).isRequired,\n size: PropTypes.string.isRequired\n }).isRequired,\n saveStatus: PropTypes.shape({\n display: PropTypes.bool.isRequired,\n label: PropTypes.oneOf(['Unsaved changes', 'Saved'])\n }).isRequired,\n bulletPointMenuButton: PropTypes.shape(bulletPointMenuButtonPropTypes),\n actionButtons: PropTypes.arrayOf(PropTypes.shape(ButtonLinkPropTypes)).isRequired\n};\n\nexport default headerWithActionsPropTypes;\n\ntype TagProps = {\n label: 'Published' | 'Ongoing changes' | 'Draft' | 'Archived';\n type: 'success' | 'progress' | 'warning';\n size: string;\n};\n\ntype SaveStatusProps = {\n display: boolean;\n label?: 'Unsaved changes' | 'Saved';\n};\n\ntype CloseButtonProps = {\n size: 'default' | 'small' | 'responsive';\n icon: string;\n 'data-name': string;\n 'aria-label': string;\n onClick: () => void;\n};\n\nexport type HeaderWithActionsProps = {\n closeButton: CloseButtonProps;\n title: string;\n tag: TagProps;\n saveStatus: SaveStatusProps;\n actionButtons: ButtonLinkProps[];\n bulletPointMenuButton?: BulletPointMenuButtonProps;\n};\n\nexport type HeaderWithActionsPropsFixture = {props: Hea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EqB,aAAa,EAAEtB,SAAS,CAACuB,OAAO,CAACvB,SAAS,CAACa,KAAK,CAACX,mBAAmB,CAAC,CAAC,CAACI;AACzE,CAAC;AAED,eAAeK,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["PropTypes","bulletPointMenuButtonPropTypes","ButtonLinkPropTypes","closeButtonPropTypes","string","onClick","func","isRequired","ButtonMenuPropTypes","dataName","label","iconName","iconColor","ButtonActionPropTypes","type","disabled","bool","headerWithActionsPropTypes","closeButton","shape","title","tag","oneOf","size","saveStatus","display","oneOfType","buttons","arrayOf","buttonAriaLabel","actionButtons"],"sources":["../../../src/organism/header-with-actions/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport bulletPointMenuButtonPropTypes, {\n BulletPointMenuButtonProps\n} from '../../molecule/bullet-point-menu-button/types';\nimport ButtonLinkPropTypes, {ButtonLinkProps} from '../../atom/button-link/types';\n\nconst closeButtonPropTypes = {\n 'aria-label': PropTypes.string,\n onClick: PropTypes.func.isRequired\n};\n\nconst ButtonMenuPropTypes = {\n dataName: PropTypes.string,\n label: PropTypes.string.isRequired,\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired\n};\n\nconst ButtonActionPropTypes = {\n type: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string.isRequired\n};\n\nconst headerWithActionsPropTypes = {\n closeButton: PropTypes.shape(closeButtonPropTypes),\n title: PropTypes.string.isRequired,\n tag: PropTypes.shape({\n label: PropTypes.oneOf(['Published', 'Ongoing changes', 'Draft', 'Archived']).isRequired,\n type: PropTypes.oneOf(['success', 'progress', 'warning']).isRequired,\n size: PropTypes.string.isRequired\n }).isRequired,\n saveStatus: PropTypes.shape({\n display: PropTypes.bool.isRequired,\n label: PropTypes.oneOf(['Unsaved changes', 'Saved'])\n }).isRequired,\n bulletPointMenuButtonPropTypes: PropTypes.oneOfType([\n PropTypes.shape(bulletPointMenuButtonPropTypes),\n PropTypes.shape({\n buttons: PropTypes.arrayOf(PropTypes.shape(ButtonMenuPropTypes)).isRequired,\n onClick: PropTypes.func.isRequired,\n buttonAriaLabel: PropTypes.string\n })\n ]),\n actionButtons: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.shape(ButtonLinkPropTypes)),\n PropTypes.arrayOf(PropTypes.shape(ButtonActionPropTypes))\n ]).isRequired\n};\n\nexport default headerWithActionsPropTypes;\n\ntype TagProps = {\n label: 'Published' | 'Ongoing changes' | 'Draft' | 'Archived';\n type: 'success' | 'progress' | 'warning';\n size: string;\n};\n\ntype SaveStatusProps = {\n display: boolean;\n label?: 'Unsaved changes' | 'Saved';\n};\n\ntype CloseButtonProps = {\n 'aria-label': string;\n onClick: () => void;\n};\n\nexport type ButtonMenuProps = {\n dataName: string;\n label: string;\n iconName: string;\n iconColor: string;\n onClick: () => void;\n};\n\ntype BulletPointMenuButtonCustomProps = {\n buttons: ButtonMenuProps[];\n onClick: () => void;\n buttonAriaLabel: string;\n};\n\nexport type ButtonActionProps = {\n type: 'primary' | 'secondary';\n label: string;\n onClick: () => void;\n disabled?: boolean;\n iconName: string;\n iconColor: string;\n};\n\nexport type HeaderWithActionsProps = {\n closeButton: CloseButtonProps;\n title: string;\n tag: TagProps;\n saveStatus: SaveStatusProps;\n actionButtons: ButtonLinkProps[] | ButtonActionProps[];\n bulletPointMenuButton?: BulletPointMenuButtonProps | BulletPointMenuButtonCustomProps;\n};\n\nexport type HeaderWithActionsPropsFixture = {props: HeaderWithActionsProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,8BAA8B,MAE9B,+CAA+C;AACtD,OAAOC,mBAAmB,MAAyB,8BAA8B;AAEjF,MAAMC,oBAAoB,GAAG;EAC3B,YAAY,EAAEH,SAAS,CAACI,MAAM;EAC9BC,OAAO,EAAEL,SAAS,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IAClCG,KAAK,EAAEV,SAAS,CAACsB,KAAK,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC;EACrD,CAAC,CAAC,CAACf,UAAU;EACbN,8BAA8B,EAAED,SAAS,CAAC0B,SAAS,CAAC,CAClD1B,SAAS,CAACmB,KAAK,CAAClB,8BAA8B,CAAC,EAC/CD,SAAS,CAACmB,KAAK,CAAC;IACdQ,OAAO,EAAE3B,SAAS,CAAC4B,OAAO,CAAC5B,SAAS,CAACmB,KAAK,CAACX,mBAAmB,CAAC,CAAC,CAACD,UAAU;IAC3EF,OAAO,EAAEL,SAAS,CAACM,IAAI,CAACC,UAAU;IAClCsB,eAAe,EAAE7B,SAAS,CAACI;EAC7B,CAAC,CAAC,CACH,CAAC;EACF0B,aAAa,EAAE9B,SAAS,CAAC0B,SAAS,CAAC,CACjC1B,SAAS,CAAC4B,OAAO,CAAC5B,SAAS,CAACmB,KAAK,CAACjB,mBAAmB,CAAC,CAAC,EACvDF,SAAS,CAAC4B,OAAO,CAAC5B,SAAS,CAACmB,KAAK,CAACN,qBAAqB,CAAC,CAAC,CAC1D,CAAC,CAACN;AACL,CAAC;AAED,eAAeU,0BAA0B","ignoreList":[]}
@@ -146,6 +146,7 @@
146
146
  font-size: 14px;
147
147
  font-weight: 600;
148
148
  line-height: 20px;
149
+ cursor: pointer;
149
150
  margin-top: 32px;
150
151
  width: auto;
151
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAuBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAwBC;IAtBC;;;;;;MAMC;IAgDH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IA7GD,2EASC;IAGC,kBAAsB;IAmGxB,6BAIE;IAEF,6BAIE;IAEF,6BA4dC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAwBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+FE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAwBC;IAtBC;;;;;;MAMC;IAgDH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAKC;IAED,0BAKC;IAED,sBAIC;IAED,qBAIC;IAED,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IA7GD,2EASC;IAGC,kBAAsB;IAmGxB,6BAIE;IAEF,6BAIE;IAEF,6BA2dC;CACF"}
@@ -5,7 +5,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
5
5
  import React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import classnames from 'classnames';
8
- import { NovaCompositionNavigationArrowDown as ArrowDown, NovaCompositionNavigationBurger as BurgerIcon, NovaCompositionNavigationClose as CloseIcon, NovaCompositionCoorpacademyCog as CogIcon, NovaCompositionCoorpacademyPlacesHome24 as HomeIcon } from '@coorpacademy/nova-icons';
8
+ import { NovaCompositionNavigationArrowDown as ArrowDown, NovaCompositionNavigationBurger as BurgerIcon, NovaCompositionNavigationClose as CloseIcon, NovaCompositionCoorpacademyCog as CogIcon, NovaCompositionCoorpacademyPlacesHome24 as HomeIcon, NovaSolidTimeAlarm as AlarmIcon } from '@coorpacademy/nova-icons';
9
9
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
10
10
  import Provider from '../../atom/provider';
11
11
  import Cta from '../../atom/cta';
@@ -228,7 +228,7 @@ class MoocHeader extends React.Component {
228
228
  "aria-label": pageCountAriaLabel
229
229
  }, /*#__PURE__*/React.createElement("span", {
230
230
  className: style.counter
231
- }, item.counter > 99 ? '99+' : item.counter)) : null;
231
+ }, item.counter > 99 ? '+99' : item.counter)) : null;
232
232
  const {
233
233
  name: itemName = index
234
234
  } = item;
@@ -332,18 +332,16 @@ class MoocHeader extends React.Component {
332
332
  href: user.notifications.href,
333
333
  "data-name": "user-notifications",
334
334
  className: style.notifications
335
- }, nbNotifications > 99 ? '99+' : nbNotifications) : null;
335
+ }, nbNotifications) : null;
336
336
  const notificationPageView = /*#__PURE__*/React.createElement(Link, {
337
337
  className: classnames(style.notification, nbNotifications > 0 ? style.active : null),
338
338
  "data-name": "stat-notifications",
339
339
  href: user.notifications.href,
340
340
  "aria-label": notificationsAriaLabel
341
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
342
- icon: "bell",
343
- style: {
344
- color: nbNotifications > 0 ? COLORS.negative_700 : COLORS.neutral_500
345
- }
346
- }), notificationsView);
341
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AlarmIcon, {
342
+ width: 16,
343
+ height: 16
344
+ })), notificationsView);
347
345
  userView = /*#__PURE__*/React.createElement("div", {
348
346
  className: style.user
349
347
  }, /*#__PURE__*/React.createElement("div", {