@coorpacademy/components 11.25.0 → 11.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/es/atom/gradient/index.native.d.ts.map +1 -1
- package/es/atom/gradient/index.native.js +5 -7
- package/es/atom/gradient/index.native.js.map +1 -1
- package/es/atom/icon/index.d.ts +6 -0
- package/es/atom/icon/index.d.ts.map +1 -0
- package/es/atom/icon/index.js +67 -0
- package/es/atom/icon/index.js.map +1 -0
- package/es/atom/icon/style.css +7 -0
- package/es/globals.d.js.map +1 -1
- package/es/molecule/dashboard/learning-profile-banner/style.css +3 -5
- package/es/molecule/learning-profile-radar-chart/index.d.ts +57 -0
- package/es/molecule/learning-profile-radar-chart/index.d.ts.map +1 -0
- package/es/molecule/learning-profile-radar-chart/index.js +387 -0
- package/es/molecule/learning-profile-radar-chart/index.js.map +1 -0
- package/es/molecule/learning-profile-radar-chart/style.css +49 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts +145 -0
- package/es/molecule/learning-profile-radar-chart/types.d.ts.map +1 -0
- package/es/molecule/learning-profile-radar-chart/types.js +54 -0
- package/es/molecule/learning-profile-radar-chart/types.js.map +1 -0
- package/es/util/check-is-mobile.d.ts +2 -0
- package/es/util/check-is-mobile.d.ts.map +1 -0
- package/es/util/check-is-mobile.js +3 -0
- package/es/util/check-is-mobile.js.map +1 -0
- package/lib/atom/gradient/index.native.d.ts.map +1 -1
- package/lib/atom/gradient/index.native.js +5 -7
- package/lib/atom/gradient/index.native.js.map +1 -1
- package/lib/atom/icon/index.d.ts +6 -0
- package/lib/atom/icon/index.d.ts.map +1 -0
- package/lib/atom/icon/index.js +92 -0
- package/lib/atom/icon/index.js.map +1 -0
- package/lib/atom/icon/style.css +7 -0
- package/lib/globals.d.js.map +1 -1
- package/lib/molecule/dashboard/learning-profile-banner/style.css +3 -5
- package/lib/molecule/learning-profile-radar-chart/index.d.ts +57 -0
- package/lib/molecule/learning-profile-radar-chart/index.d.ts.map +1 -0
- package/lib/molecule/learning-profile-radar-chart/index.js +416 -0
- package/lib/molecule/learning-profile-radar-chart/index.js.map +1 -0
- package/lib/molecule/learning-profile-radar-chart/style.css +49 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts +145 -0
- package/lib/molecule/learning-profile-radar-chart/types.d.ts.map +1 -0
- package/lib/molecule/learning-profile-radar-chart/types.js +67 -0
- package/lib/molecule/learning-profile-radar-chart/types.js.map +1 -0
- package/lib/util/check-is-mobile.d.ts +2 -0
- package/lib/util/check-is-mobile.d.ts.map +1 -0
- package/lib/util/check-is-mobile.js +10 -0
- package/lib/util/check-is-mobile.js.map +1 -0
- package/package.json +11 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","Fragment","useCallback","useEffect","useMemo","useState","Radar","RadarChart","PolarGrid","PolarAngleAxis","ResponsiveContainer","Tooltip","PolarRadiusAxis","classnames","isMobile","getIsMobile","style","learningProfileRadarChartPropTypes","top","offset","x","y","alignment","margin","bottom","right","marginRight","left","marginLeft","BLACK","WHITE","DEFAULT_MAIN_COLOR","DEFAULT_COLORS","gradient","fill","stroke","percentage","color","background","label","CHART_CONFIGS","triangle","name","ticks","sideCount","quadrilateral","pentagon","hexagon","DOT_DEFAULT_PROPS","strokeWidth","strokeOpacity","r","pointerEvents","cursor","DOT_ACTIVE_PROPS","RADAR_DEFAULT_PROPS","fillOpacity","Gradient","type","colors","firstColor","secondColor","CustomTooltip","active","payload","length","tooltip","value","CustomDot","cx","cy","onDotClick","activeDot","dataName","subject","onClick","e","stopPropagation","buildRadars","totalDataset","handleOnDotClick","index","datakey","dataset","buildCustomLabel","percentagesValues","chartType","formatedColors","isCurrentDotActive","offsetX","offsetY","rest","tickWrapper","tickWrapperFocus","alignItems","textAlign","opacity","map","colorLabel","i","tickValue","tickLabel","CHART_CONFIGS_BY_SIDE_COUNT","formatValues","values_","val","formatData","legend","data_","ref","LearningProfileRadarChart","data","colorsProps","width","height","setIsMobile","setActiveDot","Object","assign","gradients","userAgent","navigator","isMobile_","setIsMobile_","handleClick","undefined","window","addEventListener","removeEventListener","formatedData","find","skillRef","key","renderCustomLabel","currentData","ResponsiveLearningProfileRadarChart","props","propTypes"],"sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"sourcesContent":["import React, {Fragment, useCallback, useEffect, useMemo, useState} from 'react';\nimport {\n Radar,\n RadarChart,\n PolarGrid,\n PolarAngleAxis,\n ResponsiveContainer,\n Tooltip,\n PolarRadiusAxis\n} from 'recharts';\nimport {\n pipe,\n keyBy,\n mapValues,\n size,\n getOr,\n map,\n toPairs,\n values,\n isEmpty,\n omit,\n fromPairs,\n times,\n flatten,\n findKey\n} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {isMobile as getIsMobile} from '../../util/check-is-mobile';\nimport style from './style.css';\nimport {\n ActiveDotType,\n FormatedColorsType,\n FormatedDataType,\n LearningProfileRadarChartPropTypes,\n TickType,\n learningProfileRadarChartPropTypes\n} from './types';\n\ntype CHART_TYPE_TYPE = keyof typeof CHART_CONFIGS;\n\n/* TICK_POSITIONS */\nconst top: TickType = {offset: {x: -100, y: -65}, alignment: 'center', margin: 'auto'};\nconst bottom: TickType = {offset: {x: -100, y: 10}, alignment: 'center', margin: 'auto'};\nconst right: TickType = {offset: {x: 30, y: -10}, alignment: 'start', marginRight: 'auto'};\nconst left: TickType = {offset: {x: -230, y: -10}, alignment: 'end', marginLeft: 'auto'};\n\n/* CONSTANTS */\nconst BLACK = '#000000ff';\nconst WHITE = '#ffffffff';\nconst DEFAULT_MAIN_COLOR = '#0062ffff';\n\nconst DEFAULT_COLORS: FormatedColorsType = {\n gradient: {\n fill: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR],\n stroke: [DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR]\n },\n percentage: {\n color: BLACK,\n background: WHITE\n },\n label: {\n color: BLACK\n }\n};\n\nconst CHART_CONFIGS = {\n triangle: {\n name: 'triangle',\n ticks: [top, right, left],\n sideCount: 3\n },\n quadrilateral: {\n name: 'quadrilateral',\n ticks: [top, right, bottom, left],\n sideCount: 4\n },\n pentagon: {\n name: 'pentagon',\n ticks: [top, right, right, left, left],\n sideCount: 5\n },\n hexagon: {\n name: 'hexagon',\n ticks: [top, right, right, bottom, left, left],\n sideCount: 6\n }\n} as const;\n\nconst DOT_DEFAULT_PROPS = {\n strokeWidth: 4,\n strokeOpacity: 0.2,\n fill: '#fff',\n r: 8,\n pointerEvents: 'all',\n style: {cursor: 'pointer'}\n} as const;\n\nconst DOT_ACTIVE_PROPS = {\n fill: '#fff',\n r: 8,\n strokeWidth: 6,\n strokeOpacity: 0.5\n} as const;\n\nconst RADAR_DEFAULT_PROPS = {\n strokeWidth: 6,\n strokeOpacity: 0.2,\n fillOpacity: 0.2\n} as const;\n\n/* COMPONENTS */\nconst Gradient = ({type, colors: [firstColor, secondColor]}: {type: string; colors: string[]}) => (\n <defs>\n <linearGradient id={`gradient-${type}`} x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={firstColor} />\n <stop offset=\"100%\" stopColor={secondColor} />\n </linearGradient>\n </defs>\n);\n\nconst CustomTooltip = ({\n active,\n payload,\n label\n}: {\n active?: boolean;\n payload?: {value: number}[];\n label?: string;\n}) =>\n active && !!payload?.length ? (\n <div className={style.tooltip}>\n <p>{label}</p>\n <p>{payload[0].value}%</p>\n </div>\n ) : null;\n\nconst CustomDot = ({\n cx,\n cy,\n payload,\n onDotClick,\n stroke,\n activeDot,\n dataName\n}: {\n cx?: number;\n cy?: number;\n payload?: {payload: {subject: string} & {[datakey: string]: number}; name: string};\n onDotClick: (name: string) => void;\n dataKey: string;\n stroke: string;\n activeDot?: ActiveDotType;\n dataName: string;\n}) => (\n <circle\n {...{\n ...DOT_DEFAULT_PROPS,\n ...(payload?.payload.subject === activeDot?.label && DOT_ACTIVE_PROPS),\n stroke,\n cx,\n cy,\n onClick: e => {\n e.stopPropagation();\n\n if (!payload?.name) return;\n onDotClick(payload.name);\n },\n 'data-name': dataName\n }}\n />\n);\n\nconst buildRadars = (\n totalDataset: number,\n handleOnDotClick: (datakey: string) => (name: string) => void,\n activeDot?: ActiveDotType\n) =>\n times(index => {\n const datakey = `value${index + 1}`;\n const dataset = `dataset-${index + 1}`;\n\n return (\n <Radar\n {...RADAR_DEFAULT_PROPS}\n fill={`url(#gradient-fill-${index})`}\n stroke={`url(#gradient-stroke-${index})`}\n key={dataset}\n name={dataset}\n dataKey={datakey}\n activeDot={{\n ...DOT_ACTIVE_PROPS,\n stroke: `url(#gradient-stroke-${index})`\n }}\n // only on mobile\n // to handle dot style on hover (convert to click)\n // use with the tooltip component\n dot={\n <CustomDot\n onDotClick={handleOnDotClick(datakey)}\n activeDot={activeDot}\n dataKey={datakey}\n stroke={`url(#gradient-stroke-${index})`}\n dataName={dataset}\n />\n }\n />\n );\n }, totalDataset);\n\nconst buildCustomLabel = ({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors\n}: {\n index: number;\n x: number;\n y: number;\n percentagesValues: number[];\n label: string;\n chartType: CHART_TYPE_TYPE;\n formatedColors: FormatedColorsType[];\n activeDot?: ActiveDotType;\n}) => {\n const isCurrentDotActive = activeDot?.label === label;\n const {\n offset: {x: offsetX, y: offsetY},\n alignment,\n ...rest\n } = CHART_CONFIGS[chartType].ticks[index];\n\n return (\n <g>\n <foreignObject x={x + offsetX} y={y + offsetY} width=\"200\" height=\"65\">\n <div\n className={classnames(style.tickWrapper, isCurrentDotActive && style.tickWrapperFocus)}\n style={{\n ...rest,\n alignItems: alignment,\n textAlign: alignment,\n opacity: !isEmpty(activeDot) && !isCurrentDotActive ? 0.3 : 1\n }}\n >\n {formatedColors.map(\n ({percentage: {color, background}, label: {color: colorLabel}}, i) => (\n <Fragment key={i}>\n <span className={style.tickValue} style={{color, background}}>\n {percentagesValues[i]}\n </span>\n <span className={style.tickLabel} style={{color: colorLabel}}>\n {label}\n </span>\n </Fragment>\n )\n )}\n </div>\n </foreignObject>\n </g>\n );\n};\n\n/* UTILS */\nconst CHART_CONFIGS_BY_SIDE_COUNT = pipe(keyBy('sideCount'), mapValues('name'))(CHART_CONFIGS);\n\nconst formatValues: (values_: number | number[]) => Record<string, number> = pipe(\n values_ => flatten([values_]),\n values_ => values_.map((val: number, i: number): [string, number] => [`value${i + 1}`, val]),\n fromPairs\n);\n\n/* this convert incoming component data to rechart data structure */\nexport const formatData: (\n legend: {[ref: string]: string},\n data_: LearningProfileRadarChartPropTypes['data']\n) => FormatedDataType[] = (legend, data_) =>\n pipe(\n toPairs,\n map(([ref, values_]: [string, number | number[]]) => ({\n ...formatValues(values_),\n subject: legend[ref]\n }))\n )(data_);\n\nexport const LearningProfileRadarChart = ({\n data,\n legend,\n totalDataset,\n colors: colorsProps,\n onClick,\n width,\n height\n}: LearningProfileRadarChartPropTypes) => {\n const [isMobile, setIsMobile] = useState(false);\n const [activeDot, setActiveDot] = useState<ActiveDotType>();\n\n const formatedColors = times(i => {\n if (!colorsProps?.length) return DEFAULT_COLORS;\n\n const colors = colorsProps[i];\n return colors ? Object.assign({}, DEFAULT_COLORS, colors) : DEFAULT_COLORS;\n })(totalDataset);\n\n const chartType: CHART_TYPE_TYPE = useMemo(\n () => getOr('hexagon', size(data), CHART_CONFIGS_BY_SIDE_COUNT),\n [data]\n );\n\n const gradients = useMemo(\n () =>\n formatedColors.map(({gradient: {fill, stroke}}, index) => (\n <svg key={`gradient-${index}`}>\n <Gradient type={`fill-${index}`} colors={fill} />\n <Gradient type={`stroke-${index}`} colors={stroke} />\n </svg>\n )),\n [formatedColors]\n );\n\n const userAgent = navigator?.userAgent;\n const isMobile_ = useMemo(() => getIsMobile(userAgent), [userAgent]);\n\n const setIsMobile_ = useCallback(() => {\n setIsMobile(isMobile_);\n }, [isMobile_]);\n\n useEffect(() => setIsMobile_(), [setIsMobile_]);\n\n useEffect(() => {\n const handleClick = () => setActiveDot(undefined);\n\n !isEmpty(activeDot) && window.addEventListener('click', handleClick);\n\n return () => {\n window.removeEventListener('click', handleClick);\n };\n }, [activeDot]);\n\n function handleOnDotClick(datakey: string) {\n return (label: string) => {\n const payload = formatedData.find(data_ => data_.subject === label);\n const skillRef = findKey(val => val === payload?.subject, legend);\n\n if (payload && skillRef) {\n setActiveDot({\n key: datakey,\n value: payload[datakey],\n label: payload.subject\n });\n onClick(skillRef);\n }\n };\n }\n\n function renderCustomLabel({\n x,\n y,\n payload: {value: label},\n index\n }: {\n x: number;\n y: number;\n payload: {value: string};\n index: number;\n }) {\n const currentData = formatedData.find(({subject}) => subject === label);\n const percentagesValues: number[] = pipe(\n omit('subject'),\n mapValues(value => `${value}%`),\n values\n )(currentData);\n\n return buildCustomLabel({\n index,\n x,\n y,\n percentagesValues,\n label,\n activeDot,\n chartType,\n formatedColors\n });\n }\n const formatedData = useMemo(() => formatData(legend, data), [legend, data]);\n\n return (\n <RadarChart\n width={width}\n height={height}\n cx=\"50%\"\n cy=\"50%\"\n outerRadius=\"80%\"\n data={formatedData}\n >\n {gradients}\n {buildRadars(totalDataset, handleOnDotClick, activeDot)}\n <PolarGrid strokeDasharray={15} strokeWidth={3} radialLines={false} />\n <PolarAngleAxis dataKey=\"subject\" tick={!isMobile && renderCustomLabel} />\n <PolarRadiusAxis tick={false} axisLine={false} domain={[0, 100]} />\n {isMobile ? <Tooltip cursor={false} content={<CustomTooltip />} /> : null}\n </RadarChart>\n );\n};\n\nconst ResponsiveLearningProfileRadarChart = (props: LearningProfileRadarChartPropTypes) => (\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <LearningProfileRadarChart {...props} />\n </ResponsiveContainer>\n);\n\nLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\nResponsiveLearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;\n\nexport default ResponsiveLearningProfileRadarChart;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,IAAeC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AgC,WAAW,EAAE,CAA7C;IAAgD,WAAW,EAAE;EAA7D,EAVF,eAWE,oBAAC,cAAD;IAAgB,OAAO,EAAC,SAAxB;IAAkC,IAAI,EAAE,CAAC1D,QAAD,IAAauH;EAArD,EAXF,eAYE,oBAAC,eAAD;IAAiB,IAAI,EAAE,KAAvB;IAA8B,QAAQ,EAAE,KAAxC;IAA+C,MAAM,EAAE,CAAC,CAAD,EAAI,GAAJ;EAAvD,EAZF,EAaGvH,QAAQ,gBAAG,oBAAC,OAAD;IAAS,MAAM,EAAE,KAAjB;IAAwB,OAAO,eAAE,oBAAC,aAAD;EAAjC,EAAH,GAA4D,IAbvE,CADF;AAiBD,CAtHM;;AAwHP,MAAMyH,mCAAmC,GAAIC,KAAD,iBAC1C,oBAAC,mBAAD;EAAqB,KAAK,EAAC,MAA3B;EAAkC,MAAM,EAAC;AAAzC,gBACE,oBAAC,yBAAD,EAA+BA,KAA/B,CADF,CADF;;AAMA1B,yBAAyB,CAAC2B,SAA1B,2CAAsCxH,kCAAtC;AACAsH,mCAAmC,CAACE,SAApC,2CAAgDxH,kCAAhD;AAEA,eAAesH,mCAAf"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_primary_blue from colors;
|
|
3
|
+
@value cm_grey_50 from colors;
|
|
4
|
+
@value lightDark from colors;
|
|
5
|
+
|
|
6
|
+
.tickWrapper {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: end;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-family: 'Gilroy';
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
padding: 0px 12px;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tickWrapperFocus {
|
|
22
|
+
background-color: cm_grey_50;
|
|
23
|
+
border-radius: 12px;
|
|
24
|
+
width: fit-content;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tickValue {
|
|
28
|
+
padding: 4px;
|
|
29
|
+
border-radius: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tickLabel {
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
white-space: normal;
|
|
36
|
+
width: 100%;
|
|
37
|
+
width: fit-content;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tooltip {
|
|
41
|
+
position: relative;
|
|
42
|
+
font-family: 'Gilroy';
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
background-color: lightDark;
|
|
45
|
+
color: cm_grey_50;
|
|
46
|
+
padding: 4px 8px;
|
|
47
|
+
border-radius: 8px;
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare const learningProfileRadarChartPropTypes: {
|
|
3
|
+
data: PropTypes.Validator<{
|
|
4
|
+
[x: string]: NonNullable<number | (number | null | undefined)[] | null | undefined> | null | undefined;
|
|
5
|
+
}>;
|
|
6
|
+
totalDataset: PropTypes.Validator<number>;
|
|
7
|
+
onDotClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
|
+
colors: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
9
|
+
gradient: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
fill: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
11
|
+
stroke: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
12
|
+
}>>;
|
|
13
|
+
percentage: PropTypes.Requireable<PropTypes.InferProps<{
|
|
14
|
+
color: PropTypes.Requireable<string>;
|
|
15
|
+
background: PropTypes.Requireable<string>;
|
|
16
|
+
}>>;
|
|
17
|
+
label: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
|
+
color: PropTypes.Requireable<string>;
|
|
19
|
+
}>>;
|
|
20
|
+
}> | null | undefined)[]>;
|
|
21
|
+
width: PropTypes.Requireable<number>;
|
|
22
|
+
height: PropTypes.Requireable<number>;
|
|
23
|
+
};
|
|
24
|
+
export declare const customDotPropTypes: {
|
|
25
|
+
cx: PropTypes.Requireable<number>;
|
|
26
|
+
cy: PropTypes.Requireable<number>;
|
|
27
|
+
payload: PropTypes.Requireable<PropTypes.InferProps<{
|
|
28
|
+
payload: PropTypes.Requireable<PropTypes.InferProps<{
|
|
29
|
+
value: PropTypes.Requireable<number>;
|
|
30
|
+
subject: PropTypes.Requireable<string>;
|
|
31
|
+
}>>;
|
|
32
|
+
name: PropTypes.Requireable<string>;
|
|
33
|
+
}>>;
|
|
34
|
+
onDotClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
+
index: PropTypes.Requireable<number>;
|
|
36
|
+
activeDot: PropTypes.Requireable<PropTypes.InferProps<{
|
|
37
|
+
label: PropTypes.Requireable<string>;
|
|
38
|
+
value: PropTypes.Requireable<number>;
|
|
39
|
+
key: PropTypes.Requireable<string>;
|
|
40
|
+
}>>;
|
|
41
|
+
dataKey: PropTypes.Requireable<string>;
|
|
42
|
+
stroke: PropTypes.Requireable<string>;
|
|
43
|
+
};
|
|
44
|
+
export declare const customTooltipPropTypes: {
|
|
45
|
+
active: PropTypes.Requireable<boolean>;
|
|
46
|
+
payload: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
47
|
+
value: PropTypes.Requireable<number>;
|
|
48
|
+
}> | null | undefined)[]>;
|
|
49
|
+
label: PropTypes.Requireable<string>;
|
|
50
|
+
};
|
|
51
|
+
export declare const gradientPropTypes: {
|
|
52
|
+
type: PropTypes.Requireable<string>;
|
|
53
|
+
colors: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
54
|
+
};
|
|
55
|
+
export declare type ColorType = {
|
|
56
|
+
gradient?: {
|
|
57
|
+
fill?: string[];
|
|
58
|
+
stroke?: string[];
|
|
59
|
+
};
|
|
60
|
+
percentage?: {
|
|
61
|
+
color?: string;
|
|
62
|
+
background?: string;
|
|
63
|
+
};
|
|
64
|
+
label?: {
|
|
65
|
+
color?: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare type LearningProfileRadarChartPropTypes = {
|
|
69
|
+
data: {
|
|
70
|
+
[ref: string]: number | number[];
|
|
71
|
+
};
|
|
72
|
+
legend: {
|
|
73
|
+
[ref: string]: string;
|
|
74
|
+
};
|
|
75
|
+
totalDataset: number;
|
|
76
|
+
onClick: (skillRef: string) => void;
|
|
77
|
+
colors?: ColorType[];
|
|
78
|
+
width?: number;
|
|
79
|
+
height?: number;
|
|
80
|
+
};
|
|
81
|
+
export declare type CustomDotPropTypes = {
|
|
82
|
+
cx: number;
|
|
83
|
+
cy: number;
|
|
84
|
+
payload: {
|
|
85
|
+
payload: {
|
|
86
|
+
value: number;
|
|
87
|
+
subject: string;
|
|
88
|
+
};
|
|
89
|
+
name: string;
|
|
90
|
+
};
|
|
91
|
+
onDotClick: (name: string) => void;
|
|
92
|
+
index: number;
|
|
93
|
+
activeDot?: {
|
|
94
|
+
label: string;
|
|
95
|
+
value: number;
|
|
96
|
+
key: string;
|
|
97
|
+
};
|
|
98
|
+
dataKey: string;
|
|
99
|
+
stroke: string;
|
|
100
|
+
};
|
|
101
|
+
export declare type CustomTooltipPropTypes = {
|
|
102
|
+
active: boolean;
|
|
103
|
+
payload: {
|
|
104
|
+
value: number;
|
|
105
|
+
}[];
|
|
106
|
+
label: string;
|
|
107
|
+
};
|
|
108
|
+
export declare type GradientPropTypes = {
|
|
109
|
+
type: string;
|
|
110
|
+
colors: string[];
|
|
111
|
+
};
|
|
112
|
+
export declare type TickType = {
|
|
113
|
+
offset: {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
};
|
|
117
|
+
alignment: 'center' | 'start' | 'end';
|
|
118
|
+
margin?: 'auto';
|
|
119
|
+
marginLeft?: 'auto';
|
|
120
|
+
marginRight?: 'auto';
|
|
121
|
+
};
|
|
122
|
+
export declare type FormatedColorsType = {
|
|
123
|
+
gradient: {
|
|
124
|
+
fill: string[];
|
|
125
|
+
stroke: string[];
|
|
126
|
+
};
|
|
127
|
+
percentage: {
|
|
128
|
+
color: string;
|
|
129
|
+
background: string;
|
|
130
|
+
};
|
|
131
|
+
label: {
|
|
132
|
+
color: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export declare type FormatedDataType = {
|
|
136
|
+
subject: string;
|
|
137
|
+
} & {
|
|
138
|
+
[key: string]: number | string;
|
|
139
|
+
};
|
|
140
|
+
export declare type ActiveDotType = {
|
|
141
|
+
key: string;
|
|
142
|
+
value: number | string;
|
|
143
|
+
label: string;
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;CAuB9C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAGF,oBAAY,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,oBAAY,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,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAC/B,SAAS,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'; // PROPTYPES
|
|
2
|
+
|
|
3
|
+
export const learningProfileRadarChartPropTypes = {
|
|
4
|
+
data: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number])).isRequired,
|
|
5
|
+
totalDataset: PropTypes.number.isRequired,
|
|
6
|
+
onDotClick: PropTypes.func,
|
|
7
|
+
colors: PropTypes.arrayOf(PropTypes.shape({
|
|
8
|
+
gradient: PropTypes.shape({
|
|
9
|
+
fill: PropTypes.arrayOf(PropTypes.string),
|
|
10
|
+
stroke: PropTypes.arrayOf(PropTypes.string)
|
|
11
|
+
}),
|
|
12
|
+
percentage: PropTypes.shape({
|
|
13
|
+
color: PropTypes.string,
|
|
14
|
+
background: PropTypes.string
|
|
15
|
+
}),
|
|
16
|
+
label: PropTypes.shape({
|
|
17
|
+
color: PropTypes.string
|
|
18
|
+
})
|
|
19
|
+
})),
|
|
20
|
+
width: PropTypes.number,
|
|
21
|
+
height: PropTypes.number
|
|
22
|
+
};
|
|
23
|
+
export const customDotPropTypes = {
|
|
24
|
+
cx: PropTypes.number,
|
|
25
|
+
cy: PropTypes.number,
|
|
26
|
+
payload: PropTypes.shape({
|
|
27
|
+
payload: PropTypes.shape({
|
|
28
|
+
value: PropTypes.number,
|
|
29
|
+
subject: PropTypes.string
|
|
30
|
+
}),
|
|
31
|
+
name: PropTypes.string
|
|
32
|
+
}),
|
|
33
|
+
onDotClick: PropTypes.func,
|
|
34
|
+
index: PropTypes.number,
|
|
35
|
+
activeDot: PropTypes.shape({
|
|
36
|
+
label: PropTypes.string,
|
|
37
|
+
value: PropTypes.number,
|
|
38
|
+
key: PropTypes.string
|
|
39
|
+
}),
|
|
40
|
+
dataKey: PropTypes.string,
|
|
41
|
+
stroke: PropTypes.string
|
|
42
|
+
};
|
|
43
|
+
export const customTooltipPropTypes = {
|
|
44
|
+
active: PropTypes.bool,
|
|
45
|
+
payload: PropTypes.arrayOf(PropTypes.shape({
|
|
46
|
+
value: PropTypes.number
|
|
47
|
+
})),
|
|
48
|
+
label: PropTypes.string
|
|
49
|
+
};
|
|
50
|
+
export const gradientPropTypes = {
|
|
51
|
+
type: PropTypes.string,
|
|
52
|
+
colors: PropTypes.arrayOf(PropTypes.string)
|
|
53
|
+
}; // TYPES
|
|
54
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","learningProfileRadarChartPropTypes","data","objectOf","oneOfType","arrayOf","number","isRequired","totalDataset","onDotClick","func","colors","shape","gradient","fill","string","stroke","percentage","color","background","label","width","height","customDotPropTypes","cx","cy","payload","value","subject","name","index","activeDot","key","dataKey","customTooltipPropTypes","active","bool","gradientPropTypes","type"],"sources":["../../../src/molecule/learning-profile-radar-chart/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\n// PROPTYPES\nexport const learningProfileRadarChartPropTypes = {\n data: PropTypes.objectOf(\n PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number])\n ).isRequired,\n totalDataset: PropTypes.number.isRequired,\n onDotClick: PropTypes.func,\n colors: PropTypes.arrayOf(\n PropTypes.shape({\n gradient: PropTypes.shape({\n fill: PropTypes.arrayOf(PropTypes.string),\n stroke: PropTypes.arrayOf(PropTypes.string)\n }),\n percentage: PropTypes.shape({\n color: PropTypes.string,\n background: PropTypes.string\n }),\n label: PropTypes.shape({\n color: PropTypes.string\n })\n })\n ),\n width: PropTypes.number,\n height: PropTypes.number\n};\n\nexport const customDotPropTypes = {\n cx: PropTypes.number,\n cy: PropTypes.number,\n payload: PropTypes.shape({\n payload: PropTypes.shape({\n value: PropTypes.number,\n subject: PropTypes.string\n }),\n name: PropTypes.string\n }),\n onDotClick: PropTypes.func,\n index: PropTypes.number,\n activeDot: PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.number,\n key: PropTypes.string\n }),\n dataKey: PropTypes.string,\n stroke: PropTypes.string\n};\n\nexport const customTooltipPropTypes = {\n active: PropTypes.bool,\n payload: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.number\n })\n ),\n label: PropTypes.string\n};\n\nexport const gradientPropTypes = {\n type: PropTypes.string,\n colors: PropTypes.arrayOf(PropTypes.string)\n};\n\n// TYPES\nexport type ColorType = {\n gradient?: {\n fill?: string[];\n stroke?: string[];\n };\n percentage?: {\n color?: string;\n background?: string;\n };\n label?: {\n color?: string;\n };\n};\n\nexport type LearningProfileRadarChartPropTypes = {\n data: {\n [ref: string]: number | number[];\n };\n legend: {\n [ref: string]: string;\n };\n totalDataset: number;\n onClick: (skillRef: string) => void;\n colors?: ColorType[];\n width?: number;\n height?: number;\n};\n\nexport type CustomDotPropTypes = {\n cx: number;\n cy: number;\n payload: {\n payload: {\n value: number;\n subject: string;\n };\n name: string;\n };\n onDotClick: (name: string) => void;\n index: number;\n activeDot?: {\n label: string;\n value: number;\n key: string;\n };\n dataKey: string;\n stroke: string;\n};\n\nexport type CustomTooltipPropTypes = {\n active: boolean;\n payload: {\n value: number;\n }[];\n label: string;\n};\n\nexport type GradientPropTypes = {\n type: string;\n colors: string[];\n};\n\nexport type TickType = {\n offset: {x: number; y: number};\n alignment: 'center' | 'start' | 'end';\n margin?: 'auto';\n marginLeft?: 'auto';\n marginRight?: 'auto';\n};\n\nexport type FormatedColorsType = {\n gradient: {\n fill: string[];\n stroke: string[];\n };\n percentage: {\n color: string;\n background: string;\n };\n label: {\n color: string;\n };\n};\n\nexport type FormatedDataType = {\n subject: string;\n} & {\n [key: string]: number | string;\n};\n\nexport type ActiveDotType = {\n key: string;\n value: number | string;\n label: string;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB,C,CAEA;;AACA,OAAO,MAAMC,kCAAkC,GAAG;EAChDC,IAAI,EAAEF,SAAS,CAACG,QAAV,CACJH,SAAS,CAACI,SAAV,CAAoB,CAACJ,SAAS,CAACK,OAAV,CAAkBL,SAAS,CAACM,MAA5B,CAAD,EAAsCN,SAAS,CAACM,MAAhD,CAApB,CADI,EAEJC,UAH8C;EAIhDC,YAAY,EAAER,SAAS,CAACM,MAAV,CAAiBC,UAJiB;EAKhDE,UAAU,EAAET,SAAS,CAACU,IAL0B;EAMhDC,MAAM,EAAEX,SAAS,CAACK,OAAV,CACNL,SAAS,CAACY,KAAV,CAAgB;IACdC,QAAQ,EAAEb,SAAS,CAACY,KAAV,CAAgB;MACxBE,IAAI,EAAEd,SAAS,CAACK,OAAV,CAAkBL,SAAS,CAACe,MAA5B,CADkB;MAExBC,MAAM,EAAEhB,SAAS,CAACK,OAAV,CAAkBL,SAAS,CAACe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ACY,KAAV,CAAgB;IACde,KAAK,EAAE3B,SAAS,CAACM;EADH,CAAhB,CADO,CAF2B;EAOpCc,KAAK,EAAEpB,SAAS,CAACe;AAPmB,CAA/B;AAUP,OAAO,MAAMsB,iBAAiB,GAAG;EAC/BC,IAAI,EAAEtC,SAAS,CAACe,MADe;EAE/BJ,MAAM,EAAEX,SAAS,CAACK,OAAV,CAAkBL,SAAS,CAACe,MAA5B;AAFuB,CAA1B,C,CAKP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-is-mobile.d.ts","sourceRoot":"","sources":["../../src/util/check-is-mobile.js"],"names":[],"mappings":"AAEO,8CAC6D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-is-mobile.js","names":["MOBILE_USER_AGENT_REGEX","isMobile","userAgent","test","toLowerCase"],"sources":["../../src/util/check-is-mobile.js"],"sourcesContent":["const MOBILE_USER_AGENT_REGEX = /iphone|ipad|ipod|android|blackberry|windows phone/g;\n\nexport const isMobile = userAgent =>\n userAgent && MOBILE_USER_AGENT_REGEX.test(userAgent.toLowerCase());\n"],"mappings":"AAAA,MAAMA,uBAAuB,GAAG,oDAAhC;AAEA,OAAO,MAAMC,QAAQ,GAAGC,SAAS,IAC/BA,SAAS,IAAIF,uBAAuB,CAACG,IAAxB,CAA6BD,SAAS,CAACE,WAAV,EAA7B,CADR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/gradient/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAIvC,oBAAY,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,oBAAoB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CACvE,CAAC;AAEF,QAAA,MAAM,QAAQ,qFAQX,KAAK,
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/gradient/index.native.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAIvC,oBAAY,KAAK,GAAG;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,oBAAoB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CACvE,CAAC;AAEF,QAAA,MAAM,QAAQ,qFAQX,KAAK,gBAkCP,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -7,7 +7,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _colorjs = _interopRequireDefault(require("colorjs.io"));
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
@@ -23,12 +23,10 @@ const Gradient = ({
|
|
|
23
23
|
let calculatedColors = colors;
|
|
24
24
|
|
|
25
25
|
if (colors.length === 1) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = (0, _color.default)(colors[0]).object();
|
|
31
|
-
calculatedColors = transparencyPosition === 'top' ? [`rgba(${r}, ${g}, ${b}, 0)`, colors[0], colors[0]] : [colors[0], colors[0], `rgba(${r}, ${g}, ${b}, 0)`];
|
|
26
|
+
const [raw] = colors;
|
|
27
|
+
const transparent = new _colorjs.default(raw).to('srgb');
|
|
28
|
+
transparent.alpha = 0;
|
|
29
|
+
calculatedColors = transparencyPosition === 'top' ? [transparent.toString(), raw, raw] : [raw, raw, transparent.toString()];
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
const _style = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["Gradient","children","colors","transparencyPosition","height","style","testID","pointerEvents","calculatedColors","length","
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["Gradient","children","colors","transparencyPosition","height","style","testID","pointerEvents","calculatedColors","length","raw","transparent","Color","to","alpha","toString","_style","push"],"sources":["../../../src/atom/gradient/index.native.tsx"],"sourcesContent":["import React, {ReactNode} from 'react';\nimport {ViewStyle} from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport Color from 'colorjs.io';\n\nexport type Props = {\n children?: ReactNode;\n colors: Array<string>;\n transparencyPosition?: 'top' | 'bottom';\n height?: number;\n style?: ViewStyle | ViewStyle[];\n testID?: string;\n pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only' | undefined;\n};\n\nconst Gradient = ({\n children,\n colors,\n transparencyPosition = 'top',\n height,\n style,\n testID,\n pointerEvents\n}: Props) => {\n let calculatedColors = colors;\n if (colors.length === 1) {\n const [raw] = colors;\n const transparent = new Color(raw).to('srgb');\n transparent.alpha = 0;\n\n calculatedColors =\n transparencyPosition === 'top'\n ? [transparent.toString(), raw, raw]\n : [raw, raw, transparent.toString()];\n }\n\n const _style = [];\n\n if (style) {\n _style.push(style);\n }\n if (height) {\n _style.push({height});\n }\n\n return (\n (\n <LinearGradient\n colors={calculatedColors}\n style={_style}\n pointerEvents={pointerEvents}\n testID={testID}\n >\n {children}\n </LinearGradient>\n ) || null\n );\n};\n\nexport default Gradient;\n"],"mappings":";;;;;AAAA;;AAEA;;AACA;;;;AAYA,MAAMA,QAAQ,GAAG,CAAC;EAChBC,QADgB;EAEhBC,MAFgB;EAGhBC,oBAAoB,GAAG,KAHP;EAIhBC,MAJgB;EAKhBC,KALgB;EAMhBC,MANgB;EAOhBC;AAPgB,CAAD,KAQJ;EACX,IAAIC,gBAAgB,GAAGN,MAAvB;;EACA,IAAIA,MAAM,CAACO,MAAP,KAAkB,CAAtB,EAAyB;IACvB,MAAM,CAACC,GAAD,IAAQR,MAAd;IACA,MAAMS,WAAW,GAAG,IAAIC,gBAAJ,CAAUF,GAAV,EAAeG,EAAf,CAAkB,MAAlB,CAApB;IACAF,WAAW,CAACG,KAAZ,GAAoB,CAApB;IAEAN,gBAAgB,GACdL,oBAAoB,KAAK,KAAzB,GACI,CAACQ,WAAW,CAACI,QAAZ,EAAD,EAAyBL,GAAzB,EAA8BA,GAA9B,CADJ,GAEI,CAACA,GAAD,EAAMA,GAAN,EAAWC,WAAW,CAACI,QAAZ,EAAX,CAHN;EAID;;EAED,MAAMC,MAAM,GAAG,EAAf;;EAEA,IAAIX,KAAJ,EAAW;IACTW,MAAM,CAACC,IAAP,CAAYZ,KAAZ;EACD;;EACD,IAAID,MAAJ,EAAY;IACVY,MAAM,CAACC,IAAP,CAAY;MAACb;IAAD,CAAZ;EACD;;EAED,OACE,aACE,6BAAC,kCAAD;IACE,MAAM,EAAEI,gBADV;IAEE,KAAK,EAAEQ,MAFT;IAGE,aAAa,EAAET,aAHjB;IAIE,MAAM,EAAED;EAJV,GAMGL,QANH,CADF,IASK,IAVP;AAYD,CA1CD;;eA4CeD,Q"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAgBA,mDAAoD;AAiB7C,iEACoE;;AAE3E,uDA6BG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getForegroundColor = exports.default = exports.DEFAULT_ICON_COLOR = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
11
|
+
|
|
12
|
+
var _proSolidSvgIcons = require("@fortawesome/pro-solid-svg-icons");
|
|
13
|
+
|
|
14
|
+
var _fontawesomeSvgCore = require("@fortawesome/fontawesome-svg-core");
|
|
15
|
+
|
|
16
|
+
var _toLower = _interopRequireDefault(require("lodash/fp/toLower"));
|
|
17
|
+
|
|
18
|
+
var _merge = _interopRequireDefault(require("lodash/fp/merge"));
|
|
19
|
+
|
|
20
|
+
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
21
|
+
|
|
22
|
+
var _colorjs = _interopRequireDefault(require("colorjs.io"));
|
|
23
|
+
|
|
24
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
_fontawesomeSvgCore.library.add(_proSolidSvgIcons.fas);
|
|
29
|
+
|
|
30
|
+
const DEFAULT_PRESET = 'm';
|
|
31
|
+
const ICON_LUMINOSITY = 32;
|
|
32
|
+
const DEFAULT_WRAPPER_SIZE = 40;
|
|
33
|
+
const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';
|
|
34
|
+
exports.DEFAULT_ICON_COLOR = DEFAULT_ICON_COLOR;
|
|
35
|
+
const SIZE_CONFIGS = {
|
|
36
|
+
s: {
|
|
37
|
+
faSize: 'sm',
|
|
38
|
+
wrapperSize: 32
|
|
39
|
+
},
|
|
40
|
+
m: {
|
|
41
|
+
faSize: 'lg',
|
|
42
|
+
wrapperSize: DEFAULT_WRAPPER_SIZE
|
|
43
|
+
},
|
|
44
|
+
xl: {
|
|
45
|
+
faSize: 'xl',
|
|
46
|
+
wrapperSize: 48
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getForegroundColor = backgroundColor => new _colorjs.default(backgroundColor).to('hsl').set({
|
|
51
|
+
l: ICON_LUMINOSITY
|
|
52
|
+
}).toString();
|
|
53
|
+
|
|
54
|
+
exports.getForegroundColor = getForegroundColor;
|
|
55
|
+
|
|
56
|
+
const Icon = /*#__PURE__*/_react.default.memo(function Icon({
|
|
57
|
+
iconName,
|
|
58
|
+
iconColor,
|
|
59
|
+
backgroundColor,
|
|
60
|
+
preset = DEFAULT_PRESET,
|
|
61
|
+
size
|
|
62
|
+
}) {
|
|
63
|
+
const effectiveIconColor = iconColor || backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR;
|
|
64
|
+
const effectiveSize = size ? (0, _merge.default)(SIZE_CONFIGS[DEFAULT_PRESET], size) : (0, _getOr.default)(SIZE_CONFIGS[DEFAULT_PRESET], (0, _toLower.default)(preset), SIZE_CONFIGS);
|
|
65
|
+
const iconWrapperStyle = {
|
|
66
|
+
backgroundColor,
|
|
67
|
+
width: effectiveSize.wrapperSize,
|
|
68
|
+
height: effectiveSize.wrapperSize
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
className: _style.default.iconWrapper,
|
|
72
|
+
style: iconWrapperStyle
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
74
|
+
icon: `fa-${iconName}`,
|
|
75
|
+
color: effectiveIconColor,
|
|
76
|
+
size: effectiveSize.faSize
|
|
77
|
+
}));
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
Icon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
|
+
iconName: _propTypes.default.string.isRequired,
|
|
82
|
+
iconColor: _propTypes.default.string,
|
|
83
|
+
backgroundColor: _propTypes.default.string,
|
|
84
|
+
preset: _propTypes.default.oneOf(['s', 'm', 'xl']),
|
|
85
|
+
size: _propTypes.default.shape({
|
|
86
|
+
faSize: _propTypes.default.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
|
|
87
|
+
wrapperSize: _propTypes.default.number
|
|
88
|
+
})
|
|
89
|
+
} : {};
|
|
90
|
+
var _default = Icon;
|
|
91
|
+
exports.default = _default;
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["library","add","fas","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","getForegroundColor","backgroundColor","Color","to","set","l","toString","Icon","React","memo","iconName","iconColor","preset","size","effectiveIconColor","effectiveSize","merge","getOr","toLower","iconWrapperStyle","width","height","style","iconWrapper","propTypes","PropTypes","string","isRequired","oneOf","shape","number"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport Color from 'colorjs.io';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 'sm',\n wrapperSize: 32\n },\n m: {\n faSize: 'lg',\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 'xl',\n wrapperSize: 48\n }\n};\n\nexport const getForegroundColor = backgroundColor =>\n new Color(backgroundColor).to('hsl').set({l: ICON_LUMINOSITY}).toString();\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n preset = DEFAULT_PRESET,\n size\n}) {\n const effectiveIconColor =\n iconColor || backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR;\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const iconWrapperStyle = {\n backgroundColor,\n width: effectiveSize.wrapperSize,\n height: effectiveSize.wrapperSize\n };\n\n return (\n <div className={style.iconWrapper} style={iconWrapperStyle}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n size={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: PropTypes.oneOf([\n '2xs',\n 'xs',\n 'sm',\n 'lg',\n 'xl',\n '2xl',\n '1x',\n '2x',\n '3x',\n '4x',\n '5x',\n '6x',\n '7x',\n '8x',\n '9x',\n '10x'\n ]),\n wrapperSize: PropTypes.number\n })\n};\n\nexport default Icon;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEAA,2BAAA,CAAQC,GAAR,CAAYC,qBAAZ;;AAEA,MAAMC,cAAc,GAA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AtB;IAAmC,KAAK,EAAEJ;EAA1C,gBACE,6BAAC,iCAAD;IACE,IAAI,EAAG,MAAKT,QAAS,EADvB;IAEE,KAAK,EAAEI,kBAFT;IAGE,IAAI,EAAEC,aAAa,CAACnB;EAHtB,EADF,CADF;AASD,CA7BY,CAAb;;AA+BAW,IAAI,CAACiB,SAAL,2CAAiB;EACfd,QAAQ,EAAEe,kBAAA,CAAUC,MAAV,CAAiBC,UADZ;EAEfhB,SAAS,EAAEc,kBAAA,CAAUC,MAFN;EAGfzB,eAAe,EAAEwB,kBAAA,CAAUC,MAHZ;EAIfd,MAAM,EAAEa,kBAAA,CAAUG,KAAV,CAAgB,CAAC,GAAD,EAAM,GAAN,EAAW,IAAX,CAAhB,CAJO;EAKff,IAAI,EAAEY,kBAAA,CAAUI,KAAV,CAAgB;IACpBjC,MAAM,EAAE6B,kBAAA,CAAUG,KAAV,CAAgB,CACtB,KADsB,EAEtB,IAFsB,EAGtB,IAHsB,EAItB,IAJsB,EAKtB,IALsB,EAMtB,KANsB,EAOtB,IAPsB,EAQtB,IARsB,EAStB,IATsB,EAUtB,IAVsB,EAWtB,IAXsB,EAYtB,IAZsB,EAatB,IAbsB,EActB,IAdsB,EAetB,IAfsB,EAgBtB,KAhBsB,CAAhB,CADY;IAmBpB/B,WAAW,EAAE4B,kBAAA,CAAUK;EAnBH,CAAhB;AALS,CAAjB;eA4BevB,I"}
|
package/lib/globals.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'browser-env';\ndeclare module 'react-native/*';\ndeclare module '
|
|
1
|
+
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'browser-env';\ndeclare module 'react-native/*';\ndeclare module 'css-color-function';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
@@ -148,10 +148,6 @@
|
|
|
148
148
|
font-size: 16px;
|
|
149
149
|
line-height: 19px;
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
.cta {
|
|
153
|
-
max-width: 175px;
|
|
154
|
-
}
|
|
155
151
|
}
|
|
156
152
|
|
|
157
153
|
@media mobile {
|
|
@@ -162,6 +158,8 @@
|
|
|
162
158
|
|
|
163
159
|
.banner {
|
|
164
160
|
justify-content: center;
|
|
161
|
+
padding-right: 24px;
|
|
162
|
+
padding-left: 24px;
|
|
165
163
|
}
|
|
166
164
|
|
|
167
165
|
.right {
|
|
@@ -183,7 +181,7 @@
|
|
|
183
181
|
}
|
|
184
182
|
|
|
185
183
|
.cta {
|
|
186
|
-
|
|
184
|
+
margin-top: 12px;
|
|
187
185
|
}
|
|
188
186
|
}
|
|
189
187
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormatedDataType, LearningProfileRadarChartPropTypes } from './types';
|
|
3
|
+
export declare const formatData: (legend: {
|
|
4
|
+
[ref: string]: string;
|
|
5
|
+
}, data_: LearningProfileRadarChartPropTypes['data']) => FormatedDataType[];
|
|
6
|
+
export declare const LearningProfileRadarChart: {
|
|
7
|
+
({ data, legend, totalDataset, colors: colorsProps, onClick, width, height }: LearningProfileRadarChartPropTypes): JSX.Element;
|
|
8
|
+
propTypes: {
|
|
9
|
+
data: import("prop-types").Validator<{
|
|
10
|
+
[x: string]: NonNullable<number | (number | null | undefined)[] | null | undefined> | null | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
totalDataset: import("prop-types").Validator<number>;
|
|
13
|
+
onDotClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
colors: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
15
|
+
gradient: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
16
|
+
fill: import("prop-types").Requireable<(string | null | undefined)[]>;
|
|
17
|
+
stroke: import("prop-types").Requireable<(string | null | undefined)[]>;
|
|
18
|
+
}>>;
|
|
19
|
+
percentage: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
20
|
+
color: import("prop-types").Requireable<string>;
|
|
21
|
+
background: import("prop-types").Requireable<string>;
|
|
22
|
+
}>>;
|
|
23
|
+
label: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
24
|
+
color: import("prop-types").Requireable<string>;
|
|
25
|
+
}>>;
|
|
26
|
+
}> | null | undefined)[]>;
|
|
27
|
+
width: import("prop-types").Requireable<number>;
|
|
28
|
+
height: import("prop-types").Requireable<number>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
declare const ResponsiveLearningProfileRadarChart: {
|
|
32
|
+
(props: LearningProfileRadarChartPropTypes): JSX.Element;
|
|
33
|
+
propTypes: {
|
|
34
|
+
data: import("prop-types").Validator<{
|
|
35
|
+
[x: string]: NonNullable<number | (number | null | undefined)[] | null | undefined> | null | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
totalDataset: import("prop-types").Validator<number>;
|
|
38
|
+
onDotClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
39
|
+
colors: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
40
|
+
gradient: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
41
|
+
fill: import("prop-types").Requireable<(string | null | undefined)[]>;
|
|
42
|
+
stroke: import("prop-types").Requireable<(string | null | undefined)[]>;
|
|
43
|
+
}>>;
|
|
44
|
+
percentage: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
45
|
+
color: import("prop-types").Requireable<string>;
|
|
46
|
+
background: import("prop-types").Requireable<string>;
|
|
47
|
+
}>>;
|
|
48
|
+
label: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
49
|
+
color: import("prop-types").Requireable<string>;
|
|
50
|
+
}>>;
|
|
51
|
+
}> | null | undefined)[]>;
|
|
52
|
+
width: import("prop-types").Requireable<number>;
|
|
53
|
+
height: import("prop-types").Requireable<number>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export default ResponsiveLearningProfileRadarChart;
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/learning-profile-radar-chart/index.tsx"],"names":[],"mappings":";AA6BA,OAAO,EAGL,gBAAgB,EAChB,kCAAkC,EAGnC,MAAM,SAAS,CAAC;AA+OjB,eAAO,MAAM,UAAU,EAAE,CACvB,MAAM,EAAE;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,EAC/B,KAAK,EAAE,kCAAkC,CAAC,MAAM,CAAC,KAC9C,gBAAgB,EAOX,CAAC;AAEX,eAAO,MAAM,yBAAyB;kFAQnC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CA8GpC,CAAC;AAEF,QAAA,MAAM,mCAAmC;YAAW,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;CAIrF,CAAC;AAKF,eAAe,mCAAmC,CAAC"}
|