@policystudio/policy-studio-ui-vue 1.0.31 → 1.0.34

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 (31) hide show
  1. package/.eslintrc.js +36 -35
  2. package/babel.config.js +1 -1
  3. package/dist/css/psui_styles.css +26 -8
  4. package/package.json +2 -1
  5. package/postcss.config.js +1 -1
  6. package/src/assets/images/multifamily-units.svg +10 -0
  7. package/src/assets/scss/components/PsChips.scss +4 -4
  8. package/src/assets/scss/components/PsDataTable.scss +17 -0
  9. package/src/assets/scss/components/PsDropdown.scss +6 -4
  10. package/src/assets/scss/components/PsDropdownList.scss +2 -2
  11. package/src/assets/scss/components/PsTooltip.scss +0 -1
  12. package/src/components/accordion/PsAccordionItem.vue +1 -1
  13. package/src/components/chips/PsChips.vue +10 -10
  14. package/src/components/controls/PsSwitch.vue +10 -13
  15. package/src/components/datatable/PsDataTable.vue +3 -1
  16. package/src/components/datatable/PsDataTableItem.vue +1 -1
  17. package/src/components/forms/PsDropdown.vue +58 -44
  18. package/src/components/forms/PsDropdownList.vue +1 -1
  19. package/src/components/forms/PsInputTextArea.vue +1 -1
  20. package/src/components/playground/PsScrollBar.vue +236 -3
  21. package/src/components/tabs/PsTabHeader.vue +13 -5
  22. package/src/components/tooltip/PsDialogTooltip.vue +11 -11
  23. package/src/components/tooltip/PsRichTooltip.vue +6 -6
  24. package/src/components/tooltip/PsTooltip.vue +8 -8
  25. package/src/components/ui/PsIcon.vue +14 -23
  26. package/src/stories/Chips.stories.js +6 -31
  27. package/src/stories/Dropdown.stories.js +73 -29
  28. package/src/stories/Icon.stories.js +21 -0
  29. package/src/stories/InlineSelector.stories.js +1 -1
  30. package/src/stories/Playground.stories.js +1 -1
  31. package/src/util/imageLoader.js +1 -1
package/.eslintrc.js CHANGED
@@ -15,41 +15,42 @@ module.exports = {
15
15
  'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16
16
  'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
17
17
  'semi': ['warn', 'never'],
18
- "vue/order-in-components": ["warn", {
19
- "order": [
20
- "el",
21
- "name",
22
- "key",
23
- "parent",
24
- ["components", "directives", "filters"],
25
- ["props", "propsData"],
26
- "functional",
27
- ["delimiters", "comments"],
28
- "extends",
29
- "mixins",
30
- ["provide", "inject"],
31
- "ROUTER_GUARDS",
32
- "layout",
33
- "middleware",
34
- "validate",
35
- "scrollToTop",
36
- "transition",
37
- "loading",
38
- "inheritAttrs",
39
- "model",
40
- "emits",
41
- "setup",
42
- "asyncData",
43
- "data",
44
- "fetch",
45
- "head",
46
- "computed",
47
- "watch",
48
- "watchQuery",
49
- "LIFECYCLE_HOOKS",
50
- "methods",
51
- ["template", "render"],
52
- "renderError"
18
+ 'quotes': [2, 'single'],
19
+ 'vue/order-in-components': ['warn', {
20
+ 'order': [
21
+ 'el',
22
+ 'name',
23
+ 'key',
24
+ 'parent',
25
+ ['components', 'directives', 'filters'],
26
+ ['props', 'propsData'],
27
+ 'functional',
28
+ ['delimiters', 'comments'],
29
+ 'extends',
30
+ 'mixins',
31
+ ['provide', 'inject'],
32
+ 'ROUTER_GUARDS',
33
+ 'layout',
34
+ 'middleware',
35
+ 'validate',
36
+ 'scrollToTop',
37
+ 'transition',
38
+ 'loading',
39
+ 'inheritAttrs',
40
+ 'model',
41
+ 'emits',
42
+ 'setup',
43
+ 'asyncData',
44
+ 'data',
45
+ 'fetch',
46
+ 'head',
47
+ 'computed',
48
+ 'watch',
49
+ 'watchQuery',
50
+ 'LIFECYCLE_HOOKS',
51
+ 'methods',
52
+ ['template', 'render'],
53
+ 'renderError'
53
54
  ]
54
55
  }]
55
56
  },
package/babel.config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- presets: ["@vue/cli-plugin-babel/preset"],
2
+ presets: ['@vue/cli-plugin-babel/preset'],
3
3
  }
@@ -17618,7 +17618,6 @@ html {
17618
17618
  transition-duration: 300ms;
17619
17619
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
17620
17620
  transition-delay: 0.4s;
17621
- min-width: 256px;
17622
17621
  }
17623
17622
 
17624
17623
  .psui-el-tooltip .psui-el-tooltip-wrapper .psui-el-tooltip-dialog .psui-el-tooltip-content {
@@ -18189,6 +18188,8 @@ html {
18189
18188
  .psui-el-dropdown-menu-list {
18190
18189
  width: 100%;
18191
18190
  font-weight: 700;
18191
+ margin-top: 0.75rem;
18192
+ margin-bottom: 0.75rem;
18192
18193
  }
18193
18194
 
18194
18195
  .psui-el-dropdown-menu-list li {
@@ -18209,7 +18210,10 @@ html {
18209
18210
  .psui-el-dropdown-menu-list li:hover {
18210
18211
  --text-opacity: 1;
18211
18212
  color: #318FAC;
18212
- color: rgba(49, 143, 172, var(--text-opacity))
18213
+ color: rgba(49, 143, 172, var(--text-opacity));
18214
+ --bg-opacity: 1;
18215
+ background-color: #ECF7FB;
18216
+ background-color: rgba(236, 247, 251, var(--bg-opacity));
18213
18217
  }
18214
18218
 
18215
18219
  .psui-el-dropdown-menu-list li span {
@@ -18244,8 +18248,6 @@ html {
18244
18248
  .psui-el-dropdown-menu-dialog-wrapper {
18245
18249
  display: none;
18246
18250
  transform-origin: top right;
18247
- padding-top: 1rem;
18248
- padding-bottom: 1rem;
18249
18251
  background-color: #ffffff;
18250
18252
  position: fixed;
18251
18253
  width: auto;
@@ -18895,6 +18897,19 @@ html {
18895
18897
  border-bottom: 0;
18896
18898
  }
18897
18899
 
18900
+ .psui-el-table-rich thead th {
18901
+ padding: 15px 16px;
18902
+ }
18903
+
18904
+ .psui-el-table-rich tbody th,
18905
+ .psui-el-table-rich tbody td,
18906
+ .psui-el-table-rich tbody tr {
18907
+ padding: 7px 16px;
18908
+ --text-opacity: 1;
18909
+ color: #28323B;
18910
+ color: rgba(40, 50, 59, var(--text-opacity));
18911
+ }
18912
+
18898
18913
  .psui-el-highlight-ripple-icon {
18899
18914
  position: static;
18900
18915
  box-sizing: border-box;
@@ -19438,7 +19453,9 @@ html {
19438
19453
  --text-opacity: 1;
19439
19454
  color: #798490;
19440
19455
  color: rgba(121, 132, 144, var(--text-opacity));
19441
- background-color: #ffffff;
19456
+ --bg-opacity: 1;
19457
+ background-color: #F3F6F9;
19458
+ background-color: rgba(243, 246, 249, var(--bg-opacity));
19442
19459
  transition-property: all;
19443
19460
  cursor: pointer;
19444
19461
  border-radius: 0.25rem;
@@ -19462,6 +19479,9 @@ html {
19462
19479
  --text-opacity: 1;
19463
19480
  color: #318FAC;
19464
19481
  color: rgba(49, 143, 172, var(--text-opacity));
19482
+ --bg-opacity: 1;
19483
+ background-color: #F3F6F9;
19484
+ background-color: rgba(243, 246, 249, var(--bg-opacity));
19465
19485
  }
19466
19486
 
19467
19487
  .psui-el-chips.type-checkbox label:hover:before, .psui-el-chips.type-radio label:hover:before {
@@ -19493,9 +19513,6 @@ html {
19493
19513
  --text-opacity: 1;
19494
19514
  color: #515E6A;
19495
19515
  color: rgba(81, 94, 106, var(--text-opacity));
19496
- --bg-opacity: 1;
19497
- background-color: #F3F6F9;
19498
- background-color: rgba(243, 246, 249, var(--bg-opacity));
19499
19516
  transition-property: all;
19500
19517
  cursor: pointer;
19501
19518
  border-radius: 0.25rem;
@@ -19505,6 +19522,7 @@ html {
19505
19522
  padding-right: 0.75rem;
19506
19523
  font-size: 14px;
19507
19524
  line-height: 130%;
19525
+ background-color: #F6F7F8;
19508
19526
  }
19509
19527
 
19510
19528
  .psui-el-chips.type-button label:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.0.31",
3
+ "version": "1.0.34",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -17,6 +17,7 @@
17
17
  "build-temp-tailwind": "postcss src/assets/scss/base.scss -o temp/css/psui_styles.css",
18
18
  "publish": "npm run lint && npm run build-tailwind && build-storybook && npm publish",
19
19
  "serve": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-tailwind\"",
20
+ "serve-prod": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-prod-tailwind\"",
20
21
  "watch-storybook": "start-storybook -p 6006",
21
22
  "watch-prod-tailwind": "watch 'npm run build-tailwind' ./src/assets",
22
23
  "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets",
package/postcss.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  plugins: {
3
3
  'postcss-nested': {},
4
- "postcss-import": {},
4
+ 'postcss-import': {},
5
5
  tailwindcss: {},
6
6
  autoprefixer: {},
7
7
  },
@@ -0,0 +1,10 @@
1
+ <svg width="39" height="38" viewBox="0 0 39 38" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0)">
3
+ <path d="M18.2274 34.9462V30.9159M18.2274 34.9462H3.12439V30.9159H4.56681M18.2274 34.9462H21.1123H23.8274M34.3911 10.2129V34.9462H31.3789H28.6214M34.3911 10.2129L35.7911 10.8068V7.74167L18.2274 1.61667V4.27349M34.3911 10.2129L18.2274 4.27349M16.2759 11.6129L4.56681 16.7498M18.2274 7.74167L3.12439 14.6833V17.3826L4.56681 16.7498M18.2274 7.74167V30.9159M18.2274 7.74167V4.27349M8.34257 30.9159V25.7826H14.4941V30.9159M8.34257 30.9159H14.4941M8.34257 30.9159H4.56681M14.4941 30.9159H18.2274M4.56681 30.9159V16.7498M23.8274 34.9462V27.3947H28.6214V34.9462M23.8274 34.9462H28.6214M8.34257 18.825L12.5001 17.0432H14.4941V22.4735H8.34257V18.825ZM21.1123 18.4432H24.5062V23.7886H21.1123V18.4432ZM27.985 18.4432H31.3789V23.7886H27.985V18.4432ZM21.1123 15.1341H24.5062V9.70379L21.1123 8.34621V15.1341ZM27.985 15.1341H31.3789V12.1644L27.985 10.8068V15.1341Z" stroke="#A9AEB0" stroke-width="1.4" stroke-linejoin="round"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0">
7
+ <rect width="37.3333" height="37.3333" fill="white" transform="translate(0.791016 0.333344)"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  label {
31
- @apply psui-flex psui-items-center psui-justify-center psui-text-gray-50 psui-bg-white psui-transition-all psui-cursor-pointer psui-rounded;
31
+ @apply psui-flex psui-items-center psui-justify-center psui-text-gray-50 psui-bg-gray-10 psui-transition-all psui-cursor-pointer psui-rounded;
32
32
  padding: 4px 8px 4px 6px;
33
33
 
34
34
  &:before {
@@ -40,7 +40,7 @@
40
40
  }
41
41
 
42
42
  &:hover {
43
- @apply psui-text-blue-60;
43
+ @apply psui-text-blue-60 psui-bg-gray-10;
44
44
  &:before {
45
45
  @apply psui-text-blue-50;
46
46
  }
@@ -83,8 +83,8 @@
83
83
 
84
84
  &.type-button {
85
85
  label {
86
- @apply psui-flex psui-items-center psui-justify-center psui-text-gray-60 psui-bg-gray-10 psui-transition-all psui-cursor-pointer psui-rounded psui-py-1 psui-px-3 psui-text-small;
87
-
86
+ @apply psui-flex psui-items-center psui-justify-center psui-text-gray-60 psui-transition-all psui-cursor-pointer psui-rounded psui-py-1 psui-px-3 psui-text-small;
87
+ background-color: #F6F7F8;
88
88
  &:hover {
89
89
  @apply psui-text-blue-60 psui-bg-white;
90
90
  }
@@ -45,6 +45,23 @@
45
45
  border-bottom: 0;
46
46
  }
47
47
  }
48
+
49
+ &-rich {
50
+ thead {
51
+ th {
52
+ padding: 15px 16px;
53
+ }
54
+ }
55
+
56
+ tbody {
57
+ th,
58
+ td,
59
+ tr {
60
+ padding: 7px 16px;
61
+ @apply .psui-text-gray-80;
62
+ }
63
+ }
64
+ }
48
65
  }
49
66
 
50
67
  }
@@ -1,7 +1,7 @@
1
1
  @layer components {
2
2
  .psui-el-dropdown-menu {
3
3
  @apply psui-relative psui-inline-block psui-text-left;
4
-
4
+
5
5
  button {
6
6
  @apply psui-inline-flex psui-justify-center psui-items-center psui-w-full psui-font-medium psui-leading-none;
7
7
  background-color: transparent;
@@ -9,6 +9,7 @@
9
9
  padding-bottom: 2.5px;
10
10
  min-height: 27px;
11
11
  font-size: 0.875rem;
12
+
12
13
 
13
14
  &:focus {
14
15
  outline: none;
@@ -17,10 +18,11 @@
17
18
  }
18
19
 
19
20
  &-dialog-wrapper {
20
- @apply psui-hidden psui-origin-top-right psui-py-4 psui-bg-white psui-fixed psui-w-auto psui-rounded-md psui-z-50 psui-opacity-0 psui-shadow-elevation-20 psui-transition-all psui-duration-100 psui-ease-in;
21
-
21
+ @apply psui-hidden psui-origin-top-right psui-bg-white psui-fixed psui-w-auto psui-rounded-md psui-z-50 psui-opacity-0 psui-shadow-elevation-20 psui-transition-all psui-duration-100 psui-ease-in;
22
+
22
23
  &-dialog {
23
- @apply w-full;
24
+ @apply psui-w-full;
25
+
24
26
  }
25
27
  }
26
28
  }
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .psui-el-dropdown-menu-list {
3
- @apply psui-w-full psui-font-bold;
3
+ @apply psui-w-full psui-font-bold psui-my-3;
4
4
 
5
5
  li {
6
6
  @apply psui-w-full psui-text-gray-60 psui-text-small psui-list-none psui-flex psui-flex-col psui-cursor-pointer;
@@ -8,7 +8,7 @@
8
8
  font-weight: 700;
9
9
 
10
10
  &:hover {
11
- @apply psui-text-blue-60
11
+ @apply psui-text-blue-60 psui-bg-blue-10;
12
12
  }
13
13
 
14
14
  span {
@@ -7,7 +7,6 @@
7
7
  .psui-el-tooltip-dialog {
8
8
  @apply psui-fixed psui-opacity-0 psui-transition-opacity psui-duration-300 psui-ease-in-out;
9
9
  transition-delay: 0.4s;
10
- min-width: 256px;
11
10
 
12
11
  .psui-el-tooltip-content {
13
12
  @apply psui-flex psui-flex-col psui-bg-gray-50 psui-text-white;
@@ -21,7 +21,7 @@
21
21
  <script>
22
22
  import { getParentVueComponentByName } from '../../util/GeneralFunctions'
23
23
  export default {
24
- name: "PsAccordionItem",
24
+ name: 'PsAccordionItem',
25
25
  props: {
26
26
  /**
27
27
  * It sets the title of the accordion item.
@@ -31,17 +31,17 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- export const type = ["radio", "checkbox", "button"]
34
+ export const type = ['radio', 'checkbox', 'button']
35
35
 
36
36
  export default {
37
- name: "PsChips",
37
+ name: 'PsChips',
38
38
  props: {
39
39
  /**
40
40
  * It sets the label of the chips button.
41
41
  */
42
42
  label: {
43
43
  type: String,
44
- default: "",
44
+ default: '',
45
45
  },
46
46
  /**
47
47
  * It sets the type of the chips button. eg: radio, checkbox, button.
@@ -50,7 +50,7 @@ export default {
50
50
  type: String,
51
51
  required: true,
52
52
  default: 'button',
53
- validator: (type) => ["radio", "checkbox", "button"].includes(type)
53
+ validator: (type) => ['radio', 'checkbox', 'button'].includes(type)
54
54
  },
55
55
  /**
56
56
  * It sets the layout of the chipsbutton. eg: simple, with-icon, rich.
@@ -65,7 +65,7 @@ export default {
65
65
  */
66
66
  icon: {
67
67
  type: String,
68
- default: "",
68
+ default: '',
69
69
  },
70
70
  /**
71
71
  * It sets if the button was checked or not checked.
@@ -89,7 +89,7 @@ export default {
89
89
  default: false
90
90
  },
91
91
  },
92
- emits: ["click", "change"],
92
+ emits: ['click', 'change'],
93
93
  data() {
94
94
  return {
95
95
  isChecked: false,
@@ -107,7 +107,7 @@ export default {
107
107
  let cssClass = ''
108
108
 
109
109
  if (this.checked === true ) {
110
- cssClass = "psui-text-blue-50 psui-bg-blue-20"
110
+ cssClass = 'psui-text-blue-50 psui-bg-blue-20'
111
111
  }
112
112
 
113
113
  return cssClass
@@ -116,15 +116,15 @@ export default {
116
116
  methods: {
117
117
  onClick() {
118
118
  this.isChecked = !this.isChecked
119
- this.$emit("click")
119
+ this.$emit('click')
120
120
  },
121
121
  onChange(event) {
122
122
  this.isChecked = event.target.checked
123
123
  this.$emit('update:checked', event.target.checked)
124
- this.$emit("change", event)
124
+ this.$emit('change', event)
125
125
  },
126
126
  onClose() {
127
- this.$emit("close")
127
+ this.$emit('close')
128
128
  },
129
129
  },
130
130
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div class='psui-el-switch' :class="getComponentClass">
3
- <input type="checkbox" :id='label' v-model="getValue">
4
- <label :for="label" class='psui-el-switch-button' :class="getToggleClass" />
2
+ <div class='psui-el-switch' :class="getComponentClass" @click="change()">
3
+ <input type="checkbox" :checked="value" />
4
+ <label class='psui-el-switch-button' :class="[getToggleClass]" />
5
5
  </div>
6
6
  </template>
7
7
 
@@ -34,21 +34,18 @@ export default {
34
34
  },
35
35
  computed:{
36
36
  getToggleClass(){
37
- return `toggle-${this.value.toString()}`
37
+ return this.value ? 'toggle-true' : 'toggle-false'
38
38
  },
39
39
  getComponentClass(){
40
40
  return `size-${this.size}`
41
- },
42
- getValue:{
43
- get(){
44
- return this.value
45
- },
46
- set(value){
47
- this.$emit('input', value)
48
- this.$emit('change', value)
49
- }
50
41
  }
51
42
  },
43
+ methods: {
44
+ change() {
45
+ this.$emit('update:value', !this.value)
46
+ this.$emit('change', !this.value)
47
+ }
48
+ }
52
49
  }
53
50
  </script>
54
51
 
@@ -57,7 +57,9 @@ export default {
57
57
  */
58
58
  data: {
59
59
  type: Array,
60
- required: true
60
+ default() {
61
+ return []
62
+ }
61
63
  },
62
64
  /**
63
65
  * It sets the values which will be use to render the footer.
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script>
38
38
  export default {
39
- name: "PsDataTableItem",
39
+ name: 'PsDataTableItem',
40
40
  props: {
41
41
  data: {
42
42
  type: Array,