@policystudio/policy-studio-ui-vue 1.0.19 → 1.0.23
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.
- package/.eslintrc.js +1 -2
- package/.storybook/main.js +10 -2
- package/.storybook/preview.js +1 -1
- package/README.md +8 -0
- package/babel.config.js +3 -0
- package/backup-package-lock.json +37194 -0
- package/dist/css/psui_styles.css +15709 -14658
- package/package.json +32 -21
- package/postcss.config.js +2 -0
- package/src/assets/scss/base.scss +9 -29
- package/src/assets/scss/components/PsAccordion.scss +63 -0
- package/src/assets/scss/components/PsButton.scss +145 -0
- package/src/assets/scss/components/PsInput.scss +104 -0
- package/src/components/accordion/PsAccordion.vue +30 -21
- package/src/components/accordion/PsAccordionItem.vue +29 -67
- package/src/components/badges-and-tags/PsCardInfos.vue +38 -0
- package/src/components/badges-and-tags/PsChartLegend.vue +43 -0
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
- package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
- package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
- package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
- package/src/components/buttons/PsButton.vue +43 -75
- package/src/components/chips/PsChips.vue +46 -38
- package/src/components/controls/PsCheckbox.vue +29 -16
- package/src/components/controls/PsDraggable.vue +174 -3
- package/src/components/controls/PsRadioButton.vue +74 -43
- package/src/components/controls/PsSwitch.vue +75 -76
- package/src/components/controls/PsToggle.vue +1 -1
- package/src/components/datatable/PsDataTable.vue +25 -29
- package/src/components/datatable/PsDataTableItem.vue +2 -2
- package/src/components/forms/PsInput.vue +122 -102
- package/src/components/notifications/PsDialog.vue +37 -18
- package/src/components/tabs/PsTabHeader.vue +3 -2
- package/src/components/tooltip/PsDialogTooltip.vue +79 -0
- package/src/components/tooltip/PsRichTooltip.vue +44 -0
- package/src/components/tooltip/PsTooltip.vue +118 -0
- package/src/components/ui/PsIcon.vue +87 -24
- package/src/index.js +29 -9
- package/src/stories/Accordion.stories.js +88 -28
- package/src/stories/Button.stories.js +86 -38
- package/src/stories/CardInfos.stories.js +16 -0
- package/src/stories/ChartLegend.stories.js +16 -0
- package/src/stories/Checkbox.stories.js +6 -6
- package/src/stories/Chips.stories.js +14 -8
- package/src/stories/ClimateZoneBadge.stories.js +24 -0
- package/src/stories/Colors.stories.mdx +35 -35
- package/src/stories/CostEffectBar.stories.js +23 -0
- package/src/stories/Datatable.stories.js +15 -8
- package/src/stories/Dialog.stories.js +150 -17
- package/src/stories/Draggable.stories.js +22 -0
- package/src/stories/Dropdown.stories.js +8 -10
- package/src/stories/HighlightRippleDot.stories.js +16 -0
- package/src/stories/Input.stories.js +71 -19
- package/src/stories/MiniTag.stories.js +46 -0
- package/src/stories/ProgressBar.stories.js +23 -0
- package/src/stories/RadioButton.stories.js +15 -15
- package/src/stories/Slider.stories.js +9 -9
- package/src/stories/Swith.stories.js +10 -10
- package/src/stories/TabHeader.stories.js +9 -9
- package/src/stories/Toast.stories.js +13 -13
- package/src/stories/Toggle.stories.js +12 -13
- package/src/stories/Tooltip.stories.js +114 -0
- package/src/util/GeneralFunctions.js +11 -12
- package/src/util/imageLoader.js +50 -0
- package/tailwind.config.js +71 -47
- package/src/assets/scss/tailwind.css +0 -70643
- package/src/assets/scss/tailwind.scss +0 -61088
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div @mouseover="open" @mouseleave="close" ref="tooltip">
|
|
3
|
+
<div ref="tooltiptrigger">
|
|
4
|
+
<slot name="trigger"></slot>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="psui-relative">
|
|
8
|
+
<div
|
|
9
|
+
role="menu"
|
|
10
|
+
ref="dialog"
|
|
11
|
+
class="
|
|
12
|
+
psui-fixed
|
|
13
|
+
psui-hidden
|
|
14
|
+
psui-opacity-0
|
|
15
|
+
psui-transition-opacity
|
|
16
|
+
psui-duration-500
|
|
17
|
+
psui-ease-in-out
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="
|
|
22
|
+
psui-flex
|
|
23
|
+
psui-flex-col
|
|
24
|
+
psui-rounded-md
|
|
25
|
+
psui-shadow-md
|
|
26
|
+
psui-z-20
|
|
27
|
+
psui-p-4
|
|
28
|
+
"
|
|
29
|
+
aria-orientation="vertical"
|
|
30
|
+
:class="cssClass"
|
|
31
|
+
>
|
|
32
|
+
<h2 v-if="title" class="psui-font-bold">{{ title}}</h2>
|
|
33
|
+
<slot name="dialog" class="psui-font-normal"
|
|
34
|
+
>
|
|
35
|
+
</slot
|
|
36
|
+
>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script>
|
|
44
|
+
export default {
|
|
45
|
+
name: "PsTooltip",
|
|
46
|
+
props: {
|
|
47
|
+
title: {
|
|
48
|
+
type: String,
|
|
49
|
+
},
|
|
50
|
+
ignoreDialog: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
keepOpen: {
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
cssClass:{
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'psui-bg-gray-50 psui-text-white'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
inheritAttrs: true,
|
|
63
|
+
emits: ["show"],
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
show: false,
|
|
67
|
+
closingTimeout: null,
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
mounted() {
|
|
71
|
+
document.addEventListener("resize", this.updatePosition)
|
|
72
|
+
},
|
|
73
|
+
beforeDestroy() {
|
|
74
|
+
document.removeEventListener("resize", this.updatePosition)
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
open() {
|
|
78
|
+
if (this.show || this.ignoreDialog) return
|
|
79
|
+
this.$emit("show")
|
|
80
|
+
this.show = true
|
|
81
|
+
|
|
82
|
+
this.$refs.dialog.style.display = "block"
|
|
83
|
+
this.$refs.dialog.style.opacity = 0
|
|
84
|
+
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
this.updatePosition()
|
|
87
|
+
}, 10)
|
|
88
|
+
},
|
|
89
|
+
close() {
|
|
90
|
+
if (this.show && this.$refs.dialog) {
|
|
91
|
+
this.$emit("close")
|
|
92
|
+
this.show = false
|
|
93
|
+
|
|
94
|
+
this.$refs.dialog.style.display = "none"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
updatePosition() {
|
|
98
|
+
const dialog = this.$refs.dialog
|
|
99
|
+
const trigger = this.$refs.tooltiptrigger
|
|
100
|
+
|
|
101
|
+
const rectDialog = dialog.getBoundingClientRect()
|
|
102
|
+
const rectTrigger = trigger.getBoundingClientRect()
|
|
103
|
+
const windowWidth = document.documentElement.clientWidth
|
|
104
|
+
dialog.style.top = `${rectTrigger.y + rectTrigger.height}px`
|
|
105
|
+
|
|
106
|
+
if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
|
|
107
|
+
dialog.style.left = `${windowWidth - rectDialog.width - 30}px`
|
|
108
|
+
} else {
|
|
109
|
+
dialog.style.left = `${rectTrigger.x}px`
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
dialog.style.opacity = 100
|
|
114
|
+
}, 100)
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="display: contents">
|
|
3
|
-
<
|
|
4
|
-
v-if="
|
|
3
|
+
<span
|
|
4
|
+
v-if="getIconType === 'material-icons'"
|
|
5
|
+
class="material-icons-round"
|
|
5
6
|
:class="[getIconClasses]"
|
|
6
7
|
>
|
|
7
|
-
|
|
8
|
-
</
|
|
9
|
-
<img v-else-if="
|
|
8
|
+
{{ getIcon }}
|
|
9
|
+
</span>
|
|
10
|
+
<img v-else-if="getIconType === 'url'" :src="icon" :class="[iconClasses]" />
|
|
10
11
|
<inline-svg
|
|
11
12
|
v-else
|
|
12
|
-
:src="
|
|
13
|
-
width="
|
|
14
|
-
height="
|
|
15
|
-
stroke="
|
|
13
|
+
:src="icon"
|
|
14
|
+
:width="getWidth"
|
|
15
|
+
:height="getHeight"
|
|
16
|
+
:stroke="getColor"
|
|
17
|
+
:fill="getColor"
|
|
16
18
|
></inline-svg>
|
|
17
19
|
</div>
|
|
18
20
|
</template>
|
|
19
21
|
|
|
20
22
|
<script>
|
|
23
|
+
import tailwindConfig from '../../../tailwind.config'
|
|
24
|
+
import imageLoader from '../../util/imageLoader'
|
|
21
25
|
export default {
|
|
22
|
-
name: '
|
|
26
|
+
name: 'AppIcon',
|
|
23
27
|
props: {
|
|
24
28
|
icon: {
|
|
25
29
|
type: String,
|
|
@@ -27,39 +31,98 @@ export default {
|
|
|
27
31
|
},
|
|
28
32
|
type: {
|
|
29
33
|
type: String,
|
|
30
|
-
default: 'material-icons'
|
|
31
34
|
},
|
|
32
35
|
iconClasses: {
|
|
33
36
|
type: String
|
|
34
37
|
},
|
|
35
38
|
size: {
|
|
36
|
-
type: [Number, String]
|
|
39
|
+
type: [Number, String],
|
|
37
40
|
},
|
|
38
41
|
width: {
|
|
39
|
-
type: Number
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 24
|
|
40
44
|
},
|
|
41
45
|
height: {
|
|
42
|
-
type: Number
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 24
|
|
43
48
|
},
|
|
44
49
|
stroke: {
|
|
45
50
|
type: String,
|
|
51
|
+
default: null
|
|
46
52
|
},
|
|
47
53
|
color: {
|
|
48
|
-
type: String
|
|
54
|
+
type: String,
|
|
55
|
+
default: null,
|
|
56
|
+
validator: value => {
|
|
57
|
+
return value.includes('psui-text-') &&
|
|
58
|
+
typeof(tailwindConfig.theme.colors[value.replace('psui-text-', '')]) != 'undefined' ||
|
|
59
|
+
typeof(tailwindConfig.theme.colors[value]) != 'undefined'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
loaderIcon: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'hourglass_top'
|
|
65
|
+
},
|
|
66
|
+
loaderErrorIcon: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'more_horiz'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
finishedImageLoad: false,
|
|
74
|
+
imageLoadError: false
|
|
49
75
|
}
|
|
50
|
-
|
|
51
76
|
},
|
|
52
77
|
computed: {
|
|
78
|
+
getIconType() {
|
|
79
|
+
if(this.imageLoadError || !this.finishedImageLoad) return 'material-icons'
|
|
80
|
+
if(this.type) return this.type
|
|
81
|
+
if(!this.icon.includes('/')) return 'material-icons'
|
|
82
|
+
if(!this.icon.includes('.svg')) return 'url'
|
|
83
|
+
return 'svg'
|
|
84
|
+
},
|
|
85
|
+
getIcon() {
|
|
86
|
+
if(!this.icon.includes('/')) return this.icon
|
|
87
|
+
if(!this.finishedImageLoad && !this.imageLoadError && this.loaderIcon) return this.loaderIcon
|
|
88
|
+
if(this.imageLoadError) return this.loaderErrorIcon
|
|
89
|
+
return this.icon ? this.icon : ''
|
|
90
|
+
},
|
|
53
91
|
getIconClasses() {
|
|
54
92
|
if(this.iconClasses) return this.iconClasses
|
|
55
|
-
|
|
56
|
-
const color = this.iconColor.length > 0 ? `psui-text-${this.iconColor}` : ''
|
|
57
|
-
return `psui-mr-2 psui-my-auto material-icons ${size} ${color}`
|
|
93
|
+
return `${this.size} ${this.color}`
|
|
58
94
|
},
|
|
95
|
+
getWidth() {
|
|
96
|
+
if(this.size) return this.size
|
|
97
|
+
return this.width
|
|
98
|
+
},
|
|
99
|
+
getHeight() {
|
|
100
|
+
if(this.size) return this.size
|
|
101
|
+
return this.height
|
|
102
|
+
},
|
|
103
|
+
getColor() {
|
|
104
|
+
if(this.getIconType === 'material-icons') return this.color
|
|
105
|
+
return tailwindConfig.theme.colors[this.color.replace('psui-text-', '')] || tailwindConfig.theme.colors[this.color]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
watch: {
|
|
109
|
+
'icon': function() {
|
|
110
|
+
this.loadImage()
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
mounted() {
|
|
114
|
+
if(this.icon.includes('/')) this.loadImage()
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
loadImage() {
|
|
118
|
+
imageLoader({ imageUrl: this.icon, returnsBase64: false })
|
|
119
|
+
.then(() => {
|
|
120
|
+
this.finishedImageLoad = true
|
|
121
|
+
})
|
|
122
|
+
.catch(() => {
|
|
123
|
+
this.imageLoadError = true
|
|
124
|
+
})
|
|
125
|
+
}
|
|
59
126
|
}
|
|
60
127
|
}
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style>
|
|
64
|
-
|
|
65
|
-
</style>
|
|
128
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -13,15 +13,22 @@ import PsAccordionItem from './components/accordion/PsAccordionItem.vue'
|
|
|
13
13
|
import PsChips from './components/chips/PsChips.vue'
|
|
14
14
|
import PsDataTable from './components/datatable/PsDataTable.vue'
|
|
15
15
|
import PsDataTableItem from './components/datatable/PsDataTableItem.vue'
|
|
16
|
+
import PsIcon from './components/ui/PsIcon.vue'
|
|
17
|
+
import PsTooltip from './components/tooltip/PsTooltip.vue'
|
|
18
|
+
import PsRichTooltip from './components/tooltip/PsRichTooltip.vue'
|
|
19
|
+
import PsDialogTooltip from './components/tooltip/PsDialogTooltip.vue'
|
|
20
|
+
import PsDraggable from './components/controls/PsDraggable.vue'
|
|
21
|
+
// import PsCardInfos from './components/badges-and-tags/PsCardInfos.vue'
|
|
22
|
+
import PsChartLegend from './components/badges-and-tags/PsChartLegend.vue'
|
|
16
23
|
|
|
17
24
|
export default {
|
|
18
25
|
install(Vue) {
|
|
19
|
-
Vue.component('PsButton',
|
|
20
|
-
Vue.component('PsCheckbox',
|
|
21
|
-
Vue.component('PsDialog',
|
|
22
|
-
Vue.component('PsToast',
|
|
23
|
-
Vue.component('PsTabHeader',
|
|
24
|
-
Vue.component('PsRadioButton',
|
|
26
|
+
Vue.component('PsButton', PsButton)
|
|
27
|
+
Vue.component('PsCheckbox', PsCheckbox)
|
|
28
|
+
Vue.component('PsDialog', PsDialog)
|
|
29
|
+
Vue.component('PsToast', PsToast)
|
|
30
|
+
Vue.component('PsTabHeader', PsTabHeader)
|
|
31
|
+
Vue.component('PsRadioButton', PsRadioButton)
|
|
25
32
|
Vue.component('PsSlider', PsSlider)
|
|
26
33
|
Vue.component('PsSwitch', PsSwitch)
|
|
27
34
|
Vue.component('PsInput', PsInput)
|
|
@@ -31,7 +38,14 @@ export default {
|
|
|
31
38
|
Vue.component('PsChips', PsChips)
|
|
32
39
|
Vue.component('PsDataTable', PsDataTable)
|
|
33
40
|
Vue.component('PsDataTableItem', PsDataTableItem)
|
|
34
|
-
|
|
41
|
+
Vue.component('PsIcon', PsIcon)
|
|
42
|
+
Vue.component('PsTooltip', PsTooltip)
|
|
43
|
+
Vue.component('PsRichTooltip', PsRichTooltip)
|
|
44
|
+
Vue.component('PsDialogTooltip', PsDialogTooltip)
|
|
45
|
+
Vue.component('PsDraggable', PsDraggable)
|
|
46
|
+
// Vue.component('PsCardInfos', PsCardInfos)
|
|
47
|
+
Vue.component('PsChartLegend', PsChartLegend)
|
|
48
|
+
},
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
export {
|
|
@@ -49,5 +63,11 @@ export {
|
|
|
49
63
|
PsAccordionItem,
|
|
50
64
|
PsChips,
|
|
51
65
|
PsDataTable,
|
|
52
|
-
PsDataTableItem
|
|
53
|
-
|
|
66
|
+
PsDataTableItem,
|
|
67
|
+
PsTooltip,
|
|
68
|
+
PsRichTooltip,
|
|
69
|
+
PsDialogTooltip,
|
|
70
|
+
PsDraggable,
|
|
71
|
+
// PsCardInfos,
|
|
72
|
+
PsChartLegend,
|
|
73
|
+
}
|
|
@@ -1,35 +1,95 @@
|
|
|
1
|
-
import PsAccordionItem, {
|
|
2
|
-
|
|
1
|
+
import PsAccordionItem, {
|
|
2
|
+
iconTypes,
|
|
3
|
+
fontCss,
|
|
4
|
+
} from '../components/accordion/PsAccordionItem.vue'
|
|
5
|
+
import PsAccordion, { sizes } from '../components/accordion/PsAccordion.vue'
|
|
3
6
|
|
|
4
7
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
title: 'Components/Accordion',
|
|
9
|
+
component: PsAccordion,
|
|
10
|
+
subcomponents: { PsAccordionItem },
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: { control: { type: 'select', options: sizes } },
|
|
13
|
+
iconType: { control: { type: 'select', options: iconTypes } },
|
|
14
|
+
fontCss: { control: { type: 'select', options: fontCss } },
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
title: 'Section 1',
|
|
18
|
+
},
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
export const AccordionItem = (args, { argTypes }) => ({
|
|
19
|
-
props: Object.keys(argTypes, args),
|
|
20
|
-
components: { PsAccordionItem },
|
|
21
|
-
template: '<PsAccordionItem v-bind="$props"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p></PsAccordionItem>',
|
|
22
|
-
})
|
|
23
|
-
AccordionItem.parameters = {
|
|
24
|
-
controls: {
|
|
25
|
-
include: ['title', 'iconType', 'fontCss']
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
21
|
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
export const Index = (args, { argTypes }) => ({
|
|
23
|
+
props: Object.keys(argTypes, args),
|
|
24
|
+
components: { PsAccordion, PsAccordionItem },
|
|
25
|
+
template:
|
|
26
|
+
`<div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-2 psui-gap-6">
|
|
34
27
|
|
|
28
|
+
<div>
|
|
29
|
+
<div class="psui-my-4">
|
|
30
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">Accordion Big</h1>
|
|
31
|
+
</div>
|
|
32
|
+
<PsAccordion layout="big" class="psui-bg-white">
|
|
33
|
+
<PsAccordionItem title="Header 01">
|
|
34
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
35
|
+
</PsAccordionItem>
|
|
36
|
+
<PsAccordionItem title="Header 02">
|
|
37
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
38
|
+
</PsAccordionItem>
|
|
39
|
+
<PsAccordionItem title="Header 03">
|
|
40
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
41
|
+
</PsAccordionItem>
|
|
42
|
+
</PsAccordion>
|
|
43
|
+
</div>
|
|
35
44
|
|
|
45
|
+
<div>
|
|
46
|
+
<div class="psui-my-4">
|
|
47
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">Accordion Medium</h1>
|
|
48
|
+
</div>
|
|
49
|
+
<PsAccordion layout="medium" class="psui-bg-white">
|
|
50
|
+
<PsAccordionItem title="Header 01">
|
|
51
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
52
|
+
</PsAccordionItem>
|
|
53
|
+
<PsAccordionItem title="Header 02" :opened="false">
|
|
54
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
55
|
+
</PsAccordionItem>
|
|
56
|
+
<PsAccordionItem title="Header 03">
|
|
57
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
58
|
+
</PsAccordionItem>
|
|
59
|
+
</PsAccordion>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div>
|
|
63
|
+
<div class="psui-my-4">
|
|
64
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">Variations</h1>
|
|
65
|
+
</div>
|
|
66
|
+
<PsAccordion layout="medium" class="psui-bg-white" iconOpened="thumb_down" iconClosed="thumb_up">
|
|
67
|
+
<PsAccordionItem title="Custom Icon">
|
|
68
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
69
|
+
</PsAccordionItem>
|
|
70
|
+
<PsAccordionItem title="Initial Content Opened" :opened="true">
|
|
71
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
72
|
+
</PsAccordionItem>
|
|
73
|
+
</PsAccordion>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div>
|
|
77
|
+
<div class="psui-my-4">
|
|
78
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">Custom Icons By Accordion Item</h1>
|
|
79
|
+
</div>
|
|
80
|
+
<PsAccordion layout="medium" class="psui-bg-white">
|
|
81
|
+
<PsAccordionItem title="Custom Icon" iconOpened="thumb_down" iconClosed="thumb_up">
|
|
82
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
83
|
+
</PsAccordionItem>
|
|
84
|
+
<PsAccordionItem title="Initial Content Opened" :opened="true">
|
|
85
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
86
|
+
</PsAccordionItem>
|
|
87
|
+
<PsAccordionItem title="Initial Content Opened" iconOpened="visibility_off" iconClosed="visibility_on">
|
|
88
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
|
|
89
|
+
</PsAccordionItem>
|
|
90
|
+
</PsAccordion>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
`,
|
|
95
|
+
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PsButton, { sizes } from '../components/buttons/PsButton.vue'
|
|
1
|
+
import PsButton, { sizes } from '../components/buttons/PsButton.vue'
|
|
2
2
|
const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Button',
|
|
@@ -9,46 +9,94 @@ export default {
|
|
|
9
9
|
icon: { control: { type: 'select', options: icons} },
|
|
10
10
|
iconRight: { control: { type: 'select', options: icons} }
|
|
11
11
|
},
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const TemplateDefault = (args, {argTypes}) => ({
|
|
15
15
|
props: Object.keys(argTypes),
|
|
16
16
|
components: { PsButton },
|
|
17
17
|
template: `
|
|
18
|
-
<
|
|
18
|
+
<div style="display:flex; flex-direction: column;">
|
|
19
|
+
<p>Size: Big</p>
|
|
20
|
+
<div style="display: flex; flex-direction: column; gap: 10px;">
|
|
21
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
22
|
+
<span style="text-align: center; color: red;">Solid Style</span>
|
|
23
|
+
<PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left'/>
|
|
24
|
+
<PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right'/>
|
|
25
|
+
<PsButton label='Text Only' layout='solid' />
|
|
26
|
+
<PsButton label='Disabled' layout='solid' icon='verified' iconPosition='left' disabled/>
|
|
27
|
+
</div>
|
|
28
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
29
|
+
<span style="text-align: center; color: blue;">Outline Style</span>
|
|
30
|
+
<PsButton label='Left Icon' layout='outline' icon='verified' iconPosition='left'/>
|
|
31
|
+
<PsButton label='Right Icon' layout='outline' icon='verified' iconPosition='right'/>
|
|
32
|
+
<PsButton label='Text Only' layout='outline'/>
|
|
33
|
+
<PsButton label='Disabled' layout='outline' icon='verified' iconPosition='left' disabled/>
|
|
34
|
+
</div>
|
|
35
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
36
|
+
<span style="text-align: center; color: brown;">Ghost Style</span>
|
|
37
|
+
<PsButton label='Left Icon' layout='ghost' icon='verified' iconPosition='left'/>
|
|
38
|
+
<PsButton label='Right Icon' layout='ghost' icon='verified' iconPosition='right'/>
|
|
39
|
+
<PsButton label='Text Only' layout='ghost' />
|
|
40
|
+
<PsButton label='Disabled' layout='ghost' icon='verified' iconPosition='left' disabled/>
|
|
41
|
+
</div>
|
|
42
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
43
|
+
<span style="text-align: center; color: green;">Only-Text Style</span>
|
|
44
|
+
<PsButton label='Left Icon' layout='onlytext' icon='verified' iconPosition='left'/>
|
|
45
|
+
<PsButton label='Right Icon' layout='onlytext' icon='verified' iconPosition='right'/>
|
|
46
|
+
<PsButton label='Text Only' layout='onlytext'/>
|
|
47
|
+
<PsButton label='Disabled' layout='onlytext' icon='verified' iconPosition='left' disabled/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<p>Size: Medium</p>
|
|
51
|
+
<div style="display: flex; flex-direction: column; gap: 10px;">
|
|
52
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
53
|
+
<span style="text-align: center; color: red;">Solid Style</span>
|
|
54
|
+
<PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='medium'/>
|
|
55
|
+
<PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='medium'/>
|
|
56
|
+
<PsButton label='Text Only' layout='solid' size='medium'/>
|
|
57
|
+
<PsButton label='Disabled' layout='solid' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
58
|
+
</div>
|
|
59
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
60
|
+
<span style="text-align: center; color: blue;">Outline Style</span>
|
|
61
|
+
<PsButton label='Left Icon' layout='outline' icon='verified' iconPosition='left' size='medium'/>
|
|
62
|
+
<PsButton label='Right Icon' layout='outline' icon='verified' iconPosition='right' size='medium'/>
|
|
63
|
+
<PsButton label='Text Only' layout='outline' size='medium'/>
|
|
64
|
+
<PsButton label='Disabled' layout='outline' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
65
|
+
</div>
|
|
66
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
67
|
+
<span style="text-align: center; color: brown;">Ghost Style</span>
|
|
68
|
+
<PsButton label='Left Icon' layout='ghost' icon='verified' iconPosition='left' size='medium'/>
|
|
69
|
+
<PsButton label='Right Icon' layout='ghost' icon='verified' iconPosition='right' size='medium'/>
|
|
70
|
+
<PsButton label='Text Only' layout='ghost' size='medium'/>
|
|
71
|
+
<PsButton label='Disabled' layout='ghost' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
72
|
+
</div>
|
|
73
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
74
|
+
<span style="text-align: center; color: green;">Only-Text Style</span>
|
|
75
|
+
<PsButton label='Left Icon' layout='onlytext' icon='verified' iconPosition='left' size='medium'/>
|
|
76
|
+
<PsButton label='Right Icon' layout='onlytext' icon='verified' iconPosition='right' size='medium'/>
|
|
77
|
+
<PsButton label='Text Only' layout='onlytext' size='medium'/>
|
|
78
|
+
<PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left'size='medium'/>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<p>Size: Small</p>
|
|
82
|
+
<div style="display: flex; flex-direction: column; gap: 10px;">
|
|
83
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
84
|
+
<span style="text-align: center; color: red;">Solid Style</span>
|
|
85
|
+
<PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='small'/>
|
|
86
|
+
<PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='small'/>
|
|
87
|
+
<PsButton label='Text Only' layout='solid' size='small'/>
|
|
88
|
+
<PsButton label='Disabled' layout='solid' icon='verified' iconPosition='left' disabled size='small'/>
|
|
89
|
+
</div>
|
|
90
|
+
<div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
91
|
+
<span style="text-align: center; color: green;">Only-Text Style</span>
|
|
92
|
+
<PsButton label='Left Icon' layout='onlytext' icon='verified' iconPosition='left' size='small'/>
|
|
93
|
+
<PsButton label='Right Icon' layout='onlytext' icon='verified' iconPosition='right' size='small'/>
|
|
94
|
+
<PsButton label='Text Only' layout='onlytext' size='small'/>
|
|
95
|
+
<PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left'size='small'/>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
19
99
|
`
|
|
20
|
-
})
|
|
100
|
+
})
|
|
21
101
|
|
|
22
|
-
export const
|
|
23
|
-
Solid.args = {
|
|
24
|
-
label: 'Solid button',
|
|
25
|
-
size: 'big',
|
|
26
|
-
disabled: false,
|
|
27
|
-
iconRight: 'add_circle'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Outline = Template.bind({});
|
|
31
|
-
Outline.args = {
|
|
32
|
-
label: 'Outline button',
|
|
33
|
-
size: 'big',
|
|
34
|
-
disabled: false,
|
|
35
|
-
icon: 'add_circle',
|
|
36
|
-
outline: true
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Ghost = Template.bind({});
|
|
40
|
-
Ghost.args = {
|
|
41
|
-
label: 'Ghost button',
|
|
42
|
-
size: 'big',
|
|
43
|
-
disabled: false,
|
|
44
|
-
ghost: true
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const TextOnly = Template.bind({});
|
|
48
|
-
TextOnly.args = {
|
|
49
|
-
label: 'TextOnly button',
|
|
50
|
-
disabled: false,
|
|
51
|
-
icon: 'add_circle',
|
|
52
|
-
size: 'big',
|
|
53
|
-
textOnly: true,
|
|
54
|
-
};
|
|
102
|
+
export const Default = TemplateDefault.bind({})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import PsCardInfos from '../components/badges-and-tags/PsCardInfos.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/CardInfos',
|
|
5
|
+
component: PsCardInfos,
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { PsCardInfos },
|
|
12
|
+
template: '<PsCardInfos v-bind="$props" />',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const CardInfos = Template.bind({})
|
|
16
|
+
CardInfos.args = {}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import PsChartLegend from '../components/badges-and-tags/PsChartLegend.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/ChartLegend',
|
|
5
|
+
component: PsChartLegend,
|
|
6
|
+
argTypes: {},
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { PsChartLegend },
|
|
12
|
+
template: '<PsChartLegend v-bind="$props" />',
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const ChartLegend = Template.bind({})
|
|
16
|
+
ChartLegend.args = {}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import PsCheckbox
|
|
2
|
-
const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
1
|
+
import PsCheckbox from '../components/controls/PsCheckbox.vue'
|
|
2
|
+
// const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Checkbox',
|
|
5
5
|
component: PsCheckbox,
|
|
6
6
|
argTypes: {
|
|
7
7
|
disabled: { control: 'boolean' },
|
|
8
8
|
},
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
const Template = (args, { argTypes }) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
@@ -36,13 +36,13 @@ const Template = (args, { argTypes }) => ({
|
|
|
36
36
|
<p>Checked: {{ selected }}</p>
|
|
37
37
|
</div>
|
|
38
38
|
`
|
|
39
|
-
})
|
|
39
|
+
})
|
|
40
40
|
|
|
41
|
-
export const Default = Template.bind({})
|
|
41
|
+
export const Default = Template.bind({})
|
|
42
42
|
Default.args = {
|
|
43
43
|
size: 18,
|
|
44
44
|
disabled: false,
|
|
45
45
|
label: 'Label',
|
|
46
46
|
labelClasses: '',
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
|