@policystudio/policy-studio-ui-vue 1.1.90-beta.0 → 1.1.90-beta.10

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 (77) hide show
  1. package/.eslintrc.js +12 -8
  2. package/.storybook/PolicyStudio.ts +11 -0
  3. package/.storybook/manager.ts +7 -0
  4. package/dist/css/psui_styles.css +4035 -110277
  5. package/package.json +25 -22
  6. package/postcss.config.js +1 -1
  7. package/src/App.vue +30 -0
  8. package/src/assets/scss/base.scss +27 -23
  9. package/src/assets/scss/components/PsAccordion.scss +1 -1
  10. package/src/assets/scss/components/PsChips.scss +3 -3
  11. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  12. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  13. package/src/assets/scss/components/PsTabHeader.scss +1 -1
  14. package/src/assets/scss/components/PsTableResults.scss +1 -1
  15. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  16. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +2 -1
  17. package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
  18. package/src/components/buttons/PsButton.vue +74 -96
  19. package/src/{index.js → index.ts} +4 -4
  20. package/src/shims-vue.d.ts +11 -0
  21. package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
  22. package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
  23. package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
  24. package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
  25. package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
  26. package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
  27. package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
  28. package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
  29. package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
  30. package/src/stories/ClimateZoneBadge.stories.ts +28 -0
  31. package/src/stories/CostEffectBar.stories.ts +26 -0
  32. package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
  33. package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
  34. package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
  35. package/src/stories/Draggable.stories.ts +32 -0
  36. package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +1 -11
  37. package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
  38. package/src/stories/{Header.stories.js → Header.stories.ts} +1 -0
  39. package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
  40. package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -1
  41. package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
  42. package/src/stories/{Input.stories.js → Input.stories.ts} +6 -2
  43. package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
  44. package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
  45. package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
  46. package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
  47. package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
  48. package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -0
  49. package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
  50. package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
  51. package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
  52. package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
  53. package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +4 -0
  54. package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
  55. package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
  56. package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
  57. package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
  58. package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
  59. package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
  60. package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -7
  61. package/src/util/{imageLoader.js → imageLoader.ts} +15 -9
  62. package/tailwind.config.js +11 -2
  63. package/tsconfig.json +47 -0
  64. package/webpack.config.js +17 -3
  65. package/.storybook/PolicyStudio.js +0 -10
  66. package/.storybook/manager.js +0 -6
  67. package/babel.config.js +0 -17
  68. package/src/stories/ClimateZoneBadge.stories.js +0 -17
  69. package/src/stories/CostEffectBar.stories.js +0 -23
  70. package/src/stories/Draggable.stories.js +0 -22
  71. /package/.storybook/{eventBus.js → eventBus.ts} +0 -0
  72. /package/.storybook/{main.js → main.ts} +0 -0
  73. /package/.storybook/{preview.js → preview.ts} +0 -0
  74. /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
  75. /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
  76. /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
  77. /package/src/stories/{Button.stories.js → Button.stories.ts} +0 -0
@@ -6,7 +6,7 @@ export default {
6
6
  }
7
7
  const items = ['Option 1', 'Option 2', 'Option 3']
8
8
  const selected = 'Option 2'
9
-
9
+ // @ts-ignore
10
10
  const Template = (args, { argTypes }) => ({
11
11
  props: Object.keys(argTypes),
12
12
  components: { PsToggle },
@@ -16,6 +16,7 @@ const Template = (args, { argTypes }) => ({
16
16
  })
17
17
 
18
18
  export const Default = Template.bind({})
19
+ // @ts-ignore
19
20
  Default.args = {
20
21
  items: items,
21
22
  selected: selected,
@@ -28,13 +29,15 @@ Default.args = {
28
29
  * Se quiser dar uma melhorada nessa parte, fique a vontade meu chegado! TMJ
29
30
  */
30
31
  window.addEventListener('click', (ev) => {
32
+ // @ts-ignore
31
33
  if (ev.target.classList.contains('click-to-copy')) {
34
+ // @ts-ignore
32
35
  copyText(ev.target.dataset.toCopy)
33
36
  }
34
37
  })
35
-
38
+ // @ts-ignore
36
39
  function copyText(textToCopy) {
37
- var myTemporaryInputElement = document.createElement('input')
40
+ const myTemporaryInputElement = document.createElement('input')
38
41
  myTemporaryInputElement.type = 'text'
39
42
  myTemporaryInputElement.value = textToCopy
40
43
  document.body.appendChild(myTemporaryInputElement)
@@ -8,7 +8,7 @@ export default {
8
8
  subcomponents: {PsRichTooltip, PsDialogTooltip}
9
9
  }
10
10
 
11
- const TemplateDialog = (args, {argTypes}) => ({
11
+ const TemplateDialog = (args:any, {argTypes}:{argTypes:any}) => ({
12
12
  props: Object.keys(argTypes),
13
13
  components: {PsDialogTooltip},
14
14
  template: `
@@ -41,7 +41,7 @@ const TemplateDialog = (args, {argTypes}) => ({
41
41
  `,
42
42
  })
43
43
 
44
- const TemplateRich = (args,{argTypes})=>({
44
+ const TemplateRich = (args:any, {argTypes}:{argTypes:any})=>({
45
45
  props: Object.keys(argTypes),
46
46
  components: {PsRichTooltip},
47
47
  template: `
@@ -74,7 +74,7 @@ const TemplateRich = (args,{argTypes})=>({
74
74
  `
75
75
  })
76
76
 
77
- const TemplateDefault = (args, {argTypes}) => ({
77
+ const TemplateDefault = (args:any, {argTypes}:{argTypes:any}) => ({
78
78
  props: Object.keys(argTypes),
79
79
  components: {PsTooltip},
80
80
  template: `
@@ -1,15 +1,15 @@
1
- export const randomString = (length) => {
2
- var result = ''
3
- var characters =
1
+ export const randomString = (length:any) => {
2
+ let result = ''
3
+ const characters =
4
4
  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
5
- var charactersLength = characters.length
6
- for (var i = 0; i < length; i++) {
5
+ const charactersLength = characters.length
6
+ for (let i = 0; i < length; i++) {
7
7
  result += characters.charAt(Math.floor(Math.random() * charactersLength))
8
8
  }
9
9
  return result
10
10
  }
11
11
 
12
- export const getParentScrollableEl = (node) => {
12
+ export const getParentScrollableEl = (node:any):any => {
13
13
  if (node == null) {
14
14
  return null
15
15
  }
@@ -21,7 +21,7 @@ export const getParentScrollableEl = (node) => {
21
21
  }
22
22
  }
23
23
 
24
- export const getParentVueComponentByName = (comp, name) => {
24
+ export const getParentVueComponentByName = (comp:any, name:any):any => {
25
25
  if (comp.$options.name === name) {
26
26
  return comp
27
27
  } else {
@@ -1,14 +1,17 @@
1
- export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
1
+ // @ts-ignore
2
+
3
+ export default ({ imageUrl, onProgress = null, returnsBase64 = true }:{imageUrl:any, onProgress:any, returnsBase64:any}) => {
2
4
  return new Promise((resolve, reject) => {
3
- var xhr = new XMLHttpRequest()
4
- var notifiedNotComputable = false
5
+ const xhr = new XMLHttpRequest()
6
+ let notifiedNotComputable = false
5
7
 
6
8
  xhr.open('GET', imageUrl, true)
7
9
  xhr.responseType = 'arraybuffer'
8
10
 
9
- xhr.onprogress = (ev) => {
11
+ xhr.onprogress = (ev:any) => {
10
12
  if (ev.lengthComputable) {
11
- let progress = parseInt((ev.loaded / ev.total) * 100)
13
+ // @ts-ignore
14
+ const progress = parseInt((ev.loaded / ev.total) * 100)
12
15
  if(onProgress) onProgress(progress)
13
16
  } else {
14
17
  if (!notifiedNotComputable) {
@@ -20,6 +23,7 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
20
23
 
21
24
  xhr.onloadend = () => {
22
25
  const contentType = xhr.getResponseHeader('Content-Type')
26
+ // @ts-ignore
23
27
  if (!contentType.includes('image')) {
24
28
  reject(xhr)
25
29
  } else {
@@ -28,13 +32,15 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
28
32
  }
29
33
 
30
34
  if(!returnsBase64) {
35
+ // @ts-ignore
31
36
  resolve()
32
37
  } else {
33
- var options = {}
34
- var headers = xhr.getAllResponseHeaders()
35
- var mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
38
+ const options = {}
39
+ const headers = xhr.getAllResponseHeaders()
40
+ const mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
41
+ // @ts-ignore
36
42
  if (mime && mime[1]) options.type = mime[1]
37
- var blob = new Blob([xhr.response], options)
43
+ const blob = new Blob([xhr.response], options)
38
44
  resolve(window.URL.createObjectURL(blob))
39
45
  }
40
46
  }
@@ -1,7 +1,16 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+
1
3
  module.exports = {
2
4
  prefix: 'psui-',
3
- purge: ['./index.html', './src/**/*.vue,js,ts,jsx,tsx}'],
4
- darkMode: false, // or 'media' or 'class'
5
+ content: [
6
+ './index.html',
7
+ './src/**/*.vue',
8
+ './src/**/*.js',
9
+ './src/**/*.ts',
10
+ './src/**/*.jsx',
11
+ './src/**/*.tsx',
12
+ ],
13
+ darkMode: 'media', // or 'media' or 'class'
5
14
  theme: {
6
15
  colors: {
7
16
  'white': '#ffffff ',
package/tsconfig.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "strict": true,
6
+ "moduleResolution": "node",
7
+ "allowJs": true,
8
+ "noEmitOnError": false,
9
+ "outDir": "./dist",
10
+ "rootDir": "./src",
11
+ "skipLibCheck": true, //this make ts ignore error
12
+ "skipDefaultLibCheck": true, //this make ts ignore error
13
+ "noEmit": true, //this make ts ignore error
14
+ "esModuleInterop": true,
15
+ "allowSyntheticDefaultImports": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "useDefineForClassFields": true,
18
+ "sourceMap": true,
19
+ "baseUrl": ".",
20
+ "types": [
21
+ "webpack-env"
22
+ ],
23
+ "paths": {
24
+ "@/*": [
25
+ "src/*"
26
+ ]
27
+ },
28
+ "lib": [
29
+ "esnext",
30
+ "dom",
31
+ "dom.iterable",
32
+ "scripthost"
33
+ ]
34
+ },
35
+ "include": [
36
+ "src/**/*.ts",
37
+ "src/**/*.tsx",
38
+ "src/**/*.d.ts",
39
+ "src/**/*.vue",
40
+ "src/**/*.stories.ts",
41
+ "tests/**/*.ts",
42
+ "tests/**/*.tsx",
43
+ ],
44
+ "exclude": [
45
+ "node_modules"
46
+ ]
47
+ }
package/webpack.config.js CHANGED
@@ -1,8 +1,11 @@
1
+ const { VueLoaderPlugin} = require('vue-loader')
2
+
1
3
  module.exports = {
2
4
  resolve: {
3
5
  alias: {
4
6
  vue: '@vue/compat'
5
- }
7
+ },
8
+ extensions: ['.js','.ts','.vue']
6
9
  },
7
10
  module: {
8
11
  rules: [
@@ -16,7 +19,18 @@ module.exports = {
16
19
  }
17
20
  }
18
21
  }
19
- }
22
+ },
23
+ {
24
+ test: /\.tsx?$/,
25
+ loader: 'ts-loader',
26
+ options: {
27
+ appendTsSuffixTo: [/\.vue$/],
28
+ },
29
+ exclude: /node_modules/,
30
+ },
20
31
  ]
21
- }
32
+ },
33
+ plugins:[
34
+ new VueLoaderPlugin()
35
+ ]
22
36
  }
@@ -1,10 +0,0 @@
1
- import { create } from '@storybook/theming';
2
- import logo from '../src/assets/images/policy-studio.svg';
3
-
4
- export default create({
5
- base: 'light',
6
- brandTitle: 'Policy Studio UI Vue',
7
- brandUrl: 'https://policystudio.co/',
8
- brandImage: logo,
9
- brandTarget: '_blank',
10
- });
@@ -1,6 +0,0 @@
1
- import { addons } from '@storybook/addons';
2
- import PolicyStudio from './PolicyStudio';
3
-
4
- addons.setConfig({
5
- theme: PolicyStudio,
6
- });
package/babel.config.js DELETED
@@ -1,17 +0,0 @@
1
- const presets = [
2
- [
3
- '@babel/preset-env',
4
- {
5
- targets: {
6
- edge: '17',
7
- firefox: '60',
8
- chrome: '67',
9
- safari: '11.1',
10
- },
11
- useBuiltIns: 'usage',
12
- corejs: '3.6.4',
13
- },
14
- ],
15
- ]
16
-
17
- module.exports = { presets }
@@ -1,17 +0,0 @@
1
- import PsClimateZoneBadge from '../components/badges-and-tags/PsClimateZoneBadge.vue'
2
-
3
- export default {
4
- title: 'Badges & Tags/Badges/ClimateZoneBadge',
5
- component: PsClimateZoneBadge,
6
- }
7
-
8
- const Template = (args, { argTypes }) => ({
9
- props: Object.keys(argTypes),
10
- components: { PsClimateZoneBadge },
11
- template: '<PsClimateZoneBadge v-bind="$props" />',
12
- })
13
-
14
- export const ClimateZoneBadge = Template.bind({})
15
- ClimateZoneBadge.args = {
16
- icon: 'area_chart',
17
- }
@@ -1,23 +0,0 @@
1
- import PsCostEffectBar from '../components/badges-and-tags/PsCostEffectBar.vue'
2
-
3
- export default {
4
- title: 'Badges & Tags/Badges/CostEffectBar',
5
- component: PsCostEffectBar,
6
- argTypes: {
7
- value: {
8
- control: { type: 'number', min: 0, max: 100 },
9
- },
10
- breakEven: {
11
- control: { type: 'number', min: 0, max: 100 },
12
- },
13
- },
14
- }
15
-
16
- const Template = (args, { argTypes }) => ({
17
- props: Object.keys(argTypes),
18
- components: { PsCostEffectBar },
19
- template: '<PsCostEffectBar v-bind="$props" />',
20
- })
21
-
22
- export const SimpleProgressBar = Template.bind({})
23
- SimpleProgressBar.args = {}
@@ -1,22 +0,0 @@
1
- import PsDraggable from '../components/controls/PsDraggable.vue'
2
-
3
- export default {
4
- title: 'Controls & Selectors/Draggable',
5
- component: PsDraggable
6
- }
7
-
8
- const Template = (args, {argTypes}) => ({
9
- props: Object.keys(argTypes),
10
- components: { PsDraggable },
11
- template: `
12
- <div style='width: 300px; font-family: "Lato", sans-serif; font-size: 12px;'>
13
- <PsDraggable v-bind='$props'/>
14
- </div>
15
- `
16
- })
17
-
18
- export const Component = Template.bind({})
19
- Component.args = {
20
- getColumns: {columnGroups:[{title: 'COST EFFECTIVENESS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}, {title: 'PER HOME RESULTS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}]},
21
- module: 'comparison'
22
- }
File without changes
File without changes
File without changes
File without changes