@coorpacademy/components 10.1.3 → 10.1.7
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/button-link/index.js +10 -4
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +4 -5
- package/es/atom/button-link/test/button-link.js +25 -0
- package/es/atom/button-link/test/button-link.js.map +1 -0
- package/es/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js +13 -0
- package/es/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js.map +1 -0
- package/es/atom/button-link/test/fixtures.js +35 -0
- package/es/atom/button-link/test/fixtures.js.map +1 -0
- package/es/atom/button-menu/index.js +66 -0
- package/es/atom/button-menu/index.js.map +1 -0
- package/es/atom/button-menu/style.css +51 -0
- package/es/atom/button-menu/test/fixtures/default.js +20 -0
- package/es/atom/button-menu/test/fixtures/default.js.map +1 -0
- package/es/atom/button-menu/test/fixtures/multiple-buttons.js +15 -0
- package/es/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
- package/es/atom/button-menu/test/fixtures.js +15 -0
- package/es/atom/button-menu/test/fixtures.js.map +1 -0
- package/es/atom/chips/index.js +8 -4
- package/es/atom/chips/index.js.map +1 -1
- package/es/atom/chips/style.css +17 -2
- package/es/atom/chips/test/fixtures/long-text.js +9 -0
- package/es/atom/chips/test/fixtures/long-text.js.map +1 -0
- package/es/atom/chips/test/fixtures.js +17 -0
- package/es/atom/chips/test/fixtures.js.map +1 -0
- package/es/atom/content-badge/test/fixtures.js +27 -0
- package/es/atom/content-badge/test/fixtures.js.map +1 -0
- package/es/atom/input-search/style.css +1 -0
- package/es/atom/input-search/test/fixtures.js +19 -0
- package/es/atom/input-search/test/fixtures.js.map +1 -0
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text/style.css +6 -2
- package/es/atom/input-text/test/fixtures.js +2 -0
- package/es/atom/input-text/test/fixtures.js.map +1 -1
- package/es/atom/input-textarea/style.css +3 -3
- package/es/atom/input-textarea/test/fixtures.js +4 -0
- package/es/atom/input-textarea/test/fixtures.js.map +1 -1
- package/es/atom/tag/test/fixtures.js +19 -0
- package/es/atom/tag/test/fixtures.js.map +1 -0
- package/es/atom/wizard-steps/test/fixtures.js +17 -0
- package/es/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/es/molecule/banner/index.js +19 -10
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/banner/style.css +10 -8
- package/es/molecule/banner/test/fixtures.js +15 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -0
- package/es/molecule/brand-form-group/index.js +20 -5
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +19 -0
- package/es/molecule/brand-form-group/test/fixtures.js +2 -0
- package/es/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +54 -0
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/style.css +52 -0
- package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +34 -0
- package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/default.js +11 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +13 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures.js +15 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- package/es/molecule/card/test/fixtures.js +4 -0
- package/es/molecule/card/test/fixtures.js.map +1 -1
- package/es/molecule/cm-popin/index.js +4 -4
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures/dangerous.js +2 -2
- package/es/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures/default.js +2 -2
- package/es/molecule/cm-popin/test/fixtures/default.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures/warning-with-close.js +2 -2
- package/es/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -1
- package/es/molecule/cm-popin/test/fixtures.js +17 -0
- package/es/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/es/molecule/feedback/test/fixtures.js +0 -2
- package/es/molecule/feedback/test/fixtures.js.map +1 -1
- package/es/molecule/select-multiple/index.js +113 -146
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/test/index.js +20 -79
- package/es/molecule/select-multiple/test/index.js.map +1 -1
- package/es/molecule/vertical-tabs/index.js +8 -3
- package/es/molecule/vertical-tabs/index.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures/default.js +2 -1
- package/es/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
- package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures.js +15 -0
- package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/es/molecule/wizard-summary/index.js +3 -1
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +8 -0
- package/es/molecule/wizard-summary/test/fixtures.js +21 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
- package/es/organism/brand-form/test/fixtures.js +2 -0
- package/es/organism/brand-form/test/fixtures.js.map +1 -1
- package/es/organism/playlist-translation/index.js +63 -0
- package/es/organism/playlist-translation/index.js.map +1 -0
- package/es/organism/playlist-translation/style.css +45 -0
- package/es/organism/playlist-translation/test/fixtures/default.js +24 -0
- package/es/organism/playlist-translation/test/fixtures/default.js.map +1 -0
- package/es/organism/playlist-translation/test/fixtures/delete.js +18 -0
- package/es/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
- package/es/organism/search-and-chips-results/index.js +92 -0
- package/es/organism/search-and-chips-results/index.js.map +1 -0
- package/es/organism/search-and-chips-results/style.css +57 -0
- package/es/organism/search-and-chips-results/test/fixtures/default.js +46 -0
- package/es/organism/search-and-chips-results/test/fixtures/default.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures/empty.js +23 -0
- package/es/organism/search-and-chips-results/test/fixtures/empty.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures/filtered.js +26 -0
- package/es/organism/search-and-chips-results/test/fixtures/filtered.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures/sorted-selected.js +49 -0
- package/es/organism/search-and-chips-results/test/fixtures/sorted-selected.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures/unsorted-selected.js +49 -0
- package/es/organism/search-and-chips-results/test/fixtures/unsorted-selected.js.map +1 -0
- package/es/organism/search-and-chips-results/test/fixtures.js +21 -0
- package/es/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/es/template/app-player/popin-end/test/fixtures.js +0 -2
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/es/template/teams-dashboard/index.js +4 -3
- package/es/template/teams-dashboard/index.js.map +1 -1
- package/es/variables/colors.css +2 -0
- package/lib/atom/button-link/index.js +9 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +4 -5
- package/lib/atom/button-link/test/button-link.js +37 -0
- package/lib/atom/button-link/test/button-link.js.map +1 -0
- package/lib/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js +18 -0
- package/lib/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js.map +1 -0
- package/lib/atom/button-link/test/fixtures.js +55 -0
- package/lib/atom/button-link/test/fixtures.js.map +1 -0
- package/lib/atom/button-menu/index.js +82 -0
- package/lib/atom/button-menu/index.js.map +1 -0
- package/lib/atom/button-menu/style.css +51 -0
- package/lib/atom/button-menu/test/fixtures/default.js +27 -0
- package/lib/atom/button-menu/test/fixtures/default.js.map +1 -0
- package/lib/atom/button-menu/test/fixtures/multiple-buttons.js +23 -0
- package/lib/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
- package/lib/atom/button-menu/test/fixtures.js +25 -0
- package/lib/atom/button-menu/test/fixtures.js.map +1 -0
- package/lib/atom/chips/index.js +8 -4
- package/lib/atom/chips/index.js.map +1 -1
- package/lib/atom/chips/style.css +17 -2
- package/lib/atom/chips/test/fixtures/long-text.js +14 -0
- package/lib/atom/chips/test/fixtures/long-text.js.map +1 -0
- package/lib/atom/chips/test/fixtures.js +28 -0
- package/lib/atom/chips/test/fixtures.js.map +1 -0
- package/lib/atom/content-badge/test/fixtures.js +43 -0
- package/lib/atom/content-badge/test/fixtures.js.map +1 -0
- package/lib/atom/input-search/style.css +1 -0
- package/lib/atom/input-search/test/fixtures.js +31 -0
- package/lib/atom/input-search/test/fixtures.js.map +1 -0
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text/style.css +6 -2
- package/lib/atom/input-text/test/fixtures.js +3 -0
- package/lib/atom/input-text/test/fixtures.js.map +1 -1
- package/lib/atom/input-textarea/style.css +3 -3
- package/lib/atom/input-textarea/test/fixtures.js +6 -0
- package/lib/atom/input-textarea/test/fixtures.js.map +1 -1
- package/lib/atom/tag/test/fixtures.js +31 -0
- package/lib/atom/tag/test/fixtures.js.map +1 -0
- package/lib/atom/wizard-steps/test/fixtures.js +28 -0
- package/lib/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/banner/index.js +19 -10
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/banner/style.css +10 -8
- package/lib/molecule/{search → banner}/test/fixtures.js +5 -5
- package/lib/molecule/banner/test/fixtures.js.map +1 -0
- package/lib/molecule/brand-form-group/index.js +22 -5
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +19 -0
- package/lib/molecule/brand-form-group/test/fixtures.js +3 -0
- package/lib/molecule/brand-form-group/test/fixtures.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +72 -0
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/style.css +52 -0
- package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +46 -0
- package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js +18 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +25 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js +25 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- package/lib/molecule/card/test/fixtures.js +6 -0
- package/lib/molecule/card/test/fixtures.js.map +1 -1
- package/lib/molecule/cm-popin/index.js +4 -4
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures/dangerous.js +2 -2
- package/lib/molecule/cm-popin/test/fixtures/dangerous.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures/default.js +2 -2
- package/lib/molecule/cm-popin/test/fixtures/default.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js +2 -2
- package/lib/molecule/cm-popin/test/fixtures/warning-with-close.js.map +1 -1
- package/lib/molecule/cm-popin/test/fixtures.js +28 -0
- package/lib/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/feedback/test/fixtures.js +0 -3
- package/lib/molecule/feedback/test/fixtures.js.map +1 -1
- package/lib/molecule/select-multiple/index.js +117 -143
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/test/index.js +25 -79
- package/lib/molecule/select-multiple/test/index.js.map +1 -1
- package/lib/molecule/vertical-tabs/index.js +8 -3
- package/lib/molecule/vertical-tabs/index.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures/default.js +2 -1
- package/lib/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
- package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures.js +25 -0
- package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/lib/molecule/wizard-summary/index.js +3 -1
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +8 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +34 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +31 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures.js +3 -0
- package/lib/organism/brand-form/test/fixtures.js.map +1 -1
- package/lib/organism/playlist-translation/index.js +78 -0
- package/lib/organism/playlist-translation/index.js.map +1 -0
- package/lib/organism/playlist-translation/style.css +45 -0
- package/lib/organism/playlist-translation/test/fixtures/default.js +35 -0
- package/lib/organism/playlist-translation/test/fixtures/default.js.map +1 -0
- package/lib/organism/playlist-translation/test/fixtures/delete.js +29 -0
- package/lib/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
- package/lib/organism/search-and-chips-results/index.js +105 -0
- package/lib/organism/search-and-chips-results/index.js.map +1 -0
- package/lib/organism/search-and-chips-results/style.css +57 -0
- package/lib/organism/search-and-chips-results/test/fixtures/default.js +51 -0
- package/lib/organism/search-and-chips-results/test/fixtures/default.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures/empty.js +28 -0
- package/lib/organism/search-and-chips-results/test/fixtures/empty.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures/filtered.js +31 -0
- package/lib/organism/search-and-chips-results/test/fixtures/filtered.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures/sorted-selected.js +54 -0
- package/lib/organism/search-and-chips-results/test/fixtures/sorted-selected.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures/unsorted-selected.js +54 -0
- package/lib/organism/search-and-chips-results/test/fixtures/unsorted-selected.js.map +1 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js +34 -0
- package/lib/organism/search-and-chips-results/test/fixtures.js.map +1 -0
- package/lib/template/app-player/popin-end/test/fixtures.js +0 -3
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- package/lib/template/teams-dashboard/index.js +3 -1
- package/lib/template/teams-dashboard/index.js.map +1 -1
- package/lib/variables/colors.css +2 -0
- package/package.json +3 -3
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/es/molecule/search/test/fixtures.js +0 -15
- package/es/molecule/search/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/molecule/search/test/fixtures.js.map +0 -1
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
1
2
|
import _getOr from "lodash/fp/getOr";
|
|
2
3
|
|
|
3
4
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
5
|
|
|
5
|
-
import React, {
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import classnames from 'classnames';
|
|
8
|
-
import { NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon,
|
|
9
|
+
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaCompositionCoorpacademyNext as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidComputersSdCard as SaveIcon } from '@coorpacademy/nova-icons';
|
|
9
10
|
import Link from '../link';
|
|
10
11
|
import style from './style.css';
|
|
11
12
|
const ICONS = {
|
|
13
|
+
add: AddIcon,
|
|
12
14
|
analytics: AnalyticsIcon,
|
|
15
|
+
bin: BinIcon,
|
|
16
|
+
'bullet-point': BulletPointIcon,
|
|
13
17
|
'chevron-left': ChevronLeftIcon,
|
|
14
18
|
'chevron-right': ChevronRightIcon,
|
|
15
19
|
close: CloseIcon,
|
|
20
|
+
edit: EditIcon,
|
|
16
21
|
save: SaveIcon,
|
|
17
22
|
see: EyeIcon
|
|
18
23
|
};
|
|
@@ -75,11 +80,12 @@ const ButtonLink = props => {
|
|
|
75
80
|
}), contentView);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
const handleOnClick =
|
|
83
|
+
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
79
84
|
return /*#__PURE__*/React.createElement("button", {
|
|
80
85
|
type: "button",
|
|
81
86
|
"aria-label": ariaLabel || label,
|
|
82
87
|
title: ariaLabel || label,
|
|
88
|
+
"data-name": dataName,
|
|
83
89
|
className: styleButton,
|
|
84
90
|
onClick: handleOnClick
|
|
85
91
|
}, contentView);
|
|
@@ -92,7 +98,7 @@ ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
92
98
|
'data-name': PropTypes.string,
|
|
93
99
|
icon: PropTypes.shape({
|
|
94
100
|
position: PropTypes.oneOf(['right', 'left', 'center']),
|
|
95
|
-
type: PropTypes.
|
|
101
|
+
type: PropTypes.oneOf(_keys(ICONS))
|
|
96
102
|
}),
|
|
97
103
|
onClick: PropTypes.func,
|
|
98
104
|
link: PropTypes.shape({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useCallback","PropTypes","classnames","NovaSolidRemoveAddAddCircle1","AddIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaSolidContentEditionBin","BinIcon","NovaCompositionCoorpacademyBulletPoint","BulletPointIcon","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaCompositionCoorpacademyNext","CloseIcon","NovaSolidContentEditionPencilWrite","EditIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaSolidComputersSdCard","SaveIcon","Link","style","ICONS","add","analytics","bin","close","edit","save","see","getButtonContent","icon","label","type","position","Icon","buttonContent","ButtonLink","props","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","propTypes","oneOf","string","shape","func","href","download","bool","target"],"mappings":"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","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaSolidContentEditionBin as BinIcon,\n NovaCompositionCoorpacademyBulletPoint as BulletPointIcon,\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaCompositionCoorpacademyNext as CloseIcon,\n NovaSolidContentEditionPencilWrite as EditIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaSolidComputersSdCard as SaveIcon\n} from '@coorpacademy/nova-icons';\nimport Link from '../link';\nimport style from './style.css';\n\nconst ICONS = {\n add: AddIcon,\n analytics: AnalyticsIcon,\n bin: BinIcon,\n 'bullet-point': BulletPointIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n edit: EditIcon,\n save: SaveIcon,\n see: EyeIcon\n};\n\nconst getButtonContent = (icon, label) => {\n const {type, position} = icon;\n const Icon = getOr(null, type, ICONS);\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n if (position === 'center' && Icon) {\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = props => {\n const {\n type,\n label,\n disabled,\n icon = {},\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left', 'center']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool\n};\n\nexport default ButtonLink;\n"],"file":"index.js"}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
border: none;
|
|
24
|
+
/* prevents text selection when dragging
|
|
25
|
+
the mouse over the button */
|
|
26
|
+
user-select: none;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
.disabled {
|
|
@@ -87,11 +90,7 @@
|
|
|
87
90
|
|
|
88
91
|
.text {
|
|
89
92
|
background: transparent;
|
|
90
|
-
color:
|
|
93
|
+
color: inherit;
|
|
91
94
|
border-radius: 0px;
|
|
92
95
|
height: auto;
|
|
93
96
|
}
|
|
94
|
-
|
|
95
|
-
.text:hover {
|
|
96
|
-
color: cm_primary_blue;
|
|
97
|
-
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _identity from "lodash/fp/identity";
|
|
2
|
+
import browserEnv from 'browser-env';
|
|
3
|
+
import test from 'ava';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { shallow, configure } from 'enzyme';
|
|
6
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
7
|
+
import ButtonLink from '..';
|
|
8
|
+
import defaultFixture from './fixtures/button-tertiary-icon-bullet';
|
|
9
|
+
browserEnv();
|
|
10
|
+
configure({
|
|
11
|
+
adapter: new Adapter()
|
|
12
|
+
});
|
|
13
|
+
const translate = _identity;
|
|
14
|
+
test('should launch onClick on click event', t => {
|
|
15
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(ButtonLink, defaultFixture.props), {
|
|
16
|
+
context: {
|
|
17
|
+
translate
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const button = wrapper.find('[data-name="bullet-button"]');
|
|
21
|
+
t.true(button.exists());
|
|
22
|
+
button.first().simulate('click', {});
|
|
23
|
+
t.pass();
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=button-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link/test/button-link.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","ButtonLink","defaultFixture","adapter","translate","t","wrapper","props","context","button","find","true","exists","first","simulate","pass"],"mappings":";AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,UAAP,MAAuB,IAAvB;AACA,OAAOC,cAAP,MAA2B,wCAA3B;AAEAP,UAAU;AACVI,SAAS,CAAC;AAACI,EAAAA,OAAO,EAAE,IAAIH,OAAJ;AAAV,CAAD,CAAT;AACA,MAAMI,SAAS,YAAf;AAEAR,IAAI,CAAC,sCAAD,EAAyCS,CAAC,IAAI;AAChD,QAAMC,OAAO,GAAGR,OAAO,eAAC,oBAAC,UAAD,EAAgBI,cAAc,CAACK,KAA/B,CAAD,EAA2C;AAChEC,IAAAA,OAAO,EAAE;AAACJ,MAAAA;AAAD;AADuD,GAA3C,CAAvB;AAGA,QAAMK,MAAM,GAAGH,OAAO,CAACI,IAAR,CAAa,6BAAb,CAAf;AACAL,EAAAA,CAAC,CAACM,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACAT,EAAAA,CAAC,CAACU,IAAF;AACD,CARG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport ButtonLink from '..';\nimport defaultFixture from './fixtures/button-tertiary-icon-bullet';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick on click event', t => {\n const wrapper = shallow(<ButtonLink {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n t.pass();\n});\n"],"file":"button-link.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
type: 'tertiary',
|
|
4
|
+
'aria-label': 'aria button',
|
|
5
|
+
'data-name': 'bullet-button',
|
|
6
|
+
icon: {
|
|
7
|
+
position: 'center',
|
|
8
|
+
type: 'bullet-point'
|
|
9
|
+
},
|
|
10
|
+
onClick: () => console.log('click')
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=button-tertiary-icon-bullet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js"],"names":["props","type","icon","position","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,UADD;AAEL,kBAAc,aAFT;AAGL,iBAAa,eAHR;AAILC,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,QADN;AAEJF,MAAAA,IAAI,EAAE;AAFF,KAJD;AAQLG,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AARV;AADM,CAAf","sourcesContent":["export default {\n props: {\n type: 'tertiary',\n 'aria-label': 'aria button',\n 'data-name': 'bullet-button',\n icon: {\n position: 'center',\n type: 'bullet-point'\n },\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-tertiary-icon-bullet.js"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomButtonLink from '..';
|
|
5
|
+
import fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';
|
|
6
|
+
import fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';
|
|
7
|
+
import fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';
|
|
8
|
+
import fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';
|
|
9
|
+
import fixtureButtonTertiaryIconBullet from './fixtures/button-tertiary-icon-bullet';
|
|
10
|
+
import fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';
|
|
11
|
+
import fixtureIconButton from './fixtures/icon-button';
|
|
12
|
+
import fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';
|
|
13
|
+
import fixtureLinkSecondaryIconRight from './fixtures/link-secondary-icon-right';
|
|
14
|
+
import fixtureLinkTertiaryNoIcon from './fixtures/link-tertiary-no-icon';
|
|
15
|
+
import fixtureLinkTextIconRightTargetBlank from './fixtures/link-text-icon-right-target-blank';
|
|
16
|
+
import fixtureLinkTextNoIconDownload from './fixtures/link-text-no-icon-download';
|
|
17
|
+
test('Atom › AtomButtonLink > should have valid propTypes', t => {
|
|
18
|
+
t.pass();
|
|
19
|
+
forEach(AtomButtonLink.propTypes, (value, key) => {
|
|
20
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonLink.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
test('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonDangerousNoIcon);
|
|
24
|
+
test('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);
|
|
25
|
+
test('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);
|
|
26
|
+
test('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);
|
|
27
|
+
test('Atom › AtomButtonLink › ButtonTertiaryIconBullet › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconBullet);
|
|
28
|
+
test('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);
|
|
29
|
+
test('Atom › AtomButtonLink › IconButton › should be rendered', renderComponentMacro, AtomButtonLink, fixtureIconButton);
|
|
30
|
+
test('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);
|
|
31
|
+
test('Atom › AtomButtonLink › LinkSecondaryIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkSecondaryIconRight);
|
|
32
|
+
test('Atom › AtomButtonLink › LinkTertiaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTertiaryNoIcon);
|
|
33
|
+
test('Atom › AtomButtonLink › LinkTextIconRightTargetBlank › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextIconRightTargetBlank);
|
|
34
|
+
test('Atom › AtomButtonLink › LinkTextNoIconDownload › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextNoIconDownload);
|
|
35
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonLink","fixtureButtonDangerousNoIcon","fixtureButtonPrimaryIconLeft","fixtureButtonPrimaryNoIcon","fixtureButtonSecondaryNoIconDisabled","fixtureButtonTertiaryIconBullet","fixtureButtonTertiaryIconLeft","fixtureIconButton","fixtureLinkPrimaryDisabledIconRight","fixtureLinkSecondaryIconRight","fixtureLinkTertiaryNoIcon","fixtureLinkTextIconRightTargetBlank","fixtureLinkTextNoIconDownload","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,0BAAP,MAAuC,mCAAvC;AACA,OAAOC,oCAAP,MAAiD,8CAAjD;AACA,OAAOC,+BAAP,MAA4C,wCAA5C;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,mCAAP,MAAgD,6CAAhD;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,yBAAP,MAAsC,kCAAtC;AACA,OAAOC,mCAAP,MAAgD,8CAAhD;AACA,OAAOC,6BAAP,MAA0C,uCAA1C;AAEAf,IAAI,CAAC,qDAAD,EAAwDgB,CAAC,IAAI;AAC/DA,EAAAA,CAAC,CAACC,IAAF;AACAhB,EAAAA,OAAO,CAACE,cAAc,CAACe,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+CAA8CF,GAAI,mEAA3E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOApB,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,cAA7F,EAA6GC,4BAA7G,CAAJ;AACAJ,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,cAA7F,EAA6GE,4BAA7G,CAAJ;AACAL,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,cAA3F,EAA2GG,0BAA3G,CAAJ;AACAN,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,cAArG,EAAqHI,oCAArH,CAAJ;AACAP,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,cAAhG,EAAgHK,+BAAhH,CAAJ;AACAR,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GM,6BAA9G,CAAJ;AACAT,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,cAAlF,EAAkGO,iBAAlG,CAAJ;AACAV,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,cAApG,EAAoHQ,mCAApH,CAAJ;AACAX,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GS,6BAA9G,CAAJ;AACAZ,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,cAA1F,EAA0GU,yBAA1G,CAAJ;AACAb,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,cAApG,EAAoHW,mCAApH,CAAJ;AACAd,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GY,6BAA9G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLink from '..';\nimport fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';\nimport fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';\nimport fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';\nimport fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';\nimport fixtureButtonTertiaryIconBullet from './fixtures/button-tertiary-icon-bullet';\nimport fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';\nimport fixtureIconButton from './fixtures/icon-button';\nimport fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';\nimport fixtureLinkSecondaryIconRight from './fixtures/link-secondary-icon-right';\nimport fixtureLinkTertiaryNoIcon from './fixtures/link-tertiary-no-icon';\nimport fixtureLinkTextIconRightTargetBlank from './fixtures/link-text-icon-right-target-blank';\nimport fixtureLinkTextNoIconDownload from './fixtures/link-text-no-icon-download';\n\ntest('Atom › AtomButtonLink > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLink.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLink.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonDangerousNoIcon);\ntest('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);\ntest('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);\ntest('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);\ntest('Atom › AtomButtonLink › ButtonTertiaryIconBullet › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconBullet);\ntest('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);\ntest('Atom › AtomButtonLink › IconButton › should be rendered', renderComponentMacro, AtomButtonLink, fixtureIconButton);\ntest('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);\ntest('Atom › AtomButtonLink › LinkSecondaryIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkSecondaryIconRight);\ntest('Atom › AtomButtonLink › LinkTertiaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTertiaryNoIcon);\ntest('Atom › AtomButtonLink › LinkTextIconRightTargetBlank › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextIconRightTargetBlank);\ntest('Atom › AtomButtonLink › LinkTextNoIconDownload › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextNoIconDownload);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React, { useMemo, useCallback } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import map from 'lodash/fp/map';
|
|
6
|
+
import classnames from 'classnames';
|
|
7
|
+
import style from './style.css';
|
|
8
|
+
|
|
9
|
+
const Button = props => {
|
|
10
|
+
const {
|
|
11
|
+
'data-name': dataName,
|
|
12
|
+
disabled,
|
|
13
|
+
label,
|
|
14
|
+
onClick,
|
|
15
|
+
type = 'default'
|
|
16
|
+
} = props;
|
|
17
|
+
const styleButton = classnames(style.button, type === 'default' && style.default, type === 'dangerous' && style.dangerous, disabled && style.disabled);
|
|
18
|
+
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
19
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
20
|
+
type: "button",
|
|
21
|
+
"aria-label": label,
|
|
22
|
+
title: label,
|
|
23
|
+
"data-name": dataName,
|
|
24
|
+
className: styleButton,
|
|
25
|
+
onClick: handleOnClick
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: style.buttonContent
|
|
28
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
29
|
+
className: style.label
|
|
30
|
+
}, label)));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
Button.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
34
|
+
'data-name': PropTypes.string,
|
|
35
|
+
disabled: PropTypes.bool,
|
|
36
|
+
label: PropTypes.string.isRequired,
|
|
37
|
+
onClick: PropTypes.func.isRequired,
|
|
38
|
+
type: PropTypes.oneOf(['default', 'dangerous'])
|
|
39
|
+
} : {};
|
|
40
|
+
|
|
41
|
+
const ButtonMenu = props => {
|
|
42
|
+
const {
|
|
43
|
+
buttons,
|
|
44
|
+
'data-name': dataName
|
|
45
|
+
} = props;
|
|
46
|
+
|
|
47
|
+
const buildButton = (button, index) => {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, button, {
|
|
49
|
+
key: button.label + index
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const buttonList = useMemo(() => map.convert({
|
|
54
|
+
cap: false
|
|
55
|
+
})(buildButton, buttons), [buttons, buildButton]);
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
"data-name": dataName
|
|
58
|
+
}, buttonList);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
62
|
+
buttons: PropTypes.arrayOf(PropTypes.shape(Button.propTypes)).isRequired,
|
|
63
|
+
'data-name': PropTypes.string
|
|
64
|
+
} : {};
|
|
65
|
+
export default ButtonMenu;
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/button-menu/index.js"],"names":["React","useMemo","useCallback","PropTypes","map","classnames","style","Button","props","dataName","disabled","label","onClick","type","styleButton","button","default","dangerous","handleOnClick","buttonContent","propTypes","string","bool","isRequired","func","oneOf","ButtonMenu","buttons","buildButton","index","buttonList","convert","cap","arrayOf","shape"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,WAAxB,QAA0C,OAA1C;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,MAAM,GAAGC,KAAK,IAAI;AACtB,QAAM;AAAC,iBAAaC,QAAd;AAAwBC,IAAAA,QAAxB;AAAkCC,IAAAA,KAAlC;AAAyCC,IAAAA,OAAzC;AAAkDC,IAAAA,IAAI,GAAG;AAAzD,MAAsEL,KAA5E;AACA,QAAMM,WAAW,GAAGT,UAAU,CAC5BC,KAAK,CAACS,MADsB,EAE5BF,IAAI,KAAK,SAAT,IAAsBP,KAAK,CAACU,OAFA,EAG5BH,IAAI,KAAK,WAAT,IAAwBP,KAAK,CAACW,SAHF,EAI5BP,QAAQ,IAAIJ,KAAK,CAACI,QAJU,CAA9B;AAOA,QAAMQ,aAAa,GAAGhB,WAAW,CAAC,MAAMU,OAAO,EAAd,EAAkB,CAACA,OAAD,CAAlB,CAAjC;AACA,sBACE;AACE,IAAA,IAAI,EAAC,QADP;AAEE,kBAAYD,KAFd;AAGE,IAAA,KAAK,EAAEA,KAHT;AAIE,iBAAWF,QAJb;AAKE,IAAA,SAAS,EAAEK,WALb;AAME,IAAA,OAAO,EAAEI;AANX,kBAQE;AAAK,IAAA,SAAS,EAAEZ,KAAK,CAACa;AAAtB,kBACE;AAAM,IAAA,SAAS,EAAEb,KAAK,CAACK;AAAvB,KAA+BA,KAA/B,CADF,CARF,CADF;AAcD,CAxBD;;AA0BAJ,MAAM,CAACa,SAAP,2CAAmB;AACjB,eAAajB,SAAS,CAACkB,MADN;AAEjBX,EAAAA,QAAQ,EAAEP,SAAS,CAACmB,IAFH;AAGjBX,EAAAA,KAAK,EAAER,SAAS,CAACkB,MAAV,CAAiBE,UAHP;AAIjBX,EAAAA,OAAO,EAAET,SAAS,CAACqB,IAAV,CAAeD,UAJP;AAKjBV,EAAAA,IAAI,EAAEV,SAAS,CAACsB,KAAV,CAAgB,CAAC,SAAD,EAAY,WAAZ,CAAhB;AALW,CAAnB;;AAQA,MAAMC,UAAU,GAAGlB,KAAK,IAAI;AAC1B,QAAM;AAACmB,IAAAA,OAAD;AAAU,iBAAalB;AAAvB,MAAmCD,KAAzC;;AACA,QAAMoB,WAAW,GAAG,CAACb,MAAD,EAASc,KAAT,KAAmB;AACrC,wBAAO,oBAAC,MAAD,eAAYd,MAAZ;AAAoB,MAAA,GAAG,EAAEA,MAAM,CAACJ,KAAP,GAAekB;AAAxC,OAAP;AACD,GAFD;;AAGA,QAAMC,UAAU,GAAG7B,OAAO,CAAC,MAAMG,GAAG,CAAC2B,OAAJ,CAAY;AAACC,IAAAA,GAAG,EAAE;AAAN,GAAZ,EAA0BJ,WAA1B,EAAuCD,OAAvC,CAAP,EAAwD,CAChFA,OADgF,EAEhFC,WAFgF,CAAxD,CAA1B;AAIA,sBAAO;AAAK,iBAAWnB;AAAhB,KAA2BqB,UAA3B,CAAP;AACD,CAVD;;AAYAJ,UAAU,CAACN,SAAX,2CAAuB;AACrBO,EAAAA,OAAO,EAAExB,SAAS,CAAC8B,OAAV,CAAkB9B,SAAS,CAAC+B,KAAV,CAAgB3B,MAAM,CAACa,SAAvB,CAAlB,EAAqDG,UADzC;AAErB,eAAapB,SAAS,CAACkB;AAFF,CAAvB;AAKA,eAAeK,UAAf","sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport style from './style.css';\n\nconst Button = props => {\n const {'data-name': dataName, disabled, label, onClick, type = 'default'} = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.default,\n type === 'dangerous' && style.dangerous,\n disabled && style.disabled\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n >\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n </button>\n );\n};\n\nButton.propTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n type: PropTypes.oneOf(['default', 'dangerous'])\n};\n\nconst ButtonMenu = props => {\n const {buttons, 'data-name': dataName} = props;\n const buildButton = (button, index) => {\n return <Button {...button} key={button.label + index} />;\n };\n const buttonList = useMemo(() => map.convert({cap: false})(buildButton, buttons), [\n buttons,\n buildButton\n ]);\n return <div data-name={dataName}>{buttonList}</div>;\n};\n\nButtonMenu.propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(Button.propTypes)).isRequired,\n 'data-name': PropTypes.string\n};\n\nexport default ButtonMenu;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_100 from colors;
|
|
3
|
+
@value cm_grey_200 from colors;
|
|
4
|
+
@value cm_grey_900 from colors;
|
|
5
|
+
@value cm_negative_100 from colors;
|
|
6
|
+
|
|
7
|
+
.button {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 40px;
|
|
10
|
+
font-family: Gilroy;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
border: none;
|
|
17
|
+
pointer-events: auto;
|
|
18
|
+
/* prevents text selection when dragging
|
|
19
|
+
the mouse over the button */
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.disabled {
|
|
24
|
+
opacity: 0.1;
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.buttonContent {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.label {
|
|
35
|
+
margin: 0 8px 0 8px;
|
|
36
|
+
display: block;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.default {
|
|
40
|
+
background-color: cm_grey_100;
|
|
41
|
+
color: cm_grey_900;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.default:hover {
|
|
45
|
+
background-color: cm_grey_200;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dangerous {
|
|
49
|
+
composes: default;
|
|
50
|
+
color: cm_negative_100;
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const actionButtonProps = {
|
|
2
|
+
'data-name': 'menu-publish-button',
|
|
3
|
+
label: 'Publish',
|
|
4
|
+
onClick: () => console.log('Publish'),
|
|
5
|
+
type: 'default'
|
|
6
|
+
};
|
|
7
|
+
export const deleteButtonProps = {
|
|
8
|
+
'data-name': 'menu-delete-button',
|
|
9
|
+
label: 'Delete',
|
|
10
|
+
onClick: () => console.log('Delete'),
|
|
11
|
+
type: 'dangerous'
|
|
12
|
+
};
|
|
13
|
+
export default {
|
|
14
|
+
props: {
|
|
15
|
+
buttons: [actionButtonProps, deleteButtonProps],
|
|
16
|
+
'aria-label': 'aria button',
|
|
17
|
+
'data-name': 'default-menu'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-menu/test/fixtures/default.js"],"names":["actionButtonProps","label","onClick","console","log","type","deleteButtonProps","props","buttons"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,GAAG;AAC/B,eAAa,qBADkB;AAE/BC,EAAAA,KAAK,EAAE,SAFwB;AAG/BC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAHgB;AAI/BC,EAAAA,IAAI,EAAE;AAJyB,CAA1B;AAOP,OAAO,MAAMC,iBAAiB,GAAG;AAC/B,eAAa,oBADkB;AAE/BL,EAAAA,KAAK,EAAE,QAFwB;AAG/BC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,QAAZ,CAHgB;AAI/BC,EAAAA,IAAI,EAAE;AAJyB,CAA1B;AAOP,eAAe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CAACR,iBAAD,EAAoBM,iBAApB,CADJ;AAEL,kBAAc,aAFT;AAGL,iBAAa;AAHR;AADM,CAAf","sourcesContent":["export const actionButtonProps = {\n 'data-name': 'menu-publish-button',\n label: 'Publish',\n onClick: () => console.log('Publish'),\n type: 'default'\n};\n\nexport const deleteButtonProps = {\n 'data-name': 'menu-delete-button',\n label: 'Delete',\n onClick: () => console.log('Delete'),\n type: 'dangerous'\n};\n\nexport default {\n props: {\n buttons: [actionButtonProps, deleteButtonProps],\n 'aria-label': 'aria button',\n 'data-name': 'default-menu'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { actionButtonProps, deleteButtonProps } from './default';
|
|
2
|
+
export const disabledButtonProps = {
|
|
3
|
+
'data-name': 'menu-disabled-button',
|
|
4
|
+
label: 'Disabled',
|
|
5
|
+
onClick: () => console.log('Disabled'),
|
|
6
|
+
disabled: true
|
|
7
|
+
};
|
|
8
|
+
export default {
|
|
9
|
+
props: {
|
|
10
|
+
buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps],
|
|
11
|
+
'aria-label': 'aria button 2',
|
|
12
|
+
'data-name': 'default-menu-2'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=multiple-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-menu/test/fixtures/multiple-buttons.js"],"names":["actionButtonProps","deleteButtonProps","disabledButtonProps","label","onClick","console","log","disabled","props","buttons"],"mappings":"AAAA,SAAQA,iBAAR,EAA2BC,iBAA3B,QAAmD,WAAnD;AAEA,OAAO,MAAMC,mBAAmB,GAAG;AACjC,eAAa,sBADoB;AAEjCC,EAAAA,KAAK,EAAE,UAF0B;AAGjCC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,UAAZ,CAHkB;AAIjCC,EAAAA,QAAQ,EAAE;AAJuB,CAA5B;AAOP,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CAACT,iBAAD,EAAoBE,mBAApB,EAAyCD,iBAAzC,CADJ;AAEL,kBAAc,eAFT;AAGL,iBAAa;AAHR;AADM,CAAf","sourcesContent":["import {actionButtonProps, deleteButtonProps} from './default';\n\nexport const disabledButtonProps = {\n 'data-name': 'menu-disabled-button',\n label: 'Disabled',\n onClick: () => console.log('Disabled'),\n disabled: true\n};\n\nexport default {\n props: {\n buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps],\n 'aria-label': 'aria button 2',\n 'data-name': 'default-menu-2'\n }\n};\n"],"file":"multiple-buttons.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomButtonMenu from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureMultipleButtons from './fixtures/multiple-buttons';
|
|
7
|
+
test('Atom › AtomButtonMenu > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomButtonMenu.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonMenu.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);
|
|
14
|
+
test('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-menu/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonMenu","fixtureDefault","fixtureMultipleButtons","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AAEAL,IAAI,CAAC,qDAAD,EAAwDM,CAAC,IAAI;AAC/DA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+CAA8CF,GAAI,mEAA3E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,cAA/E,EAA+FC,cAA/F,CAAJ;AACAJ,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,cAAvF,EAAuGE,sBAAvG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonMenu from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureMultipleButtons from './fixtures/multiple-buttons';\n\ntest('Atom › AtomButtonMenu > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonMenu.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonMenu.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);\ntest('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);\n"],"file":"fixtures.js"}
|
package/es/atom/chips/index.js
CHANGED
|
@@ -8,18 +8,22 @@ const Chips = props => {
|
|
|
8
8
|
const {
|
|
9
9
|
text,
|
|
10
10
|
information,
|
|
11
|
-
selected,
|
|
11
|
+
selected = false,
|
|
12
12
|
onClick
|
|
13
13
|
} = props;
|
|
14
14
|
const handleClick = useMemo(() => () => onClick(), [onClick]);
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: classnames(style.container, selected ? style.selected : style.unselected),
|
|
17
|
-
onClick: handleClick
|
|
17
|
+
onClick: handleClick,
|
|
18
|
+
"aria-label": `${text} ${information}`
|
|
18
19
|
}, /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: style.textZone,
|
|
21
|
+
title: text
|
|
22
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
19
23
|
className: style.text
|
|
20
|
-
}, text), /*#__PURE__*/React.createElement("
|
|
24
|
+
}, text), /*#__PURE__*/React.createElement("span", {
|
|
21
25
|
className: style.information
|
|
22
|
-
}, information), selected ? /*#__PURE__*/React.createElement(SelectedIcon, {
|
|
26
|
+
}, information)), selected ? /*#__PURE__*/React.createElement(SelectedIcon, {
|
|
23
27
|
className: style.selectedIconWrapper
|
|
24
28
|
}) : /*#__PURE__*/React.createElement(AddIcon, {
|
|
25
29
|
className: style.unselectedIconWrapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/chips/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaSolidRemoveAddAddCircle1","AddIcon","NovaSolidStatusCheckCircle2","SelectedIcon","style","Chips","props","text","information","selected","onClick","handleClick","container","unselected","selectedIconWrapper","unselectedIconWrapper","propTypes","string","bool","func"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,4BAA4B,IAAIC,OADlC,EAEEC,2BAA2B,IAAIC,YAFjC,QAGO,0BAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,KAAK,GAAGC,KAAK,IAAI;AACrB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,WAAP;AAAoBC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/chips/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaSolidRemoveAddAddCircle1","AddIcon","NovaSolidStatusCheckCircle2","SelectedIcon","style","Chips","props","text","information","selected","onClick","handleClick","container","unselected","textZone","selectedIconWrapper","unselectedIconWrapper","propTypes","string","bool","func"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,4BAA4B,IAAIC,OADlC,EAEEC,2BAA2B,IAAIC,YAFjC,QAGO,0BAHP;AAIA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,KAAK,GAAGC,KAAK,IAAI;AACrB,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA,WAAP;AAAoBC,IAAAA,QAAQ,GAAG,KAA/B;AAAsCC,IAAAA;AAAtC,MAAiDJ,KAAvD;AAEA,QAAMK,WAAW,GAAGd,OAAO,CAAC,MAAM,MAAMa,OAAO,EAApB,EAAwB,CAACA,OAAD,CAAxB,CAA3B;AAEA,sBACE;AACE,IAAA,SAAS,EAAEX,UAAU,CAACK,KAAK,CAACQ,SAAP,EAAkBH,QAAQ,GAAGL,KAAK,CAACK,QAAT,GAAoBL,KAAK,CAACS,UAApD,CADvB;AAEE,IAAA,OAAO,EAAEF,WAFX;AAGE,kBAAa,GAAEJ,IAAK,IAAGC,WAAY;AAHrC,kBAKE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACU,QAAtB;AAAgC,IAAA,KAAK,EAAEP;AAAvC,kBACE;AAAM,IAAA,SAAS,EAAEH,KAAK,CAACG;AAAvB,KAA8BA,IAA9B,CADF,eAEE;AAAM,IAAA,SAAS,EAAEH,KAAK,CAACI;AAAvB,KAAqCA,WAArC,CAFF,CALF,EASGC,QAAQ,gBACP,oBAAC,YAAD;AAAc,IAAA,SAAS,EAAEL,KAAK,CAACW;AAA/B,IADO,gBAGP,oBAAC,OAAD;AAAS,IAAA,SAAS,EAAEX,KAAK,CAACY;AAA1B,IAZJ,CADF;AAiBD,CAtBD;;AAwBAX,KAAK,CAACY,SAAN,2CAAkB;AAChBV,EAAAA,IAAI,EAAET,SAAS,CAACoB,MADA;AAEhBV,EAAAA,WAAW,EAAEV,SAAS,CAACoB,MAFP;AAGhBT,EAAAA,QAAQ,EAAEX,SAAS,CAACqB,IAHJ;AAIhBT,EAAAA,OAAO,EAAEZ,SAAS,CAACsB;AAJH,CAAlB;AAOA,eAAef,KAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaSolidStatusCheckCircle2 as SelectedIcon\n} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst Chips = props => {\n const {text, information, selected = false, onClick} = props;\n\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n\n return (\n <div\n className={classnames(style.container, selected ? style.selected : style.unselected)}\n onClick={handleClick}\n aria-label={`${text} ${information}`}\n >\n <div className={style.textZone} title={text}>\n <span className={style.text}>{text}</span>\n <span className={style.information}>{information}</span>\n </div>\n {selected ? (\n <SelectedIcon className={style.selectedIconWrapper} />\n ) : (\n <AddIcon className={style.unselectedIconWrapper} />\n )}\n </div>\n );\n};\n\nChips.propTypes = {\n text: PropTypes.string,\n information: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func\n};\n\nexport default Chips;\n"],"file":"index.js"}
|
package/es/atom/chips/style.css
CHANGED
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
@value white from colors;
|
|
8
8
|
|
|
9
9
|
.container {
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 52px;
|
|
12
12
|
border-radius: 10px;
|
|
13
13
|
padding: 10px 16px;
|
|
14
14
|
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
cursor: pointer;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.selected {
|
|
@@ -30,12 +34,22 @@
|
|
|
30
34
|
background-color: cm_grey_200;
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
.textZone {
|
|
38
|
+
flex: 1 1 100%;
|
|
39
|
+
padding-right: 32px;
|
|
40
|
+
width: calc(100% - 32px);
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
.text {
|
|
34
44
|
font-family: 'Gilroy';
|
|
35
45
|
font-style: normal;
|
|
36
46
|
font-weight: 600;
|
|
37
47
|
font-size: 14px;
|
|
38
48
|
color: cm_grey_700;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
display: block;
|
|
39
53
|
}
|
|
40
54
|
|
|
41
55
|
.information {
|
|
@@ -45,6 +59,7 @@
|
|
|
45
59
|
font-size: 10px;
|
|
46
60
|
opacity: 0.4;
|
|
47
61
|
color: cm_grey_700;
|
|
62
|
+
display: block;
|
|
48
63
|
}
|
|
49
64
|
|
|
50
65
|
.icon{
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
text: 'Population Human resourses filiale Singapour and lots and lots of text that should be cut somewhere because the chip item it should not take all the width of the component and and ellipsis should be shown.',
|
|
4
|
+
information: '345 users',
|
|
5
|
+
select: false,
|
|
6
|
+
onClick: () => console.log('click')
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=long-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/chips/test/fixtures/long-text.js"],"names":["props","text","information","select","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EACF,+MAFG;AAGLC,IAAAA,WAAW,EAAE,WAHR;AAILC,IAAAA,MAAM,EAAE,KAJH;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,CAAf","sourcesContent":["export default {\n props: {\n text:\n 'Population Human resourses filiale Singapour and lots and lots of text that should be cut somewhere because the chip item it should not take all the width of the component and and ellipsis should be shown.',\n information: '345 users',\n select: false,\n onClick: () => console.log('click')\n }\n};\n"],"file":"long-text.js"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomChips from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureLongText from './fixtures/long-text';
|
|
7
|
+
import fixtureNonSelected from './fixtures/non-selected';
|
|
8
|
+
test('Atom › AtomChips > should have valid propTypes', t => {
|
|
9
|
+
t.pass();
|
|
10
|
+
forEach(AtomChips.propTypes, (value, key) => {
|
|
11
|
+
t.not(value, undefined, `PropType for "Atom.AtomChips.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test('Atom › AtomChips › Default › should be rendered', renderComponentMacro, AtomChips, fixtureDefault);
|
|
15
|
+
test('Atom › AtomChips › LongText › should be rendered', renderComponentMacro, AtomChips, fixtureLongText);
|
|
16
|
+
test('Atom › AtomChips › NonSelected › should be rendered', renderComponentMacro, AtomChips, fixtureNonSelected);
|
|
17
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/chips/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomChips","fixtureDefault","fixtureLongText","fixtureNonSelected","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,SAAP,MAAsB,IAAtB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,sBAA5B;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAN,IAAI,CAAC,gDAAD,EAAmDO,CAAC,IAAI;AAC1DA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,SAAS,CAACM,SAAX,EAAsB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC3CJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,0CAAyCF,GAAI,mEAAtE;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,iDAAD,EAAoDE,oBAApD,EAA0EC,SAA1E,EAAqFC,cAArF,CAAJ;AACAJ,IAAI,CAAC,kDAAD,EAAqDE,oBAArD,EAA2EC,SAA3E,EAAsFE,eAAtF,CAAJ;AACAL,IAAI,CAAC,qDAAD,EAAwDE,oBAAxD,EAA8EC,SAA9E,EAAyFG,kBAAzF,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomChips from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureLongText from './fixtures/long-text';\nimport fixtureNonSelected from './fixtures/non-selected';\n\ntest('Atom › AtomChips > should have valid propTypes', t => {\n t.pass();\n forEach(AtomChips.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomChips.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomChips › Default › should be rendered', renderComponentMacro, AtomChips, fixtureDefault);\ntest('Atom › AtomChips › LongText › should be rendered', renderComponentMacro, AtomChips, fixtureLongText);\ntest('Atom › AtomChips › NonSelected › should be rendered', renderComponentMacro, AtomChips, fixtureNonSelected);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomContentBadge from '..';
|
|
5
|
+
import fixtureAdvanced from './fixtures/advanced';
|
|
6
|
+
import fixtureArticle from './fixtures/article';
|
|
7
|
+
import fixtureChapter from './fixtures/chapter';
|
|
8
|
+
import fixtureCoach from './fixtures/coach';
|
|
9
|
+
import fixtureDefault from './fixtures/default';
|
|
10
|
+
import fixturePodcast from './fixtures/podcast';
|
|
11
|
+
import fixtureScorm from './fixtures/scorm';
|
|
12
|
+
import fixtureVideo from './fixtures/video';
|
|
13
|
+
test('Atom › AtomContentBadge > should have valid propTypes', t => {
|
|
14
|
+
t.pass();
|
|
15
|
+
forEach(AtomContentBadge.propTypes, (value, key) => {
|
|
16
|
+
t.not(value, undefined, `PropType for "Atom.AtomContentBadge.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
test('Atom › AtomContentBadge › Advanced › should be rendered', renderComponentMacro, AtomContentBadge, fixtureAdvanced);
|
|
20
|
+
test('Atom › AtomContentBadge › Article › should be rendered', renderComponentMacro, AtomContentBadge, fixtureArticle);
|
|
21
|
+
test('Atom › AtomContentBadge › Chapter › should be rendered', renderComponentMacro, AtomContentBadge, fixtureChapter);
|
|
22
|
+
test('Atom › AtomContentBadge › Coach › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCoach);
|
|
23
|
+
test('Atom › AtomContentBadge › Default › should be rendered', renderComponentMacro, AtomContentBadge, fixtureDefault);
|
|
24
|
+
test('Atom › AtomContentBadge › Podcast › should be rendered', renderComponentMacro, AtomContentBadge, fixturePodcast);
|
|
25
|
+
test('Atom › AtomContentBadge › Scorm › should be rendered', renderComponentMacro, AtomContentBadge, fixtureScorm);
|
|
26
|
+
test('Atom › AtomContentBadge › Video › should be rendered', renderComponentMacro, AtomContentBadge, fixtureVideo);
|
|
27
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/content-badge/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomContentBadge","fixtureAdvanced","fixtureArticle","fixtureChapter","fixtureCoach","fixtureDefault","fixturePodcast","fixtureScorm","fixtureVideo","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,gBAAP,MAA6B,IAA7B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AAEAX,IAAI,CAAC,uDAAD,EAA0DY,CAAC,IAAI;AACjEA,EAAAA,CAAC,CAACC,IAAF;AACAZ,EAAAA,OAAO,CAACE,gBAAgB,CAACW,SAAlB,EAA6B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAClDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,iDAAgDF,GAAI,mEAA7E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAhB,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,gBAAlF,EAAoGC,eAApG,CAAJ;AACAJ,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGE,cAAnG,CAAJ;AACAL,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGG,cAAnG,CAAJ;AACAN,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGI,YAAjG,CAAJ;AACAP,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGK,cAAnG,CAAJ;AACAR,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,gBAAjF,EAAmGM,cAAnG,CAAJ;AACAT,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGO,YAAjG,CAAJ;AACAV,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,gBAA/E,EAAiGQ,YAAjG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomContentBadge from '..';\nimport fixtureAdvanced from './fixtures/advanced';\nimport fixtureArticle from './fixtures/article';\nimport fixtureChapter from './fixtures/chapter';\nimport fixtureCoach from './fixtures/coach';\nimport fixtureDefault from './fixtures/default';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureVideo from './fixtures/video';\n\ntest('Atom › AtomContentBadge > should have valid propTypes', t => {\n t.pass();\n forEach(AtomContentBadge.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomContentBadge.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomContentBadge › Advanced › should be rendered', renderComponentMacro, AtomContentBadge, fixtureAdvanced);\ntest('Atom › AtomContentBadge › Article › should be rendered', renderComponentMacro, AtomContentBadge, fixtureArticle);\ntest('Atom › AtomContentBadge › Chapter › should be rendered', renderComponentMacro, AtomContentBadge, fixtureChapter);\ntest('Atom › AtomContentBadge › Coach › should be rendered', renderComponentMacro, AtomContentBadge, fixtureCoach);\ntest('Atom › AtomContentBadge › Default › should be rendered', renderComponentMacro, AtomContentBadge, fixtureDefault);\ntest('Atom › AtomContentBadge › Podcast › should be rendered', renderComponentMacro, AtomContentBadge, fixturePodcast);\ntest('Atom › AtomContentBadge › Scorm › should be rendered', renderComponentMacro, AtomContentBadge, fixtureScorm);\ntest('Atom › AtomContentBadge › Video › should be rendered', renderComponentMacro, AtomContentBadge, fixtureVideo);\n"],"file":"fixtures.js"}
|