@coorpacademy/components 11.40.10-alpha.16.0 → 11.40.11-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/es/molecule/learner-skill-card/index.js +1 -1
  2. package/es/molecule/learner-skill-card/index.js.map +1 -1
  3. package/es/molecule/playlist-card/style.css +3 -2
  4. package/es/template/common/search-page/index.d.ts +60 -0
  5. package/es/template/common/search-page/index.d.ts.map +1 -1
  6. package/es/template/common/search-page/index.js +15 -6
  7. package/es/template/common/search-page/index.js.map +1 -1
  8. package/es/template/common/search-page/style.css +7 -0
  9. package/lib/molecule/learner-skill-card/index.js +1 -1
  10. package/lib/molecule/learner-skill-card/index.js.map +1 -1
  11. package/lib/molecule/playlist-card/style.css +3 -2
  12. package/lib/template/common/search-page/index.d.ts +60 -0
  13. package/lib/template/common/search-page/index.d.ts.map +1 -1
  14. package/lib/template/common/search-page/index.js +15 -6
  15. package/lib/template/common/search-page/index.js.map +1 -1
  16. package/lib/template/common/search-page/style.css +7 -0
  17. package/locales/bs/global.json +2 -2
  18. package/locales/cs/global.json +2 -2
  19. package/locales/de/global.json +2 -2
  20. package/locales/es/global.json +2 -2
  21. package/locales/et/global.json +2 -2
  22. package/locales/fi/global.json +2 -2
  23. package/locales/hr/global.json +2 -2
  24. package/locales/hu/global.json +2 -2
  25. package/locales/hy/global.json +2 -2
  26. package/locales/it/global.json +2 -2
  27. package/locales/ja/global.json +2 -2
  28. package/locales/ko/global.json +2 -2
  29. package/locales/lt/global.json +2 -2
  30. package/locales/nl/global.json +2 -2
  31. package/locales/pl/global.json +2 -2
  32. package/locales/pt/global.json +2 -2
  33. package/locales/ro/global.json +2 -2
  34. package/locales/ru/global.json +2 -2
  35. package/locales/sk/global.json +2 -2
  36. package/locales/sl/global.json +2 -2
  37. package/locales/sv/global.json +2 -2
  38. package/locales/tl/global.json +2 -2
  39. package/locales/tr/global.json +2 -2
  40. package/locales/uk/global.json +2 -2
  41. package/locales/vi/global.json +2 -2
  42. package/locales/zh/global.json +2 -2
  43. package/locales/zh_TW/global.json +2 -2
  44. package/package.json +2 -2
@@ -20,7 +20,7 @@ const LearnerSkillCard = (props, context) => {
20
20
  label,
21
21
  focus,
22
22
  metrics,
23
- progress,
23
+ progress = 0,
24
24
  icon,
25
25
  onClick
26
26
  } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useRef","PropTypes","Provider","GetTranslateFromContext","ProgressBar","COLORS","createGradientBackground","FaIcon","style","MAX_SCORE","updateBackgroundImage","ref","background","current","backgroundImage","LearnerSkillCard","props","context","ariaLabel","cardIndex","title","label","focus","metrics","progress","icon","onClick","content","questionsToReview","translate","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","defaultBackground","focusBackground","handleMouseEnter","handleMouseLeave","createElement","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","skillTitle","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","type","oneOf","isRequired","string","number","bool","shape","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref, background) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n title,\n label,\n focus,\n metrics,\n progress,\n icon,\n onClick\n } = props;\n const {content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.cm_grey_100];\n const headerBackgroundRef = useRef(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n data-name={`skill-card-${label}`}\n onClick={onClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n <span style={{color: tagTextColor}}>{badgeLocale}</span>\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={ariaLabel || title}\n >\n {title}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={progress}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n type: PropTypes.oneOf(['skill']).isRequired,\n title: PropTypes.string.isRequired,\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n cardIndex: PropTypes.number,\n focus: PropTypes.bool,\n progress: PropTypes.number,\n metrics: PropTypes.shape({\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n icon: PropTypes.shape({\n color: PropTypes.string,\n name: PropTypes.string\n }),\n onClick: PropTypes.func\n};\nexport default LearnerSkillCard;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAO,OA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AM;EACvB,YAAY,EAAEvF,SAAS,CAACuF,MAAM;EAC9BrE,SAAS,EAAElB,SAAS,CAACwF,MAAM;EAC3BnE,KAAK,EAAErB,SAAS,CAACyF,IAAI;EACrBlE,QAAQ,EAAEvB,SAAS,CAACwF,MAAM;EAC1BlE,OAAO,EAAEtB,SAAS,CAAC0F,KAAK,CAAC;IACvBhE,OAAO,EAAE1B,SAAS,CAACwF,MAAM;IACzB7D,iBAAiB,EAAE3B,SAAS,CAACwF;EAC/B,CAAC,CAAC;EACFhE,IAAI,EAAExB,SAAS,CAAC0F,KAAK,CAAC;IACpB7D,KAAK,EAAE7B,SAAS,CAACuF,MAAM;IACvBzD,IAAI,EAAE9B,SAAS,CAACuF;EAClB,CAAC,CAAC;EACF9D,OAAO,EAAEzB,SAAS,CAAC2F;AACrB,CAAC;AACD,eAAe7E,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useRef","PropTypes","Provider","GetTranslateFromContext","ProgressBar","COLORS","createGradientBackground","FaIcon","style","MAX_SCORE","updateBackgroundImage","ref","background","current","backgroundImage","LearnerSkillCard","props","context","ariaLabel","cardIndex","title","label","focus","metrics","progress","icon","onClick","content","questionsToReview","translate","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","defaultBackground","focusBackground","handleMouseEnter","handleMouseLeave","createElement","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","skillTitle","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","type","oneOf","isRequired","string","number","bool","shape","func"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref, background) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n title,\n label,\n focus,\n metrics,\n progress = 0,\n icon,\n onClick\n } = props;\n const {content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.cm_grey_100];\n const headerBackgroundRef = useRef(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n data-name={`skill-card-${label}`}\n onClick={onClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n <span style={{color: tagTextColor}}>{badgeLocale}</span>\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={ariaLabel || title}\n >\n {title}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={progress}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n type: PropTypes.oneOf(['skill']).isRequired,\n title: PropTypes.string.isRequired,\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n cardIndex: PropTypes.number,\n focus: PropTypes.bool,\n progress: PropTypes.number,\n metrics: PropTypes.shape({\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n icon: PropTypes.shape({\n color: PropTypes.string,\n name: PropTypes.string\n }),\n onClick: PropTypes.func\n};\nexport default LearnerSkillCard;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAO,OAAO;AACzD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,IAAGC,uBAAuB,QAAO,qBAAqB;AACrE,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,SAAQC,wBAAwB,QAAO,0CAA0C;AACjF,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAAG,GAAG;AAErB,OAAO,MAAMC,qBAAqB,GAAGA,CAACC,GAAG,EAAEC,UAAU,KAAK;EACxD,IAAID,GAAG,CAACE,OAAO,EAAE;IACfF,GAAG,CAACE,OAAO,CAACL,KAAK,CAACM,eAAe,GAAGF,UAAU;EAChD;AACF,CAAC;AACD,MAAMG,gBAAgB,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC3C,MAAM;IACJ,YAAY,EAAEC,SAAS;IACvBC,SAAS;IACTC,KAAK;IACLC,KAAK;IACLC,KAAK;IACLC,OAAO;IACPC,QAAQ,GAAG,CAAC;IACZC,IAAI;IACJC;EACF,CAAC,GAAGV,KAAK;EACT,MAAM;IAACW,OAAO;IAAEC,iBAAiB,GAAG;EAAC,CAAC,GAAGL,OAAO;EAChD,MAAMM,SAAS,GAAG1B,uBAAuB,CAACc,OAAO,CAAC;EAClD,MAAM;IAACa,KAAK;IAAEC;EAAI,CAAC,GAAGN,IAAI;EAC1B,MAAM,CAACO,aAAa,EAAEC,WAAW,EAAEC,YAAY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AC9BlD,SAAS,EAAE3B,QAAQ,CAAC8E,iBAAiB,CAACnD;AACxC,CAAC;AAEDd,gBAAgB,CAACkE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC3BC,IAAI,EAAEpF,SAAS,CAACqF,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAACC,UAAU;EAC3CnE,KAAK,EAAEnB,SAAS,CAACuF,MAAM,CAACD,UAAU;EAClClE,KAAK,EAAEpB,SAAS,CAACuF,MAAM;EACvB,YAAY,EAAEvF,SAAS,CAACuF,MAAM;EAC9BrE,SAAS,EAAElB,SAAS,CAACwF,MAAM;EAC3BnE,KAAK,EAAErB,SAAS,CAACyF,IAAI;EACrBlE,QAAQ,EAAEvB,SAAS,CAACwF,MAAM;EAC1BlE,OAAO,EAAEtB,SAAS,CAAC0F,KAAK,CAAC;IACvBhE,OAAO,EAAE1B,SAAS,CAACwF,MAAM;IACzB7D,iBAAiB,EAAE3B,SAAS,CAACwF;EAC/B,CAAC,CAAC;EACFhE,IAAI,EAAExB,SAAS,CAAC0F,KAAK,CAAC;IACpB7D,KAAK,EAAE7B,SAAS,CAACuF,MAAM;IACvBzD,IAAI,EAAE9B,SAAS,CAACuF;EAClB,CAAC,CAAC;EACF9D,OAAO,EAAEzB,SAAS,CAAC2F;AACrB,CAAC;AACD,eAAe7E,gBAAgB","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  @value cm_grey_100 from colors;
4
4
  @value cm_grey_400 from colors;
5
5
  @value cm_grey_500 from colors;
6
+ @value cm_grey_700 from colors;
6
7
  @value cm_grey_75 from colors;
7
8
 
8
9
  .container {
@@ -46,14 +47,14 @@
46
47
  left: 0;
47
48
  width: 100%;
48
49
  height: 160px;
49
- background: #1d1d2b80;
50
+ background: color(cm_grey_700 a(50%));
50
51
  border-top-right-radius: 12px;
51
52
  border-top-left-radius: 12px;
52
53
  transition: all 0.5s ease-out;
53
54
  }
54
55
 
55
56
  .container:hover .imageContainer::after {
56
- background: #1d1d2b00;
57
+ background: color(cm_grey_700 a(0%));
57
58
  }
58
59
  .container:hover {
59
60
  box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.10);
@@ -78,6 +78,66 @@ declare namespace SearchPage {
78
78
  filterGroupAriaLabel: PropTypes.Requireable<string>;
79
79
  sortAriaLabel: PropTypes.Requireable<string>;
80
80
  }>>;
81
+ const quickFilters: PropTypes.Requireable<PropTypes.InferProps<{
82
+ primaryOption: PropTypes.Requireable<PropTypes.InferProps<{
83
+ defaultLabel: PropTypes.Requireable<string>;
84
+ defaultValue: PropTypes.Requireable<string>;
85
+ defaultIconName: PropTypes.Requireable<string>;
86
+ defaultSelected: PropTypes.Requireable<boolean>;
87
+ defaultAriaLabel: PropTypes.Requireable<string>;
88
+ onDefaultClick: PropTypes.Requireable<(...args: any[]) => any>;
89
+ }>>;
90
+ nextFilterAriaLabel: PropTypes.Requireable<string>;
91
+ previousFilterAriaLabel: PropTypes.Requireable<string>;
92
+ filterOptionsAriaLabel: PropTypes.Requireable<string>;
93
+ filterOptions: PropTypes.Requireable<(PropTypes.InferProps<{
94
+ iconName: PropTypes.Requireable<string>;
95
+ label: PropTypes.Requireable<string>;
96
+ value: PropTypes.Requireable<string>;
97
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
98
+ selected: PropTypes.Requireable<boolean>;
99
+ ariaLabel: PropTypes.Requireable<string>;
100
+ }> | null | undefined)[]>;
101
+ filterButton: PropTypes.Requireable<PropTypes.InferProps<{
102
+ type: PropTypes.Requireable<string>;
103
+ usage: PropTypes.Requireable<string>;
104
+ label: PropTypes.Requireable<string>;
105
+ content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
106
+ 'aria-label': PropTypes.Requireable<string>;
107
+ tooltipText: PropTypes.Requireable<string>;
108
+ tooltipPlacement: PropTypes.Requireable<string>;
109
+ 'data-name': PropTypes.Requireable<string>;
110
+ 'data-testid': PropTypes.Requireable<string>;
111
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
112
+ position: PropTypes.Requireable<string>;
113
+ type: PropTypes.Requireable<string>;
114
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
115
+ name: PropTypes.Validator<string>;
116
+ color: PropTypes.Requireable<string>;
117
+ backgroundColor: PropTypes.Requireable<string>;
118
+ size: PropTypes.Requireable<number>;
119
+ customStyle: PropTypes.Requireable<{
120
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
121
+ }>;
122
+ }>>;
123
+ }>>;
124
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
125
+ link: PropTypes.Requireable<PropTypes.InferProps<{
126
+ href: PropTypes.Requireable<string>;
127
+ download: PropTypes.Requireable<boolean>;
128
+ target: PropTypes.Requireable<string>;
129
+ }>>;
130
+ hoverBackgroundColor: PropTypes.Requireable<string>;
131
+ hoverColor: PropTypes.Requireable<string>;
132
+ disabled: PropTypes.Requireable<boolean>;
133
+ className: PropTypes.Requireable<string>;
134
+ customStyle: PropTypes.Requireable<{
135
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
136
+ }>;
137
+ useTitle: PropTypes.Requireable<boolean>;
138
+ customLabelClassName: PropTypes.Requireable<string>;
139
+ }>>;
140
+ }>>;
81
141
  const cards: PropTypes.Requireable<PropTypes.InferProps<{
82
142
  list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
83
143
  customStyle: PropTypes.Requireable<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAkBA,mEAiJC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAmBA,mEAoJC"}
@@ -1,3 +1,7 @@
1
+ import _sortBy from "lodash/fp/sortBy";
2
+ import _size from "lodash/fp/size";
3
+ import _pipe from "lodash/fp/pipe";
4
+ import _map from "lodash/fp/map";
1
5
  import _keys from "lodash/fp/keys";
2
6
  import _isEmpty from "lodash/fp/isEmpty";
3
7
  import _getOr from "lodash/fp/getOr";
@@ -17,11 +21,13 @@ import Tag from '../../../atom/tag';
17
21
  import { cardPropTypes } from '../../../molecule/card';
18
22
  import LearningPriorityCard from '../../../molecule/learning-priority-card';
19
23
  import { COLORS } from '../../../variables/colors';
24
+ import QuickFilters from '../../../molecule/quick-filters';
20
25
  import style from './style.css';
21
26
  const SearchPage = (props, context) => {
22
27
  const {
23
28
  title,
24
29
  searchFilters,
30
+ quickFilters,
25
31
  cards,
26
32
  count,
27
33
  noresultsfound,
@@ -102,12 +108,11 @@ const SearchPage = (props, context) => {
102
108
  }))), recommendationsView) : /*#__PURE__*/React.createElement(CardsGrid, cards);
103
109
 
104
110
  // Convert sections object to array and sort by order
105
- const sectionsArray = _keys(sections).map(key => ({
111
+ const sortedSections = _pipe(_keys, _map(key => ({
106
112
  key,
107
113
  ...sections[key]
108
- }));
109
- const sortedSections = sectionsArray.sort((a, b) => a.order - b.order);
110
- const hasSections = sortedSections.length > 0;
114
+ })), _sortBy('order'))(sections);
115
+ const hasSections = _size(sortedSections) > 0;
111
116
  const contentGridSection = /*#__PURE__*/React.createElement("div", {
112
117
  className: style.contentSection
113
118
  }, /*#__PURE__*/React.createElement("div", {
@@ -125,12 +130,15 @@ const SearchPage = (props, context) => {
125
130
  })), /*#__PURE__*/React.createElement("div", {
126
131
  className: style.contentGrid
127
132
  }, " ", cardsView)));
128
- return /*#__PURE__*/React.createElement("div", null, searchFilters ? /*#__PURE__*/React.createElement(Filters, _extends({}, searchFilters, {
133
+ return /*#__PURE__*/React.createElement("div", {
134
+ "data-name": "filters",
135
+ className: quickFilters ? style.quickFilters : null
136
+ }, searchFilters ? /*#__PURE__*/React.createElement(Filters, _extends({}, searchFilters, {
129
137
  moreSortAriaLabel: moreSortAriaLabel,
130
138
  moreFilterAriaLabel: moreFilterAriaLabel,
131
139
  filterGroupAriaLabel: filterGroupAriaLabel,
132
140
  sortAriaLabel: sortAriaLabel
133
- })) : null, hasSections ? /*#__PURE__*/React.createElement("div", {
141
+ })) : /*#__PURE__*/React.createElement(QuickFilters, quickFilters), hasSections ? /*#__PURE__*/React.createElement("div", {
134
142
  "data-name": "explorerSections",
135
143
  className: style.sectionsWrapper
136
144
  }, sortedSections.map((section, index) => /*#__PURE__*/React.createElement("div", {
@@ -154,6 +162,7 @@ SearchPage.propTypes = process.env.NODE_ENV !== "production" ? {
154
162
  noresultsfound: PropTypes.string,
155
163
  title: PropTypes.string,
156
164
  searchFilters: PropTypes.shape(Filters.propTypes),
165
+ quickFilters: PropTypes.shape(QuickFilters.propTypes),
157
166
  cards: PropTypes.shape(CardsGrid.propTypes),
158
167
  count: PropTypes.number,
159
168
  clearFilters: PropTypes.shape(Button.propTypes),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useRef","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CertificationCard","LearnerSkillCard","PlaylistCard","CMPopin","Tag","cardPropTypes","LearningPriorityCard","COLORS","style","SearchPage","props","context","title","searchFilters","cards","count","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","sections","skin","defaultColor","_getOr","nodeRef","recommendationsView","_isEmpty","createElement","renderSection","section","sectionCount","length","titleWithCount","className","sectionTitle","label","toString","type","size","customStyle","backgroundColor","cm_grey_100","color","neutral_500","sectionProps","dataName","key","_extends","cardsView","list","noresults","noresultstxt","clear","background","sectionsArray","_keys","map","sortedSections","sort","a","b","order","hasSections","contentGridSection","contentSection","sectionHeader","contentGrid","sectionsWrapper","index","cardsWrapper","role","ref","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","number","objectOf","arrayOf","oneOfType","showMore","onShowMore","func","showMoreOnLeftAriaLabel","showMoreOnRightAriaLabel"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React, {useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty, keys} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CertificationCard from '../../../molecule/certification-card';\nimport LearnerSkillCard from '../../../molecule/learner-skill-card';\nimport PlaylistCard from '../../../molecule/playlist-card';\nimport CMPopin from '../../../molecule/cm-popin';\nimport Tag from '../../../atom/tag';\nimport {cardPropTypes} from '../../../molecule/card';\nimport LearningPriorityCard from '../../../molecule/learning-priority-card';\nimport {COLORS} from '../../../variables/colors';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n cards,\n count,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards,\n sections = {}\n } = props;\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n const nodeRef = useRef(null);\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n // Helper function to render content sections\n const renderSection = section => {\n if (!section || isEmpty(section.cards)) return null;\n\n // Use count from props, fallback to cards.length\n const sectionCount = section.count || section.cards.length;\n\n // Create title with count tag\n const titleWithCount = (\n <div className={style.sectionTitle}>\n <span data-name=\"section-title\">{section.title}</span>\n <Tag\n label={sectionCount.toString()}\n type=\"default\"\n size=\"S\"\n customStyle={{backgroundColor: COLORS.cm_grey_100, color: COLORS.neutral_500}}\n />\n </div>\n );\n\n const sectionProps = {\n ...section,\n title: titleWithCount,\n dataName: `${section.key}-section`\n };\n\n // Use CardsList with appropriate type for all sections\n if (section.key === 'certifications') {\n return <CardsList {...sectionProps} type=\"certifications\" />;\n }\n\n if (section.key === 'skills') {\n return <CardsList {...sectionProps} type=\"skills\" />;\n }\n\n if (section.key === 'playlists') {\n return <CardsList {...sectionProps} type=\"playlists\" />;\n }\n\n // For new content, use standard cards\n return <CardsList {...sectionProps} />;\n };\n\n const cardsView = isEmpty(cards?.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n // Convert sections object to array and sort by order\n const sectionsArray = keys(sections).map(key => ({\n key,\n ...sections[key]\n }));\n const sortedSections = sectionsArray.sort((a, b) => a.order - b.order);\n\n const hasSections = sortedSections.length > 0;\n\n const contentGridSection = (\n <div className={style.contentSection}>\n <div className={style.sectionHeader}>\n <div className={style.sectionTitle}>\n <span>{title}</span>\n <Tag\n label={count || cards.list.length.toString()}\n type=\"default\"\n size=\"S\"\n customStyle={{backgroundColor: COLORS.cm_grey_100, color: COLORS.neutral_500}}\n />\n </div>\n <div className={style.contentGrid}> {cardsView}</div>\n </div>\n </div>\n );\n\n return (\n <div>\n {searchFilters ? (\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n ) : null}\n\n {hasSections ? (\n <div data-name=\"explorerSections\" className={style.sectionsWrapper}>\n {sortedSections.map((section, index) => (\n <div data-name={`section-${section.key}`} key={`${section.key}-${index}`}>\n {renderSection(section)}\n </div>\n ))}\n {contentGridSection ? <div>{contentGridSection}</div> : null}\n </div>\n ) : (\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n )}\n\n {popinWithCards ? (\n <div className={style.popinWithCards} ref={nodeRef}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n count: PropTypes.number,\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes),\n sections: PropTypes.objectOf(\n PropTypes.shape({\n title: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearnerSkillCard.propTypes),\n PropTypes.shape(CertificationCard.propTypes),\n PropTypes.shape(PlaylistCard.propTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n showMore: PropTypes.string,\n onShowMore: PropTypes.func,\n order: PropTypes.number,\n count: PropTypes.number,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n })\n })\n )\n};\n\nexport default SearchPage;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,MAAM,QAAO,OAAO;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,MAAM,MAAM,sBAAsB;AACzC,OAAOC,OAAO,MAAM,2BAA2B;AAC/C,OAAOC,SAAS,MAAM,8BAA8B;AACpD,OAAOC,SAAS,MAAM,wCAAwC;AAC9D,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,gBAAgB,MAAM,sCAAsC;AACnE,OAAOC,YAAY,MAAM,iCAAiC;AAC1D,OAAOC,OAAO,MAAM,4BAA4B;AAChD,OAAOC,GAAG,MAAM,mBAAmB;AACnC,SAAQC,aAAa,QAAO,wBAAwB;AACpD,OAAOC,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ACvCpF,SAAS,CAACyF,KAAK,CAAC7E,oBAAoB,CAACwE,SAAS,CAAC,CAChD,CACH,CAAC;IACDU,QAAQ,EAAE9F,SAAS,CAACwF,MAAM;IAC1BO,UAAU,EAAE/F,SAAS,CAACgG,IAAI;IAC1BzB,KAAK,EAAEvE,SAAS,CAAC0F,MAAM;IACvBrE,KAAK,EAAErB,SAAS,CAAC0F,MAAM;IACvB,mBAAmB,EAAE1F,SAAS,CAACyF,KAAK,CAAC;MACnCQ,uBAAuB,EAAEjG,SAAS,CAACwF,MAAM;MACzCU,wBAAwB,EAAElG,SAAS,CAACwF;IACtC,CAAC;EACH,CAAC,CACH;AACF,CAAC;AAED,eAAezE,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useRef","PropTypes","Provider","Button","Filters","CardsGrid","CardsList","CertificationCard","LearnerSkillCard","PlaylistCard","CMPopin","Tag","cardPropTypes","LearningPriorityCard","COLORS","QuickFilters","style","SearchPage","props","context","title","searchFilters","quickFilters","cards","count","noresultsfound","clearFilters","recommendations","moreSortAriaLabel","moreFilterAriaLabel","filterGroupAriaLabel","sortAriaLabel","popinWithCards","sections","skin","defaultColor","_getOr","nodeRef","recommendationsView","_isEmpty","createElement","renderSection","section","sectionCount","length","titleWithCount","className","sectionTitle","label","toString","type","size","customStyle","backgroundColor","cm_grey_100","color","neutral_500","sectionProps","dataName","key","_extends","cardsView","list","noresults","noresultstxt","clear","background","sortedSections","_pipe","_keys","_map","_sortBy","hasSections","_size","contentGridSection","contentSection","sectionHeader","contentGrid","sectionsWrapper","map","index","cardsWrapper","role","ref","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","number","objectOf","arrayOf","oneOfType","showMore","onShowMore","func","order","showMoreOnLeftAriaLabel","showMoreOnRightAriaLabel"],"sources":["../../../../src/template/common/search-page/index.js"],"sourcesContent":["import React, {useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, isEmpty, keys, map, pipe, size, sortBy} from 'lodash/fp';\nimport Provider from '../../../atom/provider';\nimport Button from '../../../atom/button';\nimport Filters from '../../../molecule/filters';\nimport CardsGrid from '../../../organism/cards-grid';\nimport CardsList from '../../../molecule/dashboard/cards-list';\nimport CertificationCard from '../../../molecule/certification-card';\nimport LearnerSkillCard from '../../../molecule/learner-skill-card';\nimport PlaylistCard from '../../../molecule/playlist-card';\nimport CMPopin from '../../../molecule/cm-popin';\nimport Tag from '../../../atom/tag';\nimport {cardPropTypes} from '../../../molecule/card';\nimport LearningPriorityCard from '../../../molecule/learning-priority-card';\nimport {COLORS} from '../../../variables/colors';\nimport QuickFilters from '../../../molecule/quick-filters';\nimport style from './style.css';\n\nconst SearchPage = (props, context) => {\n const {\n title,\n searchFilters,\n quickFilters,\n cards,\n count,\n noresultsfound,\n clearFilters,\n recommendations,\n moreSortAriaLabel,\n moreFilterAriaLabel,\n filterGroupAriaLabel,\n sortAriaLabel,\n popinWithCards,\n sections = {}\n } = props;\n const {skin} = context;\n const defaultColor = getOr('#00B0FF', 'common.primary', skin);\n const nodeRef = useRef(null);\n const recommendationsView = isEmpty(recommendations) ? null : <CardsList {...recommendations} />;\n\n // Helper function to render content sections\n const renderSection = section => {\n if (!section || isEmpty(section.cards)) return null;\n\n // Use count from props, fallback to cards.length\n const sectionCount = section.count || section.cards.length;\n\n // Create title with count tag\n const titleWithCount = (\n <div className={style.sectionTitle}>\n <span data-name=\"section-title\">{section.title}</span>\n <Tag\n label={sectionCount.toString()}\n type=\"default\"\n size=\"S\"\n customStyle={{backgroundColor: COLORS.cm_grey_100, color: COLORS.neutral_500}}\n />\n </div>\n );\n\n const sectionProps = {\n ...section,\n title: titleWithCount,\n dataName: `${section.key}-section`\n };\n\n // Use CardsList with appropriate type for all sections\n if (section.key === 'certifications') {\n return <CardsList {...sectionProps} type=\"certifications\" />;\n }\n\n if (section.key === 'skills') {\n return <CardsList {...sectionProps} type=\"skills\" />;\n }\n\n if (section.key === 'playlists') {\n return <CardsList {...sectionProps} type=\"playlists\" />;\n }\n\n // For new content, use standard cards\n return <CardsList {...sectionProps} />;\n };\n\n const cardsView = isEmpty(cards?.list) ? (\n <div>\n <div className={style.noresults}>\n <div className={style.noresultstxt}>{noresultsfound}</div>\n <Button\n {...clearFilters}\n data-name=\"searchPageClear\"\n className={style.clear}\n style={{background: defaultColor}}\n type=\"link\"\n />\n </div>\n {recommendationsView}\n </div>\n ) : (\n <CardsGrid {...cards} />\n );\n\n // Convert sections object to array and sort by order\n const sortedSections = pipe(\n keys,\n map(key => ({key, ...sections[key]})),\n sortBy('order')\n )(sections);\n\n const hasSections = size(sortedSections) > 0;\n\n const contentGridSection = (\n <div className={style.contentSection}>\n <div className={style.sectionHeader}>\n <div className={style.sectionTitle}>\n <span>{title}</span>\n <Tag\n label={count || cards.list.length.toString()}\n type=\"default\"\n size=\"S\"\n customStyle={{backgroundColor: COLORS.cm_grey_100, color: COLORS.neutral_500}}\n />\n </div>\n <div className={style.contentGrid}> {cardsView}</div>\n </div>\n </div>\n );\n\n return (\n <div data-name=\"filters\" className={quickFilters ? style.quickFilters : null}>\n {searchFilters ? (\n <Filters\n {...searchFilters}\n moreSortAriaLabel={moreSortAriaLabel}\n moreFilterAriaLabel={moreFilterAriaLabel}\n filterGroupAriaLabel={filterGroupAriaLabel}\n sortAriaLabel={sortAriaLabel}\n />\n ) : (\n <QuickFilters {...quickFilters} />\n )}\n\n {hasSections ? (\n <div data-name=\"explorerSections\" className={style.sectionsWrapper}>\n {sortedSections.map((section, index) => (\n <div data-name={`section-${section.key}`} key={`${section.key}-${index}`}>\n {renderSection(section)}\n </div>\n ))}\n {contentGridSection ? <div>{contentGridSection}</div> : null}\n </div>\n ) : (\n <div data-name=\"searchResult\" className={style.cardsWrapper}>\n <div className={style.title} role=\"status\">\n {title}\n </div>\n {cardsView}\n </div>\n )}\n\n {popinWithCards ? (\n <div className={style.popinWithCards} ref={nodeRef}>\n <CMPopin {...popinWithCards} />\n </div>\n ) : null}\n </div>\n );\n};\n\nSearchPage.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearchPage.propTypes = {\n noresultsfound: PropTypes.string,\n title: PropTypes.string,\n searchFilters: PropTypes.shape(Filters.propTypes),\n quickFilters: PropTypes.shape(QuickFilters.propTypes),\n cards: PropTypes.shape(CardsGrid.propTypes),\n count: PropTypes.number,\n clearFilters: PropTypes.shape(Button.propTypes),\n recommendations: PropTypes.shape(CardsList.propTypes),\n moreSortAriaLabel: PropTypes.string,\n moreFilterAriaLabel: PropTypes.string,\n filterGroupAriaLabel: PropTypes.string,\n sortAriaLabel: PropTypes.string,\n popinWithCards: PropTypes.shape(CMPopin.propTypes),\n sections: PropTypes.objectOf(\n PropTypes.shape({\n title: PropTypes.string,\n cards: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape(cardPropTypes),\n PropTypes.shape(LearnerSkillCard.propTypes),\n PropTypes.shape(CertificationCard.propTypes),\n PropTypes.shape(PlaylistCard.propTypes),\n PropTypes.shape(LearningPriorityCard.propTypes)\n ])\n ),\n showMore: PropTypes.string,\n onShowMore: PropTypes.func,\n order: PropTypes.number,\n count: PropTypes.number,\n 'arrows-aria-label': PropTypes.shape({\n showMoreOnLeftAriaLabel: PropTypes.string,\n showMoreOnRightAriaLabel: PropTypes.string\n })\n })\n )\n};\n\nexport default SearchPage;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IAAGC,MAAM,QAAO,OAAO;AACnC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,MAAM,MAAM,sBAAsB;AACzC,OAAOC,OAAO,MAAM,2BAA2B;AAC/C,OAAOC,SAAS,MAAM,8BAA8B;AACpD,OAAOC,SAAS,MAAM,wCAAwC;AAC9D,OAAOC,iBAAiB,MAAM,sCAAsC;AACpE,OAAOC,gBAAgB,MAAM,sCAAsC;AACnE,OAAOC,YAAY,MAAM,iCAAiC;AAC1D,OAAOC,OAAO,MAAM,4BAA4B;AAChD,OAAOC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,CAAC8F,SAAS,CAAC,CAClB9F,SAAS,CAAC0F,KAAK,CAAC/E,aAAa,CAAC,EAC9BX,SAAS,CAAC0F,KAAK,CAACnF,gBAAgB,CAAC8E,SAAS,CAAC,EAC3CrF,SAAS,CAAC0F,KAAK,CAACpF,iBAAiB,CAAC+E,SAAS,CAAC,EAC5CrF,SAAS,CAAC0F,KAAK,CAAClF,YAAY,CAAC6E,SAAS,CAAC,EACvCrF,SAAS,CAAC0F,KAAK,CAAC9E,oBAAoB,CAACyE,SAAS,CAAC,CAChD,CACH,CAAC;IACDU,QAAQ,EAAE/F,SAAS,CAACyF,MAAM;IAC1BO,UAAU,EAAEhG,SAAS,CAACiG,IAAI;IAC1BC,KAAK,EAAElG,SAAS,CAAC2F,MAAM;IACvBpE,KAAK,EAAEvB,SAAS,CAAC2F,MAAM;IACvB,mBAAmB,EAAE3F,SAAS,CAAC0F,KAAK,CAAC;MACnCS,uBAAuB,EAAEnG,SAAS,CAACyF,MAAM;MACzCW,wBAAwB,EAAEpG,SAAS,CAACyF;IACtC,CAAC;EACH,CAAC,CACH;AACF,CAAC;AAED,eAAezE,UAAU","ignoreList":[]}
@@ -31,6 +31,13 @@
31
31
  margin: 8px 0;
32
32
  }
33
33
 
34
+ .quickFilters {
35
+ position: relative;
36
+ max-width: 1080px;
37
+ margin: auto;
38
+ box-sizing: border-box;
39
+ }
40
+
34
41
  .title {
35
42
  font-family: "Gilroy";
36
43
  font-size: 20px;
@@ -28,7 +28,7 @@ const LearnerSkillCard = (props, context) => {
28
28
  label,
29
29
  focus,
30
30
  metrics,
31
- progress,
31
+ progress = 0,
32
32
  icon,
33
33
  onClick
34
34
  } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_progressBar","_colors","_getBackgroundGradientColor","_icon","_style","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MAX_SCORE","updateBackgroundImage","ref","background","current","style","backgroundImage","exports","LearnerSkillCard","props","context","ariaLabel","cardIndex","title","label","focus","metrics","progress","icon","onClick","content","questionsToReview","translate","GetTranslateFromContext","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","COLORS","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","useRef","defaultBackground","useMemo","createGradientBackground","focusBackground","handleMouseEnter","useCallback","handleMouseLeave","createElement","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","skillTitle","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","Provider","childContextTypes","propTypes","process","env","NODE_ENV","type","PropTypes","oneOf","isRequired","string","number","bool","shape","func","_default"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref, background) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n title,\n label,\n focus,\n metrics,\n progress,\n icon,\n onClick\n } = props;\n const {content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.cm_grey_100];\n const headerBackgroundRef = useRef(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n data-name={`skill-card-${label}`}\n onClick={onClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n <span style={{color: tagTextColor}}>{badgeLocale}</span>\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={ariaLabel || title}\n >\n {title}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={progress}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n type: PropTypes.oneOf(['skill']).isRequired,\n title: PropTypes.string.isRequired,\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n cardIndex: PropTypes.number,\n focus: PropTypes.bool,\n progress: PropTypes.number,\n metrics: PropTypes.shape({\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n icon: PropTypes.shape({\n color: PropTypes.string,\n name: PropTypes.string\n }),\n onClick: PropTypes.func\n};\nexport default LearnerSkillCard;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,2BAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sB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AS,CAACG,MAAM,CAACD,UAAU;EAClC1E,KAAK,EAAEwE,kBAAS,CAACG,MAAM;EACvB,YAAY,EAAEH,kBAAS,CAACG,MAAM;EAC9B7E,SAAS,EAAE0E,kBAAS,CAACI,MAAM;EAC3B3E,KAAK,EAAEuE,kBAAS,CAACK,IAAI;EACrB1E,QAAQ,EAAEqE,kBAAS,CAACI,MAAM;EAC1B1E,OAAO,EAAEsE,kBAAS,CAACM,KAAK,CAAC;IACvBxE,OAAO,EAAEkE,kBAAS,CAACI,MAAM;IACzBrE,iBAAiB,EAAEiE,kBAAS,CAACI;EAC/B,CAAC,CAAC;EACFxE,IAAI,EAAEoE,kBAAS,CAACM,KAAK,CAAC;IACpBpE,KAAK,EAAE8D,kBAAS,CAACG,MAAM;IACvBhE,IAAI,EAAE6D,kBAAS,CAACG;EAClB,CAAC,CAAC;EACFtE,OAAO,EAAEmE,kBAAS,CAACO;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAvF,OAAA,CAAAzB,OAAA,GACa0B,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_provider","_progressBar","_colors","_getBackgroundGradientColor","_icon","_style","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MAX_SCORE","updateBackgroundImage","ref","background","current","style","backgroundImage","exports","LearnerSkillCard","props","context","ariaLabel","cardIndex","title","label","focus","metrics","progress","icon","onClick","content","questionsToReview","translate","GetTranslateFromContext","color","name","badgeIconName","badgeLocale","tagTextColor","tagBackgroundColor","COLORS","purple_700","purple_100","neutral_500","cm_grey_100","headerBackgroundRef","useRef","defaultBackground","useMemo","createGradientBackground","focusBackground","handleMouseEnter","useCallback","handleMouseLeave","createElement","className","learnerSkillCardContainer","onMouseEnter","onMouseLeave","iconHeaderWrapper","iconWrapper","iconName","iconColor","size","faSize","wrapperSize","borderRadius","gradientBackground","customStyle","border","learnerSkillCardContent","skillTitleWrapper","skillFocusBadge","backgroundColor","questionWrapper","skillTitle","contentAndQuestionsWrapper","dangerouslySetInnerHTML","__html","count","skillInformation","cm_grey_400","progressInformations","value","displayInfo","max","progressWrapper","cm_positive_500","contextTypes","Provider","childContextTypes","propTypes","process","env","NODE_ENV","type","PropTypes","oneOf","isRequired","string","number","bool","shape","func","_default"],"sources":["../../../src/molecule/learner-skill-card/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ProgressBar from '../progress-bar';\nimport {COLORS} from '../../variables/colors';\nimport {createGradientBackground} from '../../util/get-background-gradient-color';\nimport FaIcon from '../../atom/icon';\nimport style from './style.css';\n\nconst MAX_SCORE = 100;\n\nexport const updateBackgroundImage = (ref, background) => {\n if (ref.current) {\n ref.current.style.backgroundImage = background;\n }\n};\nconst LearnerSkillCard = (props, context) => {\n const {\n 'aria-label': ariaLabel,\n cardIndex,\n title,\n label,\n focus,\n metrics,\n progress = 0,\n icon,\n onClick\n } = props;\n const {content, questionsToReview = 0} = metrics;\n const translate = GetTranslateFromContext(context);\n const {color, name} = icon;\n const [badgeIconName, badgeLocale, tagTextColor, tagBackgroundColor] = focus\n ? ['bullseye-arrow', translate('skill_focus'), COLORS.purple_700, COLORS.purple_100]\n : ['shapes', translate('skill'), COLORS.neutral_500, COLORS.cm_grey_100];\n const headerBackgroundRef = useRef(null);\n const defaultBackground = useMemo(() => createGradientBackground(color, '93%', '100%'), [color]);\n const focusBackground = useMemo(() => createGradientBackground(color, '83%', '100%'), [color]);\n const handleMouseEnter = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, focusBackground);\n }, [focusBackground]);\n const handleMouseLeave = useCallback(() => {\n updateBackgroundImage(headerBackgroundRef, defaultBackground);\n }, [defaultBackground]);\n return (\n <div\n data-testid={`learner-skill-card-wrapper-${cardIndex}`}\n data-name={`skill-card-${label}`}\n onClick={onClick}\n className={style.learnerSkillCardContainer}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div\n data-testid=\"learner-skill-card-icon-header-wrapper\"\n ref={headerBackgroundRef}\n className={style.iconHeaderWrapper}\n style={{backgroundImage: defaultBackground, color: tagTextColor}}\n >\n <div className={style.iconWrapper} data-testid=\"learner-skill-card-icon-wrapper\">\n <FaIcon\n {...{\n iconName: name,\n iconColor: color,\n size: {\n faSize: 20,\n wrapperSize: 44\n },\n borderRadius: '12px',\n gradientBackground: true,\n customStyle: {border: '4px solid white'}\n }}\n />\n </div>\n </div>\n <div className={style.learnerSkillCardContent}>\n <div className={style.skillTitleWrapper}>\n <div\n className={style.skillFocusBadge}\n style={{\n backgroundColor: tagBackgroundColor,\n color: tagTextColor\n }}\n >\n <FaIcon\n {...{\n iconName: badgeIconName,\n backgroundColor: tagBackgroundColor,\n size: {\n faSize: 10,\n wrapperSize: 16\n }\n }}\n />\n <span style={{color: tagTextColor}}>{badgeLocale}</span>\n </div>\n\n <div className={style.questionWrapper}>\n <div\n data-name=\"skill-card-title\"\n className={style.skillTitle}\n aria-label={ariaLabel || title}\n >\n {title}\n </div>\n <div className={style.contentAndQuestionsWrapper}>\n <div\n data-name=\"learner-skill-card-skill-content-number\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: translate('content', {count: content})}}\n />\n {questionsToReview ? (\n <div\n className={style.skillInformation}\n data-name=\"learner-skill-card-skill-questions-wrapper\"\n >\n <FaIcon\n {...{\n iconName: 'circle',\n iconColor: COLORS.cm_grey_400,\n backgroundColor: 'transparent',\n size: {faSize: 4, wrapperSize: 0}\n }}\n />\n <span\n data-name=\"learner-skill-card-questions-to-review\"\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: translate('skill_chart_side_panel_questions_to_review', {\n count: questionsToReview\n })\n }}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n <div className={style.progressInformations}>\n <ProgressBar\n value={progress}\n displayInfo={false}\n max={MAX_SCORE}\n className={style.progressWrapper}\n style={{backgroundColor: COLORS.cm_positive_500}}\n />\n </div>\n </div>\n );\n};\n\nLearnerSkillCard.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nLearnerSkillCard.propTypes = {\n type: PropTypes.oneOf(['skill']).isRequired,\n title: PropTypes.string.isRequired,\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n cardIndex: PropTypes.number,\n focus: PropTypes.bool,\n progress: PropTypes.number,\n metrics: PropTypes.shape({\n content: PropTypes.number,\n questionsToReview: PropTypes.number\n }),\n icon: PropTypes.shape({\n color: PropTypes.string,\n name: PropTypes.string\n }),\n onClick: PropTypes.func\n};\nexport default LearnerSkillCard;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,2BAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAA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AAC,CAAC;EACFxE,IAAI,EAAEoE,kBAAS,CAACM,KAAK,CAAC;IACpBpE,KAAK,EAAE8D,kBAAS,CAACG,MAAM;IACvBhE,IAAI,EAAE6D,kBAAS,CAACG;EAClB,CAAC,CAAC;EACFtE,OAAO,EAAEmE,kBAAS,CAACO;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAvF,OAAA,CAAAzB,OAAA,GACa0B,gBAAgB","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  @value cm_grey_100 from colors;
4
4
  @value cm_grey_400 from colors;
5
5
  @value cm_grey_500 from colors;
6
+ @value cm_grey_700 from colors;
6
7
  @value cm_grey_75 from colors;
7
8
 
8
9
  .container {
@@ -46,14 +47,14 @@
46
47
  left: 0;
47
48
  width: 100%;
48
49
  height: 160px;
49
- background: #1d1d2b80;
50
+ background: color(cm_grey_700 a(50%));
50
51
  border-top-right-radius: 12px;
51
52
  border-top-left-radius: 12px;
52
53
  transition: all 0.5s ease-out;
53
54
  }
54
55
 
55
56
  .container:hover .imageContainer::after {
56
- background: #1d1d2b00;
57
+ background: color(cm_grey_700 a(0%));
57
58
  }
58
59
  .container:hover {
59
60
  box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.10);
@@ -78,6 +78,66 @@ declare namespace SearchPage {
78
78
  filterGroupAriaLabel: PropTypes.Requireable<string>;
79
79
  sortAriaLabel: PropTypes.Requireable<string>;
80
80
  }>>;
81
+ const quickFilters: PropTypes.Requireable<PropTypes.InferProps<{
82
+ primaryOption: PropTypes.Requireable<PropTypes.InferProps<{
83
+ defaultLabel: PropTypes.Requireable<string>;
84
+ defaultValue: PropTypes.Requireable<string>;
85
+ defaultIconName: PropTypes.Requireable<string>;
86
+ defaultSelected: PropTypes.Requireable<boolean>;
87
+ defaultAriaLabel: PropTypes.Requireable<string>;
88
+ onDefaultClick: PropTypes.Requireable<(...args: any[]) => any>;
89
+ }>>;
90
+ nextFilterAriaLabel: PropTypes.Requireable<string>;
91
+ previousFilterAriaLabel: PropTypes.Requireable<string>;
92
+ filterOptionsAriaLabel: PropTypes.Requireable<string>;
93
+ filterOptions: PropTypes.Requireable<(PropTypes.InferProps<{
94
+ iconName: PropTypes.Requireable<string>;
95
+ label: PropTypes.Requireable<string>;
96
+ value: PropTypes.Requireable<string>;
97
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
98
+ selected: PropTypes.Requireable<boolean>;
99
+ ariaLabel: PropTypes.Requireable<string>;
100
+ }> | null | undefined)[]>;
101
+ filterButton: PropTypes.Requireable<PropTypes.InferProps<{
102
+ type: PropTypes.Requireable<string>;
103
+ usage: PropTypes.Requireable<string>;
104
+ label: PropTypes.Requireable<string>;
105
+ content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
106
+ 'aria-label': PropTypes.Requireable<string>;
107
+ tooltipText: PropTypes.Requireable<string>;
108
+ tooltipPlacement: PropTypes.Requireable<string>;
109
+ 'data-name': PropTypes.Requireable<string>;
110
+ 'data-testid': PropTypes.Requireable<string>;
111
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
112
+ position: PropTypes.Requireable<string>;
113
+ type: PropTypes.Requireable<string>;
114
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
115
+ name: PropTypes.Validator<string>;
116
+ color: PropTypes.Requireable<string>;
117
+ backgroundColor: PropTypes.Requireable<string>;
118
+ size: PropTypes.Requireable<number>;
119
+ customStyle: PropTypes.Requireable<{
120
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
121
+ }>;
122
+ }>>;
123
+ }>>;
124
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
125
+ link: PropTypes.Requireable<PropTypes.InferProps<{
126
+ href: PropTypes.Requireable<string>;
127
+ download: PropTypes.Requireable<boolean>;
128
+ target: PropTypes.Requireable<string>;
129
+ }>>;
130
+ hoverBackgroundColor: PropTypes.Requireable<string>;
131
+ hoverColor: PropTypes.Requireable<string>;
132
+ disabled: PropTypes.Requireable<boolean>;
133
+ className: PropTypes.Requireable<string>;
134
+ customStyle: PropTypes.Requireable<{
135
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
136
+ }>;
137
+ useTitle: PropTypes.Requireable<boolean>;
138
+ customLabelClassName: PropTypes.Requireable<string>;
139
+ }>>;
140
+ }>>;
81
141
  const cards: PropTypes.Requireable<PropTypes.InferProps<{
82
142
  list: PropTypes.Requireable<((PropTypes.InferPropsInner<Pick<any, any>> & Partial<PropTypes.InferPropsInner<Pick<any, never>>>) | null | undefined)[]>;
83
143
  customStyle: PropTypes.Requireable<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAkBA,mEAiJC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/template/common/search-page/index.js"],"names":[],"mappings":";AAmBA,mEAoJC"}
@@ -2,6 +2,10 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
+ var _sortBy2 = _interopRequireDefault(require("lodash/fp/sortBy"));
6
+ var _size2 = _interopRequireDefault(require("lodash/fp/size"));
7
+ var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
8
+ var _map2 = _interopRequireDefault(require("lodash/fp/map"));
5
9
  var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
6
10
  var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
7
11
  var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
@@ -20,6 +24,7 @@ var _tag = _interopRequireDefault(require("../../../atom/tag"));
20
24
  var _card = require("../../../molecule/card");
21
25
  var _learningPriorityCard = _interopRequireDefault(require("../../../molecule/learning-priority-card"));
22
26
  var _colors = require("../../../variables/colors");
27
+ var _quickFilters = _interopRequireDefault(require("../../../molecule/quick-filters"));
23
28
  var _style = _interopRequireDefault(require("./style.css"));
24
29
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
30
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -29,6 +34,7 @@ const SearchPage = (props, context) => {
29
34
  const {
30
35
  title,
31
36
  searchFilters,
37
+ quickFilters,
32
38
  cards,
33
39
  count,
34
40
  noresultsfound,
@@ -109,12 +115,11 @@ const SearchPage = (props, context) => {
109
115
  }))), recommendationsView) : /*#__PURE__*/_react.default.createElement(_cardsGrid.default, cards);
110
116
 
111
117
  // Convert sections object to array and sort by order
112
- const sectionsArray = (0, _keys2.default)(sections).map(key => ({
118
+ const sortedSections = (0, _pipe2.default)(_keys2.default, (0, _map2.default)(key => ({
113
119
  key,
114
120
  ...sections[key]
115
- }));
116
- const sortedSections = sectionsArray.sort((a, b) => a.order - b.order);
117
- const hasSections = sortedSections.length > 0;
121
+ })), (0, _sortBy2.default)('order'))(sections);
122
+ const hasSections = (0, _size2.default)(sortedSections) > 0;
118
123
  const contentGridSection = /*#__PURE__*/_react.default.createElement("div", {
119
124
  className: _style.default.contentSection
120
125
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -132,12 +137,15 @@ const SearchPage = (props, context) => {
132
137
  })), /*#__PURE__*/_react.default.createElement("div", {
133
138
  className: _style.default.contentGrid
134
139
  }, " ", cardsView)));
135
- return /*#__PURE__*/_react.default.createElement("div", null, searchFilters ? /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
140
+ return /*#__PURE__*/_react.default.createElement("div", {
141
+ "data-name": "filters",
142
+ className: quickFilters ? _style.default.quickFilters : null
143
+ }, searchFilters ? /*#__PURE__*/_react.default.createElement(_filters.default, _extends({}, searchFilters, {
136
144
  moreSortAriaLabel: moreSortAriaLabel,
137
145
  moreFilterAriaLabel: moreFilterAriaLabel,
138
146
  filterGroupAriaLabel: filterGroupAriaLabel,
139
147
  sortAriaLabel: sortAriaLabel
140
- })) : null, hasSections ? /*#__PURE__*/_react.default.createElement("div", {
148
+ })) : /*#__PURE__*/_react.default.createElement(_quickFilters.default, quickFilters), hasSections ? /*#__PURE__*/_react.default.createElement("div", {
141
149
  "data-name": "explorerSections",
142
150
  className: _style.default.sectionsWrapper
143
151
  }, sortedSections.map((section, index) => /*#__PURE__*/_react.default.createElement("div", {
@@ -161,6 +169,7 @@ SearchPage.propTypes = process.env.NODE_ENV !== "production" ? {
161
169
  noresultsfound: _propTypes.default.string,
162
170
  title: _propTypes.default.string,
163
171
  searchFilters: _propTypes.default.shape(_filters.default.propTypes),
172
+ quickFilters: _propTypes.default.shape(_quickFilters.default.propTypes),
164
173
  cards: _propTypes.default.shape(_cardsGrid.default.propTypes),
165
174
  count: _propTypes.default.number,
166
175
  clearFilters: _propTypes.default.shape(_button.default.propTypes),