@vonage/vivid-react 2.10.56 → 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 (81) hide show
  1. package/.vscode/settings.json +4 -0
  2. package/README.md +17 -7
  3. package/package.json +9 -10
  4. package/scripts/cli.js +13 -14
  5. package/scripts/generateWrappers/consts.js +9 -15
  6. package/scripts/generateWrappers/generator.js +138 -4
  7. package/scripts/generateWrappers/prop.types.js +20 -19
  8. package/scripts/generateWrappers/templates/js/react-component-v3.tmpl +19 -0
  9. package/scripts/generateWrappers/templates/js/stories.tmpl +2 -2
  10. package/scripts/generateWrappers/templates/templates.js +3 -0
  11. package/scripts/generateWrappers/templates/ts/element-type.tmpl +3 -0
  12. package/scripts/generateWrappers/templates/ts/react-component-v3.tmpl +32 -0
  13. package/scripts/generateWrappers/templates/ts/types.tmpl +8 -0
  14. package/scripts/generateWrappers/utils.js +19 -48
  15. package/src/initialization/initVivid.js +34 -2
  16. package/stories/{VwcAccordion → v2/VwcAccordion}/VwcAccordion.stories.jsx +2 -2
  17. package/stories/{VwcActionGroup → v2/VwcActionGroup}/VwcActionGroup.stories.jsx +2 -2
  18. package/stories/{VwcBadge → v2/VwcBadge}/VwcBadge.stories.jsx +2 -2
  19. package/stories/{VwcBanner → v2/VwcBanner}/VwcBanner.stories.jsx +2 -2
  20. package/stories/{VwcButton → v2/VwcButton}/VwcButton.stories.jsx +2 -2
  21. package/stories/{VwcButtonToggleGroup → v2/VwcButtonToggleGroup}/VwcButtonToggleGroup.stories.jsx +3 -3
  22. package/stories/{VwcCalendar → v2/VwcCalendar}/VwcCalendar.stories.jsx +2 -2
  23. package/stories/{VwcCalendarEvent → v2/VwcCalendarEvent}/VwcCalendarEvent.stories.jsx +2 -2
  24. package/stories/{VwcCard → v2/VwcCard}/VwcCard.stories.jsx +4 -4
  25. package/stories/{VwcCarousel → v2/VwcCarousel}/VwcCarousel.stories.jsx +2 -2
  26. package/stories/{VwcCarouselItem → v2/VwcCarouselItem}/VwcCarouselItem.stories.jsx +2 -2
  27. package/stories/{VwcCheckListItem → v2/VwcCheckListItem}/VwcCheckListItem.stories.jsx +2 -2
  28. package/stories/{VwcCheckbox → v2/VwcCheckbox}/VwcCheckbox.stories.jsx +2 -2
  29. package/stories/{VwcChip → v2/VwcChip}/VwcChip.stories.jsx +2 -2
  30. package/stories/{VwcChipSet → v2/VwcChipSet}/VwcChipSet.stories.jsx +3 -3
  31. package/stories/{VwcCircularProgress → v2/VwcCircularProgress}/VwcCircularProgress.stories.jsx +2 -2
  32. package/stories/{VwcDataGrid → v2/VwcDataGrid}/VwcDataGrid.stories.jsx +6 -6
  33. package/stories/{VwcDataGridColumn → v2/VwcDataGridColumn}/VwcDataGridColumn.stories.jsx +2 -2
  34. package/stories/{VwcDatepicker → v2/VwcDatepicker}/VwcDatepicker.stories.jsx +2 -2
  35. package/stories/{VwcDialog → v2/VwcDialog}/VwcDialog.stories.jsx +2 -2
  36. package/stories/{VwcDrawer → v2/VwcDrawer}/VwcDrawer.stories.jsx +2 -2
  37. package/stories/{VwcDropdown → v2/VwcDropdown}/VwcDropdown.stories.jsx +2 -2
  38. package/stories/{VwcElevation → v2/VwcElevation}/VwcElevation.stories.jsx +2 -2
  39. package/stories/{VwcEmptyState → v2/VwcEmptyState}/VwcEmptyState.stories.jsx +2 -2
  40. package/stories/{VwcExpansionPanel → v2/VwcExpansionPanel}/VwcExpansionPanel.stories.jsx +2 -2
  41. package/stories/{VwcFab → v2/VwcFab}/VwcFab.stories.jsx +2 -2
  42. package/stories/{VwcFilePicker → v2/VwcFilePicker}/VwcFilePicker.stories.jsx +2 -2
  43. package/stories/{VwcFormfield → v2/VwcFormfield}/VwcFormfield.stories.jsx +2 -2
  44. package/stories/{VwcHelperMessage → v2/VwcHelperMessage}/VwcHelperMessage.stories.jsx +2 -2
  45. package/stories/{VwcIcon → v2/VwcIcon}/VwcIcon.stories.jsx +2 -2
  46. package/stories/{VwcIconButton → v2/VwcIconButton}/VwcIconButton.stories.jsx +2 -2
  47. package/stories/{VwcIconButtonToggle → v2/VwcIconButtonToggle}/VwcIconButtonToggle.stories.jsx +2 -2
  48. package/stories/{VwcKeypad → v2/VwcKeypad}/VwcKeypad.stories.jsx +2 -2
  49. package/stories/{VwcLayout → v2/VwcLayout}/VwcLayout.stories.jsx +3 -3
  50. package/stories/{VwcLinearProgress → v2/VwcLinearProgress}/VwcLinearProgress.stories.jsx +2 -2
  51. package/stories/{VwcList → v2/VwcList}/VwcList.stories.jsx +3 -3
  52. package/stories/{VwcListExpansionPanel → v2/VwcListExpansionPanel}/VwcListExpansionPanel.stories.jsx +2 -2
  53. package/stories/{VwcListItem → v2/VwcListItem}/VwcListItem.stories.jsx +2 -2
  54. package/stories/{VwcMenu → v2/VwcMenu}/VwcMenu.stories.jsx +4 -4
  55. package/stories/{VwcNotchedOutline → v2/VwcNotchedOutline}/VwcNotchedOutline.stories.jsx +2 -2
  56. package/stories/{VwcNote → v2/VwcNote}/VwcNote.stories.jsx +2 -2
  57. package/stories/{VwcPagination → v2/VwcPagination}/VwcPagination.stories.jsx +2 -2
  58. package/stories/{VwcPopup → v2/VwcPopup}/VwcPopup.stories.jsx +2 -2
  59. package/stories/{VwcRadio → v2/VwcRadio}/VwcRadio.stories.jsx +2 -2
  60. package/stories/{VwcRadioListItem → v2/VwcRadioListItem}/VwcRadioListItem.stories.jsx +2 -2
  61. package/stories/{VwcSchemeSelect → v2/VwcSchemeSelect}/VwcSchemeSelect.stories.jsx +2 -2
  62. package/stories/{VwcSelect → v2/VwcSelect}/VwcSelect.stories.jsx +2 -2
  63. package/stories/{VwcSideDrawer → v2/VwcSideDrawer}/VwcSideDrawer.stories.jsx +2 -2
  64. package/stories/{VwcSlider → v2/VwcSlider}/VwcSlider.stories.jsx +2 -2
  65. package/stories/{VwcSnackbar → v2/VwcSnackbar}/VwcSnackbar.stories.jsx +2 -2
  66. package/stories/{VwcSurface → v2/VwcSurface}/VwcSurface.stories.jsx +2 -2
  67. package/stories/{VwcSwitch → v2/VwcSwitch}/VwcSwitch.stories.jsx +2 -2
  68. package/stories/{VwcTab → v2/VwcTab}/VwcTab.stories.jsx +2 -2
  69. package/stories/{VwcTabBar → v2/VwcTabBar}/VwcTabBar.stories.jsx +3 -3
  70. package/stories/{VwcTag → v2/VwcTag}/VwcTag.stories.jsx +2 -2
  71. package/stories/{VwcText → v2/VwcText}/VwcText.stories.jsx +2 -2
  72. package/stories/{VwcTextarea → v2/VwcTextarea}/VwcTextarea.stories.jsx +2 -2
  73. package/stories/{VwcTextfield → v2/VwcTextfield}/VwcTextfield.stories.jsx +2 -2
  74. package/stories/{VwcThemeSwitch → v2/VwcThemeSwitch}/VwcThemeSwitch.stories.jsx +2 -2
  75. package/stories/{VwcTooltip → v2/VwcTooltip}/VwcTooltip.stories.jsx +4 -4
  76. package/stories/{VwcTopAppBar → v2/VwcTopAppBar}/VwcTopAppBar.stories.jsx +2 -2
  77. package/stories/{VwcTopAppBarFixed → v2/VwcTopAppBarFixed}/VwcTopAppBarFixed.stories.jsx +2 -2
  78. package/stories/{patches → v2/patches}/patches.stories.jsx +15 -15
  79. package/stories/v3/v3.stories.jsx +28 -0
  80. package/scripts/generateWrappers/index.js +0 -0
  81. package/types/index.d.ts +0 -2
@@ -1,12 +1,9 @@
1
1
  const { join, parse } = require('path')
2
2
  const { flowRight, map, replace, reverse, startCase, uniqBy } = require('lodash/fp')
3
- const { access, F_OK, readFileSync, readdirSync, existsSync, rmSync, createWriteStream } = require('fs')
3
+ const { access, F_OK, readFileSync, existsSync, rmSync } = require('fs')
4
4
  const mkdirp = require('mkdirp')
5
- const os = require('os')
6
5
  const { spawnSync } = require('child_process')
7
6
  const { WCAConfig, VividRepo, FileName, OutputLanguage, ComponentsBindablePropertiesMap, ComponentsReadOnlyPropertiesMap, ComponentsExtraPropertiesMap } = require('./consts')
8
- const { Octokit } = require('@octokit/core')
9
- const extract = require('extract-zip')
10
7
  const { copySync } = require('fs-extra')
11
8
 
12
9
  const renderPropertyJsDoc = tag => property => `* @param ${property.type ? `{${property.type}}` : ''} ${property.name} ${property.description ? `- ${property.description}` : ''} ${property.attribute ? `attribute: <${getComponentName(tag)} ${property.attribute} />` : ''}`
@@ -14,12 +11,12 @@ const renderTagPropertiesJsDoc = tag => getProperties(tag).map(renderPropertyJsD
14
11
  const renderJsDoc = tag => `/** ${tag.description || ''} \n${renderTagPropertiesJsDoc(tag)}\n*/`
15
12
  const stripQuotes = input => input.replace(/'/g, '')
16
13
  const unique = stringArray => Array.from(new Set(stringArray))
17
- const getGithubToken = () => process.env.GITHUB_ACCESS_TOKEN || process.env.GITHUB_TOKEN
18
14
  const toJsonObjectsList = collection => (collection || []).map(JSON.stringify).join(',')
19
15
  const toCommaSeparatedList = collection => (collection || []).map(x => `'${stripQuotes(x.name)}'`).join(',')
20
16
  const capitalize = input => input.replace(/(^|\s)[a-z]/g, s => s.toUpperCase())
21
17
  const deCapitalize = input => input.replace(/(^|\s)[A-Z]/g, s => s.toLowerCase())
22
18
  const getComponentName = tag => capitalize(kebab2Camel(tag.name))
19
+ const camel2kebab = input => deCapitalize(input).replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, '-').toLowerCase()
23
20
  const kebab2Camel = input => deCapitalize(input.split('-').map(x => capitalize(x)).join(''))
24
21
  const snake2Camel = input => deCapitalize(input.split('_').map(x => capitalize(x)).join(''))
25
22
  const event2PropName = eventName => `on${capitalize(kebab2Camel(snake2Camel(eventName)))}`
@@ -32,7 +29,6 @@ const getUniqueEvents = flowRight(
32
29
  reverse,
33
30
  map(event2EventDescriptor)
34
31
  )
35
- const getFileNameFromDispositionHeader = input => /filename=(.*$)/.exec(input)[1]
36
32
  const isVividPackageName = (packageName) => /@vonage\/vwc-*/.test(packageName)
37
33
  const getIndexFileName = language => `index.${language === OutputLanguage.TypeScript ? 'tsx' : language}`
38
34
  const getVividPackageName = componentPath => {
@@ -48,7 +44,6 @@ const getVividPackageName = componentPath => {
48
44
  const pkg = getParsedJson(packageJson)
49
45
  return pkg.name
50
46
  }
51
- const getYarnCommand = () => `yarn${os.platform() === 'win32' ? '.cmd' : ''}`
52
47
  const prepareDir = (p, clean = true, verbose = true) => {
53
48
  if (clean && existsSync(p)) {
54
49
  if (verbose) {
@@ -58,15 +53,14 @@ const prepareDir = (p, clean = true, verbose = true) => {
58
53
  }
59
54
  mkdirp.sync(p)
60
55
  }
61
- const getFirstFolderNameFromPath = path => readdirSync(path, { withFileTypes: true }).find(x => x.isDirectory()).name
62
56
  const getProperties = tag => (tag.properties || [])
63
57
  .filter(prop => !(ComponentsReadOnlyPropertiesMap[getComponentName(tag)] || []).includes(prop.name)) // skip readonly properties
64
58
  .filter(prop => /'.*?'/.test(prop.name) ||
65
- /^([a-zA-Z_$][a-zA-Z\\d_$]*)$/.test(prop.name)) // only props having valid names
59
+ /^([a-zA-Z_$][a-zA-Z\\d_$]*)$/.test(prop.name)) // only props having valid names
66
60
  .map(prop => {
67
61
  const isBindable = (ComponentsBindablePropertiesMap[getComponentName(tag)] || []).includes(prop.name) ||
68
- prop.type?.indexOf('=>') > 0 || // property type is function
69
- prop.type?.indexOf('[]') > 0 // property type is array
62
+ prop.type?.indexOf('=>') > 0 || // property type is function
63
+ prop.type?.indexOf('[]') > 0 // property type is array
70
64
  prop.bindable = isBindable
71
65
  return prop
72
66
  }).concat(ComponentsExtraPropertiesMap[getComponentName(tag)] || [])
@@ -81,6 +75,18 @@ const isFileExists = (fileName) => new Promise(
81
75
  ))
82
76
  const filePath = (fileName) => join(process.cwd(), fileName)
83
77
 
78
+ const readMetaData = () => new Promise(
79
+ (resolve) => {
80
+ const vividPackageFolder = join(process.cwd(), 'node_modules/@vonage/vivid')
81
+ const elementsMetaData = `${vividPackageFolder}/${FileName.customElements}`
82
+ const apiMetaData = `${vividPackageFolder}/${FileName.vividApi}`
83
+ const meta = {
84
+ api: getParsedJson(apiMetaData),
85
+ elements: getParsedJson(elementsMetaData)
86
+ }
87
+ resolve(meta)
88
+ })
89
+
84
90
  const getParsedJson = (jsonFilePath) => JSON.parse(readFileSync(jsonFilePath, { encoding: 'utf8' }))
85
91
 
86
92
  const getVividPackageNames = ({ dependencies, devDependencies }) => {
@@ -142,42 +148,6 @@ const getInputArgument = (argumentName, defaultValue = null) => {
142
148
  return targetArgument ? targetArgument.value : defaultValue
143
149
  }
144
150
 
145
- const getVividLatestRelease = async (config = { tempFolder: FileName.tempFolder, tempFileName: FileName.tempVividZipball }) => {
146
- const outFolder = filePath(config.tempFolder)
147
- prepareDir(outFolder, false)
148
- console.log('Fetching latest Vivid release artifact...')
149
- if (!getGithubToken()) {
150
- console.warn('It seems GITHUB_ACCESS_TOKEN or GITHUB_TOKEN environment variable is not defined.')
151
- return
152
- }
153
- const octokit = new Octokit({ auth: getGithubToken() })
154
- const result = await octokit.request(`GET /repos/${VividRepo}/zipball`)
155
- if (result.status === 200) {
156
- const filename = getFileNameFromDispositionHeader(result.headers['content-disposition'])
157
- console.info(`Got zipball ${filename}`)
158
- return new Promise((resolve, reject) => {
159
- const vividZipFileName = join(outFolder, config.tempFileName)
160
- const vividZipStream = createWriteStream(vividZipFileName)
161
- vividZipStream.write(Buffer.from(result.data), async () => {
162
- try {
163
- await extract(vividZipFileName, { dir: outFolder })
164
- } catch (err) {
165
- console.error(err)
166
- reject(err)
167
- }
168
- const vividFolder = join(outFolder, getFirstFolderNameFromPath(outFolder))
169
- console.log(`Installing Vivid packages at: ${vividFolder}...`)
170
- const child = spawnSync(getYarnCommand(), [], { cwd: vividFolder, stdio: 'ignore' })
171
- if (child.status === 0) {
172
- console.log('Analyzing Vivid elements...')
173
- resolve(`${vividFolder}/**/components/**`)
174
- }
175
- resolve()
176
- })
177
- })
178
- }
179
- }
180
-
181
151
  const getComponentNameFromPackage = flowRight(
182
152
  replace(/\s/g, ''),
183
153
  startCase,
@@ -210,6 +180,8 @@ module.exports = {
210
180
  getComponentNameFromPackage,
211
181
  getInputArgument,
212
182
  getUniqueEvents,
183
+ readMetaData,
184
+ camel2kebab,
213
185
  isFileExists,
214
186
  isVividPackageName,
215
187
  copyStaticAssets,
@@ -219,7 +191,6 @@ module.exports = {
219
191
  getParsedJson,
220
192
  getVividPackageName,
221
193
  getVividPackageNames,
222
- getVividLatestRelease,
223
194
  getCustomElementTagsDefinitionsList,
224
195
  prepareCompoundComponents,
225
196
  compoundComponentTemplate
@@ -2,6 +2,26 @@
2
2
  import context from '@vonage/vvd-context'
3
3
  import { init } from '@vonage/vvd-fonts'
4
4
 
5
+ import coreStyles from './../generated/style.core.all'
6
+ import darkThemeStyles from './../generated/style.theme.dark'
7
+ import lightThemeStyles from './../generated/style.theme.light'
8
+ import fontSpeziaStyles from './../generated/style.font.spezia'
9
+ import vividVersion from './../generated/vivid.version'
10
+
11
+ const vividDataAttributePrefix = 'data-vivid'
12
+
13
+ const appendStyleElement = (document = window.document) => (styleDescriptor) => {
14
+ const attributeName = `${vividDataAttributePrefix}-id`
15
+ if (document.querySelectorAll(`[${attributeName}="${styleDescriptor.id}"]`).length > 0) {
16
+ return
17
+ }
18
+ const styleElement = document.createElement('style')
19
+ styleElement.setAttribute('type', 'text/css')
20
+ styleElement.setAttribute(attributeName, styleDescriptor.id)
21
+ styleElement.innerHTML = styleDescriptor.css
22
+ document.head.append(styleElement)
23
+ }
24
+
5
25
  /**
6
26
  * mounts Vivid context (styles) & Fonts into the target scope / document
7
27
  * - target scope may by any `HTMLElement` or `Document` or `DocumentFragment` (including `ShadowRoot`)
@@ -10,13 +30,25 @@ import { init } from '@vonage/vvd-fonts'
10
30
  *
11
31
  * @param {Document | DocumentFragment | HTMLElement} target - target document/shadow root/element to mount the CSS into
12
32
  * @param {Function} callback - callback function to be invoked once init is done
33
+ * @param {Object} options - options config how to init vivid. `theme` - dark | light, `font` - proprietary | oss
34
+ *
13
35
  * @throws {Error} error - if the provided target argument is `null` or not a Node of type `Document` / `DocumentFragment` / `HTMLElement`
14
36
  */
15
- export const initVivid = (target, callback) => {
37
+ export const initVivid = (target, callback, options) => {
16
38
  if (target instanceof HTMLElement) {
17
- target.classList.add('vivid-scope')
39
+ target.classList.add('vivid-scope') // vivid 2.x
40
+ target.setAttribute(`${vividDataAttributePrefix}-v2`, vividVersion.v2)
41
+
42
+ target.classList.add('vvd-root') // vivid 3.x
43
+ target.setAttribute(`${vividDataAttributePrefix}-v3`, vividVersion.v3)
18
44
  target = undefined
19
45
  }
46
+ const appendStyle = appendStyleElement()
47
+ appendStyle(coreStyles)
48
+ appendStyle(options.theme === 'light' ? lightThemeStyles : darkThemeStyles)
49
+ if (options.font === 'proprietary') {
50
+ appendStyle(fontSpeziaStyles)
51
+ }
20
52
  return Promise.all([
21
53
  init(),
22
54
  context.mount(target)
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcAccordion from '../../dist/VwcAccordion'
2
+ import VwcAccordion from '../../../dist/VwcAccordion'
3
3
 
4
4
  export const Default = () => <VwcAccordion />
5
5
  export default {
6
- title: 'VwcAccordion',
6
+ title: 'V2/VwcAccordion',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcActionGroup from '../../dist/VwcActionGroup'
2
+ import VwcActionGroup from '../../../dist/VwcActionGroup'
3
3
 
4
4
  export const Default = () => <VwcActionGroup />
5
5
  export default {
6
- title: 'VwcActionGroup',
6
+ title: 'V2/VwcActionGroup',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcBadge from '../../dist/VwcBadge'
2
+ import VwcBadge from '../../../dist/VwcBadge'
3
3
 
4
4
  export const Default = () => <VwcBadge />
5
5
  export default {
6
- title: 'VwcBadge',
6
+ title: 'V2/VwcBadge',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcBanner from '../../dist/VwcBanner'
2
+ import VwcBanner from '../../../dist/VwcBanner'
3
3
 
4
4
  export const Default = () => <VwcBanner />
5
5
  export default {
6
- title: 'VwcBanner',
6
+ title: 'V2/VwcBanner',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcButton from '../../dist/VwcButton'
2
+ import VwcButton from '../../../dist/VwcButton'
3
3
 
4
4
  export const Default = () => <VwcButton />
5
5
  export default {
6
- title: 'VwcButton',
6
+ title: 'V2/VwcButton',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import VwcButtonToggleGroup from '../../dist/VwcButtonToggleGroup'
3
- import VwcButton from '../../dist/VwcButton'
2
+ import VwcButtonToggleGroup from '../../../dist/VwcButtonToggleGroup'
3
+ import VwcButton from '../../../dist/VwcButton'
4
4
 
5
5
  export const Default = () => {
6
6
  return (
@@ -32,7 +32,7 @@ export const RealtimeValuesSet = () => {
32
32
  }
33
33
 
34
34
  export default {
35
- title: 'VwcButtonToggleGroup',
35
+ title: 'V2/VwcButtonToggleGroup',
36
36
  argTypes: {
37
37
  //
38
38
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCalendar from '../../dist/VwcCalendar'
2
+ import VwcCalendar from '../../../dist/VwcCalendar'
3
3
 
4
4
  export const Default = () => <VwcCalendar />
5
5
  export default {
6
- title: 'VwcCalendar',
6
+ title: 'V2/VwcCalendar',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCalendarEvent from '../../dist/VwcCalendarEvent'
2
+ import VwcCalendarEvent from '../../../dist/VwcCalendarEvent'
3
3
 
4
4
  export const Default = () => <VwcCalendarEvent />
5
5
  export default {
6
- title: 'VwcCalendarEvent',
6
+ title: 'V2/VwcCalendarEvent',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
- import VwcCard from '../../dist/VwcCard'
3
- import VwcIconButton from '../../dist/VwcIconButton'
4
- import { vwcCardHeadingCropDecorator } from '../../src'
2
+ import VwcCard from '../../../dist/VwcCard'
3
+ import VwcIconButton from '../../../dist/VwcIconButton'
4
+ import { vwcCardHeadingCropDecorator } from '../../../src'
5
5
 
6
6
  const originalText = 'very loooooo ngt te eeex tkjhn klhkjg hlkjh kjuhk jhkjh kjhk jhk jhjk'
7
7
  const damnLoongWordText = 'veryloooooongtteeeextkjhnklhkjghlkjhkjuhkjhkjhkjhk jhk jhjk'
@@ -75,7 +75,7 @@ export const Default = () => (
75
75
  </>
76
76
  )
77
77
  export default {
78
- title: 'VwcCard',
78
+ title: 'V2/VwcCard',
79
79
  argTypes: {
80
80
  //
81
81
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCarousel from '../../dist/VwcCarousel'
2
+ import VwcCarousel from '../../../dist/VwcCarousel'
3
3
 
4
4
  export const Default = () => <VwcCarousel />
5
5
  export default {
6
- title: 'VwcCarousel',
6
+ title: 'V2/VwcCarousel',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCarouselItem from '../../dist/VwcCarouselItem'
2
+ import VwcCarouselItem from '../../../dist/VwcCarouselItem'
3
3
 
4
4
  export const Default = () => <VwcCarouselItem />
5
5
  export default {
6
- title: 'VwcCarouselItem',
6
+ title: 'V2/VwcCarouselItem',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCheckListItem from '../../dist/VwcCheckListItem'
2
+ import VwcCheckListItem from '../../../dist/VwcCheckListItem'
3
3
 
4
4
  export const Default = () => <VwcCheckListItem />
5
5
  export default {
6
- title: 'VwcCheckListItem',
6
+ title: 'V2/VwcCheckListItem',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCheckbox from '../../dist/VwcCheckbox'
2
+ import VwcCheckbox from '../../../dist/VwcCheckbox'
3
3
 
4
4
  export const Default = () => <VwcCheckbox />
5
5
  export default {
6
- title: 'VwcCheckbox',
6
+ title: 'V2/VwcCheckbox',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcChip from '../../dist/VwcChip'
2
+ import VwcChip from '../../../dist/VwcChip'
3
3
 
4
4
  export const Default = () => <VwcChip />
5
5
  export default {
6
- title: 'VwcChip',
6
+ title: 'V2/VwcChip',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import VwcChipSet from '../../dist/VwcChipSet'
3
- import VwcChip from '../../dist/VwcChip'
2
+ import VwcChipSet from '../../../dist/VwcChipSet'
3
+ import VwcChip from '../../../dist/VwcChip'
4
4
 
5
5
  export const Default = (argTypes) =>
6
6
  <VwcChipSet {...argTypes}>
@@ -17,7 +17,7 @@ export const Filter = (argTypes) =>
17
17
  </VwcChipSet>
18
18
 
19
19
  export default {
20
- title: 'VwcChipSet',
20
+ title: 'V2/VwcChipSet',
21
21
  argTypes: {
22
22
  type: {
23
23
  options: ['action', 'input', 'choice', 'filter'],
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcCircularProgress from '../../dist/VwcCircularProgress'
2
+ import VwcCircularProgress from '../../../dist/VwcCircularProgress'
3
3
 
4
4
  export const Default = () => <VwcCircularProgress />
5
5
  export default {
6
- title: 'VwcCircularProgress',
6
+ title: 'V2/VwcCircularProgress',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcSwitch from '../../dist/VwcSwitch'
3
- import VwcButton from '../../dist/VwcButton'
4
- import VwcDataGrid from '../../dist/VwcDataGrid'
5
- import VwcDataGridColumn from '../../dist/VwcDataGridColumn'
6
- import { cellRendererFactory } from '../../src/dataGrid'
2
+ import VwcSwitch from '../../../dist/VwcSwitch'
3
+ import VwcButton from '../../../dist/VwcButton'
4
+ import VwcDataGrid from '../../../dist/VwcDataGrid'
5
+ import VwcDataGridColumn from '../../../dist/VwcDataGridColumn'
6
+ import { cellRendererFactory } from '../../../src/dataGrid'
7
7
 
8
8
  const sequentalData = (rowBlueprint, totalRows) => {
9
9
  const result = new Array(totalRows)
@@ -105,5 +105,5 @@ export const Default = () => {
105
105
  }
106
106
 
107
107
  export default {
108
- title: 'VwcDataGrid'
108
+ title: 'V2/VwcDataGrid'
109
109
  }
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcDataGridColumn from '../../dist/VwcDataGridColumn'
2
+ import VwcDataGridColumn from '../../../dist/VwcDataGridColumn'
3
3
 
4
4
  export const Default = () => <VwcDataGridColumn />
5
5
  export default {
6
- title: 'VwcDataGridColumn',
6
+ title: 'V2/VwcDataGridColumn',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcDatepicker from '../../dist/VwcDatepicker'
2
+ import VwcDatepicker from '../../../dist/VwcDatepicker'
3
3
 
4
4
  export const Default = () => <VwcDatepicker />
5
5
  export default {
6
- title: 'VwcDatepicker',
6
+ title: 'V2/VwcDatepicker',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcDialog from '../../dist/VwcDialog'
2
+ import VwcDialog from '../../../dist/VwcDialog'
3
3
 
4
4
  export const Default = () => <VwcDialog />
5
5
  export default {
6
- title: 'VwcDialog',
6
+ title: 'V2/VwcDialog',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcDrawer from '../../dist/VwcDrawer'
2
+ import VwcDrawer from '../../../dist/VwcDrawer'
3
3
 
4
4
  export const Default = () => <VwcDrawer />
5
5
  export default {
6
- title: 'VwcDrawer',
6
+ title: 'V2/VwcDrawer',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcDropdown from '../../dist/VwcDropdown'
2
+ import VwcDropdown from '../../../dist/VwcDropdown'
3
3
 
4
4
  export const Default = () => <VwcDropdown />
5
5
  export default {
6
- title: 'VwcDropdown',
6
+ title: 'V2/VwcDropdown',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcElevation from '../../dist/VwcElevation'
2
+ import VwcElevation from '../../../dist/VwcElevation'
3
3
 
4
4
  export const Default = () => <VwcElevation />
5
5
  export default {
6
- title: 'VwcElevation',
6
+ title: 'V2/VwcElevation',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcEmptyState from '../../dist/VwcEmptyState'
2
+ import VwcEmptyState from '../../../dist/VwcEmptyState'
3
3
 
4
4
  export const Default = () => <VwcEmptyState body="body" icon="chat-line" heading="heading" />
5
5
  export default {
6
- title: 'VwcEmptyState',
6
+ title: 'V2/VwcEmptyState',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcExpansionPanel from '../../dist/VwcExpansionPanel'
2
+ import VwcExpansionPanel from '../../../dist/VwcExpansionPanel'
3
3
 
4
4
  export const Default = () => <VwcExpansionPanel />
5
5
  export default {
6
- title: 'VwcExpansionPanel',
6
+ title: 'V2/VwcExpansionPanel',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcFab from '../../dist/VwcFab'
2
+ import VwcFab from '../../../dist/VwcFab'
3
3
 
4
4
  export const Default = () => <VwcFab />
5
5
  export default {
6
- title: 'VwcFab',
6
+ title: 'V2/VwcFab',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcFilePicker from '../../dist/VwcFilePicker'
2
+ import VwcFilePicker from '../../../dist/VwcFilePicker'
3
3
 
4
4
  export const Default = () => <VwcFilePicker />
5
5
  export default {
6
- title: 'VwcFilePicker',
6
+ title: 'V2/VwcFilePicker',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcFormfield from '../../dist/VwcFormfield'
2
+ import VwcFormfield from '../../../dist/VwcFormfield'
3
3
 
4
4
  export const Default = () => <VwcFormfield />
5
5
  export default {
6
- title: 'VwcFormfield',
6
+ title: 'V2/VwcFormfield',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcHelperMessage from '../../dist/VwcHelperMessage'
2
+ import VwcHelperMessage from '../../../dist/VwcHelperMessage'
3
3
 
4
4
  export const Default = () => <VwcHelperMessage />
5
5
  export default {
6
- title: 'VwcHelperMessage',
6
+ title: 'V2/VwcHelperMessage',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcIcon from '../../dist/VwcIcon'
2
+ import VwcIcon from '../../../dist/VwcIcon'
3
3
 
4
4
  export const Default = () => <VwcIcon />
5
5
  export default {
6
- title: 'VwcIcon',
6
+ title: 'V2/VwcIcon',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcIconButton from '../../dist/VwcIconButton'
2
+ import VwcIconButton from '../../../dist/VwcIconButton'
3
3
 
4
4
  export const Default = () => <VwcIconButton />
5
5
  export default {
6
- title: 'VwcIconButton',
6
+ title: 'V2/VwcIconButton',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import VwcIconButtonToggle from '../../dist/VwcIconButtonToggle'
2
+ import VwcIconButtonToggle from '../../../dist/VwcIconButtonToggle'
3
3
 
4
4
  export const Default = () => <VwcIconButtonToggle />
5
5
  export default {
6
- title: 'VwcIconButtonToggle',
6
+ title: 'V2/VwcIconButtonToggle',
7
7
  argTypes: {
8
8
  //
9
9
  // Example values