@policystudio/policy-studio-ui-vue 1.0.20 → 1.0.21

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 (43) hide show
  1. package/.storybook/main.js +9 -1
  2. package/dist/css/psui_styles.css +14742 -14620
  3. package/package.json +4 -1
  4. package/postcss.config.js +2 -0
  5. package/src/assets/scss/base.scss +5 -4
  6. package/src/assets/scss/components/PsInput.scss +89 -0
  7. package/src/components/accordion/PsAccordion.vue +18 -22
  8. package/src/components/accordion/PsAccordionItem.vue +5 -5
  9. package/src/components/badges-and-tags/PsChartLegend.vue +128 -0
  10. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
  11. package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
  12. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
  13. package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
  14. package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
  15. package/src/components/buttons/PsButton.vue +1 -1
  16. package/src/components/chips/PsChips.vue +10 -20
  17. package/src/components/controls/PsCheckbox.vue +29 -16
  18. package/src/components/controls/PsDraggable.vue +171 -25
  19. package/src/components/controls/PsRadioButton.vue +25 -19
  20. package/src/components/forms/PsInput.vue +122 -102
  21. package/src/components/notifications/PsDialog.vue +37 -18
  22. package/src/components/tooltip/PsRichTooltip.vue +6 -0
  23. package/src/components/tooltip/PsTooltip.vue +1 -3
  24. package/src/index.js +9 -9
  25. package/src/stories/Accordion.stories.js +28 -22
  26. package/src/stories/ChartLegend.stories.js +16 -0
  27. package/src/stories/Chips.stories.js +7 -1
  28. package/src/stories/ClimateZoneBadge.stories.js +24 -0
  29. package/src/stories/Colors.stories.mdx +1 -1
  30. package/src/stories/CostEffectBar.stories.js +23 -0
  31. package/src/stories/Dialog.stories.js +141 -8
  32. package/src/stories/Draggable.stories.js +4 -6
  33. package/src/stories/Dropdown.stories.js +3 -5
  34. package/src/stories/HighlightRippleDot.stories.js +16 -0
  35. package/src/stories/Input.stories.js +36 -5
  36. package/src/stories/MiniTag.stories.js +46 -0
  37. package/src/stories/ProgressBar.stories.js +23 -0
  38. package/src/stories/RadioButton.stories.js +2 -2
  39. package/src/stories/Toggle.stories.js +7 -8
  40. package/src/stories/Tooltip.stories.js +5 -4
  41. package/src/util/GeneralFunctions.js +6 -7
  42. package/src/util/imageLoader.js +1 -1
  43. package/tailwind.config.js +72 -50
@@ -0,0 +1,23 @@
1
+ import PsProgressBar from '../components/badges-and-tags/PsProgressBar.vue'
2
+
3
+ export default {
4
+ title: 'Components/ProgressBar',
5
+ component: PsProgressBar,
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: { PsProgressBar },
19
+ template: '<PsProgressBar v-bind="$props" />',
20
+ })
21
+
22
+ export const ProgressBar = Template.bind({})
23
+ ProgressBar.args = {}
@@ -25,7 +25,7 @@ const Template = (args, { argTypes }) => ({
25
25
  </div>
26
26
  </div>
27
27
  </div>
28
- `
28
+ `,
29
29
  })
30
30
 
31
31
  export const Default = Template.bind({})
@@ -33,5 +33,5 @@ Default.args = {}
33
33
 
34
34
  export const Small = Template.bind({})
35
35
  Small.args = {
36
- small: true
36
+ small: true,
37
37
  }
@@ -12,16 +12,15 @@ const Template = (args, { argTypes }) => ({
12
12
  components: { PsToggle },
13
13
  template: `
14
14
  <PsToggle v-bind="$props" :selected.sync="selected" />
15
- `
15
+ `,
16
16
  })
17
17
 
18
18
  export const Default = Template.bind({})
19
19
  Default.args = {
20
20
  items: items,
21
- selected: selected
21
+ selected: selected,
22
22
  }
23
23
 
24
-
25
24
  /**
26
25
  * Hey Luciano!
27
26
  * Adicionei este script aqui pois não entendi como criar uma story com script em MDX ou algo que rode geral, saca?
@@ -29,18 +28,18 @@ Default.args = {
29
28
  * Se quiser dar uma melhorada nessa parte, fique a vontade meu chegado! TMJ
30
29
  */
31
30
  window.addEventListener('click', (ev) => {
32
- if(ev.target.classList.contains('click-to-copy')) {
31
+ if (ev.target.classList.contains('click-to-copy')) {
33
32
  copyText(ev.target.dataset.toCopy)
34
33
  }
35
34
  })
36
35
 
37
- function copyText(textToCopy) {
38
- var myTemporaryInputElement = document.createElement("input")
39
- myTemporaryInputElement.type = "text"
36
+ function copyText(textToCopy) {
37
+ var myTemporaryInputElement = document.createElement('input')
38
+ myTemporaryInputElement.type = 'text'
40
39
  myTemporaryInputElement.value = textToCopy
41
40
  document.body.appendChild(myTemporaryInputElement)
42
41
  myTemporaryInputElement.select()
43
- document.execCommand("Copy")
42
+ document.execCommand('Copy')
44
43
  document.body.removeChild(myTemporaryInputElement)
45
44
  alert('Item copied to clipboard!')
46
45
  }
@@ -13,8 +13,8 @@ const TemplateDialog = (args, {argTypes}) => ({
13
13
  components: {PsDialogTooltip},
14
14
  template: `
15
15
  <div style='display: flex; justify-content: flex-end;'>
16
- <PsDialogTooltip v-bind='$props'>
17
- <p>Trigger</p>
16
+ <PsDialogTooltip v-bind='$props'>
17
+ <p>Trigger</p>
18
18
  </PsDialogTooltip>
19
19
  <div>
20
20
  `,
@@ -29,7 +29,7 @@ const TemplateRich = (args,{argTypes})=>({
29
29
  template: `
30
30
  <div style='display: flex; justify-content: flex-end;'>
31
31
  <PsRichTooltip v-bind='$props'>
32
- <p>Trigger</p>
32
+ <p>Trigger</p>
33
33
  </PsRichTooltip>
34
34
  </div>
35
35
  `
@@ -89,8 +89,9 @@ Dialog.args = {
89
89
 
90
90
  export const Rich = TemplateRich.bind({})
91
91
  Rich.args = {
92
- type: 'red',
92
+ type: 'blue',
93
93
  title: 'This is a test!!',
94
+ text: 'Here goes your text',
94
95
  cssClass: 'psui-w-32'
95
96
  }
96
97
 
@@ -1,15 +1,15 @@
1
1
  export const randomString = (length) => {
2
- var result = ''
3
- var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
2
+ var result = ''
3
+ var characters =
4
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
4
5
  var charactersLength = characters.length
5
- for ( var i = 0; i < length; i++ ) {
6
- result += characters.charAt(Math.floor(Math.random() * charactersLength))
6
+ for (var i = 0; i < length; i++) {
7
+ result += characters.charAt(Math.floor(Math.random() * charactersLength))
7
8
  }
8
9
  return result
9
10
  }
10
11
 
11
12
  export const getParentScrollableEl = (node) => {
12
-
13
13
  if (node == null) {
14
14
  return null
15
15
  }
@@ -19,5 +19,4 @@ export const getParentScrollableEl = (node) => {
19
19
  } else {
20
20
  return getParentScrollableEl(node.parentNode)
21
21
  }
22
-
23
- }
22
+ }
@@ -34,7 +34,7 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
34
34
  var headers = xhr.getAllResponseHeaders()
35
35
  var mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
36
36
  if (mime && mime[1]) options.type = mime[1]
37
- var blob = new Blob([this.response], options)
37
+ var blob = new Blob([xhr.response], options)
38
38
  resolve(window.URL.createObjectURL(blob))
39
39
  }
40
40
  }
@@ -4,7 +4,7 @@ module.exports = {
4
4
  darkMode: false, // or 'media' or 'class'
5
5
  theme: {
6
6
  colors: {
7
- 'white': '#ffffff !important',
7
+ white: '#ffffff !important',
8
8
  'gray-10': '#F3F6F9',
9
9
  'gray-20': '#E6ECF2',
10
10
  'gray-30': '#D6DDE5',
@@ -14,42 +14,42 @@ module.exports = {
14
14
  'gray-70': '#34404A',
15
15
  'gray-80': '#28323B',
16
16
 
17
- 'blue': '#5094D3',
18
- 'blue-10':'#ECF7FB',
19
- 'blue-20':'#E0EFF6',
20
- 'blue-50':'#64B5CE',
21
- 'blue-60':'#318FAC',
22
- 'blue-70':'#00465F',
23
- 'blue-80':'#002A3A',
17
+ blue: '#5094D3',
18
+ 'blue-10': '#ECF7FB',
19
+ 'blue-20': '#E0EFF6',
20
+ 'blue-50': '#64B5CE',
21
+ 'blue-60': '#318FAC',
22
+ 'blue-70': '#00465F',
23
+ 'blue-80': '#002A3A',
24
24
 
25
- 'green-10':'#DEF8E8',
26
- 'green-20':'#5DB883',
27
- 'green-70':'#44A06A',
28
- 'green-80':'#286943',
25
+ 'green-10': '#DEF8E8',
26
+ 'green-20': '#5DB883',
27
+ 'green-70': '#44A06A',
28
+ 'green-80': '#286943',
29
29
 
30
- 'yellow-10':'#FDF3E3',
31
- 'yellow-20':'#EDAB3E',
32
- 'yellow-70':'#B87305',
33
- 'yellow-80':'#834C0D',
30
+ 'yellow-10': '#FDF3E3',
31
+ 'yellow-20': '#EDAB3E',
32
+ 'yellow-70': '#B87305',
33
+ 'yellow-80': '#834C0D',
34
34
 
35
- 'red-10':'#FCEBEB',
36
- 'red-20':'#D65C5A',
37
- 'red-70':'#AA3937',
38
- 'red-80':'#832F2E',
39
-
40
- 'sky': '#518BE2',
41
- 'teal': '#57C0BA',
42
- 'emerald': '#8CCA82',
43
- 'mustard': '#E9CF74',
44
- 'orange': '#FF906D',
45
- 'pink': '#FF77B8',
46
- 'purple': '#9278C9'
35
+ 'red-10': '#FCEBEB',
36
+ 'red-20': '#D65C5A',
37
+ 'red-70': '#AA3937',
38
+ 'red-80': '#832F2E',
39
+
40
+ sky: '#518BE2',
41
+ teal: '#57C0BA',
42
+ emerald: '#8CCA82',
43
+ mustard: '#E9CF74',
44
+ orange: '#FF906D',
45
+ pink: '#FF77B8',
46
+ purple: '#9278C9',
47
47
  },
48
48
  fontFamily: {
49
- 'sans': ['Lato'],
49
+ sans: ['Lato'],
50
50
  },
51
51
  fontSize: {
52
- big:['16px','130%'],
52
+ big: ['16px', '130%'],
53
53
  small: ['14px', '130%'],
54
54
  xsmall: ['12px', '130%'],
55
55
  accent: ['14px', '130%', { letterSpacing: '0.6px' }],
@@ -61,46 +61,68 @@ module.exports = {
61
61
  h4: ['20px', '120%'],
62
62
  h5: ['18px', '120%'],
63
63
  h6: ['17px', '120%'],
64
- },
64
+ },
65
65
  boxShadow: {
66
- 'elevation--5': '0px 1px 0px #FFFFFF, inset 0px 1px 2px rgba(0, 0, 0, 0.1)',
67
- 'elevation-5': '0px 0px 4px rgba(0, 0, 0, 0.03), 0px 1px 2px rgba(0, 0, 0, 0.1)',
68
- 'elevation-10': '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 2px 5px rgba(0, 0, 0, 0.08)',
69
- 'elevation-20': '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 5px 6px rgba(0, 0, 0, 0.1)',
70
- 'elevation-30': '0px 0px 8px rgba(0, 0, 0, 0.05), 0px 10px 15px rgba(0, 0, 0, 0.15)',
71
- 'elevation-40': '0px 0px 20px rgba(0, 0, 0, 0.05), 0px 30px 60px rgba(0, 0, 0, 0.2)',
66
+ 'elevation--5':
67
+ '0px 1px 0px #FFFFFF, inset 0px 1px 2px rgba(0, 0, 0, 0.1)',
68
+ 'elevation-5':
69
+ '0px 0px 4px rgba(0, 0, 0, 0.03), 0px 1px 2px rgba(0, 0, 0, 0.1)',
70
+ 'elevation-10':
71
+ '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 2px 5px rgba(0, 0, 0, 0.08)',
72
+ 'elevation-20':
73
+ '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 5px 6px rgba(0, 0, 0, 0.1)',
74
+ 'elevation-30':
75
+ '0px 0px 8px rgba(0, 0, 0, 0.05), 0px 10px 15px rgba(0, 0, 0, 0.15)',
76
+ 'elevation-40':
77
+ '0px 0px 20px rgba(0, 0, 0, 0.05), 0px 30px 60px rgba(0, 0, 0, 0.2)',
72
78
  sm: '0px 0px 4px rgba(0, 0, 0, 0.03), 0px 1px 2px rgba(0, 0, 0, 0.1)',
73
- default: '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 2px 5px rgba(0, 0, 0, 0.08)',
79
+ default:
80
+ '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 2px 5px rgba(0, 0, 0, 0.08)',
74
81
  md: '0px 0px 8px rgba(0, 0, 0, 0.04), 0px 5px 6px rgba(0, 0, 0, 0.1)',
75
82
  lg: '0px 0px 8px rgba(0, 0, 0, 0.05), 0px 10px 15px rgba(0, 0, 0, 0.15)',
76
83
  xl: '0px 0px 20px rgba(0, 0, 0, 0.05), 0px 30px 60px rgba(0, 0, 0, 0.2)',
77
84
  inner: '0px 1px 0px #FFFFFF, inset 0px 1px 2px rgba(0, 0, 0, 0.1)',
78
85
  none: 'none',
79
86
  },
80
- borderColor: theme => ({
87
+ borderColor: (theme) => ({
81
88
  ...theme('colors'),
82
89
  DEFAULT: theme('colors.blue-70', 'currentColor'),
83
90
  }),
84
- divideColor: theme => ({
91
+ divideColor: (theme) => ({
85
92
  ...theme('colors'),
86
93
  }),
87
94
  extend: {
88
95
  divideOpacity: {
89
- '10': '0.1',
90
- '20': '0.2',
91
- '95': '0.95',
92
- }
96
+ 10: '0.1',
97
+ 20: '0.2',
98
+ 95: '0.95',
99
+ },
93
100
  },
94
101
  },
95
102
  variants: {
96
103
  boxShadow: ['active'],
97
104
  borderRadius: ['last', 'first'],
98
- backgroundColor: ['responsive', 'hover', 'active', 'focus', 'group-hover', 'even', 'first', 'disabled'],
99
- textColor: ['responsive', 'hover', 'active', 'focus', 'group-hover', 'first', 'disabled'],
105
+ backgroundColor: [
106
+ 'responsive',
107
+ 'hover',
108
+ 'active',
109
+ 'focus',
110
+ 'group-hover',
111
+ 'even',
112
+ 'first',
113
+ 'disabled',
114
+ ],
115
+ textColor: [
116
+ 'responsive',
117
+ 'hover',
118
+ 'active',
119
+ 'focus',
120
+ 'group-hover',
121
+ 'first',
122
+ 'disabled',
123
+ ],
100
124
  borderColor: ['disabled'],
101
- extend: {
102
- },
125
+ extend: {},
103
126
  },
104
- plugins: [
105
- ],
127
+ plugins: [],
106
128
  }