@policystudio/policy-studio-ui-vue 1.0.28 → 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 (81) hide show
  1. package/.storybook/preview.js +7 -1
  2. package/README.md +6 -2
  3. package/dist/css/psui_styles.css +1863 -210
  4. package/package.json +15 -5
  5. package/src/assets/scss/base.scss +4 -0
  6. package/src/assets/scss/components/PsAccordion.scss +28 -11
  7. package/src/assets/scss/components/PsButton.scss +39 -18
  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/PsClimateZoneBadge.scss +1 -1
  12. package/src/assets/scss/components/PsCostEffectBar.scss +22 -27
  13. package/src/assets/scss/components/PsDialog.scss +5 -2
  14. package/src/assets/scss/components/PsDotLoader.scss +45 -0
  15. package/src/assets/scss/components/PsDraggable.scss +64 -0
  16. package/src/assets/scss/components/PsDropdown.scss +5 -22
  17. package/src/assets/scss/components/PsDropdownList.scss +19 -0
  18. package/src/assets/scss/components/PsHighlightRippleDot.scss +1 -1
  19. package/src/assets/scss/components/PsInlineSelector.scss +92 -1
  20. package/src/assets/scss/components/PsInput.scss +8 -3
  21. package/src/assets/scss/components/PsInputSelect.scss +75 -30
  22. package/src/assets/scss/components/PsInputTextArea.scss +5 -2
  23. package/src/assets/scss/components/PsMiniTag.scss +36 -0
  24. package/src/assets/scss/components/PsRadioButton.scss +5 -5
  25. package/src/assets/scss/components/PsSwitch.scss +4 -4
  26. package/src/assets/scss/components/PsTabHeader.scss +14 -0
  27. package/src/assets/scss/components/PsToast.scss +3 -3
  28. package/src/assets/scss/components/PsToggle.scss +6 -2
  29. package/src/assets/scss/components/PsTooltip.scss +51 -18
  30. package/src/components/accordion/PsAccordion.vue +7 -23
  31. package/src/components/accordion/PsAccordionItem.vue +41 -25
  32. package/src/components/badges-and-tags/PsCardInfos.vue +12 -0
  33. package/src/components/badges-and-tags/PsChartLegend.vue +13 -0
  34. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +7 -0
  35. package/src/components/badges-and-tags/PsCostEffectBar.vue +6 -1
  36. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -1
  37. package/src/components/badges-and-tags/PsMiniTag.vue +21 -24
  38. package/src/components/badges-and-tags/PsProgressBar.vue +17 -9
  39. package/src/components/buttons/PsButton.vue +27 -2
  40. package/src/components/chips/PsChips.vue +24 -4
  41. package/src/components/controls/PsCheckbox.vue +32 -16
  42. package/src/components/controls/PsDraggable.vue +39 -150
  43. package/src/components/controls/PsInlineSelector.vue +144 -6
  44. package/src/components/controls/PsRadioButton.vue +28 -15
  45. package/src/components/controls/PsSlider.vue +1 -1
  46. package/src/components/controls/PsSwitch.vue +20 -11
  47. package/src/components/controls/PsToggle.vue +33 -12
  48. package/src/components/datatable/PsDataTable.vue +18 -0
  49. package/src/components/forms/PsDropdown.vue +18 -60
  50. package/src/components/forms/PsDropdownList.vue +82 -0
  51. package/src/components/forms/PsInput.vue +28 -1
  52. package/src/components/forms/PsInputSelect.vue +31 -2
  53. package/src/components/forms/PsInputTextArea.vue +53 -40
  54. package/src/components/notifications/PsDialog.vue +15 -0
  55. package/src/components/notifications/PsToast.vue +15 -0
  56. package/src/components/playground/PsScrollBar.vue +15 -0
  57. package/src/components/tabs/PsTabHeader.vue +19 -1
  58. package/src/components/tooltip/PsDialogTooltip.vue +103 -20
  59. package/src/components/tooltip/PsRichTooltip.vue +6 -3
  60. package/src/components/tooltip/PsTooltip.vue +19 -3
  61. package/src/components/ui/PsDotLoader.vue +15 -0
  62. package/src/components/ui/PsIcon.vue +30 -0
  63. package/src/index.js +39 -7
  64. package/src/stories/Accordion.stories.js +12 -48
  65. package/src/stories/Button.stories.js +30 -7
  66. package/src/stories/Chips.stories.js +14 -2
  67. package/src/stories/Colors.stories.mdx +1 -0
  68. package/src/stories/Dropdown.stories.js +36 -13
  69. package/src/stories/InlineSelector.stories.js +3 -1
  70. package/src/stories/InputSelect.stories.js +8 -0
  71. package/src/stories/MiniTag.stories.js +12 -6
  72. package/src/stories/Playground.stories.js +16 -0
  73. package/src/stories/Switch.stories.js +8 -2
  74. package/src/stories/Toast.stories.js +16 -16
  75. package/src/stories/Tooltip.stories.js +6 -6
  76. package/src/stories/Typography.stories.mdx +22 -18
  77. package/src/util/GeneralFunctions.js +8 -0
  78. package/tailwind.config.js +8 -3
  79. package/vetur/attributes.json +1376 -0
  80. package/vetur/tags.json +632 -0
  81. package/src/components/badges-and-tags/PsCostEffectBar.Copy.vue +0 -72
@@ -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(() => {
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div class="psui-el-dotloader">
3
+ <div class="psui-el-dotloader-wrapper">
4
+ <span></span>
5
+ <span></span>
6
+ <span></span>
7
+ </div>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ name: 'PsDotLoader',
14
+ }
15
+ </script>
@@ -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'
@@ -14,6 +18,7 @@ import PsChips from './components/chips/PsChips.vue'
14
18
  import PsDataTable from './components/datatable/PsDataTable.vue'
15
19
  import PsDataTableItem from './components/datatable/PsDataTableItem.vue'
16
20
  import PsIcon from './components/ui/PsIcon.vue'
21
+ import PsDotLoader from './components/ui/PsDotLoader.vue'
17
22
  import PsTooltip from './components/tooltip/PsTooltip.vue'
18
23
  import PsRichTooltip from './components/tooltip/PsRichTooltip.vue'
19
24
  import PsDialogTooltip from './components/tooltip/PsDialogTooltip.vue'
@@ -21,8 +26,9 @@ import PsDraggable from './components/controls/PsDraggable.vue'
21
26
  import PsCardInfos from './components/badges-and-tags/PsCardInfos.vue'
22
27
  import PsChartLegend from './components/badges-and-tags/PsChartLegend.vue'
23
28
  import PsInlineSelector from './components/controls/PsInlineSelector.vue'
24
- import PsInputTextArea from './components/forms/PsInputTextArea.vue'
25
- import PsInputSelect from './components/forms/PsInputSelect.vue'
29
+ import PsScrollBar from './components/playground/PsScrollBar.vue'
30
+
31
+
26
32
 
27
33
  export default {
28
34
  install(Vue) {
@@ -42,6 +48,7 @@ export default {
42
48
  Vue.component('PsDataTable', PsDataTable)
43
49
  Vue.component('PsDataTableItem', PsDataTableItem)
44
50
  Vue.component('PsIcon', PsIcon)
51
+ Vue.component('PsDotLoader', PsDotLoader)
45
52
  Vue.component('PsTooltip', PsTooltip)
46
53
  Vue.component('PsRichTooltip', PsRichTooltip)
47
54
  Vue.component('PsDialogTooltip', PsDialogTooltip)
@@ -51,25 +58,46 @@ export default {
51
58
  Vue.component('PsInlineSelector', PsInlineSelector)
52
59
  Vue.component('PsInputTextArea', PsInputTextArea)
53
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
+ })
54
80
  },
55
81
  }
56
82
 
57
83
  export {
58
84
  PsButton,
59
85
  PsCheckbox,
60
- PsDialog,
61
- PsToast,
62
- PsTabHeader,
63
86
  PsRadioButton,
64
87
  PsSlider,
65
88
  PsSwitch,
66
- PsInput,
67
89
  PsToggle,
90
+ PsInput,
91
+ PsDialog,
92
+ PsToast,
93
+ PsTabHeader,
68
94
  PsAccordion,
69
95
  PsAccordionItem,
70
96
  PsChips,
71
97
  PsDataTable,
72
98
  PsDataTableItem,
99
+ PsIcon,
100
+ PsDotLoader,
73
101
  PsTooltip,
74
102
  PsRichTooltip,
75
103
  PsDialogTooltip,
@@ -78,5 +106,9 @@ export {
78
106
  PsChartLegend,
79
107
  PsInlineSelector,
80
108
  PsInputTextArea,
81
- PsInputSelect
109
+ PsInputSelect,
110
+ PsDropdown,
111
+ PsDropdownList,
112
+ PsScrollBar
82
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
  }
@@ -54,6 +54,7 @@ Out colors are designed to be harmonious, ensure accessible text, and distinguis
54
54
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-red-80 click-to-copy" data-to-copy="psui-bg-red-80">Red 80 <div>#832F2E</div></div>
55
55
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-red-70 click-to-copy" data-to-copy="psui-bg-red-70">Red 70 <div>#AA3937</div></div>
56
56
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-red-20 click-to-copy" data-to-copy="psui-bg-red-20">Red 20 <div>#D65C5A</div></div>
57
+ <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-red-20 psui-bg-red-15 click-to-copy" data-to-copy="psui-bg-red-15">Red 15 <div>#EAC5C5</div></div>
57
58
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-red-20 psui-bg-red-10 click-to-copy" data-to-copy="psui-bg-red-10">Red 10 <div>#FCEBEB</div></div>
58
59
  </div>
59
60