@vonage/vivid-react 2.10.47 → 2.10.58

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.
Files changed (292) hide show
  1. package/.storybook/main.js +11 -0
  2. package/.storybook/preview.js +3 -0
  3. package/.vscode/settings.json +4 -0
  4. package/README.md +75 -65
  5. package/babel.config.js +38 -0
  6. package/package.json +66 -67
  7. package/rollup.config.js +30 -0
  8. package/scripts/cli.js +27 -0
  9. package/scripts/generateWrappers/consts.js +220 -0
  10. package/scripts/generateWrappers/generator.js +264 -0
  11. package/scripts/generateWrappers/helpers/generator.js +18 -0
  12. package/scripts/generateWrappers/helpers/generator.test.js +56 -0
  13. package/scripts/generateWrappers/prop.types.js +87 -0
  14. package/scripts/generateWrappers/templates/js/index.tmpl +2 -0
  15. package/scripts/generateWrappers/templates/js/react-component-v3.tmpl +19 -0
  16. package/scripts/generateWrappers/templates/js/react-component.tmpl +30 -0
  17. package/scripts/generateWrappers/templates/js/stories.tmpl +18 -0
  18. package/scripts/generateWrappers/templates/templates.js +39 -0
  19. package/scripts/generateWrappers/templates/ts/element-type.tmpl +3 -0
  20. package/scripts/generateWrappers/templates/ts/index.tmpl +2 -0
  21. package/scripts/generateWrappers/templates/ts/react-component-v3.tmpl +32 -0
  22. package/scripts/generateWrappers/templates/ts/react-component.tmpl +28 -0
  23. package/scripts/generateWrappers/templates/ts/types.tmpl +8 -0
  24. package/scripts/generateWrappers/utils.js +197 -0
  25. package/scripts/generateWrappers/utils.test.js +71 -0
  26. package/scripts/updateDocs.js +42 -0
  27. package/scripts/updateVividPackages.js +81 -0
  28. package/src/dataGrid/index.js +15 -0
  29. package/src/index.js +3 -0
  30. package/src/initialization/initVivid.js +56 -0
  31. package/src/patches/VwcCard/index.js +2 -0
  32. package/src/patches/VwcCard/vwcCardHeadingCrop.js +28 -0
  33. package/src/patches/VwcCard/vwcCardWithMenu.js +14 -0
  34. package/src/patches/index.js +6 -0
  35. package/src/patches/vwcDataGrid.js +26 -0
  36. package/src/patches/vwcNoteContentOverflow.js +20 -0
  37. package/src/patches/vwcSetAttributeValue.js +12 -0
  38. package/src/patches/vwcSnackBarHtmlMessage.js +21 -0
  39. package/src/patches/vwcTooltip.js +46 -0
  40. package/stories/v2/VwcAccordion/VwcAccordion.stories.jsx +18 -0
  41. package/stories/v2/VwcActionGroup/VwcActionGroup.stories.jsx +18 -0
  42. package/stories/v2/VwcBadge/VwcBadge.stories.jsx +18 -0
  43. package/stories/v2/VwcBanner/VwcBanner.stories.jsx +18 -0
  44. package/stories/v2/VwcButton/VwcButton.stories.jsx +18 -0
  45. package/stories/v2/VwcButtonToggleGroup/VwcButtonToggleGroup.stories.jsx +47 -0
  46. package/stories/v2/VwcCalendar/VwcCalendar.stories.jsx +18 -0
  47. package/stories/v2/VwcCalendarEvent/VwcCalendarEvent.stories.jsx +18 -0
  48. package/stories/v2/VwcCard/VwcCard.stories.jsx +90 -0
  49. package/stories/v2/VwcCarousel/VwcCarousel.stories.jsx +18 -0
  50. package/stories/v2/VwcCarouselItem/VwcCarouselItem.stories.jsx +18 -0
  51. package/stories/v2/VwcCheckListItem/VwcCheckListItem.stories.jsx +18 -0
  52. package/stories/v2/VwcCheckbox/VwcCheckbox.stories.jsx +18 -0
  53. package/stories/v2/VwcChip/VwcChip.stories.jsx +18 -0
  54. package/stories/v2/VwcChipSet/VwcChipSet.stories.jsx +38 -0
  55. package/stories/v2/VwcCircularProgress/VwcCircularProgress.stories.jsx +18 -0
  56. package/stories/v2/VwcDataGrid/VwcDataGrid.stories.jsx +109 -0
  57. package/stories/v2/VwcDataGridColumn/VwcDataGridColumn.stories.jsx +18 -0
  58. package/stories/v2/VwcDatepicker/VwcDatepicker.stories.jsx +18 -0
  59. package/stories/v2/VwcDialog/VwcDialog.stories.jsx +18 -0
  60. package/stories/v2/VwcDrawer/VwcDrawer.stories.jsx +18 -0
  61. package/stories/v2/VwcDropdown/VwcDropdown.stories.jsx +18 -0
  62. package/stories/v2/VwcElevation/VwcElevation.stories.jsx +18 -0
  63. package/stories/v2/VwcEmptyState/VwcEmptyState.stories.jsx +18 -0
  64. package/stories/v2/VwcExpansionPanel/VwcExpansionPanel.stories.jsx +18 -0
  65. package/stories/v2/VwcFab/VwcFab.stories.jsx +18 -0
  66. package/stories/v2/VwcFilePicker/VwcFilePicker.stories.jsx +18 -0
  67. package/stories/v2/VwcFormfield/VwcFormfield.stories.jsx +18 -0
  68. package/stories/v2/VwcHelperMessage/VwcHelperMessage.stories.jsx +18 -0
  69. package/stories/v2/VwcIcon/VwcIcon.stories.jsx +18 -0
  70. package/stories/v2/VwcIconButton/VwcIconButton.stories.jsx +18 -0
  71. package/stories/v2/VwcIconButtonToggle/VwcIconButtonToggle.stories.jsx +18 -0
  72. package/stories/v2/VwcKeypad/VwcKeypad.stories.jsx +18 -0
  73. package/stories/v2/VwcLayout/VwcLayout.stories.jsx +63 -0
  74. package/stories/v2/VwcLinearProgress/VwcLinearProgress.stories.jsx +18 -0
  75. package/stories/v2/VwcList/VwcList.stories.jsx +25 -0
  76. package/stories/v2/VwcListExpansionPanel/VwcListExpansionPanel.stories.jsx +18 -0
  77. package/stories/v2/VwcListItem/VwcListItem.stories.jsx +18 -0
  78. package/stories/v2/VwcMenu/VwcMenu.stories.jsx +41 -0
  79. package/stories/v2/VwcNotchedOutline/VwcNotchedOutline.stories.jsx +18 -0
  80. package/stories/v2/VwcNote/VwcNote.stories.jsx +18 -0
  81. package/stories/v2/VwcPagination/VwcPagination.stories.jsx +18 -0
  82. package/stories/v2/VwcPopup/VwcPopup.stories.jsx +18 -0
  83. package/stories/v2/VwcRadio/VwcRadio.stories.jsx +18 -0
  84. package/stories/v2/VwcRadioListItem/VwcRadioListItem.stories.jsx +18 -0
  85. package/stories/v2/VwcSchemeSelect/VwcSchemeSelect.stories.jsx +18 -0
  86. package/stories/v2/VwcSelect/VwcSelect.stories.jsx +18 -0
  87. package/stories/v2/VwcSideDrawer/VwcSideDrawer.stories.jsx +18 -0
  88. package/stories/v2/VwcSlider/VwcSlider.stories.jsx +18 -0
  89. package/stories/v2/VwcSnackbar/VwcSnackbar.stories.jsx +18 -0
  90. package/stories/v2/VwcSurface/VwcSurface.stories.jsx +18 -0
  91. package/stories/v2/VwcSwitch/VwcSwitch.stories.jsx +18 -0
  92. package/stories/v2/VwcTab/VwcTab.stories.jsx +18 -0
  93. package/stories/v2/VwcTabBar/VwcTabBar.stories.jsx +63 -0
  94. package/stories/v2/VwcTag/VwcTag.stories.jsx +18 -0
  95. package/stories/v2/VwcText/VwcText.stories.jsx +18 -0
  96. package/stories/v2/VwcTextarea/VwcTextarea.stories.jsx +24 -0
  97. package/stories/v2/VwcTextfield/VwcTextfield.stories.jsx +47 -0
  98. package/stories/v2/VwcThemeSwitch/VwcThemeSwitch.stories.jsx +18 -0
  99. package/stories/v2/VwcTooltip/VwcTooltip.stories.jsx +41 -0
  100. package/stories/v2/VwcTopAppBar/VwcTopAppBar.stories.jsx +18 -0
  101. package/stories/v2/VwcTopAppBarFixed/VwcTopAppBarFixed.stories.jsx +18 -0
  102. package/stories/v2/patches/patches.stories.jsx +94 -0
  103. package/stories/v3/v3.stories.jsx +28 -0
  104. package/tsconfig.json +70 -0
  105. package/VwcAccordion/index.d.ts +0 -14
  106. package/VwcAccordion/index.js +0 -59
  107. package/VwcAccordion/package.json +0 -11
  108. package/VwcActionGroup/index.d.ts +0 -18
  109. package/VwcActionGroup/index.js +0 -90
  110. package/VwcActionGroup/package.json +0 -11
  111. package/VwcBadge/index.d.ts +0 -29
  112. package/VwcBadge/index.js +0 -154
  113. package/VwcBadge/package.json +0 -11
  114. package/VwcBanner/index.d.ts +0 -26
  115. package/VwcBanner/index.js +0 -91
  116. package/VwcBanner/package.json +0 -11
  117. package/VwcButton/index.d.ts +0 -55
  118. package/VwcButton/index.js +0 -240
  119. package/VwcButton/package.json +0 -11
  120. package/VwcButtonToggleGroup/index.d.ts +0 -25
  121. package/VwcButtonToggleGroup/index.js +0 -91
  122. package/VwcButtonToggleGroup/package.json +0 -11
  123. package/VwcCalendar/index.d.ts +0 -20
  124. package/VwcCalendar/index.js +0 -70
  125. package/VwcCalendar/package.json +0 -11
  126. package/VwcCalendarEvent/index.d.ts +0 -25
  127. package/VwcCalendarEvent/index.js +0 -81
  128. package/VwcCalendarEvent/package.json +0 -11
  129. package/VwcCard/index.d.ts +0 -23
  130. package/VwcCard/index.js +0 -76
  131. package/VwcCard/package.json +0 -11
  132. package/VwcCarousel/index.d.ts +0 -14
  133. package/VwcCarousel/index.js +0 -45
  134. package/VwcCarousel/package.json +0 -11
  135. package/VwcCarouselItem/index.d.ts +0 -14
  136. package/VwcCarouselItem/index.js +0 -49
  137. package/VwcCarouselItem/package.json +0 -11
  138. package/VwcCheckListItem/index.d.ts +0 -41
  139. package/VwcCheckListItem/index.js +0 -153
  140. package/VwcCheckListItem/package.json +0 -11
  141. package/VwcCheckbox/index.d.ts +0 -34
  142. package/VwcCheckbox/index.js +0 -126
  143. package/VwcCheckbox/package.json +0 -11
  144. package/VwcChip/index.d.ts +0 -31
  145. package/VwcChip/index.js +0 -106
  146. package/VwcChip/package.json +0 -11
  147. package/VwcChipSet/index.d.ts +0 -16
  148. package/VwcChipSet/index.js +0 -60
  149. package/VwcChipSet/package.json +0 -11
  150. package/VwcCircularProgress/index.d.ts +0 -24
  151. package/VwcCircularProgress/index.js +0 -84
  152. package/VwcCircularProgress/package.json +0 -11
  153. package/VwcDataGrid/index.d.ts +0 -33
  154. package/VwcDataGrid/index.js +0 -122
  155. package/VwcDataGrid/package.json +0 -11
  156. package/VwcDataGridColumn/index.d.ts +0 -43
  157. package/VwcDataGridColumn/index.js +0 -144
  158. package/VwcDataGridColumn/package.json +0 -11
  159. package/VwcDatepicker/index.d.ts +0 -120
  160. package/VwcDatepicker/index.js +0 -422
  161. package/VwcDatepicker/package.json +0 -11
  162. package/VwcDialog/index.d.ts +0 -40
  163. package/VwcDialog/index.js +0 -135
  164. package/VwcDialog/package.json +0 -11
  165. package/VwcDrawer/index.d.ts +0 -20
  166. package/VwcDrawer/index.js +0 -80
  167. package/VwcDrawer/package.json +0 -11
  168. package/VwcDropdown/index.d.ts +0 -61
  169. package/VwcDropdown/index.js +0 -221
  170. package/VwcDropdown/package.json +0 -11
  171. package/VwcElevation/index.d.ts +0 -14
  172. package/VwcElevation/index.js +0 -45
  173. package/VwcElevation/package.json +0 -11
  174. package/VwcEmptyState/index.d.ts +0 -18
  175. package/VwcEmptyState/index.js +0 -59
  176. package/VwcEmptyState/package.json +0 -11
  177. package/VwcExpansionPanel/index.d.ts +0 -34
  178. package/VwcExpansionPanel/index.js +0 -199
  179. package/VwcExpansionPanel/package.json +0 -11
  180. package/VwcFab/index.d.ts +0 -32
  181. package/VwcFab/index.js +0 -124
  182. package/VwcFab/package.json +0 -11
  183. package/VwcFilePicker/index.d.ts +0 -24
  184. package/VwcFilePicker/index.js +0 -88
  185. package/VwcFilePicker/package.json +0 -11
  186. package/VwcFormfield/index.d.ts +0 -20
  187. package/VwcFormfield/index.js +0 -70
  188. package/VwcFormfield/package.json +0 -11
  189. package/VwcHelperMessage/index.d.ts +0 -14
  190. package/VwcHelperMessage/index.js +0 -49
  191. package/VwcHelperMessage/package.json +0 -11
  192. package/VwcIcon/index.d.ts +0 -22
  193. package/VwcIcon/index.js +0 -102
  194. package/VwcIcon/package.json +0 -11
  195. package/VwcIconButton/index.d.ts +0 -31
  196. package/VwcIconButton/index.js +0 -111
  197. package/VwcIconButton/package.json +0 -11
  198. package/VwcIconButtonToggle/index.d.ts +0 -37
  199. package/VwcIconButtonToggle/index.js +0 -136
  200. package/VwcIconButtonToggle/package.json +0 -11
  201. package/VwcKeypad/index.d.ts +0 -31
  202. package/VwcKeypad/index.js +0 -176
  203. package/VwcKeypad/package.json +0 -11
  204. package/VwcLayout/index.d.ts +0 -20
  205. package/VwcLayout/index.js +0 -105
  206. package/VwcLayout/package.json +0 -11
  207. package/VwcLinearProgress/index.d.ts +0 -26
  208. package/VwcLinearProgress/index.js +0 -98
  209. package/VwcLinearProgress/package.json +0 -11
  210. package/VwcList/index.d.ts +0 -35
  211. package/VwcList/index.js +0 -146
  212. package/VwcList/package.json +0 -11
  213. package/VwcListExpansionPanel/index.d.ts +0 -19
  214. package/VwcListExpansionPanel/index.js +0 -68
  215. package/VwcListExpansionPanel/package.json +0 -11
  216. package/VwcListItem/index.d.ts +0 -42
  217. package/VwcListItem/index.js +0 -171
  218. package/VwcListItem/package.json +0 -11
  219. package/VwcMenu/index.d.ts +0 -53
  220. package/VwcMenu/index.js +0 -210
  221. package/VwcMenu/package.json +0 -11
  222. package/VwcNotchedOutline/index.d.ts +0 -17
  223. package/VwcNotchedOutline/index.js +0 -58
  224. package/VwcNotchedOutline/package.json +0 -11
  225. package/VwcNote/index.d.ts +0 -18
  226. package/VwcNote/index.js +0 -59
  227. package/VwcNote/package.json +0 -11
  228. package/VwcPagination/index.d.ts +0 -16
  229. package/VwcPagination/index.js +0 -52
  230. package/VwcPagination/package.json +0 -11
  231. package/VwcPopup/index.d.ts +0 -30
  232. package/VwcPopup/index.js +0 -147
  233. package/VwcPopup/package.json +0 -11
  234. package/VwcRadio/index.d.ts +0 -52
  235. package/VwcRadio/index.js +0 -149
  236. package/VwcRadio/package.json +0 -11
  237. package/VwcRadioListItem/index.d.ts +0 -41
  238. package/VwcRadioListItem/index.js +0 -148
  239. package/VwcRadioListItem/package.json +0 -11
  240. package/VwcSchemeSelect/index.d.ts +0 -14
  241. package/VwcSchemeSelect/index.js +0 -46
  242. package/VwcSchemeSelect/package.json +0 -11
  243. package/VwcSelect/index.d.ts +0 -60
  244. package/VwcSelect/index.js +0 -253
  245. package/VwcSelect/package.json +0 -11
  246. package/VwcSideDrawer/index.d.ts +0 -22
  247. package/VwcSideDrawer/index.js +0 -73
  248. package/VwcSideDrawer/package.json +0 -11
  249. package/VwcSlider/index.d.ts +0 -34
  250. package/VwcSlider/index.js +0 -129
  251. package/VwcSlider/package.json +0 -11
  252. package/VwcSnackbar/index.d.ts +0 -42
  253. package/VwcSnackbar/index.js +0 -138
  254. package/VwcSnackbar/package.json +0 -11
  255. package/VwcSurface/index.d.ts +0 -42
  256. package/VwcSurface/index.js +0 -145
  257. package/VwcSurface/package.json +0 -11
  258. package/VwcSwitch/index.d.ts +0 -27
  259. package/VwcSwitch/index.js +0 -114
  260. package/VwcSwitch/package.json +0 -11
  261. package/VwcTab/index.d.ts +0 -40
  262. package/VwcTab/index.js +0 -151
  263. package/VwcTab/package.json +0 -11
  264. package/VwcTabBar/index.d.ts +0 -15
  265. package/VwcTabBar/index.js +0 -55
  266. package/VwcTabBar/package.json +0 -11
  267. package/VwcTag/index.d.ts +0 -34
  268. package/VwcTag/index.js +0 -115
  269. package/VwcTag/package.json +0 -11
  270. package/VwcText/index.d.ts +0 -18
  271. package/VwcText/index.js +0 -83
  272. package/VwcText/package.json +0 -11
  273. package/VwcTextarea/index.d.ts +0 -93
  274. package/VwcTextarea/index.js +0 -331
  275. package/VwcTextarea/package.json +0 -11
  276. package/VwcTextfield/index.d.ts +0 -89
  277. package/VwcTextfield/index.js +0 -329
  278. package/VwcTextfield/package.json +0 -11
  279. package/VwcThemeSwitch/index.d.ts +0 -14
  280. package/VwcThemeSwitch/index.js +0 -57
  281. package/VwcThemeSwitch/package.json +0 -11
  282. package/VwcTooltip/index.d.ts +0 -22
  283. package/VwcTooltip/index.js +0 -105
  284. package/VwcTooltip/package.json +0 -11
  285. package/VwcTopAppBar/index.d.ts +0 -22
  286. package/VwcTopAppBar/index.js +0 -77
  287. package/VwcTopAppBar/package.json +0 -11
  288. package/VwcTopAppBarFixed/index.d.ts +0 -22
  289. package/VwcTopAppBarFixed/index.js +0 -88
  290. package/VwcTopAppBarFixed/package.json +0 -11
  291. package/index.js +0 -281
  292. package/types/index.d.ts +0 -2
@@ -0,0 +1,220 @@
1
+ const FileName = {
2
+ packageJson: 'package.json',
3
+ tempFolder: 'temp',
4
+ customElements: 'custom-elements.json',
5
+ vividApi: 'vivid.api.json',
6
+ tempFileName: 'analyzerOutput.json',
7
+ tempTsFolder: 'ts',
8
+ generatedFolder: 'src/generated',
9
+ tempVividZipball: 'vivid.zip',
10
+ defaultOutputDirectory: 'dist',
11
+ storyOutputDir: 'stories',
12
+ readme: 'README.md',
13
+ testing: 'testing',
14
+ types: 'types'
15
+ }
16
+
17
+ const Assets = [
18
+ FileName.packageJson,
19
+ FileName.readme,
20
+ FileName.testing,
21
+ FileName.types
22
+ ].join(',')
23
+
24
+ const VividRepo = 'Vonage/vivid'
25
+
26
+ const WCAConfig = {
27
+ tempFolder: FileName.tempFolder,
28
+ tempFileName: FileName.tempFileName,
29
+ nodeArgumentsFactory: (packageNames, analyzerOutputFile) => [
30
+ './node_modules/web-component-analyzer/cli.js',
31
+ 'analyze',
32
+ `node_modules/{${packageNames.join(',')}}/{src/,}*.?s`,
33
+ '--discoverNodeModules',
34
+ '--format', 'json',
35
+ '--outFile', analyzerOutputFile
36
+ ]
37
+ }
38
+
39
+ const CLIArgument = {
40
+ Assets: 'assets', // static assets to be copied to output folder
41
+ Output: 'output', // output folder
42
+ Language: 'language', // language js,ts
43
+ CleanTemp: 'clean' // clean up temp folder after CLI run
44
+ }
45
+
46
+ const OutputLanguage = {
47
+ JavaScript: 'js',
48
+ TypeScript: 'ts'
49
+ }
50
+
51
+ // TODO: this can be removed when JSDocs for each component will be updated in Vivid repository
52
+ const ComponentsEventsMap = {
53
+ VwcButtonToggleGroup: ['selected'],
54
+ VwcButton: ['click'],
55
+ VwcCard: ['click'],
56
+ VwcCheckbox: ['change'],
57
+ VwcChipSet: [{ name: 'MDCChip:selection', propName: 'onSelection' }],
58
+ VwcDataGrid: [{ name: 'selected-items-changed', propName: 'onSelectedItemsChange' }],
59
+ VwcDialog: ['opening', 'opened', 'closing', 'closed'],
60
+ VwcIconButton: ['click'],
61
+ VwcIconButtonToggle: [{ name: 'MDCIconButtonToggle:change', propName: 'onChange' }],
62
+ VwcListExpansionPanel: ['closed', 'opened'],
63
+ VwcListItem: ['click', { name: 'request-selected', propName: 'onRequestSelected' }],
64
+ VwcCheckListItem: [{ name: 'request-selected', propName: 'onRequestSelected' }],
65
+ VwcPagination: ['change'],
66
+ VwcRadio: ['change'],
67
+ VwcSlider: ['change'],
68
+ VwcSnackbar: ['opening', 'opened', 'closing', 'closed'],
69
+ VwcSwitch: ['change'],
70
+ VwcTab: [{ name: 'MDCTab:interacted', propName: 'onInteracted' }],
71
+ VwcTabBar: [{ name: 'MDCTabBar:activated', propName: 'onActivated' }],
72
+ VwcTextfield: ['input', 'blur', 'focus'],
73
+ VwcTextarea: ['input', 'blur', 'focus']
74
+ }
75
+
76
+ const ComponentsEventsMapV3 = {
77
+ VwcButton: ['click']
78
+ }
79
+
80
+ const ComponentsReadOnlyPropertiesMap = {
81
+ VwcAccordion: ['styles'],
82
+ VwcActionGroup: ['styles'],
83
+ VwcAudio: ['styles', 'floatingLabelFoundation', 'lineRippleFoundation'],
84
+ VwcListExpansionPanel: ['styles', 'headerNodes'],
85
+ VwcExpansionPanel: ['styles'],
86
+ VwcBadge: ['styles'],
87
+ VwcBanner: ['styles'],
88
+ VwcDrawer: ['styles'],
89
+ VwcNotchedOutline: ['styles'],
90
+ VwcSurface: ['styles'],
91
+ VwcFilePicker: ['styles'],
92
+ VwcFormfield: ['styles'],
93
+ VwcHelperMessage: ['styles'],
94
+ VwcLinearProgress: ['styles'],
95
+ VwcThemeSwitch: ['styles'],
96
+ VwcTopAppBar: ['styles'],
97
+ VwcChip: ['styles'],
98
+ VwcCircularProgress: ['styles'],
99
+ VwcTopAppBarFixed: ['styles'],
100
+ VwcMediaController: ['floatingLabelFoundation', 'lineRippleFoundation'],
101
+ VwcRelativeTime: ['floatingLabelFoundation', 'lineRippleFoundation'],
102
+ VwcCarouselItem: ['floatingLabelFoundation', 'lineRippleFoundation'],
103
+ VwcList: ['styles', 'items', 'selected', 'index', 'layout', 'debouncedLayout'],
104
+ VwcListItem: ['styles', 'ripple', 'text'],
105
+ VwcLayout: ['styles'],
106
+ VwcSwitch: ['styles', 'ripple'],
107
+ VwcTab: ['styles', 'active', 'ripple', 'isRippleActive'],
108
+ VwcFab: ['styles', 'ripple'],
109
+ VwcTabBar: ['styles', 'active'],
110
+ VwcText: ['styles'],
111
+ VwcTextarea: ['styles', 'validity', 'ripple'],
112
+ VwcTextfield: ['styles', 'validity', 'willValidate', 'selectionStart', 'selectionEnd', 'ripple'],
113
+ VwcMenu: ['styles', 'slotElement', 'items', 'index', 'selected', 'mdcRoot'],
114
+ VwcRadio: ['styles', 'ripple', 'isRippleActive'],
115
+ VwcRadioListItem: ['styles', 'ripple'],
116
+ VwcSelect: ['styles', 'items', 'ripple'],
117
+ VwcCheckbox: ['styles', 'isRippleActive', 'ripple'],
118
+ VwcChipSet: ['styles', 'chips'],
119
+ VwcCheckListItem: ['styles', 'ripple'],
120
+ VwcDialog: ['styles'],
121
+ VwcDropdown: ['styles', 'items', 'selected'],
122
+ VwcButton: ['styles', 'buttonElement', 'ripple'],
123
+ VwcButtonToggleGroup: ['items', 'selected'],
124
+ VwcKeypad: ['styles', 'digitsDisplay'],
125
+ VwcIconButton: ['styles', 'buttonElement', 'ripple'],
126
+ VwcIconButtonToggle: ['styles', 'ripple'],
127
+ VwcDataGrid: ['styles', 'selectedItems'],
128
+ VwcSlider: ['styles', 'ripple']
129
+ }
130
+
131
+ // Properties reflected as attributes having different name
132
+ const RenamedReflectedAttributesPropertiesMap = {
133
+ VwcText: ['fontFace'], // font-face attribute
134
+ VwcLayout: ['columnBasis', 'columnSpacing', 'autoSizing']
135
+ }
136
+
137
+ // Bindable means property has complex type: (Function, Object, Array, etc.) OR properties reflected as attributes having different name
138
+ // Those properties needs to be binded directly to the underlying web element "as is"
139
+ // w/o toString => fromString transformations via HTML attributes
140
+ const ComponentsBindablePropertiesMap = {
141
+ VwcButton: ['form'],
142
+ VwcTextarea: ['form'],
143
+ VwcTextfield: ['form'],
144
+ VwcDataGrid: ['rowDetailsRenderer'],
145
+ VwcDataGridColumn: ['headerRenderer', 'footerRenderer', 'cellRenderer'],
146
+ VwcDialog: ['closeButton'],
147
+ VwcMenu: ['anchor'],
148
+ ...RenamedReflectedAttributesPropertiesMap
149
+ }
150
+
151
+ // Extra properties to be exposed for element
152
+ const ComponentsExtraPropertiesMap = {
153
+ VwcIconButton: [
154
+ {
155
+ "name": "value",
156
+ "type": "string"
157
+ }
158
+ ]
159
+ }
160
+
161
+ const CompoundComponentsMap = {
162
+ VwcButton: {
163
+ CallToAction: {
164
+ unelevated: true,
165
+ connotation: 'cta',
166
+ type: 'button',
167
+ layout: 'filled'
168
+ },
169
+ Alert: {
170
+ unelevated: true,
171
+ connotation: 'alert',
172
+ type: 'button',
173
+ layout: 'filled'
174
+ },
175
+ Outlined: {
176
+ unelevated: true,
177
+ layout: 'outlined',
178
+ type: 'button'
179
+ },
180
+ Success: {
181
+ unelevated: true,
182
+ connotation: 'success',
183
+ type: 'button',
184
+ layout: 'filled'
185
+ },
186
+ Info: {
187
+ unelevated: true,
188
+ connotation: 'info',
189
+ type: 'button',
190
+ layout: 'filled'
191
+ },
192
+ Primary: {
193
+ unelevated: true,
194
+ connotation: 'primary',
195
+ type: 'button',
196
+ layout: 'filled'
197
+ },
198
+ Announcement: {
199
+ unelevated: true,
200
+ connotation: 'announcement',
201
+ type: 'button',
202
+ layout: 'filled'
203
+ }
204
+ }
205
+ }
206
+
207
+ module.exports = {
208
+ ComponentsEventsMap,
209
+ ComponentsEventsMapV3,
210
+ ComponentsReadOnlyPropertiesMap,
211
+ ComponentsBindablePropertiesMap,
212
+ ComponentsExtraPropertiesMap,
213
+ CompoundComponentsMap,
214
+ FileName,
215
+ Assets,
216
+ OutputLanguage,
217
+ WCAConfig,
218
+ CLIArgument,
219
+ VividRepo
220
+ }
@@ -0,0 +1,264 @@
1
+ const packageJson = require('../../package.json')
2
+ const { getImportsFromTag } = require('./helpers/generator')
3
+ const {
4
+ ComponentsEventsMap,
5
+ ComponentsEventsMapV3,
6
+ CompoundComponentsMap,
7
+ OutputLanguage,
8
+ FileName
9
+ } = require('./consts')
10
+
11
+ const { pathExists, outputFile, outputJson } = require('fs-extra')
12
+
13
+ const {
14
+ compileTypescript,
15
+ prepareDir,
16
+ getComponentName,
17
+ toJsonObjectsList,
18
+ filePath,
19
+ camel2kebab,
20
+ event2PropName,
21
+ renderJsDoc,
22
+ getIndexFileName,
23
+ getProperties,
24
+ getUniqueEvents,
25
+ getVividPackageName,
26
+ prepareCompoundComponents,
27
+ compoundComponentTemplate
28
+ } = require('./utils')
29
+ const { getTemplate, TemplateToken } = require('./templates/templates')
30
+ const { join } = require('path')
31
+ const { getPropTypes, getDefaultProps, getProps, mapType } = require('./prop.types')
32
+ const { writeFileSync, readFileSync } = require('fs')
33
+
34
+ const generateTypings = outputDir => async tags => {
35
+ const distTs = join(FileName.tempFolder, FileName.tempTsFolder)
36
+ await generateWrappers(distTs, OutputLanguage.TypeScript, false, false)(tags)
37
+ await compileTypescript(distTs)(outputDir)
38
+ }
39
+
40
+ const generateTypingsV3 = outputDir => async meta => {
41
+ const distTs = join(FileName.tempFolder, FileName.tempTsFolder)
42
+ await generateWrappersV3(distTs, OutputLanguage.TypeScript, false, false)(meta)
43
+ await compileTypescript(distTs)(outputDir)
44
+ }
45
+
46
+ const renderComponent = tag => language => componentName => {
47
+ const compoundsConfig = CompoundComponentsMap[componentName] || {}
48
+ const getCompoundComponents = prepareCompoundComponents(componentName, compoundComponentTemplate, compoundsConfig)
49
+ return getTemplate('react-component', language)
50
+ .replace(TemplateToken.CLASS_JSDOC, renderJsDoc(tag))
51
+ .replace(TemplateToken.IMPORTS, getImportsFromTag(tag).join('\n'))
52
+ .replace(TemplateToken.EVENTS, toJsonObjectsList(getUniqueEvents(tag.events)))
53
+ .replace(TemplateToken.PROPERTIES,
54
+ toJsonObjectsList(
55
+ getProperties(tag)
56
+ .filter(property => property.bindable)
57
+ .map(({ name }) => name))
58
+ )
59
+ .replace(TemplateToken.ATTRIBUTES, '')
60
+ .replace(TemplateToken.PROP_TYPES, getPropTypes(tag).join(',\n'))
61
+ .replace(TemplateToken.PROPS, getProps(tag).join(',\n'))
62
+ .replace(TemplateToken.DEFAULT_PROPS, getDefaultProps(tag).join(',\n'))
63
+ .replace(TemplateToken.TAG_DESCRIPTOR_JSON, JSON.stringify(tag, null, ' '))
64
+ .replace(TemplateToken.COMPOUND_COMPONENTS, getCompoundComponents())
65
+ .replace(TemplateToken.REACT_IMPORT, getCompoundComponents() &&
66
+ 'import { createElement } from \'react\'')
67
+ .replace(new RegExp(TemplateToken.COMPONENT_CLASS_NAME, 'g'), componentName)
68
+ .replace(new RegExp(TemplateToken.TAG, 'g'), tag.name)
69
+ }
70
+
71
+ /**
72
+ * Generates Vivid 2.x wrappers
73
+ */
74
+ const generateWrappers = (outputDir, language = OutputLanguage.JavaScript, cleanTemp = true, verbose = true) => async (tags) => {
75
+ const indexFileName = getIndexFileName(language)
76
+ const saveIndex = (outputDir, content) => {
77
+ const indexOutputFileName = join(outputDir, indexFileName)
78
+ return outputFile(
79
+ indexOutputFileName,
80
+ content
81
+ )
82
+ }
83
+
84
+ const saveStory = async (outputDir, componentName, content) => {
85
+ const indexOutputFileName = join(outputDir, `${componentName}.stories.jsx`)
86
+ const exists = await pathExists(indexOutputFileName)
87
+ return exists || outputFile(
88
+ indexOutputFileName,
89
+ content
90
+ )
91
+ }
92
+
93
+ const getStoriesContent = (componentName, tag) =>
94
+ getTemplate('stories', OutputLanguage.JavaScript)
95
+ .split(TemplateToken.COMPONENT_CLASS_NAME).join(componentName)
96
+
97
+ prepareDir(outputDir, true, verbose)
98
+ const components = []
99
+
100
+ for (const tag of tags) {
101
+ const componentName = getComponentName(tag)
102
+ components.push(componentName)
103
+ if (verbose) {
104
+ console.info(`Processing ${componentName}...`)
105
+ }
106
+ tag.events = [...(tag.events || []), ...(ComponentsEventsMap[componentName] || [])]
107
+
108
+ const componentOutputDir = join(process.cwd(), outputDir, componentName)
109
+ const storyOutputDir = join(process.cwd(), FileName.storyOutputDir, 'v2', componentName)
110
+ const componentContent = renderComponent(tag)(language)(componentName)
111
+
112
+ await saveIndex(componentOutputDir, componentContent)
113
+ await saveStory(storyOutputDir, componentName, getStoriesContent(componentName, tag))
114
+
115
+ const packageName = getVividPackageName(tag.path)
116
+ const packageJsonContent = {
117
+ name: `@vonage/vivid-react-${tag.name}`,
118
+ version: packageJson.version,
119
+ main: indexFileName,
120
+ types: 'index.d.ts',
121
+ private: true,
122
+ license: 'MIT',
123
+ dependencies: {
124
+ [packageName]: packageJson.dependencies[packageName]
125
+ }
126
+ }
127
+ await outputJson(join(componentOutputDir, FileName.packageJson), packageJsonContent, { spaces: 2 })
128
+ }
129
+
130
+ if (language === OutputLanguage.JavaScript) {
131
+ await generateTypings(outputDir)(tags)
132
+ }
133
+
134
+ prepareDir(filePath(FileName.tempFolder), cleanTemp, verbose)
135
+
136
+ if (verbose) {
137
+ console.info(`${components.length} wrappers generated at ${outputDir}`)
138
+ }
139
+ }
140
+
141
+ const renderComponentV3 = prefix => classDeclaration => language => componentClassName => {
142
+ const componentPrefix = prefix
143
+ const componentName = classDeclaration.name
144
+ const componentTagName = `${componentPrefix}-${camel2kebab(componentName)}`
145
+ const events = [...(classDeclaration.events?.map(({ name }) => name) || []), ...(ComponentsEventsMapV3[componentClassName] || [])]
146
+ const properties = classDeclaration.members?.filter(({ privacy = 'public', kind, readonly }) => kind === 'field' && privacy === 'public' && readonly !== true) || []
147
+ const attributes = classDeclaration.attributes?.filter(({ fieldName }) => properties.find(({ name }) => fieldName === name)) || []
148
+ const propertyNames = properties.map(({ name }) => `'${name}'`)
149
+ const props = [
150
+ ...(events.map(x => x.propName || event2PropName(x.name || x)).map(x => ` ${x}?: (event: SyntheticEvent) => void`)),
151
+ ...(properties.map(({ name, type }) => ` ${name}?: ${mapType(type?.text)}`))
152
+ ]
153
+ const renderPropertyJsDoc = ({ type, name, attribute = null, description }) => `* @param ${type?.text ? `{${type?.text}}` : ''} ${name} ${description ? `- ${description}` : ''} ${attribute ? `**attribute** \`${attribute.name || attribute.fieldName}\`` : ''}`
154
+ const jsDoc = `/** ${classDeclaration.description || componentClassName} \n${properties.map((p) => ({ ...p, attribute: attributes.find(({ fieldName }) => fieldName === p.name) })).map(renderPropertyJsDoc).join('\n')}\n*/`
155
+
156
+ return getTemplate('react-component-v3', language)
157
+ .replace(TemplateToken.CLASS_JSDOC, jsDoc)
158
+ .replace(TemplateToken.ATTRIBUTES, '')
159
+ .replace(TemplateToken.PROP_TYPES, '')
160
+ .replace(TemplateToken.PROPS, props.join(',\n'))
161
+ .replace(TemplateToken.TAG_DESCRIPTOR_JSON, JSON.stringify(classDeclaration, null, ' '))
162
+ .replace(new RegExp(TemplateToken.COMPONENT_CLASS_NAME, 'g'), componentClassName)
163
+ .replace(new RegExp(TemplateToken.TAG_PREFIX, 'g'), componentPrefix)
164
+ .replace(new RegExp(TemplateToken.COMPONENT_NAME, 'g'), componentName)
165
+ .replace(new RegExp(TemplateToken.TAG, 'g'), componentTagName)
166
+ .replace(new RegExp(TemplateToken.EVENTS, 'g'), toJsonObjectsList(getUniqueEvents(events)))
167
+ .replace(new RegExp(TemplateToken.PROPERTIES, 'g'), propertyNames.join(', '))
168
+ }
169
+
170
+ /**
171
+ * Generates Vivid 3.x wrappers
172
+ */
173
+ const generateWrappersV3 = (outputDir, language = OutputLanguage.JavaScript, cleanTemp = true, verbose = true) => async (meta) => {
174
+ const componentPrefix = 'vvd3'
175
+ const indexFileName = getIndexFileName(language)
176
+ const saveIndex = (outputDir, content) => {
177
+ const indexOutputFileName = join(outputDir, indexFileName)
178
+ return outputFile(
179
+ indexOutputFileName,
180
+ content
181
+ )
182
+ }
183
+
184
+ const outDir = `${outputDir}/v3`
185
+
186
+ const classDeclarations = meta.elements.modules.reduce((acc, { declarations }) =>
187
+ [...acc, ...declarations.filter(({ kind }) => kind === 'class')]
188
+ , [])
189
+
190
+ for (const classDeclaration of classDeclarations) {
191
+ const componentName = `Vwc${classDeclaration.name}`
192
+ const componentNameKebab = camel2kebab(classDeclaration.name)
193
+ const componentOutputDir = join(process.cwd(), outDir, componentName)
194
+ const componentContent = renderComponentV3(componentPrefix)(classDeclaration)(language)(componentName)
195
+ await saveIndex(componentOutputDir, componentContent)
196
+
197
+ const packageName = '@vonage/vivid'
198
+ const packageJsonContent = {
199
+ name: `@vonage/vivid-react-${componentPrefix}-${componentNameKebab}`,
200
+ version: packageJson.dependencies[packageName],
201
+ main: indexFileName,
202
+ types: 'index.d.ts',
203
+ private: true,
204
+ license: 'MIT',
205
+ dependencies: {
206
+ [packageName]: packageJson.dependencies[packageName]
207
+ }
208
+ }
209
+ await outputJson(join(componentOutputDir, FileName.packageJson), packageJsonContent, { spaces: 2 })
210
+
211
+ if (verbose) {
212
+ console.info(`${componentName}... v3`)
213
+ }
214
+ }
215
+
216
+ if (language === OutputLanguage.TypeScript) {
217
+ const typesDir = filePath(FileName.types)
218
+ prepareDir(typesDir)
219
+ await outputFile(
220
+ join(typesDir, `index.d.ts`),
221
+ getTemplate('types', OutputLanguage.TypeScript)
222
+ .replace(TemplateToken.ELEMENT_TYPES,
223
+ classDeclarations.map(({ attributes, name }) => {
224
+ const componentTagName = `${componentPrefix}-${camel2kebab(name)}`
225
+ return getTemplate('element-type', OutputLanguage.TypeScript)
226
+ .replace(TemplateToken.TAG, componentTagName)
227
+ .replace(TemplateToken.ATTRIBUTES, (attributes || []).map(({ name, fieldName, type = { text: 'string' } }) => ` "${name || fieldName}": ${type.text};`).join('\n'))
228
+ }).join('\n')
229
+ )
230
+ )
231
+ }
232
+
233
+ if (language === OutputLanguage.JavaScript) {
234
+ const generatedDir = filePath(FileName.generatedFolder)
235
+ prepareDir(generatedDir)
236
+
237
+ writeFileSync(
238
+ `${generatedDir}/vivid.version.js`,
239
+ `export default { v2: '${packageJson.dependencies['@vonage/vvd-core']}', v3: \`${packageJson.dependencies['@vonage/vivid']}\`}`
240
+ )
241
+
242
+ for (const { name, file } of [
243
+ { name: 'core.all', file: './node_modules/@vonage/vivid/styles/core/all.css' },
244
+ { name: 'theme.light', file: './node_modules/@vonage/vivid/styles/tokens/theme-light.css' },
245
+ { name: 'theme.dark', file: './node_modules/@vonage/vivid/styles/tokens/theme-dark.css' },
246
+ { name: 'font.spezia', file: './node_modules/@vonage/vivid/styles/fonts/spezia-variable.css' }
247
+ ]) {
248
+ const cssText = readFileSync(file, { encoding: 'utf8' }).replace(/\/\*# sourceMappingURL=.*\*\//g, '')
249
+ writeFileSync(
250
+ `${generatedDir}/style.${name}.js`,
251
+ `export default { id: '${name}', css: \`${cssText}\`}`
252
+ )
253
+ }
254
+
255
+ await generateTypingsV3(outputDir)(meta)
256
+ }
257
+
258
+ prepareDir(filePath(FileName.tempFolder), cleanTemp, verbose)
259
+ }
260
+
261
+ module.exports = {
262
+ generateWrappers,
263
+ generateWrappersV3
264
+ }
@@ -0,0 +1,18 @@
1
+ const { posix, win32 } = require('path')
2
+
3
+ const rootImportExclusions = ['vwc-tags']
4
+
5
+ module.exports.getImportsFromTag = ({ name, path }) => {
6
+ const normalizedPath = path.split(win32.sep).join(posix.sep)
7
+ const [, rootComponent] = /@vonage\/([\w-]+)\//g.exec(normalizedPath)
8
+ const result = []
9
+ if (rootComponent === name) {
10
+ result.push(`@vonage/${name}`)
11
+ } else {
12
+ if (rootImportExclusions.indexOf(rootComponent) < 0) {
13
+ result.push(`@vonage/${rootComponent}`)
14
+ }
15
+ result.push(`@vonage/${rootComponent}/${name}`)
16
+ }
17
+ return result.map(x => `import '${x}'`)
18
+ }
@@ -0,0 +1,56 @@
1
+ const { posix, win32 } = require('path')
2
+ const { getImportsFromTag } = require('./generator')
3
+
4
+ describe('getImportsFromTag', () => {
5
+ const mainComponentTag = {
6
+ name: 'vwc-list',
7
+ path: './../node_modules/@vonage/vwc-list/src/vwc-list.ts'
8
+ }
9
+
10
+ const subComponentExclusionTag = {
11
+ name: 'vwc-tag',
12
+ path: './..\\node_modules\\@vonage\\vwc-tags\\vwc-tag.d.ts'
13
+ }
14
+
15
+ const subComponentTag = {
16
+ name: 'vwc-radio-list-item',
17
+ path: './../node_modules/@vonage/vwc-list/src/vwc-radio-list-item.ts'
18
+ }
19
+
20
+ it('should create a default import for main component', () => {
21
+ const result = getImportsFromTag(mainComponentTag)
22
+
23
+ expect(result).toEqual([`import '@vonage/vwc-list'`])
24
+ })
25
+
26
+ it('should create import from specific file for subcomponent and main component import', () => {
27
+ const result = getImportsFromTag(subComponentTag)
28
+
29
+ expect(result).toEqual([
30
+ `import '@vonage/vwc-list'`,
31
+ `import '@vonage/vwc-list/${subComponentTag.name}'`
32
+ ])
33
+ })
34
+
35
+ it('should create import from specific file for subcomponent with exclusion', () => {
36
+ const result = getImportsFromTag(subComponentExclusionTag)
37
+
38
+ expect(result).toEqual([
39
+ `import '@vonage/vwc-tags/${subComponentExclusionTag.name}'`
40
+ ])
41
+ })
42
+
43
+ it('should work for win32 paths', () => {
44
+ const winTag = {
45
+ ...subComponentTag,
46
+ path: subComponentTag.path.split(posix.sep).join(win32.sep)
47
+ }
48
+
49
+ const result = getImportsFromTag(winTag)
50
+
51
+ expect(result).toEqual([
52
+ `import '@vonage/vwc-list'`,
53
+ `import '@vonage/vwc-list/${subComponentTag.name}'`
54
+ ])
55
+ })
56
+ })
@@ -0,0 +1,87 @@
1
+ const { event2PropName, getProperties } = require('./utils')
2
+
3
+ // Common
4
+
5
+ const getEvents = tag => (tag.events || []).map(x => x.propName || event2PropName(x.name || x))
6
+ const isTypeSet = type => /(".*?" \|)/.test(type)
7
+ const isStringTypeSet = type => /".*"[ |]?/.test(type) && /".*"[ |]?/.exec(type)[0] === type
8
+ const isBoolean = type => /^(true|false)$/.test(type) || type === 'boolean'
9
+ const isArray = type => /(.*)\[\]$/gm.test(type) || type === 'array'
10
+ const isNumber = type => /(integer)/.test(type) || type === 'number | null'
11
+
12
+ // TypeScript
13
+ const mapType = type => ([
14
+ 'boolean',
15
+ 'Boolean',
16
+ 'string',
17
+ 'string | null',
18
+ 'string | undefined',
19
+ 'string | number',
20
+ 'number',
21
+ 'unknown'].indexOf(type) >= 0 ||
22
+ isTypeSet(type))
23
+ ? type
24
+ : isBoolean(type)
25
+ ? 'boolean'
26
+ : isNumber(type)
27
+ ? 'number'
28
+ : isArray(type)
29
+ ? 'any[]'
30
+ : `any /* ${type} */`
31
+
32
+ const getProps = tag => {
33
+ const eventsProps = getEvents(tag).map(x => ` ${x}?: (event: SyntheticEvent) => void`)
34
+
35
+ const properties = getProperties(tag)
36
+ const props = properties.map(x => ` ${x.name}?: ${mapType(x.type)}`)
37
+
38
+ return [
39
+ ...eventsProps,
40
+ ...props
41
+ ]
42
+ }
43
+
44
+ // JavaScript
45
+
46
+ const getDefaultProps = tag => {
47
+ const defaultProperties = getProperties(tag).filter(x => x.default)
48
+ return defaultProperties.map(x => ` ${x.name}: ${x.default}`)
49
+ }
50
+
51
+ const getPropTypes = tag => {
52
+ const eventsPropTypes = getEvents(tag).map(x => ` ${x}: PropTypes.func`)
53
+
54
+ const properties = getProperties(tag)
55
+ const isString = type => type === 'string | undefined' || type === 'string | null'
56
+ const getSetTypeOptions = setType => setType.split('|').map(x => x.trim())
57
+ const mapTypeToPropType = type => ['boolean', 'string', 'number', 'array'].indexOf(type) >= 0
58
+ ? (type === 'boolean' ? 'bool' : type)
59
+ : isStringTypeSet(type)
60
+ ? `oneOf([${getSetTypeOptions(type).join(',')}])`
61
+ : isString(type)
62
+ ? 'string'
63
+ : isNumber(type)
64
+ ? 'number'
65
+ : isArray(type)
66
+ ? 'array'
67
+ : isBoolean(type)
68
+ ? 'bool'
69
+ : `any /* ${type || 'type not provided'} */`
70
+ const propertiesPropTypes = properties.map(x =>
71
+ ` ${x.name}: PropTypes.${mapTypeToPropType(x.type)}${x.default ? `/* default: ${x.default} */` : ''}${x.attribute ? `/* attribute: ${x.attribute} */` : ''}`)
72
+
73
+ return [
74
+ ...eventsPropTypes,
75
+ ...propertiesPropTypes
76
+ ]
77
+ }
78
+
79
+ module.exports = {
80
+ // JavaScript
81
+ getDefaultProps,
82
+ getPropTypes,
83
+
84
+ // TypeScript
85
+ getProps,
86
+ mapType
87
+ }
@@ -0,0 +1,2 @@
1
+ <% banner %>
2
+ <% exports %>
@@ -0,0 +1,19 @@
1
+ <% banner %>
2
+ /*
3
+ Code in this file were generated using following JSON:
4
+ <% descriptor-json %>
5
+ */
6
+ import wrapper from '@vonage/vivid-react-wrapper'
7
+ import { register<% component-name %> } from '@vonage/vivid'
8
+
9
+ register<% component-name %>('<% tag-prefix %>')
10
+
11
+ const <% component-class-name %> = wrapper(`<% tag %>`, {
12
+ events: [<% events %>],
13
+ attributes: [<% attributes %>],
14
+ properties: [<% properties %>]
15
+ })
16
+
17
+ <% component-class-name %>.displayName = '<% component-class-name %>'
18
+
19
+ export default <% component-class-name %>