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

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 (69) hide show
  1. package/.storybook/preview.js +7 -1
  2. package/README.md +6 -2
  3. package/dist/css/psui_styles.css +461 -139
  4. package/package.json +15 -5
  5. package/src/assets/scss/base.scss +2 -0
  6. package/src/assets/scss/components/PsAccordion.scss +28 -11
  7. package/src/assets/scss/components/PsButton.scss +21 -4
  8. package/src/assets/scss/components/PsCardInfos.scss +1 -1
  9. package/src/assets/scss/components/PsCheckbox.scss +4 -5
  10. package/src/assets/scss/components/PsChips.scss +13 -8
  11. package/src/assets/scss/components/PsDialog.scss +5 -2
  12. package/src/assets/scss/components/PsDraggable.scss +64 -0
  13. package/src/assets/scss/components/PsDropdown.scss +5 -22
  14. package/src/assets/scss/components/PsDropdownList.scss +19 -0
  15. package/src/assets/scss/components/PsInput.scss +8 -3
  16. package/src/assets/scss/components/PsInputSelect.scss +6 -3
  17. package/src/assets/scss/components/PsInputTextArea.scss +5 -2
  18. package/src/assets/scss/components/PsRadioButton.scss +5 -5
  19. package/src/assets/scss/components/PsSwitch.scss +4 -4
  20. package/src/assets/scss/components/PsTabHeader.scss +14 -0
  21. package/src/assets/scss/components/PsToast.scss +3 -3
  22. package/src/assets/scss/components/PsToggle.scss +6 -2
  23. package/src/assets/scss/components/PsTooltip.scss +51 -18
  24. package/src/components/accordion/PsAccordion.vue +7 -23
  25. package/src/components/accordion/PsAccordionItem.vue +41 -25
  26. package/src/components/badges-and-tags/PsCardInfos.vue +12 -0
  27. package/src/components/badges-and-tags/PsChartLegend.vue +13 -0
  28. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +7 -0
  29. package/src/components/badges-and-tags/PsCostEffectBar.vue +6 -0
  30. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -1
  31. package/src/components/badges-and-tags/PsMiniTag.vue +6 -0
  32. package/src/components/badges-and-tags/PsProgressBar.vue +17 -9
  33. package/src/components/buttons/PsButton.vue +22 -1
  34. package/src/components/chips/PsChips.vue +24 -3
  35. package/src/components/controls/PsCheckbox.vue +32 -16
  36. package/src/components/controls/PsDraggable.vue +39 -150
  37. package/src/components/controls/PsInlineSelector.vue +30 -0
  38. package/src/components/controls/PsRadioButton.vue +28 -15
  39. package/src/components/controls/PsSwitch.vue +20 -11
  40. package/src/components/controls/PsToggle.vue +33 -12
  41. package/src/components/datatable/PsDataTable.vue +18 -0
  42. package/src/components/forms/PsDropdown.vue +18 -60
  43. package/src/components/forms/PsDropdownList.vue +82 -0
  44. package/src/components/forms/PsInput.vue +28 -1
  45. package/src/components/forms/PsInputSelect.vue +21 -0
  46. package/src/components/forms/PsInputTextArea.vue +53 -40
  47. package/src/components/notifications/PsDialog.vue +15 -0
  48. package/src/components/notifications/PsToast.vue +12 -0
  49. package/src/components/playground/PsScrollBar.vue +15 -0
  50. package/src/components/tabs/PsTabHeader.vue +18 -0
  51. package/src/components/tooltip/PsDialogTooltip.vue +103 -20
  52. package/src/components/tooltip/PsRichTooltip.vue +6 -3
  53. package/src/components/tooltip/PsTooltip.vue +19 -3
  54. package/src/components/ui/PsIcon.vue +30 -0
  55. package/src/index.js +30 -2
  56. package/src/stories/Accordion.stories.js +12 -48
  57. package/src/stories/Button.stories.js +30 -7
  58. package/src/stories/Chips.stories.js +14 -2
  59. package/src/stories/Dropdown.stories.js +36 -13
  60. package/src/stories/Playground.stories.js +16 -0
  61. package/src/stories/Switch.stories.js +8 -2
  62. package/src/stories/Toast.stories.js +16 -16
  63. package/src/stories/Tooltip.stories.js +6 -6
  64. package/src/stories/Typography.stories.mdx +22 -18
  65. package/src/util/GeneralFunctions.js +8 -0
  66. package/tailwind.config.js +7 -3
  67. package/vetur/attributes.json +1376 -0
  68. package/vetur/tags.json +632 -0
  69. package/src/components/forms/PsDropdownCopy.vue +0 -212
@@ -1,50 +1,133 @@
1
1
  <template>
2
- <PsTooltip :layout="layout" :cssClass="cssClass" :title="title">
3
- <template v-slot:trigger>
2
+ <div @mouseenter="open" v-click-outside="close" ref="tooltip" class='psui-el-tooltip'>
3
+ <div ref="tooltiptrigger" class='psui-el-tooltip-trigger'>
4
4
  <slot name="trigger"></slot>
5
- </template>
6
- <template
7
- v-slot:content
8
- >
9
- <slot name="content"></slot>
10
- <button
11
- v-if="buttonText"
12
- @click="onClick"
5
+ </div>
6
+
7
+ <div class='psui-el-tooltip-wrapper'>
8
+ <div
9
+ role="menu"
10
+ ref="dialog"
11
+ class='psui-el-tooltip-dialog'
12
+ :class="cssClass"
13
13
  >
14
- {{ buttonText }}
15
- </button>
16
- </template>
17
- </PsTooltip>
14
+ <div
15
+ class="psui-el-tooltip-content"
16
+ aria-orientation="vertical"
17
+ :class="getComponentClass"
18
+ >
19
+ <h2 v-if="title">{{ title}}</h2>
20
+ <div class="psui-el-tooltip-content-wrapper">
21
+ <slot name="content"></slot>
22
+ <button
23
+ v-if="buttonText"
24
+ @click="onClick"
25
+ >
26
+ {{ buttonText }}
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
18
33
  </template>
19
34
 
20
35
  <script>
21
- import PsTooltip from "./PsTooltip.vue"
22
36
 
23
37
  export default {
24
38
  name: "PsDialogTooltip",
25
- components: { PsTooltip },
26
39
  props: {
27
- text: {
28
- type: String,
29
- },
40
+ /**
41
+ * It sets the title of the tooltip if needed.
42
+ */
30
43
  title: {
31
44
  type: String,
32
45
  },
46
+ /**
47
+ * It sets the label of the button within the tooltip if needed.
48
+ */
33
49
  buttonText: {
34
50
  type: String,
35
51
  },
52
+ /**
53
+ * It sets the layout of the tooltip. eg: white, dark and color.
54
+ */
36
55
  layout: {
37
56
  type: String,
38
57
  default: "white",
39
58
  validator: (value) => ["white", "dark", "color"].includes(value),
40
59
  },
60
+ /**
61
+ * It sets a additional styling if needed.
62
+ */
41
63
  cssClass: {
42
64
  type: String,
43
65
  required: false,
44
66
  },
45
67
  },
46
- emits: ["click"],
68
+ inheritAttrs: true,
69
+ emits: ["show", 'click'],
70
+ data() {
71
+ return {
72
+ show: false,
73
+ closingTimeout: null,
74
+ }
75
+ },
76
+ computed:{
77
+ getComponentClass(){
78
+ return `layout-${this.layout}`
79
+ }
80
+ },
81
+ mounted() {
82
+ document.addEventListener("resize", this.updatePosition)
83
+ },
84
+ beforeDestroy() {
85
+ document.removeEventListener("resize", this.updatePosition)
86
+ },
47
87
  methods: {
88
+ open() {
89
+ if (this.show || this.ignoreDialog) return
90
+ this.$emit("show")
91
+ this.show = true
92
+
93
+ this.$refs.dialog.style.display = "block"
94
+ this.$refs.dialog.style.opacity = 0
95
+
96
+ setTimeout(() => {
97
+ this.updatePosition()
98
+ }, 10)
99
+ },
100
+ close() {
101
+ if (this.show && this.$refs.dialog) {
102
+ this.$emit("close")
103
+ this.show = false
104
+
105
+ this.$refs.dialog.style.display = "none"
106
+ }
107
+ },
108
+ updatePosition() {
109
+ const dialog = this.$refs.dialog
110
+ const trigger = this.$refs.tooltiptrigger
111
+
112
+ const rectDialog = dialog.getBoundingClientRect()
113
+ const rectTrigger = trigger.getBoundingClientRect()
114
+ const windowWidth = document.documentElement.clientWidth
115
+ dialog.style.top = `${rectTrigger.y + rectTrigger.height + 8}px`
116
+
117
+ if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
118
+ dialog.style.left = `${windowWidth - rectDialog.width - 30}px`
119
+ } else if (rectTrigger.x - Math.abs(rectTrigger.width-rectDialog.width) < 0) {
120
+ dialog.style.left = `${rectTrigger.x + 10}px`
121
+ } else if (rectDialog.width >= rectTrigger.width){
122
+ dialog.style.left = `${rectTrigger.x - ((rectDialog.width - rectTrigger.width)/2)}px`
123
+ } else {
124
+ dialog.style.left = `${rectTrigger.x + ((rectTrigger.width - rectDialog.width)/2)}px`
125
+ }
126
+
127
+ setTimeout(() => {
128
+ dialog.style.opacity = 100
129
+ }, 100)
130
+ },
48
131
  onClick() {
49
132
  this.$emit("click", this.$event)
50
133
  },
@@ -16,18 +16,21 @@ export default {
16
16
  name: "PsRichTooltip",
17
17
  components: { PsTooltip },
18
18
  props: {
19
+ /**
20
+ * It sets the title of the tooltip if needed.
21
+ */
19
22
  title: {
20
23
  type: String,
21
24
  default: "",
22
25
  },
26
+ /**
27
+ * It sets the layout of the tooltip. eg: gray, red and blue.
28
+ */
23
29
  layout: {
24
30
  type: String,
25
31
  default: "gray",
26
32
  validator: (type) => ["gray", "red", "blue"].includes(type),
27
33
  },
28
- text: {
29
- type: String,
30
- },
31
34
  cssClass: {
32
35
  type: String,
33
36
  default: "",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div @mouseover="open" @mouseleave="close" ref="tooltip" class='psui-el-tooltip'>
2
+ <div @mouseenter="open" @mouseleave="close" ref="tooltip" class='psui-el-tooltip'>
3
3
  <div ref="tooltiptrigger" class='psui-el-tooltip-trigger'>
4
4
  <slot name="trigger"></slot>
5
5
  </div>
@@ -30,16 +30,28 @@
30
30
  export default {
31
31
  name: "PsTooltip",
32
32
  props: {
33
+ /**
34
+ * It sets the title of the tooltip if needed.
35
+ */
33
36
  title: {
34
37
  type: String,
35
38
  },
39
+ /**
40
+ * It disables the dialog section.
41
+ */
36
42
  ignoreDialog: {
37
43
  type: Boolean,
38
44
  default: false,
39
45
  },
46
+ /**
47
+ * It sets the layout of the tooltip if needed. Usefull when using rich or dialog tooltip.
48
+ */
40
49
  layout:{
41
50
  type: String,
42
51
  },
52
+ /**
53
+ * It sets a additional styling if needed.
54
+ */
43
55
  cssClass:{
44
56
  type: String,
45
57
  }
@@ -91,12 +103,16 @@ export default {
91
103
  const rectDialog = dialog.getBoundingClientRect()
92
104
  const rectTrigger = trigger.getBoundingClientRect()
93
105
  const windowWidth = document.documentElement.clientWidth
94
- dialog.style.top = `${rectTrigger.y + rectTrigger.height}px`
106
+ dialog.style.top = `${rectTrigger.y + rectTrigger.height + 8}px`
95
107
 
96
108
  if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
97
109
  dialog.style.left = `${windowWidth - rectDialog.width - 30}px`
110
+ } else if (rectTrigger.x - Math.abs(rectTrigger.width-rectDialog.width) < 0) {
111
+ dialog.style.left = `${rectTrigger.x + 10}px`
112
+ } else if (rectDialog.width >= rectTrigger.width){
113
+ dialog.style.left = `${rectTrigger.x - ((rectDialog.width - rectTrigger.width)/2)}px`
98
114
  } else {
99
- dialog.style.left = `${rectTrigger.x}px`
115
+ dialog.style.left = `${rectTrigger.x + ((rectTrigger.width - rectDialog.width)/2)}px`
100
116
  }
101
117
 
102
118
  setTimeout(() => {
@@ -25,31 +25,55 @@ import imageLoader from '../../util/imageLoader'
25
25
  export default {
26
26
  name: 'AppIcon',
27
27
  props: {
28
+ /**
29
+ * It sets the text key to get the svg icon in Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
30
+ */
28
31
  icon: {
29
32
  type: String,
30
33
  default: 'more_horiz'
31
34
  },
35
+ /**
36
+ * It sets the type of the icon.
37
+ */
32
38
  type: {
33
39
  type: String,
34
40
  },
41
+ /**
42
+ * It sets the style of the icon.
43
+ */
35
44
  iconClasses: {
36
45
  type: String
37
46
  },
47
+ /**
48
+ * It sets the size of the icon.
49
+ */
38
50
  size: {
39
51
  type: [Number, String],
40
52
  },
53
+ /**
54
+ * It sets the width of the icon.
55
+ */
41
56
  width: {
42
57
  type: [Number, String],
43
58
  default: 24
44
59
  },
60
+ /**
61
+ * It sets the height of the icon.
62
+ */
45
63
  height: {
46
64
  type: [Number, String],
47
65
  default: 24
48
66
  },
67
+ /**
68
+ * It sets fill property of the icon.
69
+ */
49
70
  stroke: {
50
71
  type: String,
51
72
  default: null
52
73
  },
74
+ /**
75
+ * It sets the color of the icon.
76
+ */
53
77
  color: {
54
78
  type: String,
55
79
  default: null,
@@ -59,10 +83,16 @@ export default {
59
83
  typeof(tailwindConfig.theme.colors[value]) != 'undefined'
60
84
  }
61
85
  },
86
+ /**
87
+ * It set a animation icon if needed.
88
+ */
62
89
  loaderIcon: {
63
90
  type: String,
64
91
  default: 'hourglass_top'
65
92
  },
93
+ /**
94
+ * It sets a error when the icon is not available.
95
+ */
66
96
  loaderErrorIcon: {
67
97
  type: String,
68
98
  default: 'more_horiz'
package/src/index.js CHANGED
@@ -5,6 +5,10 @@ import PsSlider from './components/controls/PsSlider.vue'
5
5
  import PsSwitch from './components/controls/PsSwitch.vue'
6
6
  import PsToggle from './components/controls/PsToggle.vue'
7
7
  import PsInput from './components/forms/PsInput.vue'
8
+ import PsDropdown from './components/forms/PsDropdown.vue'
9
+ import PsDropdownList from './components/forms/PsDropdownList.vue'
10
+ import PsInputTextArea from './components/forms/PsInputTextArea.vue'
11
+ import PsInputSelect from './components/forms/PsInputSelect.vue'
8
12
  import PsDialog from './components/notifications/PsDialog.vue'
9
13
  import PsToast from './components/notifications/PsToast.vue'
10
14
  import PsTabHeader from './components/tabs/PsTabHeader.vue'
@@ -22,8 +26,9 @@ import PsDraggable from './components/controls/PsDraggable.vue'
22
26
  import PsCardInfos from './components/badges-and-tags/PsCardInfos.vue'
23
27
  import PsChartLegend from './components/badges-and-tags/PsChartLegend.vue'
24
28
  import PsInlineSelector from './components/controls/PsInlineSelector.vue'
25
- import PsInputTextArea from './components/forms/PsInputTextArea.vue'
26
- import PsInputSelect from './components/forms/PsInputSelect.vue'
29
+ import PsScrollBar from './components/playground/PsScrollBar.vue'
30
+
31
+
27
32
 
28
33
  export default {
29
34
  install(Vue) {
@@ -53,6 +58,25 @@ export default {
53
58
  Vue.component('PsInlineSelector', PsInlineSelector)
54
59
  Vue.component('PsInputTextArea', PsInputTextArea)
55
60
  Vue.component('PsInputSelect', PsInputSelect)
61
+ Vue.component('PsDropdown',PsDropdown)
62
+ Vue.component('PsDropdownList', PsDropdownList)
63
+ Vue.component('PsScrollBar', PsScrollBar)
64
+
65
+ Vue.directive('click-outside', {
66
+ bind: function (el, binding, vnode) {
67
+ el.clickOutsideEvent = function (event) {
68
+ // here I check that click was outside the el and his children
69
+ if (!(el == event.target || el.contains(event.target))) {
70
+ // and if it did, call method provided in attribute value
71
+ vnode.context[binding.expression](event)
72
+ }
73
+ }
74
+ document.body.addEventListener('click', el.clickOutsideEvent)
75
+ },
76
+ unbind: function (el) {
77
+ document.body.removeEventListener('click', el.clickOutsideEvent)
78
+ },
79
+ })
56
80
  },
57
81
  }
58
82
 
@@ -83,4 +107,8 @@ export {
83
107
  PsInlineSelector,
84
108
  PsInputTextArea,
85
109
  PsInputSelect,
110
+ PsDropdown,
111
+ PsDropdownList,
112
+ PsScrollBar
86
113
  }
114
+
@@ -1,21 +1,10 @@
1
- import PsAccordionItem, {
2
- iconTypes,
3
- fontCss,
4
- } from '../components/accordion/PsAccordionItem.vue'
5
- import PsAccordion, { sizes } from '../components/accordion/PsAccordion.vue'
1
+ import PsAccordionItem from '../components/accordion/PsAccordionItem.vue'
2
+ import PsAccordion from '../components/accordion/PsAccordion.vue'
6
3
 
7
4
  export default {
8
5
  title: 'Components/Accordion',
9
6
  component: PsAccordion,
10
7
  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
- },
19
8
  }
20
9
 
21
10
 
@@ -23,8 +12,8 @@ export const Index = (args, { argTypes }) => ({
23
12
  props: Object.keys(argTypes, args),
24
13
  components: { PsAccordion, PsAccordionItem },
25
14
  template:
26
- `<div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-2 psui-gap-6">
27
-
15
+ `
16
+ <div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-2 psui-gap-6">
28
17
  <div>
29
18
  <div class="psui-my-4">
30
19
  <h1 class="psui-font-bold psui-border-b psui-border-gray-30">Accordion Big</h1>
@@ -32,6 +21,10 @@ export const Index = (args, { argTypes }) => ({
32
21
  <PsAccordion layout="big" class="psui-bg-white">
33
22
  <PsAccordionItem title="Header 01">
34
23
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
24
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
25
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
26
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
27
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
35
28
  </PsAccordionItem>
36
29
  <PsAccordionItem title="Header 02">
37
30
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
@@ -49,6 +42,9 @@ export const Index = (args, { argTypes }) => ({
49
42
  <PsAccordion layout="medium" class="psui-bg-white">
50
43
  <PsAccordionItem title="Header 01">
51
44
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
45
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
46
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
47
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
52
48
  </PsAccordionItem>
53
49
  <PsAccordionItem title="Header 02" :opened="false">
54
50
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
@@ -58,38 +54,6 @@ export const Index = (args, { argTypes }) => ({
58
54
  </PsAccordionItem>
59
55
  </PsAccordion>
60
56
  </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>
57
+ </div>
94
58
  `,
95
59
  })
@@ -6,12 +6,12 @@ export default {
6
6
  argTypes: {
7
7
  size: { control: { type: 'select', options: sizes } },
8
8
  disabled: { control: 'boolean' },
9
- icon: { control: { type: 'select', options: icons} },
10
- iconRight: { control: { type: 'select', options: icons} }
9
+ icon: { control: { type: 'select', options: icons } },
10
+ iconRight: { control: { type: 'select', options: icons } },
11
11
  },
12
12
  }
13
13
 
14
- const TemplateDefault = (args, {argTypes}) => ({
14
+ const TemplateDefault = (args, { argTypes }) => ({
15
15
  props: Object.keys(argTypes),
16
16
  components: { PsButton },
17
17
  template: `
@@ -19,7 +19,7 @@ const TemplateDefault = (args, {argTypes}) => ({
19
19
  <p>Size: Big</p>
20
20
  <div style="display: flex; flex-direction: column; gap: 10px;">
21
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>
22
+ <span style="text-align: center; color: black;">Solid Style</span>
23
23
  <PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left'/>
24
24
  <PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right'/>
25
25
  <PsButton label='Text Only' layout='solid' />
@@ -46,11 +46,20 @@ const TemplateDefault = (args, {argTypes}) => ({
46
46
  <PsButton label='Text Only' layout='onlytext'/>
47
47
  <PsButton label='Disabled' layout='onlytext' icon='verified' iconPosition='left' disabled/>
48
48
  </div>
49
+ <div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
50
+ <span style="text-align: center; color: red;">Caution Button</span>
51
+ <PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left'/>
52
+ <PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right'/>
53
+ <PsButton label='Text Only' layout='caution' />
54
+ <PsButton label='Disabled' layout='caution' icon='verified' iconPosition='left' disabled/>
55
+ </div>
56
+
57
+
49
58
  </div>
50
59
  <p>Size: Medium</p>
51
60
  <div style="display: flex; flex-direction: column; gap: 10px;">
52
61
  <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>
62
+ <span style="text-align: center; color: black;">Solid Style</span>
54
63
  <PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='medium'/>
55
64
  <PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='medium'/>
56
65
  <PsButton label='Text Only' layout='solid' size='medium'/>
@@ -77,11 +86,18 @@ const TemplateDefault = (args, {argTypes}) => ({
77
86
  <PsButton label='Text Only' layout='onlytext' size='medium'/>
78
87
  <PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left' size='medium'/>
79
88
  </div>
89
+ <div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
90
+ <span style="text-align: center; color: red;">Caution Button</span>
91
+ <PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left' size='medium'/>
92
+ <PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right' size='medium'/>
93
+ <PsButton label='Text Only' layout='caution' size='medium'/>
94
+ <PsButton label='Disabled' layout='caution' icon='verified' iconPosition='left' disabled size='medium'/>
95
+ </div>
80
96
  </div>
81
97
  <p>Size: Small</p>
82
98
  <div style="display: flex; flex-direction: column; gap: 10px;">
83
99
  <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>
100
+ <span style="text-align: center; color: black;">Solid Style</span>
85
101
  <PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='small'/>
86
102
  <PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='small'/>
87
103
  <PsButton label='Text Only' layout='solid' size='small'/>
@@ -94,9 +110,16 @@ const TemplateDefault = (args, {argTypes}) => ({
94
110
  <PsButton label='Text Only' layout='onlytext' size='small'/>
95
111
  <PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left' size='small'/>
96
112
  </div>
113
+ <div style="display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
114
+ <span style="text-align: center; color: red;">Caution Button</span>
115
+ <PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left' size='small'/>
116
+ <PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right' size='small'/>
117
+ <PsButton label='Text Only' layout='caution' size='small'/>
118
+ <PsButton label='Disabled' layout='caution' disabled icon='verified' iconPosition='left' size='small'/>
119
+ </div>
97
120
  </div>
98
121
  </div>
99
- `
122
+ `,
100
123
  })
101
124
 
102
125
  export const Default = TemplateDefault.bind({})
@@ -13,8 +13,12 @@ const Template = (args, { argTypes }) => ({
13
13
  isChecked: null,
14
14
  }
15
15
  },
16
- template: `<div >
17
- <PsChips v-bind='$props' @update:checked='isChecked = $event' :checked='isChecked'/>
16
+ template: `<div style="display:flex; gap: 10px;">
17
+ <PsChips v-bind='$props' type="button" @update:checked='isChecked = $event' :checked='isChecked'/>
18
+ <PsChips v-bind='$props' label="Simple chips with icons" type="button" layout="with-icon" icon="home" @update:checked='isChecked = $event' :checked='isChecked'/>
19
+ <PsChips v-bind='$props' label="Radio chips" type="radio" @update:checked='isChecked = $event' :checked='isChecked'/>
20
+ <PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='isChecked = $event' :checked='isChecked'/>
21
+ <PsChips v-bind='$props' label="Rich chips" type="button" layout="rich" icon="text_snippet" @update:checked='isChecked = $event' :checked='isChecked'/>
18
22
  </div>
19
23
  `
20
24
  })
@@ -41,4 +45,12 @@ export const Checkbox = Template.bind({})
41
45
  Checkbox.args = {
42
46
  label: 'Checkbox Chip',
43
47
  type: 'checkbox'
48
+ }
49
+
50
+ export const Rich = Template.bind({})
51
+ Rich.args = {
52
+ label: 'Rich Chip',
53
+ type: 'button',
54
+ icon: 'text_snippet',
55
+ layout: 'rich'
44
56
  }
@@ -1,32 +1,55 @@
1
1
  import PsDropdown from '../components/forms/PsDropdown.vue'
2
+ import PsDropdownList from '../components/forms/PsDropdownList.vue'
2
3
  export default {
3
- title: 'Components/Dropdown',
4
- component: PsDropdown,
5
- argTypes: {},
4
+ title: 'Components/Dropdown',
5
+ component: { PsDropdown , PsDropdownList },
6
6
  }
7
7
 
8
8
  const Template = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
- components: { PsDropdown },
10
+ components: { PsDropdown, PsDropdownList },
11
11
  template: `
12
- <div>
13
- <PsDropdown
14
- buttonClasses="psui-p-3 "
15
- >
12
+ <div style='background: #E6ECF2; width:900px; height: 700px; padding: 20px;' class='psui-flex psui-gap-64 psui-bg-gray-20 '>
13
+ <PsDropdown>
16
14
  <template v-slot:dropdownTrigger>
17
- <div>Custom Trigger</div>
15
+ <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-2'>more_horiz</i>
18
16
  </template>
19
17
  <template v-slot:items>
18
+ <p class='psui-uppercase psui-text-gray-40' style='padding: 24px 20px 8px 20px;'>divider label</p>
20
19
  <ul>
21
- <li>Small list of the drop down</li>
20
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>public</i><span>Selectable option 01</span></li>
21
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>share</i><span>Selectable option 02</span></li>
22
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>person</i><span>Selectable option 03</span></li>
23
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>settings</i><span>Selectable option 04</span></li>
24
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>save</i><span>Selectable option 05</span></li>
25
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
22
26
  </ul>
27
+ <p class='psui-uppercase psui-text-gray-40' style='padding: 24px 20px 8px 20px;'>divider label</p>
28
+ <ul>
29
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 01</li>
30
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 02</li>
31
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 03</li>
32
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 04</li>
33
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 05</li>
34
+ <li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 06</li>
35
+ </ul>
36
+
37
+ </template>
38
+ </PsDropdown>
39
+ <PsDropdown>
40
+ <template v-slot:dropdownTrigger>
41
+ <i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
23
42
  </template>
43
+ <template v-slot:items>
44
+ <PsDropdownList v-bind='$props'></PsDropdownList>
45
+ </template>
24
46
  </PsDropdown>
25
47
  </div>
26
48
  `,
27
49
  })
28
50
 
29
- export const CustomTrigger = Template.bind({})
30
- CustomTrigger.args = {
31
- title: 'Custom trigger',
51
+
52
+ export const DropdownMenu= Template.bind({})
53
+ DropdownMenu.args = {
54
+ items: ["Selectable option 01", "Selectable option 02", "Selectable option 03", "Selectable option 04"]
32
55
  }
@@ -0,0 +1,16 @@
1
+ import PsScrollBar from '../components/playground/PsScrollBar.vue'
2
+
3
+ export default {
4
+ title: 'Components/Playground',
5
+ component: PsScrollBar
6
+ }
7
+
8
+ const Template = (args, {argTypes}) => ({
9
+ props: Object.keys(argTypes),
10
+ components: { PsScrollBar},
11
+ template: `
12
+ <PsScrollBar v-bind='$props'></PsScrollbar>
13
+ `
14
+ })
15
+
16
+ export const ScrollBar = Template.bind({})