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

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 (50) hide show
  1. package/.storybook/main.js +9 -1
  2. package/dist/css/psui_styles.css +15690 -14620
  3. package/package.json +8 -3
  4. package/postcss.config.js +2 -0
  5. package/src/assets/scss/base.scss +10 -3
  6. package/src/assets/scss/components/PsAccordion.scss +63 -0
  7. package/src/assets/scss/components/PsButton.scss +145 -0
  8. package/src/assets/scss/components/PsInput.scss +104 -0
  9. package/src/components/accordion/PsAccordion.vue +30 -29
  10. package/src/components/accordion/PsAccordionItem.vue +29 -67
  11. package/src/components/badges-and-tags/PsCardInfos.vue +38 -0
  12. package/src/components/badges-and-tags/PsChartLegend.vue +43 -0
  13. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
  14. package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
  15. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
  16. package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
  17. package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
  18. package/src/components/buttons/PsButton.vue +42 -94
  19. package/src/components/chips/PsChips.vue +10 -20
  20. package/src/components/controls/PsCheckbox.vue +29 -16
  21. package/src/components/controls/PsDraggable.vue +171 -25
  22. package/src/components/controls/PsRadioButton.vue +25 -19
  23. package/src/components/controls/PsToggle.vue +1 -1
  24. package/src/components/forms/PsInput.vue +122 -102
  25. package/src/components/notifications/PsDialog.vue +37 -18
  26. package/src/components/tabs/PsTabHeader.vue +3 -2
  27. package/src/components/tooltip/PsRichTooltip.vue +6 -0
  28. package/src/components/tooltip/PsTooltip.vue +1 -3
  29. package/src/index.js +15 -9
  30. package/src/stories/Accordion.stories.js +88 -28
  31. package/src/stories/Button.stories.js +83 -35
  32. package/src/stories/CardInfos.stories.js +16 -0
  33. package/src/stories/ChartLegend.stories.js +16 -0
  34. package/src/stories/Chips.stories.js +7 -1
  35. package/src/stories/ClimateZoneBadge.stories.js +24 -0
  36. package/src/stories/Colors.stories.mdx +1 -1
  37. package/src/stories/CostEffectBar.stories.js +23 -0
  38. package/src/stories/Dialog.stories.js +141 -8
  39. package/src/stories/Draggable.stories.js +4 -6
  40. package/src/stories/Dropdown.stories.js +3 -5
  41. package/src/stories/HighlightRippleDot.stories.js +16 -0
  42. package/src/stories/Input.stories.js +61 -9
  43. package/src/stories/MiniTag.stories.js +46 -0
  44. package/src/stories/ProgressBar.stories.js +23 -0
  45. package/src/stories/RadioButton.stories.js +2 -2
  46. package/src/stories/Toggle.stories.js +7 -8
  47. package/src/stories/Tooltip.stories.js +5 -4
  48. package/src/util/GeneralFunctions.js +6 -7
  49. package/src/util/imageLoader.js +1 -1
  50. package/tailwind.config.js +71 -48
@@ -1,38 +1,184 @@
1
1
  <template>
2
- <div>
3
- <div>
4
- <div class="psui-bg-gray-20 psui-rounded-lg psui-mb-4">
5
- <div class="psui-flex psui-justify-between psui-items-center psui-p-2">
6
- <h2 class="psui-text-gray-80 psui-font-bold psui-leading-4">Cost Effectiveness</h2>
7
- <i class="material-icons-round psui-text-gray-40" >drag_indicator</i>
8
- </div>
9
- </div>
10
- <div>
11
- <div class="psui-flex psui-flex-col psui-bg-gray-20 psui-rounded-lg psui-mb-4">
12
- <div class="psui-flex psui-justify-between psui-items-center psui-p-2">
13
- <h2 class="psui-text-gray-80 psui-font-bold psui-leading-4">Per Home Results</h2>
14
- <i class="material-icons-round psui-text-gray-40">drag_indicator</i>
15
- </div>
16
- <slot>
17
- </slot>
18
- </div>
2
+ <div class="psui-w-full psui-my-4 psui-pr-4 psui-flex psui-flex-wrap psui-justify-start psui-mb-20">
3
+ <div class="psui-w-full psui-mb-4 psui-rounded-lg psui-bg-gray-30 psui-p-2"
4
+ v-for="(columnGroup, indexColumnGroup) in getColumns.columnGroups"
5
+ :key="indexColumnGroup"
6
+ :class="{ 'is-dragging-out' : indexColumnGroup == isDraggingOverGroup}"
7
+ >
8
+ <!-- COLUMN GROUP -->
9
+ <div
10
+ class="psui-w-full psui-flex psui-justify-between psui-mb-2 psui-rounded-sm psui-items-center psui-px-2 app-draggable-list-item"
11
+ draggable="true"
12
+ @dragstart="dragStartGroup({ indexColumnGroup })"
13
+ @dragover="dragOverGroup({ indexColumnGroup })"
14
+ @dragend="dragEndGroup"
15
+ >
16
+ <h2 class="psui-w-full psui-text-gray-80 psui-font-bold psui-pl-4 psui-py-2">{{columnGroup.title}}</h2>
17
+ <i class='material-icons-round psui-text-gray-40 psui-pr-1 psui-py-2'>drag_indicator</i>
18
+ </div>
19
+
20
+ <div class="psui-w-full psui-flex psui-flex-wrap">
21
+ <!-- COLUMNS -->
22
+ <div class="psui-w-full psui-mb-2 app-draggable-list-item"
23
+ v-for="(column, indexColumn) in columnGroup.columns"
24
+ :key="`edit-columns-column-${indexColumnGroup}-${indexColumn}`"
25
+ :id="`edit-columns-column-${indexColumnGroup}-${indexColumn}`"
26
+ >
27
+ <div class="psui-select-none psui-w-full psui-py-2 psui-px-3 psui-rounded-sm psui-flex psui-items-center psui-bg-white"
28
+ draggable="true"
29
+ @dragstart="dragStartColumn({ indexColumnGroup, indexColumn })"
30
+ @dragover="dragOverColumn({ indexColumnGroup, indexColumn })"
31
+ @dragend="dragEndColumn"
32
+ :class="{ 'is-dragging-out' : checkColumnIsDragOver({ indexColumnGroup, indexColumn }) }"
33
+ >
34
+ <PsCheckbox :inputValue='column' :label='column' @change="toggleColumnIsActive({ studyKey: getColumns.key, indexColumnGroup, indexColumn, columnGroupKey: columnGroup.key})">
35
+ </PsCheckbox>
36
+
37
+ <!-- <Checkbox
38
+ class="psui-whitespace-no-wrap"
39
+ :label="column.title"
40
+ :value="column.isActive"
41
+ @change="toggleColumnIsActive({ studyKey: getColumns.key, indexColumnGroup, indexColumn, columnGroupKey: columnGroup.key})"
42
+ ></Checkbox> -->
43
+ <div class="psui-w-full psui-flex psui-justify-end">
44
+ <i class='material-icons-round psui-text-gray-30'>drag_indicator</i>
19
45
  </div>
46
+ </div>
47
+ </div>
20
48
  </div>
49
+ </div>
21
50
  </div>
22
51
  </template>
23
52
 
24
53
  <script>
54
+ import PsCheckbox from './PsCheckbox.vue'
55
+
25
56
  export default {
26
- name: 'PsDraggable',
27
- props:{
28
- data: {
29
- type: Array,
30
- required: true,
31
- }
57
+ name: 'DragAndDropEditColumnsList',
58
+ components: { PsCheckbox},
59
+ props: ['getColumns', 'module'],
60
+ data() {
61
+ return {
62
+ // Column
63
+ isDraggingColumnGroup: -1,
64
+ isDraggingOverColumn: -1,
65
+ isDraggingColumn: -1,
66
+
67
+ // Group
68
+ isDraggingGroup: -1,
69
+ isDraggingOverGroup: -1,
70
+ }
71
+ },
72
+
73
+ computed: {
74
+ getColumnsStateKey() {
75
+ return `${this.module}Columns`
76
+ },
77
+ getMoveColumnStoreMutationName() {
78
+ return `${this.module}/moveColumnItem`
79
+ },
80
+ getMoveColumnGroupStoreMutationName() {
81
+ return `${this.module}/moveColumnGroup`
82
+ },
83
+ getToggleColumnIsActiveStoreMutationName() {
84
+ return `${this.module}/toggleColumnIsActive`
85
+ }
86
+
87
+ },
88
+
89
+ methods: {
90
+ toggleColumnIsActive({ studyKey, indexColumnGroup, indexColumn, columnGroupKey }) {
91
+ this.$store.commit(this.getToggleColumnIsActiveStoreMutationName, { columnsStateKey: this.getColumnsStateKey, studyKey, indexColumnGroup, indexColumn, columnGroupKey })
92
+ },
93
+
94
+ /**
95
+ * Drag and drop COLUMN
96
+ */
97
+ dragStartColumn({ indexColumnGroup, indexColumn }) {
98
+ this.isDraggingColumn = indexColumn
99
+ this.isDraggingColumnGroup = indexColumnGroup
100
+ },
101
+ dragEndColumn() {
102
+ this.moveItemColumn({
103
+ studyKey: this.getColumns.key,
104
+ indexColumnGroup: this.isDraggingColumnGroup,
105
+ from: this.isDraggingColumn,
106
+ to: this.isDraggingOverColumn
107
+ })
108
+ this.dragLeaveColumn()
109
+ this.dragLeaveGroup()
110
+ },
111
+ dragOverColumn({ indexColumnGroup, indexColumn }) {
112
+ if(this.isDraggingColumnGroup != indexColumnGroup) return
113
+ this.isDraggingOverColumn = indexColumn
114
+ },
115
+ checkColumnIsDragOver({indexColumnGroup, indexColumn }) {
116
+ return (this.isDraggingColumnGroup == indexColumnGroup && this.isDraggingOverColumn == indexColumn)
117
+ },
118
+ dragLeaveColumn() {
119
+ this.isDraggingColumn = -1
120
+ this.isDraggingColumnGroup = -1
121
+ this.isDraggingOverColumn = -1
122
+ },
123
+ moveItemColumn({ studyKey, indexColumnGroup, from, to}) {
124
+ this.$store.commit(this.getMoveColumnStoreMutationName, {
125
+ columnsStateKey: this.getColumnsStateKey,
126
+ studyKey,
127
+ indexColumnGroup,
128
+ from,
129
+ to
130
+ })
131
+ this.blinkColumns({ indexColumnGroup, to })
132
+ this.dragLeaveColumn()
133
+ },
134
+
135
+ blinkColumns({ indexColumnGroup, to }) {
136
+ const colToBlink = document.getElementById(`edit-columns-column-${indexColumnGroup}-${to}`)
137
+ if(colToBlink) {
138
+ colToBlink.classList.add('blink')
139
+ setTimeout(() => colToBlink.classList.remove('blink'), 800)
140
+ }
141
+ },
142
+
143
+ /**
144
+ * Drag and drop GROUP
145
+ */
146
+ dragStartGroup({ indexColumnGroup }) {
147
+ this.isDraggingGroup = indexColumnGroup
148
+ },
149
+ dragEndGroup() {
150
+ this.moveItemGroup({
151
+ studyKey: this.getColumns.key,
152
+ from: this.isDraggingGroup,
153
+ to: this.isDraggingOverGroup
154
+ })
155
+ this.dragLeaveGroup()
156
+ },
157
+ dragOverGroup({ indexColumnGroup }) {
158
+ if(this.isDraggingGroup < 0) return
159
+ this.isDraggingOverGroup = indexColumnGroup
160
+ },
161
+ dragLeaveGroup() {
162
+ this.isDraggingGroup = -1
163
+ this.isDraggingOverGroup = -1
164
+ },
165
+ moveItemGroup({ studyKey, from, to}) {
166
+ this.$store.commit(this.getMoveColumnGroupStoreMutationName, {
167
+ columnsStateKey: this.getColumnsStateKey,
168
+ studyKey,
169
+ from,to
170
+ })
32
171
  }
172
+
173
+ }
33
174
  }
34
175
  </script>
176
+ <style scoped>
177
+ .app-draggable-list-item {
178
+ cursor: grab;
179
+ }
35
180
 
36
- <style>
37
-
181
+ .app-draggable-list-item label {
182
+ margin-bottom: 0;
183
+ }
38
184
  </style>
@@ -1,9 +1,15 @@
1
1
  <template>
2
2
  <label class="wrapper flex items-center">
3
3
  {{ label }}
4
- <input class="checkbox" type="radio" :checked="isChecked" :value="value" @change="$emit('change', $event.target.value)" />
5
- <span class="checkmark" :class="{ 'checkmark-small' : small }"></span>
6
- </label>
4
+ <input
5
+ class="checkbox"
6
+ type="radio"
7
+ :checked="isChecked"
8
+ :value="value"
9
+ @change="$emit('change', $event.target.value)"
10
+ />
11
+ <span class="checkmark" :class="{ 'checkmark-small': small }"></span>
12
+ </label>
7
13
  </template>
8
14
 
9
15
  <script>
@@ -11,31 +17,31 @@ export default {
11
17
  name: 'PsRadioButton',
12
18
  props: {
13
19
  label: {
14
- type: String,
15
- default: "",
16
- required:true
20
+ type: String,
21
+ default: '',
22
+ required: true,
17
23
  },
18
24
  modelValue: {
19
- default: ""
25
+ default: '',
20
26
  },
21
27
  value: {
22
28
  type: String,
23
- default: undefined
29
+ default: undefined,
24
30
  },
25
31
  small: {
26
32
  type: Boolean,
27
- default: false
28
- }
33
+ default: false,
34
+ },
29
35
  },
30
36
  model: {
31
37
  prop: 'modelValue',
32
- event: 'change'
38
+ event: 'change',
33
39
  },
34
40
  computed: {
35
41
  isChecked() {
36
42
  return this.modelValue == this.value
37
- }
38
- }
43
+ },
44
+ },
39
45
  }
40
46
  </script>
41
47
 
@@ -65,7 +71,7 @@ export default {
65
71
  width: 24px;
66
72
  border-radius: 50%;
67
73
  background-color: white;
68
- border: 2px solid #A2ACB7;
74
+ border: 2px solid #a2acb7;
69
75
  }
70
76
  .checkmark-small {
71
77
  top: 3px;
@@ -74,11 +80,11 @@ export default {
74
80
  }
75
81
  .wrapper input:checked ~ .checkmark {
76
82
  background-color: white;
77
- border-color: #64B5CE;
83
+ border-color: #64b5ce;
78
84
  border-width: 2px;
79
85
  }
80
86
  .checkmark:after {
81
- content: "";
87
+ content: '';
82
88
  position: absolute;
83
89
  display: none;
84
90
  }
@@ -91,7 +97,7 @@ export default {
91
97
  width: 12px;
92
98
  height: 12px;
93
99
  border-radius: 50%;
94
- background: #64B5CE;
100
+ background: #64b5ce;
95
101
  }
96
102
  .wrapper .checkmark-small:after {
97
103
  top: 3px;
@@ -99,6 +105,6 @@ export default {
99
105
  width: 8px;
100
106
  height: 8px;
101
107
  border-radius: 50%;
102
- background: #64B5CE;
108
+ background: #64b5ce;
103
109
  }
104
- </style>
110
+ </style>
@@ -32,7 +32,7 @@ export default {
32
32
  }
33
33
  </script>
34
34
 
35
- <style>
35
+ <style scoped>
36
36
  .wrapper {
37
37
  padding: 2px;
38
38
  }
@@ -1,102 +1,122 @@
1
- <template>
2
- <div>
3
- <div v-if="label" class="psui-font-bold psui-text-gray-80">{{ label }}</div>
4
- <div class="psui-relative">
5
- <div class="psui-absolute psui-inset-y-0 psui-left-0 psui-pl-2 psui-flex psui-items-center psui-pointer-events-none" v-if="this.$slots.prepend">
6
- <slot name="prepend"></slot>
7
- </div>
8
- <input
9
- :type="type"
10
- :placeholder="placeholder"
11
- :disabled="disabled"
12
- :aria-required="required"
13
- :aria-invalid="validation.hasError"
14
- :class="[getInputClasses, { 'psui-border-red' : validation.hasError }]"
15
- :required="required"
16
- :value="value"
17
- @focus="$emit('focus', $event)"
18
- @blur="$emit('blur', $event)"
19
- @input="$emit('input', $event)"
20
- @keydown.enter="$emit('keydown', $event)"
21
- @change="$emit('change', $event)"
22
- v-bind="getAttrs"
23
- />
24
- <div class="psui-absolute psui-inset-y-0 psui-right-0 psui-pr-2 psui-flex psui-items-center" v-if="this.$slots.append">
25
- <slot name="append"></slot>
26
- </div>
27
- </div>
28
- <div v-if="hint && !validation.hasError" class="psui-text-gray-50 psui-text-xsmall">{{ hint }}</div>
29
- <div v-if="validation.hasError && validation.label" class="psui-text-red psui-text-xsmall">{{ validation.label }}</div>
30
- </div>
31
- </template>
32
-
33
- <script>
34
- export default {
35
- name: 'PsInput',
36
- props: {
37
- type: {
38
- type: String,
39
- default: 'text'
40
- },
41
- required: {
42
- type: Boolean
43
- },
44
- placeholder: {
45
- type: String
46
- },
47
- label: {
48
- type: String
49
- },
50
- hint: {
51
- type: String
52
- },
53
- disabled: {
54
- type: Boolean,
55
- default: false
56
- },
57
- mini: {
58
- type: Boolean,
59
- default: false
60
- },
61
- validation: {
62
- type: Object,
63
- default: () => {
64
- return { hasError: false, checked: false, filled: false, required: false }
65
- }
66
- },
67
- value: {
68
- required: true,
69
- },
70
- },
71
- computed: {
72
- getInputClasses() {
73
- return `${this.getPadding} ${this.getText} psui-text-gray-60 psui-w-full psui-border psui-border-gray-30 psui-rounded-md psui-block hover:psui-border-blue-50 focus:psui-border-blue-50 ${this.getState}`
74
- },
75
- getText() {
76
- return this.mini ? 'psui-text-small' : ''
77
- },
78
- getPadding() {
79
- return this.mini ? 'psui-px-2 mini-p' : 'psui-py-2 psui-px-4'
80
- },
81
- getState() {
82
- return this.disabled ? 'disabled:psui-bg-gray-20' : 'psui-bg-white'
83
- },
84
- getAttrs() {
85
- const defaultAttrs = {
86
- autocapitalize: 'sentences',
87
- autocomplete: 'chrome-off',
88
- autocorrect: 'off',
89
- spellcheck: 'spellcheck'
90
- }
91
- return { ...defaultAttrs, ...this.$attrs }
92
- }
93
- },
94
- }
95
- </script>
96
-
97
- <style>
98
- .mini-p {
99
- padding-top: 6px;
100
- padding-bottom: 6px;
101
- }
102
- </style>
1
+ <template>
2
+ <div class="psui-el-input" :class="[getComponentClass, `layout-${layout}`]" >
3
+
4
+ <label v-if="label"> {{ label }} </label>
5
+
6
+ <div
7
+ class="psui-el-input-wrapper"
8
+ @mouseenter="isHoveringInputWrapper = true"
9
+ @mouseleave="isHoveringInputWrapper = false"
10
+ :class="{ 'hover' : isHoveringInputWrapper }"
11
+ >
12
+
13
+ <div v-if="$slots.prepend" class="psui-el-input-prepend">
14
+ <slot name="prepend"></slot>
15
+ </div>
16
+
17
+ <input
18
+ :type="type"
19
+ :placeholder="placeholder"
20
+ :disabled="disabled"
21
+ :value="value"
22
+ @focus="onInputFocus"
23
+ @blur="onInputBlur"
24
+ @input="$emit('input', $event)"
25
+ @keydown="$emit('keydown', $event)"
26
+ @change="$emit('change', $event)"
27
+ v-bind="getAttrs"
28
+ :class="{ 'focus': isFocus }"
29
+ />
30
+
31
+ <div v-if="$slots.append || hasError" class="psui-el-input-append">
32
+ <span v-if="hasError" class="material-icons psui-text-red-20 material-icons-sharp">error</span>
33
+ <slot v-else name="append"></slot>
34
+ </div>
35
+
36
+ </div>
37
+
38
+ <p v-if="hint || (hasError && typeof hasError === 'string')" class="psui-el-input-hint">
39
+ {{ typeof hasError === 'string' ? hasError : hint }}
40
+ </p>
41
+
42
+ </div>
43
+ </template>
44
+
45
+ <script>
46
+ export default {
47
+ name: 'PsInput',
48
+ props: {
49
+ type: {
50
+ type: String,
51
+ default: 'text'
52
+ },
53
+ placeholder: {
54
+ type: String
55
+ },
56
+ label: {
57
+ type: String
58
+ },
59
+ hint: {
60
+ type: String
61
+ },
62
+ layout: {
63
+ type: String,
64
+ default: 'default',
65
+ validator: (value) => ['default', 'mini'].includes(value)
66
+ },
67
+ value: {
68
+ required: true,
69
+ },
70
+ disabled: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ hasError: {
75
+ type: [String, Boolean],
76
+ default: false
77
+ },
78
+ active: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ },
83
+ data: () => ({
84
+ isHoveringInputWrapper: false,
85
+ isFocus: false,
86
+ }),
87
+ computed: {
88
+ getAttrs() {
89
+ const defaultAttrs = {
90
+ autocapitalize: 'sentences',
91
+ autocomplete: 'chrome-off',
92
+ autocorrect: 'off',
93
+ spellcheck: 'spellcheck'
94
+ }
95
+ return { ...defaultAttrs, ...this.$attrs }
96
+ },
97
+ getComponentClass() {
98
+ if (this.disabled) {
99
+ return 'status-disabled'
100
+ } else if (this.hasError) {
101
+ return 'status-error'
102
+ } else if (this.isFocus || this.isTyping || this.active ) {
103
+ return 'status-active'
104
+ } else {
105
+ return 'status-resting'
106
+ }
107
+ },
108
+ },
109
+ methods: {
110
+ onInputFocus($event) {
111
+ this.isFocus = true
112
+ this.$emit('focus', $event)
113
+ },
114
+ onInputBlur($event) {
115
+ this.isFocus = false
116
+ this.$emit('blur', $event)
117
+ }
118
+ }
119
+ }
120
+ </script>
121
+
122
+ <style> /* Please, use the file src/assets/scss/components/PsInput.scss */</style>
@@ -1,38 +1,57 @@
1
1
  <template>
2
- <div :class="cssClass">
3
- <div class="material-icons psui-my-auto">info</div>
4
- <div class="psui-w-full">{{ message }}</div>
5
- <div class="psui-cursor-pointer psui-font-bold psui-my-auto psui-pr-4">OK</div>
2
+ <div class="psui-flex psui-justify-between psui-pr-3 psui-pl-2 psui-py-2 psui-rounded-md" :class="getDialogColor">
3
+ <div class="psui-flex psui-justify-between psui-gap-2">
4
+ <i class="material-icons-round">info</i>
5
+ <div class="psui-flex psui-flex-col">
6
+ <p v-if="message" class="psui-w-full">{{ message }}</p>
7
+ <slot v-else name="content"></slot>
8
+ <slot v-if="layout === 'vertical'" name="action"></slot>
9
+ </div>
10
+ </div>
11
+ <div class="psui-flex psui-gap-3">
12
+ <slot v-if="layout === 'horizontal'" name="action"></slot>
13
+ <button @click="onClose" class="psui-w-4 psui-h-4 focus:psui-outline-none hover:opacity-70 transition-default">
14
+ <i class="material-icons-round">close</i>
15
+ </button>
16
+ </div>
6
17
  </div>
7
18
  </template>
8
19
 
9
20
  <script>
10
- export const typeOptions = ['informative', 'success', 'alert']
21
+
11
22
  export default {
12
23
  name: 'PsDialog',
13
24
  props: {
14
- type: {
25
+ status: {
15
26
  type: String,
16
27
  default: 'informative',
17
- validator: (value) => typeOptions.indexOf(value) !== -1
28
+ validator: (value) => ['informative', 'success', 'alert'].includes(value)
18
29
  },
19
30
  message: {
20
31
  type: String,
21
- required: true
32
+ },
33
+ layout:{
34
+ type: String,
35
+ default: 'horizontal',
36
+ validator: (value) => ['horizontal', 'vertical'].includes(value)
37
+ },
38
+ cssClass:{
39
+ type: String
22
40
  }
23
41
  },
24
- data() {
25
- return {
26
- colors: {
27
- informative: { background:'blue-20', color: 'blue-60' },
28
- success: { background:'green-10', color: 'green-70' },
29
- alert: { background:'yellow-10', color: 'yellow-70' }
30
- }
42
+ emits:['close'],
43
+ computed: {
44
+ getDialogColor() {
45
+ let dialogColor = ''
46
+ if(this.status === 'informative') dialogColor = `psui-bg-blue-20 psui-text-blue-60 ${this.cssClass}`
47
+ if(this.status === 'success') dialogColor = `psui-bg-green-10 psui-text-green-70 ${this.cssClass}`
48
+ if(this.status === 'alert') dialogColor = `psui-bg-yellow-10 psui-text-yellow-70 ${this.cssClass}`
49
+ return dialogColor
31
50
  }
32
51
  },
33
- computed: {
34
- cssClass() {
35
- return `psui-flex psui-space-x-4 psui-font-small psui-rounded-md psui-py-2 psui-px-4 psui-align-middle psui-flex psui-bg-${this.colors[this.type].background} psui-text-${this.colors[this.type].color}`
52
+ methods:{
53
+ onClose(){
54
+ this.$emit('close')
36
55
  }
37
56
  }
38
57
  }
@@ -6,9 +6,10 @@
6
6
  :key="item[keyValue]"
7
7
  @click="selectTab(item)"
8
8
  :class="[
9
+ 'transition-default',
9
10
  classes,
10
11
  { 'psui-bg-blue-60 psui-text-white': getSelected === item[keyValue] && theme === 'standard' },
11
- { 'psui-border-b-2 psui-border-blue-60 psui-text-blue-60 psui-font-bold': getSelected === item[keyValue] && theme === 'underline' },
12
+ { 'psui-border-blue-60 psui-text-blue-60': getSelected === item[keyValue] && theme === 'underline' },
12
13
  { 'psui-text-blue-60 psui-font-bold psui-bg-white hover:psui-text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
13
14
  ]"
14
15
  >
@@ -53,7 +54,7 @@ export default {
53
54
  },
54
55
  classes() {
55
56
  if (this.theme === 'underline') {
56
- return 'psui-text-gray-60 psui-pb-3 hover:psui-text-blue-60'
57
+ return 'psui-text-gray-60 psui-pb-3 psui-text-small psui-border-b-2 psui-border-transparent psui-font-bold hover:psui-text-blue-60'
57
58
  }
58
59
  if (this.theme === 'folder') {
59
60
  return 'psui-bg-gray-10 psui-text-gray-50 psui-py-2 psui-px-4 psui-rounded-t-lg hover:psui-text-gray-60 active:psui-text-blue-60'
@@ -3,6 +3,9 @@
3
3
  <template v-slot:trigger>
4
4
  <slot></slot>
5
5
  </template>
6
+ <template v-slot:dialog>
7
+ <p v-if="text">{{text}}</p>
8
+ </template>
6
9
  </PsTooltip>
7
10
  </template>
8
11
 
@@ -22,6 +25,9 @@ export default {
22
25
  default: "gray",
23
26
  validator: (type) => ["gray", "red", "blue"].includes(type),
24
27
  },
28
+ text: {
29
+ type: String,
30
+ },
25
31
  cssClass: {
26
32
  type: String,
27
33
  default: "",