@coorpacademy/components 11.33.3 → 11.33.5-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/autocomplete/index.js +2 -2
- package/es/atom/autocomplete/index.js.map +1 -1
- package/es/atom/autocomplete/style.css +4 -4
- package/es/atom/battle-opponent/index.js +1 -1
- package/es/atom/battle-opponent/index.js.map +1 -1
- package/es/atom/battle-opponent/style.css +7 -7
- package/es/atom/button-link-icon/index.js +1 -1
- package/es/atom/button-link-icon/index.js.map +1 -1
- package/es/atom/button-link-icon/style.css +2 -2
- package/es/atom/button-menu/index.js +1 -1
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +4 -4
- package/es/atom/input-checkbox/index.d.ts.map +1 -1
- package/es/atom/input-checkbox/index.js +1 -1
- package/es/atom/input-checkbox/index.js.map +1 -1
- package/es/atom/input-checkbox/style.css +12 -12
- package/es/atom/input-color/index.js +1 -1
- package/es/atom/input-color/index.js.map +1 -1
- package/es/atom/input-color/style.css +3 -3
- package/es/atom/input-html/index.js +1 -1
- package/es/atom/input-html/index.js.map +1 -1
- package/es/atom/input-html/style.css +3 -3
- package/es/atom/input-switch/index.js +1 -1
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +6 -6
- package/es/atom/input-text/index.js +2 -2
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text/style.css +4 -4
- package/es/atom/input-textarea/index.js +2 -2
- package/es/atom/input-textarea/index.js.map +1 -1
- package/es/atom/input-textarea/style.css +5 -5
- package/es/atom/label/index.js +1 -1
- package/es/atom/label/index.js.map +1 -1
- package/es/atom/label/style.css +1 -1
- package/es/atom/life/index.js +1 -1
- package/es/atom/life/index.js.map +1 -1
- package/es/atom/life/style.css +1 -1
- package/es/atom/picture-background/index.js +1 -1
- package/es/atom/picture-background/index.js.map +1 -1
- package/es/atom/picture-background/style.css +1 -1
- package/es/atom/range/handle.css +1 -1
- package/es/atom/range/handle.js +1 -1
- package/es/atom/range/handle.js.map +1 -1
- package/es/atom/select/index.js +1 -1
- package/es/atom/select/index.js.map +1 -1
- package/es/atom/select/style.css +13 -13
- package/es/atom/select-icon/index.js +1 -1
- package/es/atom/select-icon/index.js.map +1 -1
- package/es/atom/select-icon/style.css +1 -1
- package/es/atom/status-item/index.js +1 -1
- package/es/atom/status-item/index.js.map +1 -1
- package/es/atom/status-item/style.css +1 -1
- package/es/atom/tag/index.js +1 -1
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/tag/style.css +1 -1
- package/es/molecule/brand-create-form/index.js +1 -1
- package/es/molecule/brand-create-form/index.js.map +1 -1
- package/es/molecule/brand-create-form/style.css +4 -4
- package/es/molecule/brand-upload-box/index.js +1 -1
- package/es/molecule/brand-upload-box/index.js.map +1 -1
- package/es/molecule/brand-upload-box/style.css +3 -3
- package/es/molecule/card/customer.css +2 -2
- package/es/molecule/card/customer.d.ts +1 -1
- package/es/molecule/card/customer.js +1 -1
- package/es/molecule/card/customer.js.map +1 -1
- package/es/molecule/card/index.d.ts +1 -1
- package/es/molecule/card/index.js +1 -1
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +19 -19
- package/es/molecule/filters/index.js +1 -1
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/filters/style.css +4 -4
- package/es/molecule/hero/index.js +1 -1
- package/es/molecule/hero/index.js.map +1 -1
- package/es/molecule/hero/style.css +10 -10
- package/es/molecule/module-card/index.js +1 -1
- package/es/molecule/module-card/index.js.map +1 -1
- package/es/molecule/module-card/style.css +3 -3
- package/es/molecule/select-multiple/index.js +2 -2
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/style.css +5 -5
- package/es/molecule/theme-image/index.js +1 -1
- package/es/molecule/theme-image/index.js.map +1 -1
- package/es/molecule/theme-image/style.css +4 -4
- package/es/molecule/titled-checkbox/index.js +1 -1
- package/es/molecule/titled-checkbox/index.js.map +1 -1
- package/es/molecule/titled-checkbox/style.css +1 -1
- package/es/organism/brand-analytics/analytics-popin.css +1 -1
- package/es/organism/brand-analytics/analytics-popin.js +1 -1
- package/es/organism/brand-analytics/analytics-popin.js.map +1 -1
- package/es/organism/cards-grid/index.js +1 -1
- package/es/organism/cards-grid/index.js.map +1 -1
- package/es/organism/cards-grid/style.css +1 -1
- package/es/organism/popin/index.js +1 -1
- package/es/organism/popin/index.js.map +1 -1
- package/es/organism/popin/style.css +1 -1
- package/es/organism/resource-browser/index.js +1 -1
- package/es/organism/resource-browser/index.js.map +1 -1
- package/es/organism/resource-browser/style.css +2 -2
- package/es/template/activity/index.js +1 -1
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/style.css +2 -2
- package/es/template/back-office/dashboard-preview/dashboard-popin.css +1 -1
- package/es/template/back-office/dashboard-preview/dashboard-popin.js +1 -1
- package/es/template/back-office/dashboard-preview/dashboard-popin.js.map +1 -1
- package/es/template/external-course/index.js +2 -2
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/external-course/style.css +2 -2
- package/lib/atom/autocomplete/index.js +2 -2
- package/lib/atom/autocomplete/index.js.map +1 -1
- package/lib/atom/autocomplete/style.css +4 -4
- package/lib/atom/battle-opponent/index.js +1 -1
- package/lib/atom/battle-opponent/index.js.map +1 -1
- package/lib/atom/battle-opponent/style.css +7 -7
- package/lib/atom/button-link-icon/index.js +1 -1
- package/lib/atom/button-link-icon/index.js.map +1 -1
- package/lib/atom/button-link-icon/style.css +2 -2
- package/lib/atom/button-menu/index.js +1 -1
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +4 -4
- package/lib/atom/input-checkbox/index.d.ts.map +1 -1
- package/lib/atom/input-checkbox/index.js +1 -1
- package/lib/atom/input-checkbox/index.js.map +1 -1
- package/lib/atom/input-checkbox/style.css +12 -12
- package/lib/atom/input-color/index.js +1 -1
- package/lib/atom/input-color/index.js.map +1 -1
- package/lib/atom/input-color/style.css +3 -3
- package/lib/atom/input-html/index.js +1 -1
- package/lib/atom/input-html/index.js.map +1 -1
- package/lib/atom/input-html/style.css +3 -3
- package/lib/atom/input-switch/index.js +1 -1
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +6 -6
- package/lib/atom/input-text/index.js +2 -2
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text/style.css +4 -4
- package/lib/atom/input-textarea/index.js +2 -2
- package/lib/atom/input-textarea/index.js.map +1 -1
- package/lib/atom/input-textarea/style.css +5 -5
- package/lib/atom/label/index.js +1 -1
- package/lib/atom/label/index.js.map +1 -1
- package/lib/atom/label/style.css +1 -1
- package/lib/atom/life/index.js +1 -1
- package/lib/atom/life/index.js.map +1 -1
- package/lib/atom/life/style.css +1 -1
- package/lib/atom/picture-background/index.js +1 -1
- package/lib/atom/picture-background/index.js.map +1 -1
- package/lib/atom/picture-background/style.css +1 -1
- package/lib/atom/range/handle.css +1 -1
- package/lib/atom/range/handle.js +1 -1
- package/lib/atom/range/handle.js.map +1 -1
- package/lib/atom/select/index.js +1 -1
- package/lib/atom/select/index.js.map +1 -1
- package/lib/atom/select/style.css +13 -13
- package/lib/atom/select-icon/index.js +1 -1
- package/lib/atom/select-icon/index.js.map +1 -1
- package/lib/atom/select-icon/style.css +1 -1
- package/lib/atom/status-item/index.js +1 -1
- package/lib/atom/status-item/index.js.map +1 -1
- package/lib/atom/status-item/style.css +1 -1
- package/lib/atom/tag/index.js +1 -1
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/tag/style.css +1 -1
- package/lib/molecule/brand-create-form/index.js +1 -1
- package/lib/molecule/brand-create-form/index.js.map +1 -1
- package/lib/molecule/brand-create-form/style.css +4 -4
- package/lib/molecule/brand-upload-box/index.js +1 -1
- package/lib/molecule/brand-upload-box/index.js.map +1 -1
- package/lib/molecule/brand-upload-box/style.css +3 -3
- package/lib/molecule/card/customer.css +2 -2
- package/lib/molecule/card/customer.d.ts +1 -1
- package/lib/molecule/card/customer.js +1 -1
- package/lib/molecule/card/customer.js.map +1 -1
- package/lib/molecule/card/index.d.ts +1 -1
- package/lib/molecule/card/index.js +1 -1
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +19 -19
- package/lib/molecule/filters/index.js +1 -1
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/filters/style.css +4 -4
- package/lib/molecule/hero/index.js +1 -1
- package/lib/molecule/hero/index.js.map +1 -1
- package/lib/molecule/hero/style.css +10 -10
- package/lib/molecule/module-card/index.js +1 -1
- package/lib/molecule/module-card/index.js.map +1 -1
- package/lib/molecule/module-card/style.css +3 -3
- package/lib/molecule/select-multiple/index.js +2 -2
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/style.css +5 -5
- package/lib/molecule/theme-image/index.js +1 -1
- package/lib/molecule/theme-image/index.js.map +1 -1
- package/lib/molecule/theme-image/style.css +4 -4
- package/lib/molecule/titled-checkbox/index.js +1 -1
- package/lib/molecule/titled-checkbox/index.js.map +1 -1
- package/lib/molecule/titled-checkbox/style.css +1 -1
- package/lib/organism/brand-analytics/analytics-popin.css +1 -1
- package/lib/organism/brand-analytics/analytics-popin.js +1 -1
- package/lib/organism/brand-analytics/analytics-popin.js.map +1 -1
- package/lib/organism/cards-grid/index.js +1 -1
- package/lib/organism/cards-grid/index.js.map +1 -1
- package/lib/organism/cards-grid/style.css +1 -1
- package/lib/organism/popin/index.js +1 -1
- package/lib/organism/popin/index.js.map +1 -1
- package/lib/organism/popin/style.css +1 -1
- package/lib/organism/resource-browser/index.js +1 -1
- package/lib/organism/resource-browser/index.js.map +1 -1
- package/lib/organism/resource-browser/style.css +2 -2
- package/lib/template/activity/index.js +1 -1
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/style.css +2 -2
- package/lib/template/back-office/dashboard-preview/dashboard-popin.css +1 -1
- package/lib/template/back-office/dashboard-preview/dashboard-popin.js +1 -1
- package/lib/template/back-office/dashboard-preview/dashboard-popin.js.map +1 -1
- package/lib/template/external-course/index.js +2 -2
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/external-course/style.css +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","createElement","_extends","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","key","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","onClick","onBlur","onMouseLeave","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,IAAI,MAAM,gBAAgB;AACjC,SACEC,kCAAkC,IAAIC,SAAS,EAC/CC,iCAAiC,IAAIC,OAAO,QACvC,0BAA0B;AACjC,OAAOC,QAAQ,IAAGC,kBAAkB,QAAO,aAAa;AACxD,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBlB,MAAM,EAAEiB,KAAK,CAACjB,MAAM;EACpBmB,OAAO,EAAEF,KAAK,CAACE,OAAO;EACtBC,MAAM,EAAEH,KAAK,CAACG,M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AS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACF,0BAA0B,CAAC,CAAC;EACzErD,QAAQ,EAAEvD,SAAS,CAAC2G,IAAI;EACxBnD,KAAK,EAAExD,SAAS,CAAC2G,IAAI;EACrB,YAAY,EAAE3G,SAAS,CAACuG,MAAM;EAC9B,iBAAiB,EAAEvG,SAAS,CAACuG;AAC/B,CAAC;AAED,eAAe5D,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","PropTypes","classnames","concat","filter","find","flatMapDeep","get","getOr","includes","isEmpty","keys","map","size","NovaCompositionNavigationArrowDown","ArrowDown","NovaCompositionNavigationArrowTop","ArrowUp","Provider","GetSkinFromContext","getClassState","style","themeStyle","invalid","header","mooc","question","sort","thematiques","player","template","skillDetail","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","color","className","createElement","_extends","Select","legacyContext","name","options","optgroups","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabelledBy","skin","setIsArrowUp","handleSelectOnFocus","handleSelectOnBlur","selectOption","option","index","key","value","optionList","optgroup","label","i","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","shouldUseSkinFontColor","undefined","behaviorClassName","defaultStyle","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","onClick","onBlur","onMouseLeave","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","SelectOptionGroupPropTypes","arrayOf","shape","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","func","oneOf"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport concat from 'lodash/fp/concat';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport flatMapDeep from 'lodash/fp/flatMapDeep';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n skillDetail: style.skillDetail,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n optgroups = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const selectOption = (option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n };\n\n const optionList = !isEmpty(options)\n ? options.map((option, index) => selectOption(option, index))\n : optgroups.map((optgroup, index) => {\n return (\n <optgroup key={index} label={optgroup.label}>\n {optgroup.options && optgroup.options.map((option, i) => selectOption(option, i))}\n </optgroup>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title}</span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, concat(options, flatMapDeep('options', optgroups)))),\n [multiple, options, optgroups]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.defaultStyle, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-testid=\"select-wrapper\"\n data-name=\"select-wrapper\"\n title={title}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-testid=\"select-span\"\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, [\n 'player',\n 'invalid',\n 'question',\n 'thematiques',\n 'template',\n 'skillDetail'\n ])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(ariaLabel && !ariaLabelledBy ? {'aria-label': ariaLabel} : {})}\n {...(ariaLabel ? {title: ariaLabel} : {})}\n data-name=\"native-select\"\n className={style.selectBox}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nexport const SelectOptionGroupPropTypes = {\n label: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes))\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n optgroups: PropTypes.arrayOf(PropTypes.shape(SelectOptionGroupPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,MAAM,MAAM,kBAAkB;AACrC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,QAAQ,MAAM,oBAAoB;AACzC,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,IAAI,MAAM,gBAAgB;AACjC,SACEC,kCAAkC,IAAIC,SAAS,EAC/CC,iCAAiC,IAAIC,OAAO,QACvC,0BAA0B;AACjC,OAAOC,QAAQ,IAAGC,kBAAkB,QAAO,aAAa;AACxD,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,K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C5G,IAAI,CAACW,UAAU,CAAC,CAAC;EACxCyB,OAAO,EAAE9C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACR,qBAAqB,CAAC,CAAC;EAClEvD,SAAS,EAAE/C,SAAS,CAAC6G,OAAO,CAAC7G,SAAS,CAAC8G,KAAK,CAACF,0BAA0B,CAAC,CAAC;EACzErD,QAAQ,EAAEvD,SAAS,CAAC2G,IAAI;EACxBnD,KAAK,EAAExD,SAAS,CAAC2G,IAAI;EACrB,YAAY,EAAE3G,SAAS,CAACuG,MAAM;EAC9B,iBAAiB,EAAEvG,SAAS,CAACuG;AAC/B,CAAC;AAED,eAAe5D,MAAM","ignoreList":[]}
|
package/es/atom/select/style.css
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
@value cm_blue_900 from colors;
|
|
18
18
|
@value cm_grey_450 from colors;
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.defaultStyle {
|
|
21
21
|
display: flex;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.coorpmanager {
|
|
25
|
-
composes:
|
|
25
|
+
composes: defaultStyle;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
div.coorpmanager label.selectWrapper {
|
|
@@ -51,18 +51,18 @@ div.coorpmanager label.selectWrapper {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
.error {
|
|
54
|
-
composes:
|
|
54
|
+
composes: defaultStyle;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.modified {
|
|
58
|
-
composes:
|
|
58
|
+
composes: defaultStyle;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.selectWrapper {
|
|
62
62
|
position: relative;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.
|
|
65
|
+
.defaultStyle .selectWrapper {
|
|
66
66
|
display: flex;
|
|
67
67
|
align-items: center;
|
|
68
68
|
height: 50px;
|
|
@@ -94,7 +94,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
94
94
|
text-overflow: ellipsis;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.defaultStyle .selectBox {
|
|
98
98
|
font-family: "Gilroy";
|
|
99
99
|
text-transform: none;
|
|
100
100
|
padding: 0 15px;
|
|
@@ -155,7 +155,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
155
155
|
margin: auto 0;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
.
|
|
158
|
+
.defaultStyle select:focus::-ms-value {
|
|
159
159
|
background-color: transparent; /* make the select background transparent in ie */
|
|
160
160
|
color: dark;
|
|
161
161
|
}
|
|
@@ -194,7 +194,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
.
|
|
197
|
+
.defaultStyle .selectBox[multiple] {
|
|
198
198
|
padding: 0;
|
|
199
199
|
height: 80px;
|
|
200
200
|
}
|
|
@@ -257,7 +257,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
257
257
|
*/
|
|
258
258
|
|
|
259
259
|
.no-label {
|
|
260
|
-
composes:
|
|
260
|
+
composes: defaultStyle;
|
|
261
261
|
position: relative;
|
|
262
262
|
}
|
|
263
263
|
|
|
@@ -278,7 +278,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
278
278
|
box-sizing: border-box;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
div.
|
|
281
|
+
div.defaultStyle label.selectWrapper span.longLabel {
|
|
282
282
|
min-width: 230px;
|
|
283
283
|
max-width: 280px;
|
|
284
284
|
white-space: pre-wrap;
|
|
@@ -367,7 +367,7 @@ div.player:hover span.selectSpan {
|
|
|
367
367
|
height: 100%;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
.player.
|
|
370
|
+
.player.defaultStyle .selectBox {
|
|
371
371
|
position: absolute;
|
|
372
372
|
top: 0px;
|
|
373
373
|
left: 0px;
|
|
@@ -407,7 +407,7 @@ div.player:hover span.selectSpan {
|
|
|
407
407
|
*/
|
|
408
408
|
|
|
409
409
|
.mooc {
|
|
410
|
-
composes:
|
|
410
|
+
composes: defaultStyle;
|
|
411
411
|
width: 150px;
|
|
412
412
|
}
|
|
413
413
|
|
|
@@ -552,7 +552,7 @@ div.player:hover span.selectSpan {
|
|
|
552
552
|
margin-left: 0;
|
|
553
553
|
}
|
|
554
554
|
|
|
555
|
-
.
|
|
555
|
+
.defaultStyle .selectWrapper select.selectBox {
|
|
556
556
|
width: inherit;
|
|
557
557
|
border-radius: 8px;
|
|
558
558
|
padding: 0;
|
|
@@ -61,7 +61,7 @@ const SelectIcon = props => {
|
|
|
61
61
|
isSelected = false
|
|
62
62
|
} = options;
|
|
63
63
|
const contentView = getButtonContent(faIcon, options);
|
|
64
|
-
const styleButton = classnames(style.
|
|
64
|
+
const styleButton = classnames(style.defaultStyle, isSelected && style.selected);
|
|
65
65
|
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
66
66
|
const IconButton = useCallback(() => /*#__PURE__*/React.createElement("button", {
|
|
67
67
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","classnames","FaIcon","COLORS","style","ICON_COLOR","cm_primary_blue","BACKGROUND_COLOR","white","CHECK_ICON_NAME_MAP","single","multi","getButtonContent","faIcon","options","selectionMode","isSelected","iconColor","createElement","className","contentWrapper","checkIcon","iconName","backgroundColor","size","faSize","wrapperSize","iconWrapper","icon","iconText","SelectIcon","props","dataName","ariaLabel","onClick","contentView","styleButton","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","PropTypes","classnames","FaIcon","COLORS","style","ICON_COLOR","cm_primary_blue","BACKGROUND_COLOR","white","CHECK_ICON_NAME_MAP","single","multi","getButtonContent","faIcon","options","selectionMode","isSelected","iconColor","createElement","className","contentWrapper","checkIcon","iconName","backgroundColor","size","faSize","wrapperSize","iconWrapper","icon","iconText","SelectIcon","props","dataName","ariaLabel","onClick","contentView","styleButton","defaultStyle","selected","handleOnClick","IconButton","type","propTypes","process","env","NODE_ENV","string","func","shape","oneOf","bool"],"sources":["../../../src/atom/select-icon/index.js"],"sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport FaIcon from '../icon';\n\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ICON_COLOR = COLORS.cm_primary_blue;\nconst BACKGROUND_COLOR = COLORS.white;\nconst CHECK_ICON_NAME_MAP = {\n single: 'circle-check',\n multi: 'square-check'\n};\n\nconst getButtonContent = (faIcon, options = {}) => {\n const {selectionMode = 'single', isSelected = false, iconColor = ICON_COLOR} = options;\n\n return (\n <div className={style.contentWrapper}>\n {isSelected ? (\n /* checkbox icon */\n <div className={style.checkIcon}>\n <FaIcon\n iconName={CHECK_ICON_NAME_MAP[selectionMode]}\n iconColor={iconColor}\n backgroundColor={BACKGROUND_COLOR}\n size={{faSize: 16, wrapperSize: 16}}\n />\n </div>\n ) : null}\n {\n /* selection tick (L18) / icon */\n <div className={style.iconWrapper}>\n <div className={style.icon}>\n <FaIcon\n iconName={faIcon}\n iconColor={isSelected ? iconColor : ''}\n size={{faSize: 32, wrapperSize: 32}}\n />\n </div>\n <div className={style.iconText}>{faIcon}</div>\n </div>\n }\n </div>\n );\n};\n\nconst SelectIcon = props => {\n const {faIcon, 'data-name': dataName, 'aria-label': ariaLabel, onClick, options = {}} = props;\n\n const {isSelected = false} = options;\n\n const contentView = getButtonContent(faIcon, options);\n const styleButton = classnames(style.defaultStyle, isSelected && style.selected);\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const IconButton = useCallback(\n () => (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}`}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n ),\n [ariaLabel, contentView, dataName, handleOnClick, styleButton]\n );\n\n return <IconButton />;\n};\n\nSelectIcon.propTypes = {\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n faIcon: PropTypes.string,\n onClick: PropTypes.func,\n options: PropTypes.shape({\n selectionMode: PropTypes.oneOf(['single', 'multi']),\n isSelected: PropTypes.bool,\n iconColor: PropTypes.string\n })\n};\n\nexport default SelectIcon;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,QAAO,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,SAAS;AAE5B,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAGF,MAAM,CAACG,eAAe;AACzC,MAAMC,gBAAgB,GAAGJ,MAAM,CAACK,KAAK;AACrC,MAAMC,mBAAmB,GAAG;EAC1BC,MAAM,EAAE,cAAc;EACtBC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAACC,MAAM,EAAEC,OAAO,GAAG,CAAC,CAAC,KAAK;EACjD,MAAM;IAACC,aAAa,GAAG,QAAQ;IAAEC,UAAU,GAAG,KAAK;IAAEC,SAAS,GAAGZ;EAAU,CAAC,GAAGS,OAAO;EAEtF,oBACEhB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAEf,KAAK,CAACgB;EAAe,GAClCJ,UAAU;EAAA;EACT;EACAlB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAEf,KAAK,CAACiB;EAAU,gBAC9BvB,KAAA,CAAAoB,aAAA,CAAChB,MAAM;IACLoB,QAAQ,EAAEb,mBAAmB,CAACM,aAAa,CAAE;IAC7CE,SAAS,EAAEA,SAAU;IACrBM,eAAe,EAAEhB,gBAAiB;IAClCiB,IAAI,EAAE;MAACC,MAAM,EAAE,EAAE;MAAEC,WAAW,EAAE;IAAE;EAAE,CACrC,CACE,CAAC,GACJ,IAAI;EAAA;EAEN;EACA5B,KAAA,CAAAoB,aAA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Q,EAAEO,aAAa,EAAEH,WAAW,CAC/D,CAAC;EAED,oBAAOtC,KAAA,CAAAoB,aAAA,CAACsB,UAAU,MAAE,CAAC;AACvB,CAAC;AAEDV,UAAU,CAACY,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACrB,YAAY,EAAE7C,SAAS,CAAC8C,MAAM;EAC9B,WAAW,EAAE9C,SAAS,CAAC8C,MAAM;EAC7BjC,MAAM,EAAEb,SAAS,CAAC8C,MAAM;EACxBZ,OAAO,EAAElC,SAAS,CAAC+C,IAAI;EACvBjC,OAAO,EAAEd,SAAS,CAACgD,KAAK,CAAC;IACvBjC,aAAa,EAAEf,SAAS,CAACiD,KAAK,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnDjC,UAAU,EAAEhB,SAAS,CAACkD,IAAI;IAC1BjC,SAAS,EAAEjB,SAAS,CAAC8C;EACvB,CAAC;AACH,CAAC;AAED,eAAehB,UAAU","ignoreList":[]}
|
|
@@ -79,7 +79,7 @@ const StatusItem = props => {
|
|
|
79
79
|
selected
|
|
80
80
|
} = props;
|
|
81
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: classnames(style.
|
|
82
|
+
className: classnames(style.defaultStyle, icon === 'right' && style.right, icon === 'wrong' && style.wrong, current && style.current, icon === 'valid' && style.valid, icon === 'invalid' && style.invalid, icon === 'errors-number' && style.errorsNumber, selected && style.selected),
|
|
83
83
|
"data-name": "status-item"
|
|
84
84
|
}, /*#__PURE__*/React.createElement(Content, props));
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","Provider","GetTranslateFromContext","style","propTypes","Content","props","legacyContext","icon","current","value","translate","child","contentAriaLabel","headerStepValue","createElement","className","rightIcon","currentRightIcon","role","wrongIcon","currentWrongIcon","bulkImportErrorsNumber","validIcon","invalidIcon","_extends","StatusItem","selected","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","Provider","GetTranslateFromContext","style","propTypes","Content","props","legacyContext","icon","current","value","translate","child","contentAriaLabel","headerStepValue","createElement","className","rightIcon","currentRightIcon","role","wrongIcon","currentWrongIcon","bulkImportErrorsNumber","validIcon","invalidIcon","_extends","StatusItem","selected","defaultStyle","right","wrong","valid","invalid","errorsNumber","process","env","NODE_ENV","contextTypes","skin","childContextTypes"],"sources":["../../../src/atom/status-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport style from './style.css';\nimport propTypes, {StatusItemProps} from './types';\n\nconst Content = (props: StatusItemProps, legacyContext: WebContextValues) => {\n const {icon, current, value} = props;\n const translate = GetTranslateFromContext(legacyContext);\n let child;\n let contentAriaLabel;\n switch (icon) {\n case 'no-answer':\n child = value;\n contentAriaLabel = translate('review_header_step_item.not_answered_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n });\n break;\n\n case 'right':\n child = (\n <RightIcon\n className={classnames(style.rightIcon, current && style.currentRightIcon)}\n role=\"status\"\n aria-label={translate('review_header_step_item.correct_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n })}\n />\n );\n break;\n\n case 'wrong':\n child = (\n <WrongIcon\n className={classnames(style.wrongIcon, current && style.currentWrongIcon)}\n role=\"alert\"\n aria-label={translate('review_header_step_item.incorrect_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n })}\n />\n );\n break;\n\n case 'errors-number':\n child = value;\n contentAriaLabel = translate('bulk_import.errors_number', {\n bulkImportErrorsNumber: value\n });\n break;\n\n case 'valid':\n child = (\n <RightIcon\n className={classnames(style.validIcon)}\n role=\"status\"\n aria-label={translate('bulk_import.valid_scorm')}\n />\n );\n break;\n\n case 'invalid':\n child = (\n <WrongIcon\n className={classnames(style.invalidIcon)}\n role=\"alert\"\n aria-label={translate('bulk_import.invalid_scorm')}\n />\n );\n break;\n\n default:\n return null;\n }\n\n return (\n <span\n {...(icon === 'no-answer' || icon === 'errors-number'\n ? {'aria-label': contentAriaLabel, role: 'status'}\n : {})}\n className={style.value}\n >\n {child}\n </span>\n );\n};\n\nconst StatusItem = (props: StatusItemProps) => {\n const {icon, current, selected} = props;\n return (\n <div\n className={classnames(\n style.defaultStyle,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current,\n icon === 'valid' && style.valid,\n icon === 'invalid' && style.invalid,\n icon === 'errors-number' && style.errorsNumber,\n selected && style.selected\n )}\n data-name=\"status-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nContent.propTypes = propTypes;\n\nContent.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nStatusItem.propTypes = propTypes;\n\nexport default StatusItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,gCAAgC,IAAIC,SAAS,EAC7CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AACjC,OAAOC,QAAQ,IAAGC,uBAAuB,QAAO,aAAa;AAE7D,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,MAAyB,SAAS;AAElD,MAAMC,OAAO,GAAGA,CAACC,KAAsB,EAAEC,aAA+B,KAAK;EAC3E,MAAM;IAACC,IAAI;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGJ,KAAK;EACpC,MAAMK,SAAS,GAAGT,uBAAuB,CAACK,aAAa,CAAC;EACxD,IAAIK,KAAK;EACT,IAAIC,gBAAgB;EACpB,QAAQL,IAAI;IACV,KAAK,WAAW;MACdI,KAAK,GAAGF,KAAK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,EAAErC,QAAQ,CAACsC,iBAAiB,CAACD,IAAI;EACrC3B,SAAS,EAAEV,QAAQ,CAACsC,iBAAiB,CAAC5B;AACxC,CAAC;AAEDe,UAAU,CAACtB,SAAS,GAAA8B,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGhC,SAAS;AAEhC,eAAesB,UAAU","ignoreList":[]}
|
package/es/atom/tag/index.js
CHANGED
package/es/atom/tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Icon","style","TAG_STYLES","default","success","failure","warning","progress","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","customStyle","icon","position","iconProps","createElement","className","content","propTypes","process","env","NODE_ENV","string","oneOf","_keys","objectOf","oneOfType","number","shape"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport Icon from '../icon';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Icon","style","TAG_STYLES","default","defaultStyle","success","failure","warning","progress","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","customStyle","icon","position","iconProps","createElement","className","content","propTypes","process","env","NODE_ENV","string","oneOf","_keys","objectOf","oneOfType","number","shape"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport Icon from '../icon';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.defaultStyle,\n success: style.success,\n failure: style.failure,\n warning: style.warning,\n progress: style.progress\n};\n\nconst TAG_SIZE = {\n S: style.small,\n M: style.medium,\n L: style.large\n};\n\nconst Tag = ({label, type = 'default', size = 'M', customStyle = {}, icon = {}}) => {\n const {position, ...iconProps} = icon;\n\n return (\n <span\n className={classnames(TAG_STYLES[type], TAG_SIZE[size])}\n data-name={`content-tag-${label}`}\n style={customStyle}\n >\n <div className={style.content}>\n {position === 'left' ? <Icon {...iconProps} /> : null}\n <div>{label}</div>\n {position === 'right' ? <Icon {...iconProps} /> : null}\n </div>\n </span>\n );\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES)),\n size: PropTypes.oneOf(['S', 'M', 'L']),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n icon: PropTypes.shape({...Icon.propTypes, position: PropTypes.oneOf(['left', 'right'])})\n};\n\nexport default Tag;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBC,OAAO,EAAEF,KAAK,CAACG,YAAY;EAC3BC,OAAO,EAAEJ,KAAK,CAACI,OAAO;EACtBC,OAAO,EAAEL,KAAK,CAACK,OAAO;EACtBC,OAAO,EAAEN,KAAK,CAACM,OAAO;EACtBC,QAAQ,EAAEP,KAAK,CAACO;AAClB,CAAC;AAED,MAAMC,QAAQ,GAAG;EACfC,CAAC,EAAET,KAAK,CAACU,KAAK;EACdC,CAAC,EAAEX,KAAK,CAACY,MAAM;EACfC,CAAC,EAAEb,KAAK,CAACc;AACX,CAAC;AAED,MAAMC,GAAG,GAAGA,CAAC;EAACC,KAAK;EAAEC,IAAI,GAAG,SAAS;EAAEC,IAAI,GAAG,GAAG;EAAEC,WAAW,GAAG,CAAC,CAAC;EAAEC,IAAI,GAAG,CAAC;AAAC,CAAC,KAAK;EAClF,MAAM;IAACC,QAAQ;IAAE,GAAGC;EAAS,CAAC,GAAGF,IAAI;EAErC,oBACExB,KAAA,CAAA2B,aAAA;IACEC,SAAS,EAAE1B,UAAU,CAACG,UAAU,CAACgB,IAAI,CAAC,EAAET,QAAQ,CAACU,IAAI,CAAC,CAAE;IACxD,aAAW,eAAeF,KAAK,EAAG;IAClChB,KAAK,EAAEmB;EAAY,gBAEnBvB,KAAA,CAAA2B,aAAA;IAAKC,SAAS,EAAExB,KAAK,CAACyB;EAAQ,GAC3BJ,QAAQ,KAAK,MAAM,gBAAGzB,KAAA,CAAA2B,aAAA,CAACxB,IAAI,EAAKuB,SAAY,CAAC,GAAG,IAAI,eACrD1B,KAAA,CAAA2B,aAAA,cAAMP,KAAW,CAAC,EACjBK,QAAQ,KAAK,OAAO,gBAAGzB,KAAA,CAAA2B,aAAA,CAACxB,IAAI,EAAKuB,SAAY,CAAC,GAAG,IAC/C,CACD,CAAC;AAEX,CAAC;AAEDP,GAAG,CAACW,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACdb,KAAK,EAAEnB,SAAS,CAACiC,MAAM;EACvBb,IAAI,EAAEpB,SAAS,CAACkC,KAAK,CAACC,KAAA,CAAK/B,UAAU,CAAC,CAAC;EACvCiB,IAAI,EAAErB,SAAS,CAACkC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;EACtCZ,WAAW,EAAEtB,SAAS,CAACoC,QAAQ,CAACpC,SAAS,CAACqC,SAAS,CAAC,CAACrC,SAAS,CAACiC,MAAM,EAAEjC,SAAS,CAACsC,MAAM,CAAC,CAAC,CAAC;EAC1Ff,IAAI,EAAEvB,SAAS,CAACuC,KAAK,CAAC;IAAC,GAAGrC,IAAI,CAAC2B,SAAS;IAAEL,QAAQ,EAAExB,SAAS,CAACkC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC;EAAC,CAAC;AACzF,CAAC;AAED,eAAehB,GAAG","ignoreList":[]}
|
package/es/atom/tag/style.css
CHANGED
|
@@ -20,7 +20,7 @@ const BrandCreateForm = (props, context) => {
|
|
|
20
20
|
} = context;
|
|
21
21
|
const waitMessage = translate('Wait_creation');
|
|
22
22
|
const wrapperClass = isModified || isPending || field.error ? style.modifiedWrapper : style.wrapper;
|
|
23
|
-
const fieldClass = field.error ? style.error : style.
|
|
23
|
+
const fieldClass = field.error ? style.error : style.defaultStyle;
|
|
24
24
|
const disabled = isPending || !isModified;
|
|
25
25
|
const {
|
|
26
26
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","ButtonLink","Loader","Provider","style","BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","modifiedWrapper","wrapper","fieldClass","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","ButtonLink","Loader","Provider","style","BrandCreateForm","props","context","title","subtitle","description","field","onSubmit","submitValue","isPending","isModified","translate","waitMessage","wrapperClass","error","modifiedWrapper","wrapper","fieldClass","defaultStyle","disabled","onChange","handleChange","e","target","value","actionView","createElement","className","wait","loading","type","usage","customStyle","display","width","label","header","content","maxLength","placeholder","defaultValue","onInput","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","shape","func","bool"],"sources":["../../../src/molecule/brand-create-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport Loader from '../../atom/loader';\nimport Provider from '../../atom/provider';\nimport style from './style.css';\n\nconst BrandCreateForm = (props, context) => {\n const {title, subtitle, description, field, onSubmit, submitValue, isPending, isModified} = props;\n const {translate} = context;\n const waitMessage = translate('Wait_creation');\n\n const wrapperClass =\n isModified || isPending || field.error ? style.modifiedWrapper : style.wrapper;\n const fieldClass = field.error ? style.error : style.defaultStyle;\n const disabled = isPending || !isModified;\n const {onChange} = field;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const actionView = isPending ? (\n <div>\n <div className={style.wait}>{waitMessage}</div>\n <div className={style.loading}>\n <Loader />\n </div>\n </div>\n ) : (\n <div>\n <ButtonLink\n type=\"primary\"\n data-name=\"brand_create_submit_button\"\n usage=\"submit\"\n customStyle={{\n display: 'inline-block',\n width: 'fit-content'\n }}\n disabled={disabled}\n label={submitValue}\n />\n </div>\n );\n\n return (\n <div className={wrapperClass}>\n <div className={style.header}>\n <h1>{title}</h1>\n </div>\n <form className={style.content} onSubmit={onSubmit}>\n <h2>{subtitle}</h2>\n <div className={style.description}>{description}</div>\n <div className={fieldClass}>\n <label>\n <input\n type=\"text\"\n maxLength=\"40\"\n data-name=\"brand_create_text_input\"\n placeholder={field.placeholder}\n defaultValue={field.value}\n onInput={handleChange}\n />\n {field.label}\n </label>\n </div>\n {actionView}\n </form>\n </div>\n );\n};\n\nBrandCreateForm.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nBrandCreateForm.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string.isRequired,\n description: PropTypes.string.isRequired,\n field: PropTypes.shape({\n placeholder: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n error: PropTypes.string,\n value: PropTypes.string\n }).isRequired,\n onSubmit: PropTypes.func.isRequired,\n submitValue: PropTypes.string.isRequired,\n isPending: PropTypes.bool,\n isModified: PropTypes.bool\n};\n\nexport default BrandCreateForm;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,eAAe,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC1C,MAAM;IAACC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAAU,CAAC,GAAGT,KAA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AACwD,IAAI,CAACF,UAAU;IACnCnC,KAAK,EAAEnB,SAAS,CAACqD,MAAM;IACvBxB,KAAK,EAAE7B,SAAS,CAACqD;EACnB,CAAC,CAAC,CAACC,UAAU;EACb1C,QAAQ,EAAEZ,SAAS,CAACwD,IAAI,CAACF,UAAU;EACnCzC,WAAW,EAAEb,SAAS,CAACqD,MAAM,CAACC,UAAU;EACxCxC,SAAS,EAAEd,SAAS,CAACyD,IAAI;EACzB1C,UAAU,EAAEf,SAAS,CAACyD;AACxB,CAAC;AAED,eAAepD,eAAe","ignoreList":[]}
|
|
@@ -73,22 +73,22 @@
|
|
|
73
73
|
margin-bottom: 20px;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.
|
|
76
|
+
.defaultStyle {
|
|
77
77
|
margin-bottom: 70px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.error {
|
|
81
|
-
composes:
|
|
81
|
+
composes: defaultStyle;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.
|
|
84
|
+
.defaultStyle label {
|
|
85
85
|
font-family: 'Gilroy';
|
|
86
86
|
font-weight: 600;
|
|
87
87
|
font-size: 18px;
|
|
88
88
|
color: medium;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
.
|
|
91
|
+
.defaultStyle input {
|
|
92
92
|
font-family: "Gilroy";
|
|
93
93
|
text-transform: none;
|
|
94
94
|
padding: 0 15px;
|
|
@@ -54,7 +54,7 @@ class BrandUploadBox extends React.Component {
|
|
|
54
54
|
className: style.wrapper
|
|
55
55
|
}, /*#__PURE__*/React.createElement("div", {
|
|
56
56
|
id: idBox,
|
|
57
|
-
className: dragging ? style.dropping : style.
|
|
57
|
+
className: dragging ? style.dropping : style.defaultStyle
|
|
58
58
|
}, /*#__PURE__*/React.createElement("div", {
|
|
59
59
|
className: style.cont
|
|
60
60
|
}, /*#__PURE__*/React.createElement(UploadIcon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidDataTransferDataUpload1","UploadIcon","Loader","style","BrandUploadBox","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","_uniqueId","skin","context","status","content","description","browse","onLoad","name","brandColor","_get","createElement","className","loading","wrapper","id","dropping","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","NovaSolidDataTransferDataUpload1","UploadIcon","Loader","style","BrandUploadBox","Component","constructor","props","state","dragging","handleDragStart","bind","handleDragStop","setState","render","idBox","_uniqueId","skin","context","status","content","description","browse","onLoad","name","brandColor","_get","createElement","className","loading","wrapper","id","dropping","defaultStyle","cont","color","arrow","desc","type","inputFile","onChange","onDragEnter","onDrop","onDragLeave","propTypes","process","env","NODE_ENV","string","oneOf","func"],"sources":["../../../src/molecule/brand-upload-box/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {uniqueId, get} from 'lodash/fp';\nimport {NovaSolidDataTransferDataUpload1 as UploadIcon} from '@coorpacademy/nova-icons';\nimport Loader from '../../atom/loader';\nimport style from './style.css';\n\nclass BrandUploadBox extends React.Component {\n static propTypes = {\n name: PropTypes.string,\n description: PropTypes.string,\n browse: PropTypes.string,\n status: PropTypes.oneOf(['default', 'loading']),\n onLoad: PropTypes.func\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n dragging: false\n };\n\n this.handleDragStart = this.handleDragStart.bind(this);\n this.handleDragStop = this.handleDragStop.bind(this);\n }\n\n handleDragStart() {\n this.setState({\n dragging: true\n });\n }\n\n handleDragStop() {\n this.setState({\n dragging: false\n });\n }\n\n render() {\n const idBox = uniqueId('drop-box-');\n const {skin} = this.context;\n const {status} = this.props;\n const {dragging} = this.state;\n\n let content;\n\n const {description = '', browse = '', onLoad, name} = this.props;\n const brandColor = get('common.brand', skin);\n\n switch (status) {\n case 'loading':\n content = (\n <div className={style.loading}>\n <Loader />\n </div>\n );\n break;\n\n default:\n content = (\n <div className={style.wrapper}>\n <div id={idBox} className={dragging ? style.dropping : style.defaultStyle}>\n <div className={style.cont}>\n <UploadIcon style={{color: brandColor}} className={style.arrow} />\n <div className={style.desc}>{description}</div>\n <span className={style.browse}>{browse}</span>\n </div>\n <input\n type=\"file\"\n name={name}\n className={style.inputFile}\n onChange={onLoad}\n onDragEnter={this.handleDragStart}\n onDrop={this.handleDragStop}\n onDragLeave={this.handleDragStop}\n />\n </div>\n </div>\n );\n }\n\n return content;\n }\n}\n\nexport default BrandUploadBox;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,gCAAgC,IAAIC,UAAU,QAAO,0BAA0B;AACvF,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,cAAc,SAASN,KAAK,CAACO,SAAS,CAAC;EAS3CC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,KAAK,GAAG;MACXC,QAAQ,EAAE;IACZ,CAAC;IAED,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACC,IAAI,CAAC,IAAI,CAAC;IACtD,IAAI,CAACC,cAAc,GAAG,IAAI,CAACA,cAAc,CAACD,IAAI,CAAC,IAAI,CAAC;EACtD;EAEAD,eAAeA,CAAA,EAAG;IAChB,IAAI,CAACG,QAAQ,CAAC;MACZJ,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ;EAEAG,cAAcA,CAAA,EAAG;IACf,IAAI,CAACC,QAAQ,CAAC;MACZJ,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ;EAEAK,MAAMA,CAAA,EAAG;IACP,MAAMC,KAAK,GAAGC,SAAA,CAAS,WAAW,CAAC;IACnC,MAAM;MAACC;IAAI,CAAC,GAAG,IAAI,CAACC,OAAO;IAC3B,MAAM;MAACC;IAAM,CAAC,GAAG,IAAI,CAACZ,KAAK;IAC3B,MAAM;MAACE;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,EAAE,IAAI,CAAC/B,eAAgB;UAClCgC,MAAM,EAAE,IAAI,CAAC9B,cAAe;UAC5B+B,WAAW,EAAE,IAAI,CAAC/B;QAAe,CAClC,CACE,CACF,CACN;IACL;IAEA,OAAOQ,OAAO;EAChB;AACF;AA7EMhB,cAAc,CACXwC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBvB,IAAI,EAAEzB,SAAS,CAACiD,MAAM;EACtB3B,WAAW,EAAEtB,SAAS,CAACiD,MAAM;EAC7B1B,MAAM,EAAEvB,SAAS,CAACiD,MAAM;EACxB7B,MAAM,EAAEpB,SAAS,CAACkD,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;EAC/C1B,MAAM,EAAExB,SAAS,CAACmD;AACpB,CAAC;AAwEH,eAAe9C,cAAc","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
transform: scale(1.2);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.
|
|
27
|
+
.defaultStyle {
|
|
28
28
|
border: 2px dashed xtraLightGrey;
|
|
29
29
|
border-radius: 4px;
|
|
30
30
|
overflow: hidden;
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.loading {
|
|
37
|
-
composes:
|
|
37
|
+
composes: defaultStyle;
|
|
38
38
|
height: 80px;
|
|
39
39
|
border: none;
|
|
40
40
|
position: relative;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.dropping {
|
|
44
|
-
composes:
|
|
44
|
+
composes: defaultStyle;
|
|
45
45
|
border: 3px dashed brand;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@value colors: "../../variables/colors.css";
|
|
4
4
|
@value white from colors;
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.defaultStyle {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-wrap: wrap;
|
|
9
9
|
justify-content: center;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.content {
|
|
25
|
-
composes:
|
|
25
|
+
composes: defaultStyle;
|
|
26
26
|
padding: 12px 12px 0;
|
|
27
27
|
font-size: 12px;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","names":["React","PropTypes","classnames","style","THEMES","default","coorpmanager","Customer","props","name","type","coorpOriginal","theme","disabled","ariaLabel","className","customer","chapterCustomer","createElement","content","coorp","original","propTypes","process","env","NODE_ENV","oneOf","_keys","string","bool","isRequired"],"sources":["../../../src/molecule/card/customer.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './customer.css';\n\nexport const THEMES = {\n default:
|
|
1
|
+
{"version":3,"file":"customer.js","names":["React","PropTypes","classnames","style","THEMES","default","defaultStyle","coorpmanager","Customer","props","name","type","coorpOriginal","theme","disabled","ariaLabel","className","customer","chapterCustomer","createElement","content","coorp","original","propTypes","process","env","NODE_ENV","oneOf","_keys","string","bool","isRequired"],"sources":["../../../src/molecule/card/customer.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport style from './customer.css';\n\nexport const THEMES = {\n default: style.defaultStyle,\n coorpmanager: style.coorpmanager\n};\n\nconst Customer = props => {\n const {name, type, coorpOriginal, theme, disabled, 'aria-label': ariaLabel} = props;\n const className = classnames(\n THEMES[theme],\n style.customer,\n type === 'chapter' ? style.chapterCustomer : null\n );\n\n return (\n <div className={className} disabled={disabled} aria-label={ariaLabel}>\n <div className={style.content}>\n {coorpOriginal ? <span className={style.coorp}>Coorp </span> : null}\n {coorpOriginal ? <span className={style.original}>Original </span> : null}\n {!coorpOriginal && name}\n </div>\n </div>\n );\n};\n\nCustomer.propTypes = {\n theme: PropTypes.oneOf(keys(THEMES)),\n type: PropTypes.string,\n name: PropTypes.string,\n coorpOriginal: PropTypes.bool.isRequired,\n disabled: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Customer;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,MAAM,gBAAgB;AAElC,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAEF,KAAK,CAACG,YAAY;EAC3BC,YAAY,EAAEJ,KAAK,CAACI;AACtB,CAAC;AAED,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAM;IAACC,IAAI;IAAEC,IAAI;IAAEC,aAAa;IAAEC,KAAK;IAAEC,QAAQ;IAAE,YAAY,EAAEC;EAAS,CAAC,GAAGN,KAAK;EACnF,MAAMO,SAAS,GAAGd,UAAU,CAC1BE,MAAM,CAACS,KAAK,CAAC,EACbV,KAAK,CAACc,QAAQ,EACdN,IAAI,KAAK,SAAS,GAAGR,KAAK,CAACe,eAAe,GAAG,IAC/C,CAAC;EAED,oBACElB,KAAA,CAAAmB,aAAA;IAAKH,SAAS,EAAEA,SAAU;IAACF,QAAQ,EAAEA,QAAS;IAAC,cAAYC;EAAU,gBACnEf,KAAA,CAAAmB,aAAA;IAAKH,SAAS,EAAEb,KAAK,CAACiB;EAAQ,GAC3BR,aAAa,gBAAGZ,KAAA,CAAAmB,aAAA;IAAMH,SAAS,EAAEb,KAAK,CAACkB;EAAM,GAAC,QAAY,CAAC,GAAG,IAAI,EAClET,aAAa,gBAAGZ,KAAA,CAAAmB,aAAA;IAAMH,SAAS,EAAEb,KAAK,CAACmB;EAAS,GAAC,WAAe,CAAC,GAAG,IAAI,EACxE,CAACV,aAAa,IAAIF,IAChB,CACF,CAAC;AAEV,CAAC;AAEDF,QAAQ,CAACe,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACnBb,KAAK,EAAEZ,SAAS,CAAC0B,KAAK,CAACC,KAAA,CAAKxB,MAAM,CAAC,CAAC;EACpCO,IAAI,EAAEV,SAAS,CAAC4B,MAAM;EACtBnB,IAAI,EAAET,SAAS,CAAC4B,MAAM;EACtBjB,aAAa,EAAEX,SAAS,CAAC6B,IAAI,CAACC,UAAU;EACxCjB,QAAQ,EAAEb,SAAS,CAAC6B,IAAI;EACxB,YAAY,EAAE7B,SAAS,CAAC4B;AAC1B,CAAC;AAED,eAAerB,QAAQ","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ import Selectable from './selectable';
|
|
|
17
17
|
import Notification from './notification';
|
|
18
18
|
import style from './style.css';
|
|
19
19
|
export const THEMES = {
|
|
20
|
-
default:
|
|
20
|
+
default: style.defaultStyle,
|
|
21
21
|
coorpmanager: style.coorpmanager
|
|
22
22
|
};
|
|
23
23
|
const CardBackground = ({
|