@coorpacademy/components 11.40.15 → 11.40.16
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/style.css +2 -2
- package/es/atom/button-menu/utils.d.ts +1 -1
- package/es/atom/checkbox-with-title/index.d.ts +25 -1
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +19 -2
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +4 -4
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/content-badge/style.css +2 -2
- package/es/atom/input-html/index.d.ts.map +1 -1
- package/es/atom/input-html/index.js +2 -1
- package/es/atom/input-html/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts +24 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +18 -4
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +3 -0
- package/es/atom/range/index.d.ts +35 -3
- package/es/atom/range/index.d.ts.map +1 -1
- package/es/atom/range/index.js +95 -20
- package/es/atom/range/index.js.map +1 -1
- package/es/atom/range/style.css +40 -2
- package/es/atom/resource-miniature/style.css +3 -3
- package/es/atom/status-item/index.native.js +1 -1
- package/es/atom/status-item/index.native.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +11 -5
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +15 -16
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/notification.css +0 -6
- package/es/molecule/card/notification.d.ts.map +1 -1
- package/es/molecule/card/notification.js +12 -14
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +2 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/coorpmanager-base-banner/style.css +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +9 -0
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +5 -1
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +1 -1
- package/es/molecule/draggable-list/index.d.ts +1 -0
- package/es/molecule/go1-banner/style.css +3 -3
- package/es/molecule/learning-priority-modal/index.js +1 -1
- package/es/molecule/learning-priority-modal/index.js.map +1 -1
- package/es/molecule/modal/style.css +3 -3
- package/es/molecule/multi-filter-panel/index.d.ts +42 -0
- package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +28 -15
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts +32 -5
- package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.js +4 -0
- package/es/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +6 -1
- package/es/molecule/quick-filters/index.js +3 -1
- package/es/molecule/quick-filters/index.js.map +1 -1
- package/es/molecule/quick-filters/style.css +7 -2
- package/es/molecule/tabs/index.d.ts +39 -0
- package/es/molecule/tabs/index.d.ts.map +1 -0
- package/es/molecule/tabs/index.js +69 -0
- package/es/molecule/tabs/index.js.map +1 -0
- package/es/molecule/tabs/style.css +28 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/organism/brand-analytics/style.css +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +1 -0
- package/es/organism/content-skill-modal/index.d.ts +23 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +23 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +22 -0
- package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.js +21 -4
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.d.ts +3 -0
- package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/es/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/es/organism/filter-chip/index.d.ts +21 -0
- package/es/organism/filter-chip/index.d.ts.map +1 -1
- package/es/organism/filter-chip/index.js +14 -2
- package/es/organism/filter-chip/index.js.map +1 -1
- package/es/organism/filter-range/index.d.ts +28 -0
- package/es/organism/filter-range/index.d.ts.map +1 -0
- package/es/organism/filter-range/index.js +101 -0
- package/es/organism/filter-range/index.js.map +1 -0
- package/es/organism/filter-range/prop-types.d.ts +40 -0
- package/es/organism/filter-range/prop-types.d.ts.map +1 -0
- package/es/organism/filter-range/prop-types.js +20 -0
- package/es/organism/filter-range/prop-types.js.map +1 -0
- package/es/organism/filter-range/style.css +15 -0
- package/es/organism/filter-switch/index.d.ts +22 -0
- package/es/organism/filter-switch/index.d.ts.map +1 -1
- package/es/organism/filter-switch/index.js +18 -3
- package/es/organism/filter-switch/index.js.map +1 -1
- package/es/organism/filter-switch/prop-types.d.ts +2 -0
- package/es/organism/filter-switch/prop-types.d.ts.map +1 -1
- package/es/organism/filter-switch/prop-types.js +2 -1
- package/es/organism/filter-switch/prop-types.js.map +1 -1
- package/es/organism/list-item/index.d.ts +1 -0
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/list-items/style.css +1 -1
- package/es/organism/mooc-footer/style.css +2 -2
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/sidebar/style.css +3 -3
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +1 -0
- package/es/template/activity/stars-summary.css +2 -2
- package/es/template/app-player/loading/index.d.ts +2 -0
- package/es/template/app-player/player/index.d.ts +4 -0
- package/es/template/app-player/player/slides/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +11 -0
- package/es/template/app-player/popin-end/summary.d.ts +9 -0
- package/es/template/app-review/index.d.ts +2 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +2 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +2 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +28 -0
- package/es/template/back-office/brand-update/utils.d.ts +1 -1
- package/es/template/common/dashboard/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +106 -21
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +76 -21
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/common/search-page/style.css +52 -4
- package/es/template/external-course/index.d.ts +2 -0
- package/es/template/my-learning/index.d.ts +9 -0
- package/es/template/teams-dashboard/index.d.ts +9 -0
- package/es/util/external-content.js +2 -2
- package/es/util/external-content.js.map +1 -1
- package/es/variables/colors.css +6 -6
- package/es/variables/colors.d.ts +5 -4
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +5 -4
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button/style.css +2 -2
- package/lib/atom/button-menu/utils.d.ts +1 -1
- package/lib/atom/checkbox-with-title/index.d.ts +25 -1
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +19 -2
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +4 -4
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/content-badge/style.css +2 -2
- package/lib/atom/input-html/index.d.ts.map +1 -1
- package/lib/atom/input-html/index.js +2 -1
- package/lib/atom/input-html/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts +24 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +18 -4
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +3 -0
- package/lib/atom/range/index.d.ts +35 -3
- package/lib/atom/range/index.d.ts.map +1 -1
- package/lib/atom/range/index.js +95 -20
- package/lib/atom/range/index.js.map +1 -1
- package/lib/atom/range/style.css +40 -2
- package/lib/atom/resource-miniature/style.css +3 -3
- package/lib/atom/status-item/index.native.js +1 -1
- package/lib/atom/status-item/index.native.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +11 -5
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +15 -16
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/notification.css +0 -6
- package/lib/molecule/card/notification.d.ts.map +1 -1
- package/lib/molecule/card/notification.js +12 -14
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +2 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/coorpmanager-base-banner/style.css +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +9 -0
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +5 -1
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +1 -1
- package/lib/molecule/draggable-list/index.d.ts +1 -0
- package/lib/molecule/go1-banner/style.css +3 -3
- package/lib/molecule/learning-priority-modal/index.js +1 -1
- package/lib/molecule/learning-priority-modal/index.js.map +1 -1
- package/lib/molecule/modal/style.css +3 -3
- package/lib/molecule/multi-filter-panel/index.d.ts +42 -0
- package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js +28 -15
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts +32 -5
- package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.js +4 -0
- package/lib/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +6 -1
- package/lib/molecule/quick-filters/index.js +3 -1
- package/lib/molecule/quick-filters/index.js.map +1 -1
- package/lib/molecule/quick-filters/style.css +7 -2
- package/lib/molecule/tabs/index.d.ts +39 -0
- package/lib/molecule/tabs/index.d.ts.map +1 -0
- package/lib/molecule/tabs/index.js +74 -0
- package/lib/molecule/tabs/index.js.map +1 -0
- package/lib/molecule/tabs/style.css +28 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/organism/brand-analytics/style.css +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +1 -0
- package/lib/organism/content-skill-modal/index.d.ts +23 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +23 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +22 -0
- package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.js +21 -4
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts +3 -0
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/lib/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/lib/organism/filter-chip/index.d.ts +21 -0
- package/lib/organism/filter-chip/index.d.ts.map +1 -1
- package/lib/organism/filter-chip/index.js +14 -2
- package/lib/organism/filter-chip/index.js.map +1 -1
- package/lib/organism/filter-range/index.d.ts +28 -0
- package/lib/organism/filter-range/index.d.ts.map +1 -0
- package/lib/organism/filter-range/index.js +108 -0
- package/lib/organism/filter-range/index.js.map +1 -0
- package/lib/organism/filter-range/prop-types.d.ts +40 -0
- package/lib/organism/filter-range/prop-types.d.ts.map +1 -0
- package/lib/organism/filter-range/prop-types.js +25 -0
- package/lib/organism/filter-range/prop-types.js.map +1 -0
- package/lib/organism/filter-range/style.css +15 -0
- package/lib/organism/filter-switch/index.d.ts +22 -0
- package/lib/organism/filter-switch/index.d.ts.map +1 -1
- package/lib/organism/filter-switch/index.js +18 -3
- package/lib/organism/filter-switch/index.js.map +1 -1
- package/lib/organism/filter-switch/prop-types.d.ts +2 -0
- package/lib/organism/filter-switch/prop-types.d.ts.map +1 -1
- package/lib/organism/filter-switch/prop-types.js +2 -1
- package/lib/organism/filter-switch/prop-types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +1 -0
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/list-items/style.css +1 -1
- package/lib/organism/mooc-footer/style.css +2 -2
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/sidebar/style.css +3 -3
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +1 -0
- package/lib/template/activity/stars-summary.css +2 -2
- package/lib/template/app-player/loading/index.d.ts +2 -0
- package/lib/template/app-player/player/index.d.ts +4 -0
- package/lib/template/app-player/player/slides/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +11 -0
- package/lib/template/app-player/popin-end/summary.d.ts +9 -0
- package/lib/template/app-review/index.d.ts +2 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +2 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +2 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +28 -0
- package/lib/template/back-office/brand-update/utils.d.ts +1 -1
- package/lib/template/common/dashboard/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +106 -21
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +75 -20
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/common/search-page/style.css +52 -4
- package/lib/template/external-course/index.d.ts +2 -0
- package/lib/template/my-learning/index.d.ts +9 -0
- package/lib/template/teams-dashboard/index.d.ts +9 -0
- package/lib/util/external-content.js +2 -2
- package/lib/util/external-content.js.map +1 -1
- package/lib/variables/colors.css +6 -6
- package/lib/variables/colors.d.ts +5 -4
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +5 -4
- package/lib/variables/colors.js.map +1 -1
- package/package.json +4 -2
package/es/atom/button/style.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@value xtraLightGrey from colors;
|
|
4
4
|
@value light from colors;
|
|
5
5
|
@value white from colors;
|
|
6
|
-
@value
|
|
6
|
+
@value lightMediumGrey from colors;
|
|
7
7
|
|
|
8
8
|
.button {
|
|
9
9
|
composes: hoverFill from './hover-fill.css';
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.disabledAnchor {
|
|
44
|
-
background-color:
|
|
44
|
+
background-color: lightMediumGrey;
|
|
45
45
|
min-width: 200px;
|
|
46
46
|
text-transform: inherit;
|
|
47
47
|
border-radius: 2px;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export default CheckboxWithTitle;
|
|
2
|
-
declare function CheckboxWithTitle(props: any): JSX.Element;
|
|
2
|
+
declare function CheckboxWithTitle(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace CheckboxWithTitle {
|
|
4
4
|
const propTypes: {
|
|
5
|
+
value: PropTypes.Requireable<string>;
|
|
5
6
|
title: PropTypes.Requireable<string>;
|
|
6
7
|
name: PropTypes.Requireable<string>;
|
|
7
8
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -17,6 +18,29 @@ declare namespace CheckboxWithTitle {
|
|
|
17
18
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
18
19
|
}>;
|
|
19
20
|
};
|
|
21
|
+
namespace contextTypes {
|
|
22
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
23
|
+
common: PropTypes.Requireable<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>;
|
|
26
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
27
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
28
|
+
logo: PropTypes.Requireable<any>;
|
|
29
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
30
|
+
login: PropTypes.Requireable<any>;
|
|
31
|
+
}>>;
|
|
32
|
+
icons: PropTypes.Requireable<{
|
|
33
|
+
[x: string]: any;
|
|
34
|
+
}>;
|
|
35
|
+
mod: PropTypes.Requireable<{
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
}>;
|
|
38
|
+
courses: PropTypes.Requireable<any[]>;
|
|
39
|
+
texts: PropTypes.Requireable<{
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
}>;
|
|
42
|
+
}>>;
|
|
43
|
+
}
|
|
20
44
|
}
|
|
21
45
|
import PropTypes from "prop-types";
|
|
22
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";AAUA,0EAiEC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
2
2
|
import _noop from "lodash/fp/noop";
|
|
3
|
+
import _getOr from "lodash/fp/getOr";
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import FaIcon from '../icon';
|
|
7
|
+
import { COLORS } from '../../variables/colors';
|
|
8
|
+
import Provider from '../provider';
|
|
6
9
|
import style from './style.css';
|
|
7
10
|
const DEFAULT_ICON_STYLE = {
|
|
8
11
|
padding: '0',
|
|
9
12
|
width: '20px',
|
|
10
13
|
height: '20px'
|
|
11
14
|
};
|
|
12
|
-
const CheckboxWithTitle = props => {
|
|
15
|
+
const CheckboxWithTitle = (props, context) => {
|
|
13
16
|
const {
|
|
17
|
+
value,
|
|
14
18
|
title,
|
|
15
19
|
name,
|
|
16
20
|
checked,
|
|
@@ -24,6 +28,10 @@ const CheckboxWithTitle = props => {
|
|
|
24
28
|
},
|
|
25
29
|
customStyle = {}
|
|
26
30
|
} = props;
|
|
31
|
+
const {
|
|
32
|
+
skin
|
|
33
|
+
} = context;
|
|
34
|
+
const primaryColor = _getOr(COLORS.cm_primary_blue, 'common.primary', skin);
|
|
27
35
|
const {
|
|
28
36
|
iconName,
|
|
29
37
|
iconColor,
|
|
@@ -40,6 +48,7 @@ const CheckboxWithTitle = props => {
|
|
|
40
48
|
htmlFor: idCheckbox
|
|
41
49
|
}, /*#__PURE__*/React.createElement("input", {
|
|
42
50
|
type: "checkbox",
|
|
51
|
+
"data-value": value,
|
|
43
52
|
id: idCheckbox,
|
|
44
53
|
name: name,
|
|
45
54
|
onChange: handleChange,
|
|
@@ -48,7 +57,11 @@ const CheckboxWithTitle = props => {
|
|
|
48
57
|
"data-name": dataName,
|
|
49
58
|
"aria-label": ariaLabel
|
|
50
59
|
}), /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: style.label
|
|
60
|
+
className: style.label,
|
|
61
|
+
style: checked ? {
|
|
62
|
+
background: primaryColor,
|
|
63
|
+
borderColor: primaryColor
|
|
64
|
+
} : null
|
|
52
65
|
}, checked ? /*#__PURE__*/React.createElement(FaIcon, {
|
|
53
66
|
className: style.icon,
|
|
54
67
|
iconName: iconName,
|
|
@@ -69,6 +82,7 @@ const CheckboxWithTitle = props => {
|
|
|
69
82
|
}) : null);
|
|
70
83
|
};
|
|
71
84
|
CheckboxWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
85
|
+
value: PropTypes.string,
|
|
72
86
|
title: PropTypes.string,
|
|
73
87
|
name: PropTypes.string,
|
|
74
88
|
checked: PropTypes.bool,
|
|
@@ -82,5 +96,8 @@ CheckboxWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
82
96
|
}),
|
|
83
97
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
84
98
|
} : {};
|
|
99
|
+
CheckboxWithTitle.contextTypes = {
|
|
100
|
+
skin: Provider.childContextTypes.skin
|
|
101
|
+
};
|
|
85
102
|
export default CheckboxWithTitle;
|
|
86
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FaIcon","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","idCheckbox","_uniqueId","handleChange","e","target","createElement","className","container","htmlFor","type","id","checkbox","label","dangerouslySetInnerHTML","__html","propTypes","process","env","NODE_ENV","string","bool","func","shape","objectOf","oneOfType","number"],"sources":["../../../src/atom/checkbox-with-title/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport FaIcon from '../icon';\nimport style from './style.css';\n\nconst DEFAULT_ICON_STYLE = {padding: '0', width: '20px', height: '20px'};\n\nconst CheckboxWithTitle = props => {\n const {\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n icon = {iconName: 'check', iconColor: 'white', preset: 's'},\n customStyle = {}\n } = props;\n const {iconName, iconColor, preset} = icon;\n const idCheckbox = useMemo(() => uniqueId('input-checkbox-'), []);\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <div className={style.container} style={{...customStyle}}>\n {onChange !== noop ? (\n <label htmlFor={idCheckbox}>\n <input\n type=\"checkbox\"\n id={idCheckbox}\n name={name}\n onChange={handleChange}\n checked={checked}\n className={style.checkbox}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FaIcon","COLORS","Provider","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","context","value","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","skin","primaryColor","_getOr","cm_primary_blue","idCheckbox","_uniqueId","handleChange","e","target","createElement","className","container","htmlFor","type","id","checkbox","label","background","borderColor","dangerouslySetInnerHTML","__html","propTypes","process","env","NODE_ENV","string","bool","func","shape","objectOf","oneOfType","number","contextTypes","childContextTypes"],"sources":["../../../src/atom/checkbox-with-title/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, noop, uniqueId} from 'lodash/fp';\nimport FaIcon from '../icon';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst DEFAULT_ICON_STYLE = {padding: '0', width: '20px', height: '20px'};\n\nconst CheckboxWithTitle = (props, context) => {\n const {\n value,\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n icon = {iconName: 'check', iconColor: 'white', preset: 's'},\n customStyle = {}\n } = props;\n const {skin} = context;\n const primaryColor = getOr(COLORS.cm_primary_blue, 'common.primary', skin);\n const {iconName, iconColor, preset} = icon;\n const idCheckbox = useMemo(() => uniqueId('input-checkbox-'), []);\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <div className={style.container} style={{...customStyle}}>\n {onChange !== noop ? (\n <label htmlFor={idCheckbox}>\n <input\n type=\"checkbox\"\n data-value={value}\n id={idCheckbox}\n name={name}\n onChange={handleChange}\n checked={checked}\n className={style.checkbox}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n <div\n className={style.label}\n style={checked ? {background: primaryColor, borderColor: primaryColor} : null}\n >\n {checked ? (\n <FaIcon\n className={style.icon}\n iconName={iconName}\n iconColor={iconColor}\n preset={preset}\n customStyle={DEFAULT_ICON_STYLE}\n />\n ) : (\n <FaIcon\n className={style.icon}\n iconName={'square'}\n iconColor={'transparent'}\n preset=\"s\"\n customStyle={DEFAULT_ICON_STYLE}\n />\n )}\n </div>\n </label>\n ) : null}\n {title ? (\n <span\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n ) : null}\n </div>\n );\n};\n\nCheckboxWithTitle.propTypes = {\n value: PropTypes.string,\n title: PropTypes.string,\n name: PropTypes.string,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n iconName: PropTypes.string,\n iconColor: PropTypes.string,\n preset: PropTypes.string\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nCheckboxWithTitle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nexport default CheckboxWithTitle;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,kBAAkB,GAAG;EAACC,OAAO,EAAE,GAAG;EAAEC,KAAK,EAAE,MAAM;EAAEC,MAAM,EAAE;AAAM,CAAC;AAExE,MAAMC,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC5C,MAAM;IACJC,KAAK;IACLC,KAAK;IACLC,IAAI;IACJC,OAAO;IACPC,QAAQ,GAAAC,KAAO;IACf,WAAW,EAAEC,QAAQ;IACrB,YAAY,EAAEC,SAAS;IACvBC,IAAI,GAAG;MAACC,QAAQ,EAAE,OAAO;MAAEC,SAAS,EAAE,OAAO;MAAEC,MAAM,EAAE;IAAG,CAAC;IAC3DC,WAAW,GAAG,CAAC;EACjB,CAAC,GAAGd,KAAK;EACT,MAAM;IAACe;EAAI,CAAC,GAAGd,OAAO;EACtB,MAAMe,YAAY,GAAGC,MAAA,CAAMzB,MAAM,CAAC0B,eAAe,EAAE,gBAAgB,EAAEH,IAAI,CAAC;EAC1E,MAAM;IAACJ,QAAQ;IAAEC,SAAS;IAAEC;EAAM,CAAC,GAAGH,IAAI;EAC1C,MAAMS,UAAU,GAAG9B,OAAO,CAAC,MAAM+B,SAAA,CAAS,iBAAiB,CAAC,EAAE,EAAE,CAAC;EACjE,MAAMC,YAAY,GAAGhC,OAAO,CAAC,MAAMiC,CAAC,IAAIhB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uBAAuB,EAAE;MAACC,MAAM,EAAEhC;IAAK;EAAE,CAC1C,CAAC,GACA,IACD,CAAC;AAEV,CAAC;AAEDJ,iBAAiB,CAACqC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC5BrC,KAAK,EAAEZ,SAAS,CAACkD,MAAM;EACvBrC,KAAK,EAAEb,SAAS,CAACkD,MAAM;EACvBpC,IAAI,EAAEd,SAAS,CAACkD,MAAM;EACtBnC,OAAO,EAAEf,SAAS,CAACmD,IAAI;EACvBnC,QAAQ,EAAEhB,SAAS,CAACoD,IAAI;EACxB,YAAY,EAAEpD,SAAS,CAACkD,MAAM;EAC9B,WAAW,EAAElD,SAAS,CAACkD,MAAM;EAC7B9B,IAAI,EAAEpB,SAAS,CAACqD,KAAK,CAAC;IACpBhC,QAAQ,EAAErB,SAAS,CAACkD,MAAM;IAC1B5B,SAAS,EAAEtB,SAAS,CAACkD,MAAM;IAC3B3B,MAAM,EAAEvB,SAAS,CAACkD;EACpB,CAAC,CAAC;EACF1B,WAAW,EAAExB,SAAS,CAACsD,QAAQ,CAACtD,SAAS,CAACuD,SAAS,CAAC,CAACvD,SAAS,CAACkD,MAAM,EAAElD,SAAS,CAACwD,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED/C,iBAAiB,CAACgD,YAAY,GAAG;EAC/BhC,IAAI,EAAEtB,QAAQ,CAACuD,iBAAiB,CAACjC;AACnC,CAAC;AACD,eAAehB,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,6DA0EC"}
|
package/es/atom/chip/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState, useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import getOr from 'lodash/fp/getOr';
|
|
5
5
|
import { convert } from 'css-color-function';
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
7
|
import { fas } from '@fortawesome/pro-solid-svg-icons';
|
|
@@ -27,14 +27,14 @@ const Chip = (props, context) => {
|
|
|
27
27
|
customIcon,
|
|
28
28
|
onClick,
|
|
29
29
|
leftIcon,
|
|
30
|
-
backgroundColor
|
|
30
|
+
backgroundColor,
|
|
31
31
|
customStyle
|
|
32
32
|
} = props;
|
|
33
33
|
const {
|
|
34
34
|
skin
|
|
35
35
|
} = context;
|
|
36
|
-
const skinColor =
|
|
37
|
-
const selectedBgColor = backgroundColor === 'skin' && skinColor ? skinColor : backgroundColor;
|
|
36
|
+
const skinColor = getOr(DEFAULT_BACKGROUND_COLOR, 'common.primary', skin);
|
|
37
|
+
const selectedBgColor = backgroundColor === 'skin' && skinColor ? skinColor : backgroundColor || DEFAULT_BACKGROUND_COLOR;
|
|
38
38
|
const hoveredSelectedBgColor = calculateHoveredSelectedBgColor(selectedBgColor);
|
|
39
39
|
const [isHovered, setIsHovered] = useState(false);
|
|
40
40
|
const handleClick = useMemo(() => onClick, [onClick]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","getOr","convert","FontAwesomeIcon","fas","library","Provider","COLORS","style","add","LUMINOSITY_DELTA","cm_primary_blue","DEFAULT_BACKGROUND_COLOR","ICON_SIZE","calculateHoveredSelectedBgColor","selectedBgColor","luminosityDelta","Chip","props","context","text","subText","textColor","cm_grey_700","selected","customIcon","onClick","leftIcon","backgroundColor","customStyle","skin","skinColor","hoveredSelectedBgColor","isHovered","setIsHovered","handleClick","handleMouseEnter","handleMouseLeave","hoverStyle","defaultIcon","showIcon","color","white","createElement","className","container","unselected","onMouseEnter","onMouseLeave","left","icon","fontSize","title","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","func","objectOf","oneOfType","number"],"sources":["../../../src/atom/chip/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport Provider from '../provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst LUMINOSITY_DELTA = 0.08;\nconst {cm_primary_blue: DEFAULT_BACKGROUND_COLOR} = COLORS;\nconst ICON_SIZE = '12px';\n\nexport const calculateHoveredSelectedBgColor = (\n selectedBgColor,\n luminosityDelta = LUMINOSITY_DELTA\n) => convert(`hsl(from ${selectedBgColor} h s calc(l*(1 - ${luminosityDelta})))`);\n// note: luminosity decrease is relative to the selected color\n\nconst Chip = (props, context) => {\n const {\n text,\n subText,\n textColor = COLORS.cm_grey_700,\n selected = false,\n customIcon,\n onClick,\n leftIcon,\n backgroundColor,\n customStyle\n } = props;\n const {skin} = context;\n const skinColor = getOr(DEFAULT_BACKGROUND_COLOR, 'common.primary', skin);\n const selectedBgColor =\n backgroundColor === 'skin' && skinColor\n ? skinColor\n : backgroundColor || DEFAULT_BACKGROUND_COLOR;\n const hoveredSelectedBgColor = calculateHoveredSelectedBgColor(selectedBgColor);\n\n const [isHovered, setIsHovered] = useState(false);\n\n const handleClick = useMemo(() => onClick, [onClick]);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const hoverStyle = isHovered ? {backgroundColor: hoveredSelectedBgColor} : {};\n\n const defaultIcon = selected ? 'fa-check' : 'fa-plus';\n const showIcon = customIcon !== 'none';\n const color = selected ? COLORS.white : textColor;\n\n return (\n <div\n className={classnames(style.container, !selected && style.unselected)}\n style={{\n ...(selected && selectedBgColor ? {backgroundColor: selectedBgColor} : {}),\n ...(selected && hoverStyle),\n ...customStyle\n }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n aria-label={text}\n data-name={`chip-${text}`}\n >\n <div className={style.left}>\n {leftIcon ? <FontAwesomeIcon style={{color}} icon={leftIcon} fontSize={ICON_SIZE} /> : null}\n <div title={text}>\n <span className={style.text} style={{color}}>\n {text}\n </span>\n {subText ? (\n <span className={style.subText} style={{color}}>\n {subText}\n </span>\n ) : null}\n </div>\n </div>\n {showIcon ? (\n <FontAwesomeIcon\n style={{color}}\n icon={customIcon ? `fa-${customIcon}` : defaultIcon}\n fontSize={ICON_SIZE}\n />\n ) : null}\n </div>\n );\n};\n\nChip.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nChip.propTypes = {\n text: PropTypes.string,\n subText: PropTypes.string,\n textColor: PropTypes.string,\n selected: PropTypes.bool,\n customIcon: PropTypes.string,\n backgroundColor: PropTypes.string,\n onClick: PropTypes.func,\n leftIcon: PropTypes.string,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default Chip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,MAAM,iBAAiB;AACnC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,SAAQC,GAAG,QAAO,kCAAkC;AACpD,SAAQC,OAAO,QAAO,mCAAm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_scorm from colors;
|
|
8
|
-
@value
|
|
8
|
+
@value cm_blue_article from colors;
|
|
9
9
|
@value cm_red_200 from colors;
|
|
10
10
|
@value cm_red_video from colors;
|
|
11
11
|
@value cm_violet_podcast from colors;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
.article {
|
|
59
59
|
composes: level;
|
|
60
|
-
background-color:
|
|
60
|
+
background-color: cm_blue_article;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.video {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-html/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-html/index.js"],"names":[],"mappings":";AAYA,wEA4DC"}
|
|
@@ -4,6 +4,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { NovaLineBusinessCircleView as PreviewIcon, NovaLineContentEditionPencil2 as PencilIcon } from '@coorpacademy/nova-icons';
|
|
6
6
|
import Provider, { GetSkinFromContext } from '../provider';
|
|
7
|
+
import { COLORS } from '../../variables/colors';
|
|
7
8
|
import InputPreview from './input-preview';
|
|
8
9
|
import style from './style.css';
|
|
9
10
|
const InputHtml = (props, legacyContext) => {
|
|
@@ -23,7 +24,7 @@ const InputHtml = (props, legacyContext) => {
|
|
|
23
24
|
setPreview(!preview);
|
|
24
25
|
}, [preview, setPreview]);
|
|
25
26
|
const skin = GetSkinFromContext(legacyContext);
|
|
26
|
-
const mediumColor = _getOr(
|
|
27
|
+
const mediumColor = _getOr(COLORS.cm_grey_400, 'common.medium', skin);
|
|
27
28
|
const {
|
|
28
29
|
title,
|
|
29
30
|
placeholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","NovaLineBusinessCircleView","PreviewIcon","NovaLineContentEditionPencil2","PencilIcon","Provider","GetSkinFromContext","InputPreview","style","InputHtml","props","legacyContext","value","onChange","_noop","text","setText","preview","setPreview","handleChange","e","_value","target","handlePreview","preventDefault","skin","mediumColor","_getOr","title","placeholder","error","description","disabled","className","defaultStyle","iconContent","createElement","color","height","contentWrapper","input","toggle","onClick","propTypes","process","env","NODE_ENV","string","bool","func","contextTypes","childContextTypes"],"sources":["../../../src/atom/input-html/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, getOr} from 'lodash/fp';\nimport {\n NovaLineBusinessCircleView as PreviewIcon,\n NovaLineContentEditionPencil2 as PencilIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport InputPreview from './input-preview';\nimport style from './style.css';\n\nconst InputHtml = (props, legacyContext) => {\n const {value = '', onChange = noop} = props;\n const [text, setText] = useState(value);\n const [preview, setPreview] = useState(true);\n\n const handleChange = useCallback(\n e => {\n const _value = e.target.value;\n setText(_value);\n onChange(_value);\n },\n [onChange]\n );\n\n const handlePreview = useCallback(\n e => {\n e.preventDefault();\n setPreview(!preview);\n },\n [preview, setPreview]\n );\n\n const skin = GetSkinFromContext(legacyContext);\n const mediumColor = getOr(
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","PropTypes","NovaLineBusinessCircleView","PreviewIcon","NovaLineContentEditionPencil2","PencilIcon","Provider","GetSkinFromContext","COLORS","InputPreview","style","InputHtml","props","legacyContext","value","onChange","_noop","text","setText","preview","setPreview","handleChange","e","_value","target","handlePreview","preventDefault","skin","mediumColor","_getOr","cm_grey_400","title","placeholder","error","description","disabled","className","defaultStyle","iconContent","createElement","color","height","contentWrapper","input","toggle","onClick","propTypes","process","env","NODE_ENV","string","bool","func","contextTypes","childContextTypes"],"sources":["../../../src/atom/input-html/index.js"],"sourcesContent":["import React, {useCallback, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, getOr} from 'lodash/fp';\nimport {\n NovaLineBusinessCircleView as PreviewIcon,\n NovaLineContentEditionPencil2 as PencilIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport {COLORS} from '../../variables/colors';\nimport InputPreview from './input-preview';\nimport style from './style.css';\n\nconst InputHtml = (props, legacyContext) => {\n const {value = '', onChange = noop} = props;\n const [text, setText] = useState(value);\n const [preview, setPreview] = useState(true);\n\n const handleChange = useCallback(\n e => {\n const _value = e.target.value;\n setText(_value);\n onChange(_value);\n },\n [onChange]\n );\n\n const handlePreview = useCallback(\n e => {\n e.preventDefault();\n setPreview(!preview);\n },\n [preview, setPreview]\n );\n\n const skin = GetSkinFromContext(legacyContext);\n const mediumColor = getOr(COLORS.cm_grey_400, 'common.medium', skin);\n\n const {title, placeholder, error, description, disabled} = props;\n\n const className = error ? style.error : style.defaultStyle;\n const iconContent = !preview ? (\n <PreviewIcon style={{color: mediumColor}} height={16} />\n ) : (\n <PencilIcon style={{color: mediumColor}} height={16} />\n );\n\n return (\n <div className={className}>\n <label>\n <span className={style.title}>{`${title} `}</span>\n <div className={style.contentWrapper}>\n <InputPreview\n title={title}\n text={text}\n placeholder={placeholder}\n onChange={handleChange}\n disabled={disabled}\n preview={preview}\n className={style.input}\n />\n </div>\n <span\n data-testid={preview ? 'pencil-icon' : 'preview-icon'}\n className={style.toggle}\n onClick={handlePreview}\n >\n {iconContent}\n </span>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nInputHtml.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n disabled: PropTypes.bool,\n value: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string\n};\n\nInputHtml.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default InputHtml;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,QAAO,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAElC,SACEC,0BAA0B,IAAIC,WAAW,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EAAE/B,SAAS,CAACiD,MAAM;EAC7Bf,QAAQ,EAAElC,SAAS,CAACkD,IAAI;EACxBrC,KAAK,EAAEb,SAAS,CAACiD,MAAM;EACvBjB,KAAK,EAAEhC,SAAS,CAACiD,MAAM;EACvBnC,QAAQ,EAAEd,SAAS,CAACmD,IAAI;EACxBlB,WAAW,EAAEjC,SAAS,CAACiD;AACzB,CAAC;AAEDvC,SAAS,CAAC0C,YAAY,GAAG;EACvB1B,IAAI,EAAErB,QAAQ,CAACgD,iBAAiB,CAAC3B;AACnC,CAAC;AAED,eAAehB,SAAS","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default InputSwitch;
|
|
2
|
-
declare function InputSwitch(props: any): JSX.Element;
|
|
2
|
+
declare function InputSwitch(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace InputSwitch {
|
|
4
4
|
const propTypes: {
|
|
5
5
|
title: PropTypes.Requireable<string>;
|
|
@@ -19,6 +19,29 @@ declare namespace InputSwitch {
|
|
|
19
19
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
20
20
|
icon: PropTypes.Requireable<string>;
|
|
21
21
|
};
|
|
22
|
+
namespace contextTypes {
|
|
23
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
24
|
+
common: PropTypes.Requireable<{
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
}>;
|
|
27
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
29
|
+
logo: PropTypes.Requireable<any>;
|
|
30
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
31
|
+
login: PropTypes.Requireable<any>;
|
|
32
|
+
}>>;
|
|
33
|
+
icons: PropTypes.Requireable<{
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
}>;
|
|
36
|
+
mod: PropTypes.Requireable<{
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
courses: PropTypes.Requireable<any[]>;
|
|
40
|
+
texts: PropTypes.Requireable<{
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
}>;
|
|
43
|
+
}>>;
|
|
44
|
+
}
|
|
22
45
|
}
|
|
23
46
|
import PropTypes from "prop-types";
|
|
24
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";AAUA,oEAwGC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
2
2
|
import _noop from "lodash/fp/noop";
|
|
3
|
+
import _getOr from "lodash/fp/getOr";
|
|
3
4
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
5
|
import React, { useMemo } from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
8
|
import classNames from 'classnames';
|
|
8
9
|
import getClassState from '../../util/get-class-state';
|
|
10
|
+
import { COLORS } from '../../variables/colors';
|
|
11
|
+
import Provider from '../provider';
|
|
9
12
|
import style from './style.css';
|
|
10
|
-
const InputSwitch = props => {
|
|
13
|
+
const InputSwitch = (props, context) => {
|
|
11
14
|
const {
|
|
12
15
|
title,
|
|
13
16
|
name,
|
|
@@ -26,6 +29,10 @@ const InputSwitch = props => {
|
|
|
26
29
|
'aria-label': ariaLabel,
|
|
27
30
|
icon
|
|
28
31
|
} = props;
|
|
32
|
+
const {
|
|
33
|
+
skin
|
|
34
|
+
} = context;
|
|
35
|
+
const primaryColor = _getOr(COLORS.cm_primary_blue, 'common.primary', skin);
|
|
29
36
|
const idSwitch = id || _uniqueId('input-switch-');
|
|
30
37
|
const isDisabled = disabled ? 'disabled' : '';
|
|
31
38
|
const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);
|
|
@@ -97,12 +104,16 @@ const InputSwitch = props => {
|
|
|
97
104
|
"data-name": "input-switch-label",
|
|
98
105
|
tabIndex: 0,
|
|
99
106
|
"aria-label": ariaLabel,
|
|
100
|
-
title: ariaLabel
|
|
101
|
-
|
|
107
|
+
title: ariaLabel,
|
|
108
|
+
style: value ? {
|
|
109
|
+
background: primaryColor,
|
|
110
|
+
borderColor: primaryColor
|
|
111
|
+
} : null
|
|
112
|
+
}))), details || titlePosition === 'right' ? /*#__PURE__*/React.createElement("div", {
|
|
102
113
|
className: !details ? style.alignedTextContainer : null
|
|
103
114
|
}, titlePosition === 'right' ? titleView : null, details ? /*#__PURE__*/React.createElement("div", {
|
|
104
115
|
className: style.detailsTxt
|
|
105
|
-
}, details) : null), descriptionView);
|
|
116
|
+
}, details) : null) : null, descriptionView);
|
|
106
117
|
};
|
|
107
118
|
InputSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
108
119
|
title: PropTypes.string,
|
|
@@ -122,5 +133,8 @@ InputSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
122
133
|
requiredSelection: PropTypes.bool,
|
|
123
134
|
icon: PropTypes.string
|
|
124
135
|
} : {};
|
|
136
|
+
InputSwitch.contextTypes = {
|
|
137
|
+
skin: Provider.childContextTypes.skin
|
|
138
|
+
};
|
|
125
139
|
export default InputSwitch;
|
|
126
140
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FontAwesomeIcon","classNames","getClassState","style","InputSwitch","props","title","name","id","value","disabled","onChange","_noop","description","modified","theme","titlePosition","details","requiredSelection","dataName","ariaLabelledBy","ariaLabel","icon","idSwitch","_uniqueId","isDisabled","handleChange","e","target","checked","titleView","createElement","className","titleContainer","newMoocTitleContainer","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","newMooc","newMoocModified","partielUncheck","defaultStyle","btnSwitchContainer","_extends","type","checkbox","htmlFor","tabIndex","alignedTextContainer","detailsTxt","propTypes","process","env","NODE_ENV","string","bool","func","oneOf"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst InputSwitch = props => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-label': ariaLabel,\n icon\n } = props;\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FontAwesomeIcon","classNames","getClassState","COLORS","Provider","style","InputSwitch","props","context","title","name","id","value","disabled","onChange","_noop","description","modified","theme","titlePosition","details","requiredSelection","dataName","ariaLabelledBy","ariaLabel","icon","skin","primaryColor","_getOr","cm_primary_blue","idSwitch","_uniqueId","isDisabled","handleChange","e","target","checked","titleView","createElement","className","titleContainer","newMoocTitleContainer","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","newMooc","newMoocModified","partielUncheck","defaultStyle","btnSwitchContainer","_extends","type","checkbox","htmlFor","tabIndex","background","borderColor","alignedTextContainer","detailsTxt","propTypes","process","env","NODE_ENV","string","bool","func","oneOf","contextTypes","childContextTypes"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, noop, uniqueId} from 'lodash/fp';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst InputSwitch = (props, context) => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-label': ariaLabel,\n icon\n } = props;\n const {skin} = context;\n const primaryColor = getOr(COLORS.cm_primary_blue, 'common.primary', skin);\n const idSwitch = id || uniqueId('input-switch-');\n const isDisabled = disabled ? 'disabled' : '';\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n const titleView = title ? (\n <div\n className={classNames(\n icon ? style.titleContainer : null,\n theme === 'newMooc' ? style.newMoocTitleContainer : null\n )}\n >\n {icon ? <FontAwesomeIcon icon={icon} className={style.icon} /> : null}\n <span id={`title-view-${dataName}`} className={style.title}>\n {title}\n </span>\n </div>\n ) : null;\n\n const descriptionView = description ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const getClass = () => {\n switch (theme) {\n case 'coorpmanager':\n return {\n defaultClass: style.coorpmanager,\n modifiedClass: style.coorpmanagerModified\n };\n case 'newMooc':\n return {\n defaultClass: style.newMooc,\n modifiedClass: style.newMoocModified\n };\n case 'mooc':\n return {\n defaultClass: style.partielUncheck,\n modifiedClass: style.coorpmanagerModified\n };\n default:\n return {defaultClass: style.defaultStyle, modifiedClass: style.modified};\n }\n };\n const {defaultClass, modifiedClass} = getClass();\n const className = getClassState(defaultClass, modifiedClass, null, modified);\n\n return (\n <div className={className} data-name={`switch-input-${theme}${dataName}`}>\n {titlePosition === 'left' ? titleView : null}\n <div className={requiredSelection ? style.requiredSelection : null}>\n <div className={style.btnSwitchContainer}>\n <input\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(title ? {'aria-labelledby': `title-view-${dataName}`} : {})}\n {...(ariaLabel && !ariaLabelledBy && !title ? {'aria-label': ariaLabel} : {})}\n type=\"checkbox\"\n id={idSwitch}\n name={name}\n onChange={handleChange}\n checked={value}\n disabled={isDisabled}\n className={style.checkbox}\n aria-labelledby={ariaLabelledBy}\n />\n <label\n htmlFor={idSwitch}\n data-name=\"input-switch-label\"\n tabIndex={0}\n aria-label={ariaLabel}\n title={ariaLabel}\n style={value ? {background: primaryColor, borderColor: primaryColor} : null}\n />\n </div>\n </div>\n {details || titlePosition === 'right' ? (\n <div className={!details ? style.alignedTextContainer : null}>\n {titlePosition === 'right' ? titleView : null}\n {details ? <div className={style.detailsTxt}>{details}</div> : null}\n </div>\n ) : null}\n\n {descriptionView}\n </div>\n );\n};\n\nInputSwitch.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n id: PropTypes.string,\n value: PropTypes.bool,\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n description: PropTypes.string,\n 'aria-labelledby': PropTypes.string,\n 'aria-label': PropTypes.string,\n modified: PropTypes.bool,\n titlePosition: PropTypes.oneOf(['right', 'left']),\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc', 'newMooc']),\n details: PropTypes.string,\n 'data-name': PropTypes.string,\n requiredSelection: PropTypes.bool,\n icon: PropTypes.string\n};\n\nInputSwitch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default InputSwitch;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACtC,MAAM;IACJC,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;EACtBxD,KAAK,EAAEV,SAAS,CAACmE,MAAM;EACvBxD,IAAI,EAAEX,SAAS,CAACmE,MAAM;EACtBvD,EAAE,EAAEZ,SAAS,CAACmE,MAAM;EACpBtD,KAAK,EAAEb,SAAS,CAACoE,IAAI;EACrBtD,QAAQ,EAAEd,SAAS,CAACoE,IAAI;EACxBrD,QAAQ,EAAEf,SAAS,CAACqE,IAAI;EACxBpD,WAAW,EAAEjB,SAAS,CAACmE,MAAM;EAC7B,iBAAiB,EAAEnE,SAAS,CAACmE,MAAM;EACnC,YAAY,EAAEnE,SAAS,CAACmE,MAAM;EAC9BjD,QAAQ,EAAElB,SAAS,CAACoE,IAAI;EACxBhD,aAAa,EAAEpB,SAAS,CAACsE,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACjDnD,KAAK,EAAEnB,SAAS,CAACsE,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;EACtEjD,OAAO,EAAErB,SAAS,CAACmE,MAAM;EACzB,WAAW,EAAEnE,SAAS,CAACmE,MAAM;EAC7B7C,iBAAiB,EAAEtB,SAAS,CAACoE,IAAI;EACjC1C,IAAI,EAAE1B,SAAS,CAACmE;AAClB,CAAC;AAED5D,WAAW,CAACgE,YAAY,GAAG;EACzB5C,IAAI,EAAEtB,QAAQ,CAACmE,iBAAiB,CAAC7C;AACnC,CAAC;AAED,eAAepB,WAAW","ignoreList":[]}
|
|
@@ -215,6 +215,7 @@
|
|
|
215
215
|
.newMooc {
|
|
216
216
|
composes: defaultStyle;
|
|
217
217
|
width: 100%;
|
|
218
|
+
gap: 16px;
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
.newMoocModified {
|
|
@@ -241,6 +242,8 @@
|
|
|
241
242
|
font-weight: 600;
|
|
242
243
|
line-height: 20px;
|
|
243
244
|
color: cm_grey_700;
|
|
245
|
+
width: auto;
|
|
246
|
+
margin: 0px;
|
|
244
247
|
}
|
|
245
248
|
|
|
246
249
|
.newMooc .checkbox:checked ~ label {
|
package/es/atom/range/index.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ declare class Range extends React.Component<any, any, any> {
|
|
|
4
4
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
5
5
|
onChangeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
6
6
|
multi: PropTypes.Requireable<boolean>;
|
|
7
|
+
theme: PropTypes.Requireable<string>;
|
|
8
|
+
min: PropTypes.Requireable<number>;
|
|
9
|
+
max: PropTypes.Requireable<number>;
|
|
10
|
+
step: PropTypes.Requireable<number>;
|
|
11
|
+
minLabel: PropTypes.Requireable<string>;
|
|
12
|
+
maxLabel: PropTypes.Requireable<string>;
|
|
13
|
+
minValueLabel: PropTypes.Requireable<string>;
|
|
14
|
+
maxValueLabel: PropTypes.Requireable<string>;
|
|
7
15
|
HammerForTestingMin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
8
16
|
on: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
17
|
destroy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -14,17 +22,39 @@ declare class Range extends React.Component<any, any, any> {
|
|
|
14
22
|
destroy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
23
|
stop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
24
|
}>>;
|
|
17
|
-
|
|
25
|
+
};
|
|
26
|
+
static contextTypes: {
|
|
27
|
+
skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
common: PropTypes.Requireable<{
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}>;
|
|
31
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
33
|
+
logo: PropTypes.Requireable<any>;
|
|
34
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
35
|
+
login: PropTypes.Requireable<any>;
|
|
36
|
+
}>>;
|
|
37
|
+
icons: PropTypes.Requireable<{
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
}>;
|
|
40
|
+
mod: PropTypes.Requireable<{
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
}>;
|
|
43
|
+
courses: PropTypes.Requireable<any[]>;
|
|
44
|
+
texts: PropTypes.Requireable<{
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
}>;
|
|
47
|
+
}>>;
|
|
18
48
|
};
|
|
19
49
|
static getDerivedStateFromProps(props: any, state: any): {
|
|
20
50
|
multi: any;
|
|
21
|
-
value:
|
|
51
|
+
value: number | (number | number[])[];
|
|
22
52
|
} | null;
|
|
23
53
|
constructor(props: any, context: any);
|
|
24
54
|
state: {
|
|
25
55
|
pending: boolean;
|
|
26
56
|
multi: any;
|
|
27
|
-
value:
|
|
57
|
+
value: number | (number | number[])[];
|
|
28
58
|
};
|
|
29
59
|
handleClick(e: any): void;
|
|
30
60
|
setRefTrack(track: any): void;
|
|
@@ -33,6 +63,8 @@ declare class Range extends React.Component<any, any, any> {
|
|
|
33
63
|
handleMinChangeEnd(e: any): void;
|
|
34
64
|
handleMaxChangeEnd(e: any): void;
|
|
35
65
|
track: any;
|
|
66
|
+
normalizedToActual(normalizedValue: any): any;
|
|
67
|
+
roundToStep(value: any): number;
|
|
36
68
|
handleChange(value: any, valueIndex: any, pending: any): void;
|
|
37
69
|
triggerChange(newValues: any, pending: any): any;
|
|
38
70
|
render(): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/range/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/range/index.js"],"names":[],"mappings":";AAyFA;IACE;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;MAEE;IAEF;;;aAIC;IAED,sCAYC;IAVC;;;;MAGC;IAwEH,0BAkBC;IAjFD,8BAEC;IAaD,8BAKC;IAED,8BAKC;IAED,iCAKC;IAED,iCAKC;IAxCC,WAAkB;IAGpB,8CAGC;IAED,gCAIC;IA8BD,8DAWC;IAED,iDAKC;IAsBD,sBA2FC;CACF"}
|