@coorpacademy/components 11.6.0 → 11.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/review-presentation/index.native.js +1 -1
- package/es/atom/review-presentation/index.native.js.map +1 -1
- package/es/atom/select/index.d.ts.map +1 -1
- package/es/atom/select/index.js +48 -11
- package/es/atom/select/index.js.map +1 -1
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +1 -9
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/index.js +31 -0
- package/es/molecule/empty-state-dashboard/index.js.map +1 -0
- package/es/molecule/empty-state-dashboard/style.css +55 -0
- package/es/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/es/molecule/empty-state-dashboard/types.js +19 -0
- package/es/molecule/empty-state-dashboard/types.js.map +1 -0
- package/es/organism/list-item/index.d.ts +8 -6
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -2
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +18 -0
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/list-items/index.js +5 -1
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/review-header/index.native.d.ts.map +1 -1
- package/es/organism/review-header/index.native.js +8 -7
- package/es/organism/review-header/index.native.js.map +1 -1
- package/es/template/activity/index.d.ts +36 -40
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +89 -111
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/stars-summary.d.ts +9 -18
- package/es/template/activity/stars-summary.d.ts.map +1 -1
- package/es/template/activity/stars-summary.js +94 -122
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +20 -0
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +12 -3
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +5 -1
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/lib/atom/review-presentation/index.native.js +1 -1
- package/lib/atom/review-presentation/index.native.js.map +1 -1
- package/lib/atom/select/index.d.ts.map +1 -1
- package/lib/atom/select/index.js +46 -9
- package/lib/atom/select/index.js.map +1 -1
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +1 -10
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/empty-state-dashboard/index.d.ts +23 -0
- package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/index.js +42 -0
- package/lib/molecule/empty-state-dashboard/index.js.map +1 -0
- package/lib/molecule/empty-state-dashboard/style.css +55 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts +19 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -0
- package/lib/molecule/empty-state-dashboard/types.js +29 -0
- package/lib/molecule/empty-state-dashboard/types.js.map +1 -0
- package/lib/organism/list-item/index.d.ts +8 -6
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -2
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +18 -0
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/list-items/index.js +5 -1
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/review-header/index.native.d.ts.map +1 -1
- package/lib/organism/review-header/index.native.js +8 -7
- package/lib/organism/review-header/index.native.js.map +1 -1
- package/lib/template/activity/index.d.ts +36 -40
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +95 -110
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/stars-summary.d.ts +9 -18
- package/lib/template/activity/stars-summary.d.ts.map +1 -1
- package/lib/template/activity/stars-summary.js +90 -119
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +20 -0
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +13 -3
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +5 -1
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/locales/bs/global.json +8 -1
- package/locales/cs/global.json +8 -1
- package/locales/de/global.json +8 -1
- package/locales/en/global.json +0 -1
- package/locales/es/global.json +8 -1
- package/locales/et/global.json +8 -1
- package/locales/fr/global.json +0 -1
- package/locales/hr/global.json +8 -1
- package/locales/hu/global.json +8 -1
- package/locales/hy/global.json +0 -1
- package/locales/it/global.json +8 -1
- package/locales/ja/global.json +8 -1
- package/locales/ko/global.json +8 -1
- package/locales/nl/global.json +8 -1
- package/locales/pl/global.json +8 -1
- package/locales/pt/global.json +8 -1
- package/locales/ro/global.json +8 -1
- package/locales/ru/global.json +0 -1
- package/locales/sk/global.json +8 -1
- package/locales/tl/global.json +8 -1
- package/locales/tr/global.json +8 -1
- package/locales/uk/global.json +8 -1
- package/locales/vi/global.json +8 -1
- package/locales/zh/global.json +8 -1
- package/locales/zh_TW/global.json +8 -1
- package/package.json +2 -2
- package/locales/.mtslconfig.json +0 -1
package/es/util/button-icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaSolidStatusClose as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidContentContentViewModule1 as ListIcon, NovaSolidLoginLogout1 as LogoutIcon, NovaSolidApplicationsWindowUpload3 as PublishIcon, NovaSolidComputersSdCard as SaveIcon, NovaLineLoginKey1 as KlfIcon, NovaSolidFilesFoldersFolders as FoldersIcon } from '@coorpacademy/nova-icons';
|
|
1
|
+
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaSolidStatusClose as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidContentContentViewModule1 as ListIcon, NovaSolidLoginLogout1 as LogoutIcon, NovaSolidApplicationsWindowUpload3 as PublishIcon, NovaSolidComputersSdCard as SaveIcon, NovaLineLoginKey1 as KlfIcon, NovaSolidFilesFoldersFolders as FoldersIcon, NovaSolidFilesBasicFileUpload2 as UploadIcon } from '@coorpacademy/nova-icons';
|
|
2
2
|
export const ICONS = {
|
|
3
3
|
add: AddIcon,
|
|
4
4
|
analytics: AnalyticsIcon,
|
|
@@ -14,6 +14,7 @@ export const ICONS = {
|
|
|
14
14
|
publish: PublishIcon,
|
|
15
15
|
save: SaveIcon,
|
|
16
16
|
see: EyeIcon,
|
|
17
|
-
folders: FoldersIcon
|
|
17
|
+
folders: FoldersIcon,
|
|
18
|
+
upload: UploadIcon
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=button-icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-icons.js","names":["NovaSolidRemoveAddAddCircle1","AddIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaSolidContentEditionBin","BinIcon","NovaCompositionCoorpacademyBulletPoint","BulletPointIcon","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaSolidStatusClose","CloseIcon","NovaSolidContentEditionPencilWrite","EditIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaSolidContentContentViewModule1","ListIcon","NovaSolidLoginLogout1","LogoutIcon","NovaSolidApplicationsWindowUpload3","PublishIcon","NovaSolidComputersSdCard","SaveIcon","NovaLineLoginKey1","KlfIcon","NovaSolidFilesFoldersFolders","FoldersIcon","ICONS","add","analytics","bin","close","edit","key","list","logout","publish","save","see","folders"],"sources":["../../src/util/button-icons.js"],"sourcesContent":["import {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaSolidContentEditionBin as BinIcon,\n NovaCompositionCoorpacademyBulletPoint as BulletPointIcon,\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaSolidStatusClose as CloseIcon,\n NovaSolidContentEditionPencilWrite as EditIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaSolidContentContentViewModule1 as ListIcon,\n NovaSolidLoginLogout1 as LogoutIcon,\n NovaSolidApplicationsWindowUpload3 as PublishIcon,\n NovaSolidComputersSdCard as SaveIcon,\n NovaLineLoginKey1 as KlfIcon,\n NovaSolidFilesFoldersFolders as FoldersIcon\n} from '@coorpacademy/nova-icons';\n\nexport const ICONS = {\n add: AddIcon,\n analytics: AnalyticsIcon,\n bin: BinIcon,\n 'bullet-point': BulletPointIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n edit: EditIcon,\n key: KlfIcon,\n list: ListIcon,\n logout: LogoutIcon,\n publish: PublishIcon,\n save: SaveIcon,\n see: EyeIcon,\n folders: FoldersIcon\n};\n"],"mappings":"AAAA,SACEA,4BAA4B,IAAIC,OADlC,EAEEC,oCAAoC,IAAIC,aAF1C,EAGEC,0BAA0B,IAAIC,OAHhC,EAIEC,sCAAsC,IAAIC,eAJ5C,EAKEC,kCAAkC,IAAIC,eALxC,EAMEC,mCAAmC,IAAIC,gBANzC,EAOEC,oBAAoB,IAAIC,SAP1B,EAQEC,kCAAkC,IAAIC,QARxC,EASEC,8BAA8B,IAAIC,OATpC,EAUEC,kCAAkC,IAAIC,QAVxC,EAWEC,qBAAqB,IAAIC,UAX3B,EAYEC,kCAAkC,IAAIC,WAZxC,EAaEC,wBAAwB,IAAIC,QAb9B,EAcEC,iBAAiB,IAAIC,OAdvB,EAeEC,4BAA4B,IAAIC,WAflC,
|
|
1
|
+
{"version":3,"file":"button-icons.js","names":["NovaSolidRemoveAddAddCircle1","AddIcon","NovaCompositionCoorpacademyAnalytics","AnalyticsIcon","NovaSolidContentEditionBin","BinIcon","NovaCompositionCoorpacademyBulletPoint","BulletPointIcon","NovaCompositionNavigationArrowLeft","ChevronLeftIcon","NovaCompositionNavigationArrowRight","ChevronRightIcon","NovaSolidStatusClose","CloseIcon","NovaSolidContentEditionPencilWrite","EditIcon","NovaCompositionCoorpacademyEye","EyeIcon","NovaSolidContentContentViewModule1","ListIcon","NovaSolidLoginLogout1","LogoutIcon","NovaSolidApplicationsWindowUpload3","PublishIcon","NovaSolidComputersSdCard","SaveIcon","NovaLineLoginKey1","KlfIcon","NovaSolidFilesFoldersFolders","FoldersIcon","NovaSolidFilesBasicFileUpload2","UploadIcon","ICONS","add","analytics","bin","close","edit","key","list","logout","publish","save","see","folders","upload"],"sources":["../../src/util/button-icons.js"],"sourcesContent":["import {\n NovaSolidRemoveAddAddCircle1 as AddIcon,\n NovaCompositionCoorpacademyAnalytics as AnalyticsIcon,\n NovaSolidContentEditionBin as BinIcon,\n NovaCompositionCoorpacademyBulletPoint as BulletPointIcon,\n NovaCompositionNavigationArrowLeft as ChevronLeftIcon,\n NovaCompositionNavigationArrowRight as ChevronRightIcon,\n NovaSolidStatusClose as CloseIcon,\n NovaSolidContentEditionPencilWrite as EditIcon,\n NovaCompositionCoorpacademyEye as EyeIcon,\n NovaSolidContentContentViewModule1 as ListIcon,\n NovaSolidLoginLogout1 as LogoutIcon,\n NovaSolidApplicationsWindowUpload3 as PublishIcon,\n NovaSolidComputersSdCard as SaveIcon,\n NovaLineLoginKey1 as KlfIcon,\n NovaSolidFilesFoldersFolders as FoldersIcon,\n NovaSolidFilesBasicFileUpload2 as UploadIcon\n} from '@coorpacademy/nova-icons';\n\nexport const ICONS = {\n add: AddIcon,\n analytics: AnalyticsIcon,\n bin: BinIcon,\n 'bullet-point': BulletPointIcon,\n 'chevron-left': ChevronLeftIcon,\n 'chevron-right': ChevronRightIcon,\n close: CloseIcon,\n edit: EditIcon,\n key: KlfIcon,\n list: ListIcon,\n logout: LogoutIcon,\n publish: PublishIcon,\n save: SaveIcon,\n see: EyeIcon,\n folders: FoldersIcon,\n upload: UploadIcon\n};\n"],"mappings":"AAAA,SACEA,4BAA4B,IAAIC,OADlC,EAEEC,oCAAoC,IAAIC,aAF1C,EAGEC,0BAA0B,IAAIC,OAHhC,EAIEC,sCAAsC,IAAIC,eAJ5C,EAKEC,kCAAkC,IAAIC,eALxC,EAMEC,mCAAmC,IAAIC,gBANzC,EAOEC,oBAAoB,IAAIC,SAP1B,EAQEC,kCAAkC,IAAIC,QARxC,EASEC,8BAA8B,IAAIC,OATpC,EAUEC,kCAAkC,IAAIC,QAVxC,EAWEC,qBAAqB,IAAIC,UAX3B,EAYEC,kCAAkC,IAAIC,WAZxC,EAaEC,wBAAwB,IAAIC,QAb9B,EAcEC,iBAAiB,IAAIC,OAdvB,EAeEC,4BAA4B,IAAIC,WAflC,EAgBEC,8BAA8B,IAAIC,UAhBpC,QAiBO,0BAjBP;AAmBA,OAAO,MAAMC,KAAK,GAAG;EACnBC,GAAG,EAAEhC,OADc;EAEnBiC,SAAS,EAAE/B,aAFQ;EAGnBgC,GAAG,EAAE9B,OAHc;EAInB,gBAAgBE,eAJG;EAKnB,gBAAgBE,eALG;EAMnB,iBAAiBE,gBANE;EAOnByB,KAAK,EAAEvB,SAPY;EAQnBwB,IAAI,EAAEtB,QARa;EASnBuB,GAAG,EAAEX,OATc;EAUnBY,IAAI,EAAEpB,QAVa;EAWnBqB,MAAM,EAAEnB,UAXW;EAYnBoB,OAAO,EAAElB,WAZU;EAanBmB,IAAI,EAAEjB,QAba;EAcnBkB,GAAG,EAAE1B,OAdc;EAenB2B,OAAO,EAAEf,WAfU;EAgBnBgB,MAAM,EAAEd;AAhBW,CAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","paddingBottom","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","large","opacity","tips","marginTop","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","spacing","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tips: ViewStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: 20,\n paddingBottom: 100\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: 32\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7\n },\n tips: {\n marginTop: 32,\n height:
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["createStyleSheet","brandTheme","theme","StyleSheet","create","container","backgroundColor","colors","white","justifyContent","flex","padding","paddingTop","paddingBottom","title","height","width","fontSize","xxlarge","fontWeight","bold","lineHeight","color","text","primary","marginBottom","large","opacity","tips","marginTop","tip","flexDirection","overflow","alignItems","borderRadius","gray","extra","spacing","micro","tipText","icon","margin","button","cta","buttonText","alignSelf","Tip","props","templateContext","useTemplateContext","styleSheet","setStylesheet","useState","Icon","useEffect","_stylesheet","Onboarding","translations","onPress","appReview","presentation","TargetIcon","labelList","skills","QuestionMarkIcon","questions","HeartIcon","lifes","CheckCircle2Icon","allright","ok"],"sources":["../../../src/atom/review-presentation/index.native.tsx"],"sourcesContent":["import React, {useState, useEffect} from 'react';\nimport {View, StyleSheet, Text, ViewStyle, TextStyle} from 'react-native';\nimport {\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionMarkIcon,\n NovaSolidStatusCheckCircle2 as CheckCircle2Icon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIcon\n} from '@coorpacademy/nova-icons';\n\nimport {useTemplateContext} from '../../template/app-review/template-context';\nimport {Theme} from '../../variables/theme.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport Html from '../html/index.native';\nimport {Brand} from '../../variables/brand.native';\nimport {OnboardingProps, TipProps} from './prop-types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n title: TextStyle;\n text: TextStyle;\n tips: ViewStyle;\n tip: ViewStyle;\n tipText: TextStyle;\n icon: ViewStyle;\n button: ViewStyle;\n buttonText: TextStyle;\n};\n\nconst createStyleSheet = (brandTheme: Brand, theme: Theme): StyleSheetType =>\n StyleSheet.create({\n container: {\n backgroundColor: theme.colors.white,\n justifyContent: 'space-between',\n flex: 1,\n padding: 20,\n paddingTop: 20,\n paddingBottom: 100\n },\n title: {\n height: 72,\n width: 268,\n fontSize: theme.fontSize.xxlarge,\n fontWeight: theme.fontWeight.bold,\n lineHeight: 36,\n color: theme.colors.text.primary,\n marginBottom: 32\n },\n text: {\n fontSize: theme.fontSize.large,\n color: theme.colors.text.primary,\n opacity: 0.7\n },\n tips: {\n marginTop: 32,\n height: 230,\n justifyContent: 'center'\n },\n tip: {\n flexDirection: 'row',\n overflow: 'hidden',\n alignItems: 'center',\n height: 54,\n borderRadius: 8,\n backgroundColor: theme.colors.gray.extra,\n marginTop: theme.spacing.micro,\n marginBottom: theme.spacing.micro\n },\n tipText: {\n fontSize: 16,\n lineHeight: 22,\n color: theme.colors.text.primary\n },\n icon: {\n margin: 10\n },\n button: {\n height: 52,\n borderRadius: 7,\n marginBottom: 32,\n marginTop: 16,\n backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,\n justifyContent: 'center'\n },\n buttonText: {\n alignSelf: 'center',\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.large,\n color: '#fff'\n }\n });\n\nconst Tip = (props: TipProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme} = templateContext;\n const {Icon, text} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.tip}>\n <Icon height={16} width={16} style={styleSheet.icon} color={theme.colors.text.primary} />\n <Text style={styleSheet.tipText}>{text}</Text>\n </View>\n );\n};\n\nconst Onboarding = (props: OnboardingProps) => {\n const templateContext = useTemplateContext();\n const [styleSheet, setStylesheet] = useState<StyleSheetType | null>(null);\n const {brandTheme, theme, translations} = templateContext;\n const {onPress} = props;\n\n useEffect(() => {\n const _stylesheet = createStyleSheet(brandTheme, theme);\n setStylesheet(_stylesheet);\n }, [brandTheme, theme]);\n\n // ------------------------------------\n\n if (!styleSheet) {\n return null;\n }\n\n return (\n <View style={styleSheet.container}>\n <Html style={styleSheet.title}>{translations.appReview.presentation.title}</Html>\n <Html style={styleSheet.text}>{translations.appReview.presentation.text}</Html>\n\n <View style={styleSheet.tips}>\n <Tip Icon={TargetIcon} text={translations.appReview.presentation.labelList.skills.text} />\n <Tip\n Icon={QuestionMarkIcon}\n text={translations.appReview.presentation.labelList.questions.text}\n />\n <Tip Icon={HeartIcon} text={translations.appReview.presentation.labelList.lifes.text} />\n <Tip\n Icon={CheckCircle2Icon}\n text={translations.appReview.presentation.labelList.allright.text}\n />\n </View>\n <Touchable\n testID=\"button-quit-revision-onboarding\"\n onPress={onPress}\n analyticsID=\"button-start\"\n style={styleSheet.button}\n >\n <Text style={styleSheet.buttonText}>{translations.ok}</Text>\n </Touchable>\n </View>\n );\n};\n\nexport default Onboarding;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;;;;;;;AAgBA,MAAMA,gBAAgB,GAAG,CAACC,UAAD,EAAoBC,KAApB,KACvBC,uBAAA,CAAWC,MAAX,CAAkB;EAChBC,SAAS,EAAE;IACTC,eAAe,EAAEJ,KAAK,CAACK,MAAN,CAAaC,KADrB;I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AAuBC,YAAvB,CAAoCE,SAApC,CAA8CG,SAA9C,CAAwD1C;EAFhE,EAFF,eAME,6BAAC,GAAD;IAAK,IAAI,EAAE2C,sDAAX;IAAsB,IAAI,EAAET,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CK,KAA9C,CAAoD5C;EAAhF,EANF,eAOE,6BAAC,GAAD;IACE,IAAI,EAAE6C,sCADR;IAEE,IAAI,EAAEX,YAAY,CAACE,SAAb,CAAuBC,YAAvB,CAAoCE,SAApC,CAA8CO,QAA9C,CAAuD9C;EAF/D,EAPF,CAJF,eAgBE,6BAAC,cAAD;IACE,MAAM,EAAC,iCADT;IAEE,OAAO,EAAEmC,OAFX;IAGE,WAAW,EAAC,cAHd;IAIE,KAAK,EAAER,UAAU,CAACR;EAJpB,gBAME,6BAAC,iBAAD;IAAM,KAAK,EAAEQ,UAAU,CAACN;EAAxB,GAAqCa,YAAY,CAACa,EAAlD,CANF,CAhBF,CADF;AA2BD,CA5CD;;eA8Ced,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/select/index.js"],"names":[],"mappings":";;;;;;;;AAwDA,qEA4KC"}
|
package/lib/atom/select/index.js
CHANGED
|
@@ -54,6 +54,30 @@ const themeStyle = {
|
|
|
54
54
|
coorpmanager: null
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
const ArrowView = ({
|
|
58
|
+
shouldRender,
|
|
59
|
+
isArrowUp,
|
|
60
|
+
ariaLabel,
|
|
61
|
+
arrowClass,
|
|
62
|
+
arrowColor
|
|
63
|
+
}) => {
|
|
64
|
+
const props = (0, _react.useMemo)(() => _extends({}, ariaLabel & {
|
|
65
|
+
'aria-label': ariaLabel
|
|
66
|
+
}, arrowColor & {
|
|
67
|
+
color: arrowColor
|
|
68
|
+
}, {
|
|
69
|
+
className: arrowClass
|
|
70
|
+
}), [ariaLabel, arrowClass, arrowColor]);
|
|
71
|
+
|
|
72
|
+
if (shouldRender) {
|
|
73
|
+
return isArrowUp ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowTop, _extends({}, props, {
|
|
74
|
+
"data-testid": "select-arrow-up-icon"
|
|
75
|
+
})) : /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, _extends({}, props, {
|
|
76
|
+
"data-testid": "select-arrow-down-icon"
|
|
77
|
+
}));
|
|
78
|
+
} else return null;
|
|
79
|
+
};
|
|
80
|
+
|
|
57
81
|
const Select = (props, legacyContext) => {
|
|
58
82
|
const {
|
|
59
83
|
name,
|
|
@@ -73,6 +97,9 @@ const Select = (props, legacyContext) => {
|
|
|
73
97
|
} = props;
|
|
74
98
|
const skin = (0, _provider.GetSkinFromContext)(legacyContext);
|
|
75
99
|
const title = (0, _react.useMemo)(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
|
|
100
|
+
const [isArrowUp, setIsArrowUp] = (0, _react.useState)(false);
|
|
101
|
+
const handleSelectOnFocus = (0, _react.useCallback)(() => setIsArrowUp(true), []);
|
|
102
|
+
const handleSelectOnBlur = (0, _react.useCallback)(() => setIsArrowUp(false), []);
|
|
76
103
|
const optionList = options && options.map((option, index) => {
|
|
77
104
|
return /*#__PURE__*/_react.default.createElement("option", {
|
|
78
105
|
key: index,
|
|
@@ -98,20 +125,17 @@ const Select = (props, legacyContext) => {
|
|
|
98
125
|
selected: true
|
|
99
126
|
}, options)), [options, theme]);
|
|
100
127
|
const handleChange = (0, _react.useMemo)(() => multiple ? e => {
|
|
128
|
+
setIsArrowUp(false);
|
|
101
129
|
onChange((0, _map.default)((0, _get.default)('value'), e.target.selectedOptions));
|
|
102
130
|
} : e => {
|
|
131
|
+
setIsArrowUp(false);
|
|
103
132
|
onChange(e.target.value);
|
|
104
133
|
}, [onChange, multiple]);
|
|
105
134
|
const black = (0, _react.useMemo)(() => (0, _getOr.default)('#14171A', 'common.black', skin), [skin]);
|
|
106
135
|
const color = (0, _react.useMemo)(() => (0, _getOr.default)('#00B0FF', 'common.primary', skin), [skin]);
|
|
107
|
-
const
|
|
136
|
+
const isThemeOneOfQuestionTemplateOrPlayer = (0, _react.useMemo)(() => (0, _includes.default)(theme, ['question', 'template', 'player']), [theme]);
|
|
137
|
+
const shouldUseSkinFontColor = (0, _react.useMemo)(() => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer, [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]);
|
|
108
138
|
const arrowColor = selected ? color : undefined;
|
|
109
|
-
const arrowView = !multiple ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowDown, {
|
|
110
|
-
color: (0, _includes.default)(theme, ['question', 'template', 'player']) ? arrowColor : black,
|
|
111
|
-
className: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
112
|
-
"aria-label": ariaLabel,
|
|
113
|
-
"data-testid": "select-arrow-down-icon"
|
|
114
|
-
}) : null;
|
|
115
139
|
const behaviorClassName = (0, _react.useMemo)(() => (0, _getClassState.default)(_style.default.default, _style.default.modified, _style.default.error, modified, error), [error, modified]);
|
|
116
140
|
const composedClassName = (0, _react.useMemo)(() => (0, _classnames.default)(theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName, selected ? _style.default.selected : _style.default.unselected, className), [behaviorClassName, className, selected, theme]);
|
|
117
141
|
const labelSize = (0, _react.useMemo)(() => (0, _size.default)(selectedLabel), [selectedLabel]);
|
|
@@ -130,7 +154,13 @@ const Select = (props, legacyContext) => {
|
|
|
130
154
|
style: _extends({}, shouldUseSkinFontColor && {
|
|
131
155
|
color
|
|
132
156
|
})
|
|
133
|
-
}, selectedLabel),
|
|
157
|
+
}, selectedLabel), /*#__PURE__*/_react.default.createElement(ArrowView, {
|
|
158
|
+
shouldRender: !multiple,
|
|
159
|
+
isArrowUp: isArrowUp,
|
|
160
|
+
ariaLabel: ariaLabel,
|
|
161
|
+
arrowClass: shouldUseSkinFontColor ? _style.default.selectedArrow : _style.default.arrow,
|
|
162
|
+
arrowColor: isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black
|
|
163
|
+
}), /*#__PURE__*/_react.default.createElement("select", {
|
|
134
164
|
"data-name": "native-select",
|
|
135
165
|
className: _style.default.selectBox,
|
|
136
166
|
title: selectedLabel,
|
|
@@ -138,7 +168,14 @@ const Select = (props, legacyContext) => {
|
|
|
138
168
|
onChange: handleChange,
|
|
139
169
|
value: selected,
|
|
140
170
|
multiple: multiple,
|
|
141
|
-
disabled: disabled
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
onClick: handleSelectOnFocus,
|
|
173
|
+
onBlur: handleSelectOnBlur // onBlur does not handle completely an out of bounds click
|
|
174
|
+
// ex: select is Opened and a click is done outside, cancelling the select
|
|
175
|
+
// that doesn't count as a Blur, so an onMouseLeave is needed
|
|
176
|
+
,
|
|
177
|
+
onMouseLeave: handleSelectOnBlur,
|
|
178
|
+
"data-testid": "native-select"
|
|
142
179
|
}, optionList)), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
180
|
className: _style.default.description
|
|
144
181
|
}, description));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","Select","props","legacyContext","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","ariaLabel","skin","GetSkinFromContext","useMemo","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","includes","arrowColor","undefined","arrowView","selectedArrow","arrow","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n const arrowColor = selected ? color : undefined;\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={includes(theme, ['question', 'template', 'player']) ? arrowColor : black}\n className={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n aria-label={ariaLabel}\n data-testid=\"select-arrow-down-icon\"\n />\n ) : null;\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,MAAM,GAAG,CAACC,KAAD,EAAQC,aAAR,KAA0B;EACvC,MAAM;IACJC,IADI;IAEJC,OAAO,GAAG,EAFN;IAG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kBAAA,CAAUC;AAdP,CAAnB;eAiBehE,M"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["themeStyle","filter","style","invalid","header","mooc","question","sort","thematiques","player","template","coorpmanager","ArrowView","shouldRender","isArrowUp","ariaLabel","arrowClass","arrowColor","props","useMemo","color","className","Select","legacyContext","name","options","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","GetSkinFromContext","setIsArrowUp","useState","handleSelectOnFocus","useCallback","handleSelectOnBlur","optionList","map","option","index","value","selectOption","titleView","selected","get","find","selectedLabel","isSelectedInValidOption","getOr","validOption","handleChange","e","target","selectedOptions","black","isThemeOneOfQuestionTemplateOrPlayer","includes","shouldUseSkinFontColor","undefined","behaviorClassName","getClassState","default","composedClassName","classnames","unselected","labelSize","size","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectedArrow","arrow","selectBox","SelectOptionPropTypes","PropTypes","string","isRequired","oneOfType","number","bool","contextTypes","Provider","childContextTypes","propTypes","func","oneOf","keys","arrayOf","shape"],"sources":["../../../src/atom/select/index.js"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport filter from 'lodash/fp/filter';\nimport find from 'lodash/fp/find';\nimport get from 'lodash/fp/get';\nimport getOr from 'lodash/fp/getOr';\nimport includes from 'lodash/fp/includes';\nimport keys from 'lodash/fp/keys';\nimport map from 'lodash/fp/map';\nimport size from 'lodash/fp/size';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaCompositionNavigationArrowTop as ArrowUp\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template,\n coorpmanager: null\n};\n\nconst ArrowView = ({shouldRender, isArrowUp, ariaLabel, arrowClass, arrowColor}) => {\n const props = useMemo(\n () => ({\n ...(ariaLabel &\n {\n 'aria-label': ariaLabel\n }),\n ...(arrowColor &\n {\n color: arrowColor\n }),\n className: arrowClass\n }),\n [ariaLabel, arrowClass, arrowColor]\n );\n if (shouldRender) {\n return isArrowUp ? (\n <ArrowUp {...props} data-testid=\"select-arrow-up-icon\" />\n ) : (\n <ArrowDown {...props} data-testid=\"select-arrow-down-icon\" />\n );\n } else return null;\n};\n\nconst Select = (props, legacyContext) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle,\n 'aria-label': ariaLabel\n } = props;\n\n const skin = GetSkinFromContext(legacyContext);\n const title = useMemo(\n () => (propTitle ? `${propTitle}${required ? '*' : ''}` : null),\n [propTitle, required]\n );\n\n const [isArrowUp, setIsArrowUp] = useState(false);\n\n const handleSelectOnFocus = useCallback(() => setIsArrowUp(true), []);\n const handleSelectOnBlur = useCallback(() => setIsArrowUp(false), []);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n setIsArrowUp(false);\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n setIsArrowUp(false);\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const isThemeOneOfQuestionTemplateOrPlayer = useMemo(\n () => includes(theme, ['question', 'template', 'player']),\n [theme]\n );\n const shouldUseSkinFontColor = useMemo(\n () => !isSelectedInValidOption && selected && isThemeOneOfQuestionTemplateOrPlayer,\n [isSelectedInValidOption, selected, isThemeOneOfQuestionTemplateOrPlayer]\n );\n const arrowColor = selected ? color : undefined;\n\n const behaviorClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme && theme !== 'coorpmanager' ? themeStyle[theme] : behaviorClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviorClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div\n className={classnames(\n composedClassName,\n theme === 'coorpmanager' ? style.coorpmanager : null\n )}\n >\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n >\n {selectedLabel}\n </span>\n <ArrowView\n shouldRender={!multiple}\n isArrowUp={isArrowUp}\n ariaLabel={ariaLabel}\n arrowClass={shouldUseSkinFontColor ? style.selectedArrow : style.arrow}\n arrowColor={isThemeOneOfQuestionTemplateOrPlayer ? arrowColor : black}\n />\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n onClick={handleSelectOnFocus}\n onBlur={handleSelectOnBlur}\n // onBlur does not handle completely an out of bounds click\n // ex: select is Opened and a click is done outside, cancelling the select\n // that doesn't count as a Blur, so an onMouseLeave is needed\n onMouseLeave={handleSelectOnBlur}\n data-testid=\"native-select\"\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nexport default Select;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAG;EACjBC,MAAM,EAAEC,cAAA,CAAMD,MADG;EAEjBE,OAAO,EAAED,cAAA,CAAMC,OAFE;EAGjBC,MAAM,EAAEF,cAAA,CAAME,MAHG;EAIjBC,IAAI,EAAEH,cAAA,CAAMG,IAJK;EAKjBC,QAAQ,EAAEJ,cAAA,CAAMI,QALC;EAMjBC,IAAI,EAAEL,cAAA,CAAMK,IANK;EAOjBC,WAAW,EAAEN,cAAA,CAAMM,WAPF;EAQjBC,MAAM,EAAEP,cAAA,CAAMO,MARG;EASjBC,QAAQ,EAAER,cAAA,CAAMQ,QATC;EAUjBC,YAAY,EAAE;AAVG,CAAnB;;AAaA,MAAMC,SAAS,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","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AAuEA,iDASC"}
|
|
@@ -23,8 +23,6 @@ var _questionRange = _interopRequireDefault(require("../questions/question-range
|
|
|
23
23
|
|
|
24
24
|
var _template = _interopRequireDefault(require("../questions/template"));
|
|
25
25
|
|
|
26
|
-
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
27
|
-
|
|
28
26
|
var _audio = _interopRequireDefault(require("../audio"));
|
|
29
27
|
|
|
30
28
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
@@ -88,8 +86,6 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
|
|
|
88
86
|
const Switch = ({
|
|
89
87
|
model,
|
|
90
88
|
help
|
|
91
|
-
}, {
|
|
92
|
-
translate
|
|
93
89
|
}) => {
|
|
94
90
|
const {
|
|
95
91
|
type
|
|
@@ -111,9 +107,7 @@ const Switch = ({
|
|
|
111
107
|
return /*#__PURE__*/_react.default.createElement(_freeText.default, model);
|
|
112
108
|
|
|
113
109
|
case 'dropDown':
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_dropDown.default,
|
|
115
|
-
"aria-label": translate('drop_down_icon')
|
|
116
|
-
}));
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_dropDown.default, model);
|
|
117
111
|
|
|
118
112
|
case 'slider':
|
|
119
113
|
return /*#__PURE__*/_react.default.createElement(_questionRange.default, model);
|
|
@@ -127,9 +121,6 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
127
121
|
model: _propTypes.default.model,
|
|
128
122
|
help: _propTypes.default.help
|
|
129
123
|
} : {};
|
|
130
|
-
Switch.contextTypes = {
|
|
131
|
-
translate: _provider.default.childContextTypes.translate
|
|
132
|
-
};
|
|
133
124
|
|
|
134
125
|
const Answer = props => {
|
|
135
126
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} />;\n case 'qcm':\n return <Qcm {...model} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} />;\n case 'slider':\n return <QuestionRange {...model} />;\n case 'template':\n return <Template {...model} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <Switch model={model} help={help} />\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oBAAK,IAAL,EAAWR,UAAX,CAAX;QAAmC,MAAM,EAAC,MAA1C;QAAiD,KAAK,EAAC;MAAvD,GADF,CADF;;IAKF;MACE,OAAO,IAAP;EAvBJ;AAyBD,CA3BD;;AA6BAJ,SAAS,CAACa,SAAV,2CAAsBC,6BAAtB;;AAEA,MAAMC,MAAM,GAAG,CAAC;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
|
|
4
|
+
({ mainText, subText, imageUrl, buttonLink }: Props): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
mainText: import("prop-types").Requireable<string>;
|
|
7
|
+
subText: import("prop-types").Requireable<string>;
|
|
8
|
+
imageUrl: import("prop-types").Requireable<any>;
|
|
9
|
+
buttonLink: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
10
|
+
type: import("prop-types").Requireable<string>;
|
|
11
|
+
label: import("prop-types").Requireable<string>;
|
|
12
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
13
|
+
dataName: import("prop-types").Requireable<string>;
|
|
14
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
|
+
position: import("prop-types").Requireable<string>;
|
|
16
|
+
type: import("prop-types").Requireable<string>;
|
|
17
|
+
}>>;
|
|
18
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
19
|
+
}>>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default EmptyStateDashboard;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAC,KAAK,EAAY,MAAM,SAAS,CAAC;AAEzC,QAAA,MAAM,mBAAmB;kDAA+C,KAAK;;;;;;;;;;;;;;;;;CAW5E,CAAC;AAIF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
|
|
8
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
9
|
+
|
|
10
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
11
|
+
|
|
12
|
+
var _types = require("./types");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
18
|
+
const EmptyStateDashboard = ({
|
|
19
|
+
mainText,
|
|
20
|
+
subText,
|
|
21
|
+
imageUrl,
|
|
22
|
+
buttonLink
|
|
23
|
+
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: _style.default.container
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", {
|
|
26
|
+
className: _style.default.img,
|
|
27
|
+
src: imageUrl,
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
})), /*#__PURE__*/_react.default.createElement("p", {
|
|
30
|
+
className: _style.default.mainText
|
|
31
|
+
}, mainText), /*#__PURE__*/_react.default.createElement("p", {
|
|
32
|
+
className: _style.default.subText
|
|
33
|
+
}, subText), /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: _style.default.buttonContainer
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, buttonLink, {
|
|
36
|
+
className: _style.default.button
|
|
37
|
+
}))));
|
|
38
|
+
|
|
39
|
+
EmptyStateDashboard.propTypes = process.env.NODE_ENV !== "production" ? _types.propTypes : {};
|
|
40
|
+
var _default = EmptyStateDashboard;
|
|
41
|
+
exports.default = _default;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["EmptyStateDashboard","mainText","subText","imageUrl","buttonLink","style","container","img","buttonContainer","button","propTypes"],"sources":["../../../src/molecule/empty-state-dashboard/index.tsx"],"sourcesContent":["import React from 'react';\nimport ButtonLink from '../../atom/button-link';\nimport style from './style.css';\nimport {Props, propTypes} from './types';\n\nconst EmptyStateDashboard = ({mainText, subText, imageUrl, buttonLink}: Props) => (\n <div className={style.container}>\n <div>\n <img className={style.img} src={imageUrl} aria-hidden=\"true\" />\n </div>\n <p className={style.mainText}>{mainText}</p>\n <p className={style.subText}>{subText}</p>\n <div className={style.buttonContainer}>\n <ButtonLink {...buttonLink} className={style.button} />\n </div>\n </div>\n);\n\nEmptyStateDashboard.propTypes = propTypes;\n\nexport default EmptyStateDashboard;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,mBAAmB,GAAG,CAAC;EAACC,QAAD;EAAWC,OAAX;EAAoBC,QAApB;EAA8BC;AAA9B,CAAD,kBAC1B;EAAK,SAAS,EAAEC,cAAA,CAAMC;AAAtB,gBACE,uDACE;EAAK,SAAS,EAAED,cAAA,CAAME,GAAtB;EAA2B,GAAG,EAAEJ,QAAhC;EAA0C,eAAY;AAAtD,EADF,CADF,eAIE;EAAG,SAAS,EAAEE,cAAA,CAAMJ;AAApB,GAA+BA,QAA/B,CAJF,eAKE;EAAG,SAAS,EAAEI,cAAA,CAAMH;AAApB,GAA8BA,OAA9B,CALF,eAME;EAAK,SAAS,EAAEG,cAAA,CAAMG;AAAtB,gBACE,6BAAC,mBAAD,eAAgBJ,UAAhB;EAA4B,SAAS,EAAEC,cAAA,CAAMI;AAA7C,GADF,CANF,CADF;;AAaAT,mBAAmB,CAACU,SAApB,2CAAgCA,gBAAhC;eAEeV,mB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_500: from colors;
|
|
3
|
+
@value cm_grey_800: from colors;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
text-align: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.img {
|
|
17
|
+
height: 170px;
|
|
18
|
+
width: 220px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.text {
|
|
22
|
+
font-family: 'Gilroy';
|
|
23
|
+
margin: 0 auto 0 auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mainText {
|
|
27
|
+
composes: text;
|
|
28
|
+
color: cm_grey_800;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
font-size: 24px;
|
|
31
|
+
line-height: 32px;
|
|
32
|
+
padding-top: 36px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.subText {
|
|
36
|
+
composes: text;
|
|
37
|
+
color: cm_grey_500;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
line-height: 24px;
|
|
41
|
+
padding-top: 4px;
|
|
42
|
+
;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.buttonContainer {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
padding-top: 32px;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button {
|
|
53
|
+
width: 152px;
|
|
54
|
+
height: 44px;
|
|
55
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare const propTypes: {
|
|
3
|
+
mainText: PropTypes.Requireable<string>;
|
|
4
|
+
subText: PropTypes.Requireable<string>;
|
|
5
|
+
imageUrl: PropTypes.Requireable<any>;
|
|
6
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
+
type: PropTypes.Requireable<string>;
|
|
8
|
+
label: PropTypes.Requireable<string>;
|
|
9
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
10
|
+
dataName: PropTypes.Requireable<string>;
|
|
11
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
position: PropTypes.Requireable<string>;
|
|
13
|
+
type: PropTypes.Requireable<string>;
|
|
14
|
+
}>>;
|
|
15
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
}>>;
|
|
17
|
+
};
|
|
18
|
+
export declare type Props = PropTypes.InferProps<typeof propTypes>;
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAerB,CAAC;AAEF,oBAAY,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.propTypes = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _picture = _interopRequireDefault(require("../../atom/picture"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const propTypes = {
|
|
13
|
+
mainText: _propTypes.default.string,
|
|
14
|
+
subText: _propTypes.default.string,
|
|
15
|
+
imageUrl: _picture.default.propTypes.src,
|
|
16
|
+
buttonLink: _propTypes.default.shape({
|
|
17
|
+
type: _propTypes.default.string,
|
|
18
|
+
label: _propTypes.default.string,
|
|
19
|
+
ariaLabel: _propTypes.default.string,
|
|
20
|
+
dataName: _propTypes.default.string,
|
|
21
|
+
icon: _propTypes.default.shape({
|
|
22
|
+
position: _propTypes.default.string,
|
|
23
|
+
type: _propTypes.default.string
|
|
24
|
+
}),
|
|
25
|
+
onClick: _propTypes.default.func
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
exports.propTypes = propTypes;
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["propTypes","mainText","PropTypes","string","subText","imageUrl","Picture","src","buttonLink","shape","type","label","ariaLabel","dataName","icon","position","onClick","func"],"sources":["../../../src/molecule/empty-state-dashboard/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Picture from '../../atom/picture';\n\nexport const propTypes = {\n mainText: PropTypes.string,\n subText: PropTypes.string,\n imageUrl: Picture.propTypes.src,\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n })\n};\n\nexport type Props = PropTypes.InferProps<typeof propTypes>;\n"],"mappings":";;;;;AAAA;;AACA;;;;AAEO,MAAMA,SAAS,GAAG;EACvBC,QAAQ,EAAEC,kBAAA,CAAUC,MADG;EAEvBC,OAAO,EAAEF,kBAAA,CAAUC,MAFI;EAGvBE,QAAQ,EAAEC,gBAAA,CAAQN,SAAR,CAAkBO,GAHL;EAIvBC,UAAU,EAAEN,kBAAA,CAAUO,KAAV,CAAgB;IAC1BC,IAAI,EAAER,kBAAA,CAAUC,MADU;IAE1BQ,KAAK,EAAET,kBAAA,CAAUC,MAFS;IAG1BS,SAAS,EAAEV,kBAAA,CAAUC,MAHK;IAI1BU,QAAQ,EAAEX,kBAAA,CAAUC,MAJM;IAK1BW,IAAI,EAAEZ,kBAAA,CAAUO,KAAV,CAAgB;MACpBM,QAAQ,EAAEb,kBAAA,CAAUC,MADA;MAEpBO,IAAI,EAAER,kBAAA,CAAUC;IAFI,CAAhB,CALoB;IAS1Ba,OAAO,EAAEd,kBAAA,CAAUe;EATO,CAAhB;AAJW,CAAlB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default ListItem;
|
|
2
2
|
declare function ListItem(props: any): JSX.Element;
|
|
3
3
|
declare namespace ListItem {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const propTypes: {
|
|
5
|
+
bulletPointMenuButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
6
|
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
7
7
|
menuAriaLabel: PropTypes.Requireable<string>;
|
|
8
8
|
buttons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -13,7 +13,7 @@ declare namespace ListItem {
|
|
|
13
13
|
}> | null | undefined)[]>;
|
|
14
14
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
15
|
}>>;
|
|
16
|
-
|
|
16
|
+
buttonLink: PropTypes.Requireable<PropTypes.InferProps<{
|
|
17
17
|
type: PropTypes.Requireable<string>;
|
|
18
18
|
label: PropTypes.Requireable<string>;
|
|
19
19
|
ariaLabel: PropTypes.Requireable<string>;
|
|
@@ -24,12 +24,14 @@ declare namespace ListItem {
|
|
|
24
24
|
}>>;
|
|
25
25
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
26
|
}>>;
|
|
27
|
-
|
|
27
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
28
28
|
label: PropTypes.Requireable<string>;
|
|
29
29
|
type: PropTypes.Requireable<string>;
|
|
30
30
|
}> | null | undefined)[]>;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
title: PropTypes.Validator<string>;
|
|
32
|
+
order: PropTypes.Requireable<number>;
|
|
33
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
34
|
+
};
|
|
33
35
|
}
|
|
34
36
|
import PropTypes from "prop-types";
|
|
35
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAQA,mDAqCC"}
|