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

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 (43) hide show
  1. package/.storybook/main.js +9 -1
  2. package/dist/css/psui_styles.css +14742 -14620
  3. package/package.json +4 -1
  4. package/postcss.config.js +2 -0
  5. package/src/assets/scss/base.scss +5 -4
  6. package/src/assets/scss/components/PsInput.scss +89 -0
  7. package/src/components/accordion/PsAccordion.vue +18 -22
  8. package/src/components/accordion/PsAccordionItem.vue +5 -5
  9. package/src/components/badges-and-tags/PsChartLegend.vue +128 -0
  10. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
  11. package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
  12. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
  13. package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
  14. package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
  15. package/src/components/buttons/PsButton.vue +1 -1
  16. package/src/components/chips/PsChips.vue +10 -20
  17. package/src/components/controls/PsCheckbox.vue +29 -16
  18. package/src/components/controls/PsDraggable.vue +171 -25
  19. package/src/components/controls/PsRadioButton.vue +25 -19
  20. package/src/components/forms/PsInput.vue +122 -102
  21. package/src/components/notifications/PsDialog.vue +37 -18
  22. package/src/components/tooltip/PsRichTooltip.vue +6 -0
  23. package/src/components/tooltip/PsTooltip.vue +1 -3
  24. package/src/index.js +9 -9
  25. package/src/stories/Accordion.stories.js +28 -22
  26. package/src/stories/ChartLegend.stories.js +16 -0
  27. package/src/stories/Chips.stories.js +7 -1
  28. package/src/stories/ClimateZoneBadge.stories.js +24 -0
  29. package/src/stories/Colors.stories.mdx +1 -1
  30. package/src/stories/CostEffectBar.stories.js +23 -0
  31. package/src/stories/Dialog.stories.js +141 -8
  32. package/src/stories/Draggable.stories.js +4 -6
  33. package/src/stories/Dropdown.stories.js +3 -5
  34. package/src/stories/HighlightRippleDot.stories.js +16 -0
  35. package/src/stories/Input.stories.js +36 -5
  36. package/src/stories/MiniTag.stories.js +46 -0
  37. package/src/stories/ProgressBar.stories.js +23 -0
  38. package/src/stories/RadioButton.stories.js +2 -2
  39. package/src/stories/Toggle.stories.js +7 -8
  40. package/src/stories/Tooltip.stories.js +5 -4
  41. package/src/util/GeneralFunctions.js +6 -7
  42. package/src/util/imageLoader.js +1 -1
  43. package/tailwind.config.js +72 -50
@@ -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">
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
  }
@@ -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: "",
@@ -21,11 +21,10 @@
21
21
  class="
22
22
  psui-flex
23
23
  psui-flex-col
24
- psui-py-1
25
- psui-px-2
26
24
  psui-rounded-md
27
25
  psui-shadow-md
28
26
  psui-z-20
27
+ psui-p-4
29
28
  "
30
29
  aria-orientation="vertical"
31
30
  :class="cssClass"
@@ -69,7 +68,6 @@ export default {
69
68
  }
70
69
  },
71
70
  mounted() {
72
- console.log(this.$attrs)
73
71
  document.addEventListener("resize", this.updatePosition)
74
72
  },
75
73
  beforeDestroy() {
package/src/index.js CHANGED
@@ -21,12 +21,12 @@ import PsDraggable from './components/controls/PsDraggable.vue'
21
21
 
22
22
  export default {
23
23
  install(Vue) {
24
- Vue.component('PsButton', PsButton)
25
- Vue.component('PsCheckbox', PsCheckbox)
26
- Vue.component('PsDialog', PsDialog)
27
- Vue.component('PsToast', PsToast)
28
- Vue.component('PsTabHeader', PsTabHeader)
29
- Vue.component('PsRadioButton', PsRadioButton)
24
+ Vue.component('PsButton', PsButton)
25
+ Vue.component('PsCheckbox', PsCheckbox)
26
+ Vue.component('PsDialog', PsDialog)
27
+ Vue.component('PsToast', PsToast)
28
+ Vue.component('PsTabHeader', PsTabHeader)
29
+ Vue.component('PsRadioButton', PsRadioButton)
30
30
  Vue.component('PsSlider', PsSlider)
31
31
  Vue.component('PsSwitch', PsSwitch)
32
32
  Vue.component('PsInput', PsInput)
@@ -41,7 +41,7 @@ export default {
41
41
  Vue.component('PsRichTooltip', PsRichTooltip)
42
42
  Vue.component('PsDialogTooltip', PsDialogTooltip)
43
43
  Vue.component('PsDraggable', PsDraggable)
44
- }
44
+ },
45
45
  }
46
46
 
47
47
  export {
@@ -63,5 +63,5 @@ export {
63
63
  PsTooltip,
64
64
  PsRichTooltip,
65
65
  PsDialogTooltip,
66
- PsDraggable
67
- }
66
+ PsDraggable,
67
+ }
@@ -1,35 +1,41 @@
1
- import PsAccordionItem, {iconTypes, fontCss} from "../components/accordion/PsAccordionItem.vue"
2
- import PsAccordion, {sizes} from "../components/accordion/PsAccordion.vue"
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
- title: 'Components/Accordion',
6
- component: PsAccordion,
7
- subcomponents: { PsAccordionItem },
8
- argTypes:{
9
- size: { control: { type: 'select', options: sizes } },
10
- iconType: {control : {type: 'select', options: iconTypes}},
11
- fontCss: {control : { type: 'select', options: fontCss}}
12
- },
13
- args: {
14
- title: 'Section 1',
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
21
  export const AccordionItem = (args, { argTypes }) => ({
19
22
  props: Object.keys(argTypes, args),
20
23
  components: { PsAccordionItem },
21
- template: '<PsAccordionItem v-bind="$props"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p></PsAccordionItem>',
24
+ template: `
25
+ <PsAccordionItem v-bind="$props" style='width:400px'>
26
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p>
27
+ </PsAccordionItem>
28
+ `,
22
29
  })
23
30
  AccordionItem.parameters = {
24
- controls: {
25
- include: ['title', 'iconType', 'fontCss']
26
- }
31
+ controls: {
32
+ include: ['title', 'iconType', 'fontCss'],
33
+ },
27
34
  }
28
35
 
29
36
  export const Accordion = (args, { argTypes }) => ({
30
- props: Object.keys(argTypes, args),
31
- components: { PsAccordion, PsAccordionItem },
32
- template: '<PsAccordion v-bind="$props"><PsAccordionItem v-bind="$props"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p></PsAccordionItem><PsAccordionItem v-bind="$props"/></PsAccordion>',
37
+ props: Object.keys(argTypes, args),
38
+ components: { PsAccordion, PsAccordionItem },
39
+ template:
40
+ '<PsAccordion v-bind="$props"><PsAccordionItem v-bind="$props"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptates, illum.</p></PsAccordionItem><PsAccordionItem v-bind="$props"/></PsAccordion>',
33
41
  })
34
-
35
-
@@ -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 = {}
@@ -8,8 +8,14 @@ export default {
8
8
  const Template = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsChips },
11
+ data: ()=>{
12
+ return{
13
+ isChecked: null,
14
+ }
15
+ },
11
16
  template: `<div >
12
- <PsChips v-bind='$props'/>
17
+ <PsChips v-bind='$props' @update:checked='isChecked = $event' :checked='isChecked'/>
18
+ <pre>{{isChecked}}</pre>
13
19
  </div>
14
20
  `
15
21
  })
@@ -0,0 +1,24 @@
1
+ import PsClimateZoneBadge from '../components/badges-and-tags/PsClimateZoneBadge.vue'
2
+
3
+ // const icons = ["area_chart"];
4
+
5
+ export default {
6
+ title: 'Components/ClimateZoneBadge',
7
+ component: PsClimateZoneBadge,
8
+ argTypes: {
9
+ type: {
10
+ // icon: { control: { type: "select", options: icons } },
11
+ },
12
+ },
13
+ }
14
+
15
+ const Template = (args, { argTypes }) => ({
16
+ props: Object.keys(argTypes),
17
+ components: { PsClimateZoneBadge },
18
+ template: '<PsClimateZoneBadge v-bind="$props" />',
19
+ })
20
+
21
+ export const ClimateZoneBadge = Template.bind({})
22
+ ClimateZoneBadge.args = {
23
+ icon: 'area_chart',
24
+ }
@@ -11,7 +11,7 @@ Out colors are designed to be harmonious, ensure accessible text, and distinguis
11
11
 
12
12
  ## Blue
13
13
  <div class="psui-flex">
14
- <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-blue click-to-copy" data-to-copy="psui-bg-blue">Blue #5094D3</div>
14
+ <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-blue click-to-copy" data-to-copy="psui-bg-blue">Blue <div>#5094D3</div></div>
15
15
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-blue-80 click-to-copy" data-to-copy="psui-bg-blue-80">Blue 80 <div>#002A3A</div></div>
16
16
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-blue-70 click-to-copy" data-to-copy="psui-bg-blue-70">Blue 70 <div>#00465F</div></div>
17
17
  <div class="psui-cursor-pointer psui-p-2 psui-h-24 psui-w-32 psui-text-white psui-bg-blue-60 click-to-copy" data-to-copy="psui-bg-blue-60">Blue 60 <div>#318FAC</div></div>
@@ -0,0 +1,23 @@
1
+ import PsCostEffectBar from '../components/badges-and-tags/PsCostEffectBar.vue'
2
+
3
+ export default {
4
+ title: 'Components/CostEffectBar',
5
+ component: PsCostEffectBar,
6
+ argTypes: {
7
+ value: {
8
+ control: { type: 'number', min: 0, max: 100 },
9
+ },
10
+ breakEven: {
11
+ control: { type: 'number', min: 0, max: 100 },
12
+ },
13
+ },
14
+ }
15
+
16
+ const Template = (args, { argTypes }) => ({
17
+ props: Object.keys(argTypes),
18
+ components: { PsCostEffectBar },
19
+ template: '<PsCostEffectBar v-bind="$props" />',
20
+ })
21
+
22
+ export const SimpleProgressBar = Template.bind({})
23
+ SimpleProgressBar.args = {}
@@ -3,32 +3,165 @@ import PsDialog from '../components/notifications/PsDialog.vue'
3
3
  export default {
4
4
  title: 'Components/Dialog',
5
5
  component: PsDialog,
6
- argTypes: {
7
- type: { control: { type: 'select', options: ['informative', 'success', 'alert'] } },
8
- },
9
6
  }
10
7
 
11
8
  const Template = (args, { argTypes }) => ({
12
9
  props: Object.keys(argTypes),
13
10
  components: { PsDialog },
14
- template: '<PsDialog v-bind="$props" />',
11
+ template: `
12
+ <PsDialog v-bind="$props">
13
+ <template v-slot:content>
14
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
15
+ </template>
16
+ <template v-slot:action>
17
+ <p style='font-weight: 700;'>Action</p>
18
+ </template>
19
+ </PsDialog>
20
+ `,
15
21
  })
16
22
 
23
+ const TemplateExamples = (args, { argTypes }) => ({
24
+ props: Object.keys(argTypes),
25
+ components: { PsDialog },
26
+ template: `
27
+ <div class="psui-grid psui-grid-cols-3 psui-gap-4">
28
+
29
+ <div class="psui-col-span-3 psui-mt-8">
30
+ <h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSDialog Horizontal</h1>
31
+ </div>
32
+
33
+ <div>
34
+ <h2>Informative</h2>
35
+ <PsDialog status="informative" layout="horizontal">
36
+ <template v-slot:content>
37
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
38
+ </template>
39
+ <template v-slot:action>
40
+ <p style='font-weight: 700;'>Action</p>
41
+ </template>
42
+ </PsDialog>
43
+ </div>
44
+
45
+ <div>
46
+ <h2>Success</h2>
47
+ <PsDialog status="success" layout="horizontal">
48
+ <template v-slot:content>
49
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
50
+ </template>
51
+ <template v-slot:action>
52
+ <p style='font-weight: 700;'>Action</p>
53
+ </template>
54
+ </PsDialog>
55
+ </div>
56
+
57
+ <div>
58
+ <h2>Alert</h2>
59
+ <PsDialog status="alert" layout="horizontal">
60
+ <template v-slot:content>
61
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
62
+ </template>
63
+ <template v-slot:action>
64
+ <p style='font-weight: 700;'>Action</p>
65
+ </template>
66
+ </PsDialog>
67
+ </div>
68
+
69
+ <div class="psui-col-span-3 psui-mt-8">
70
+ <h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSDialog Vertical</h1>
71
+ </div>
72
+
73
+ <div>
74
+ <h2>Informative</h2>
75
+ <PsDialog status="informative" layout="vertical">
76
+ <template v-slot:content>
77
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
78
+ </template>
79
+ <template v-slot:action>
80
+ <p style='font-weight: 700;'>Action</p>
81
+ </template>
82
+ </PsDialog>
83
+ </div>
84
+
85
+ <div>
86
+ <h2>Success</h2>
87
+ <PsDialog status="success" layout="vertical">
88
+ <template v-slot:content>
89
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
90
+ </template>
91
+ <template v-slot:action>
92
+ <p style='font-weight: 700;'>Action</p>
93
+ </template>
94
+ </PsDialog>
95
+ </div>
96
+
97
+ <div>
98
+ <h2>Alert</h2>
99
+ <PsDialog status="alert" layout="vertical">
100
+ <template v-slot:content>
101
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
102
+ </template>
103
+ <template v-slot:action>
104
+ <p style='font-weight: 700;'>Action</p>
105
+ </template>
106
+ </PsDialog>
107
+ </div>
108
+
109
+
110
+
111
+ <!-- PSDialog Vertical -->
112
+ <div class="psui-col-span-3 psui-mt-8">
113
+ <h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSDialog Vertical Props Message</h1>
114
+ </div>
115
+
116
+ <div>
117
+ <h2>Informative</h2>
118
+ <PsDialog status="informative" layout="vertical" message="This component uses only the props message!">
119
+ <template v-slot:action>
120
+ <p style='font-weight: 700;'>Action</p>
121
+ </template>
122
+ </PsDialog>
123
+ </div>
124
+
125
+ <div>
126
+ <h2>Success</h2>
127
+ <PsDialog status="success" layout="vertical" message="This component uses only the props message!">
128
+ <template v-slot:action>
129
+ <p style='font-weight: 700;'>Action</p>
130
+ </template>
131
+ </PsDialog>
132
+ </div>
133
+
134
+ <div>
135
+ <h2>Alert</h2>
136
+ <PsDialog status="alert" layout="vertical" message="This component uses only the props message!">
137
+ <template v-slot:action>
138
+ <p style='font-weight: 700;'>Action</p>
139
+ </template>
140
+ </PsDialog>
141
+ </div>
142
+
143
+ </div>
144
+ `,
145
+ })
146
+
147
+ export const Examples = TemplateExamples.bind({})
148
+
17
149
  export const Informative = Template.bind({})
18
150
  Informative.args = {
19
- type: 'informative',
20
- message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
151
+ status: 'informative',
152
+ layout: 'vertical',
153
+ cssClass: 'psui-w-2/3'
21
154
  }
22
155
 
23
156
  export const Success = Template.bind({})
24
157
  Success.args = {
25
- type: 'success',
158
+ status: 'success',
26
159
  message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
27
160
  }
28
161
 
29
162
  export const Warning = Template.bind({})
30
163
  Warning.args = {
31
- type: 'alert',
164
+ status: 'alert',
32
165
  message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
33
166
  }
34
167
 
@@ -9,16 +9,14 @@ const Template = (args, {argTypes}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDraggable },
11
11
  template: `
12
- <div style='width: 200px'>
13
- <PsDraggable v-bind='$props'>
14
- <button>Teste 1</button>
15
- <button>Teste 2</button>
16
- </PSDraggable>
12
+ <div style='width: 300px; font-family: "Lato", sans-serif; font-size: 12px;'>
13
+ <PsDraggable v-bind='$props'/>
17
14
  </div>
18
15
  `
19
16
  })
20
17
 
21
18
  export const Component = Template.bind({})
22
19
  Component.args = {
23
- data: [{title: 'Teste 1', columns: [ 1 , 2 , 3, 4]}]
20
+ getColumns: {columnGroups:[{title: 'COST EFFECTIVENESS', columns: [ 'Teste1' , 'Teste2' , 'Teste3', 'Teste4']}, {title: 'PER HOME RESULTS', columns: [ 'Teste5' , 'Teste6' , 'Teste7', 'Teste8']}]},
21
+ module: 'comparison'
24
22
  }
@@ -2,8 +2,7 @@ import PsDropdown from '../components/forms/PsDropdown.vue'
2
2
  export default {
3
3
  title: 'Components/Dropdown',
4
4
  component: PsDropdown,
5
- argTypes: {
6
- },
5
+ argTypes: {},
7
6
  }
8
7
 
9
8
  const Template = (args, { argTypes }) => ({
@@ -24,11 +23,10 @@ const Template = (args, { argTypes }) => ({
24
23
  </template>
25
24
  </PsDropdown>
26
25
  </div>
27
- `
26
+ `,
28
27
  })
29
28
 
30
29
  export const CustomTrigger = Template.bind({})
31
30
  CustomTrigger.args = {
32
- title: 'Custom trigger'
31
+ title: 'Custom trigger',
33
32
  }
34
-
@@ -0,0 +1,16 @@
1
+ import PsHighlightRippleDot from '../components/badges-and-tags/PsHighlightRippleDot.vue'
2
+
3
+ export default {
4
+ title: 'Components/HighlightRippleDot',
5
+ component: PsHighlightRippleDot,
6
+ argTypes: {},
7
+ }
8
+
9
+ const Template = (args, { argTypes }) => ({
10
+ props: Object.keys(argTypes),
11
+ components: { PsHighlightRippleDot },
12
+ template: '<PsHighlightRippleDot v-bind="$props" />',
13
+ })
14
+
15
+ export const HighlightRippleDot = Template.bind({})
16
+ HighlightRippleDot.args = {}
@@ -19,10 +19,41 @@ const TemplateDefault = (args, { argTypes }) => ({
19
19
  }
20
20
  }
21
21
  },
22
- template: `
23
- <div class="psui-p-8 psui-bg-gray-10">
24
- <PsInput v-bind="$props" />
25
- <PsInput v-bind="$props" class="psui-mt-8" :validator="validator" />
22
+ template: `
23
+ <div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-3 psui-gap-6">
24
+
25
+ <PsInput v-bind="{...$props, label: 'Resting with hint', placeholder: '', value: '' }" />
26
+
27
+ <PsInput label="Resting without hint" />
28
+
29
+ <PsInput label="Resting with Placeholder" placeholder="This is a placeholder" />
30
+
31
+
32
+ <PsInput v-bind="{...$props, label: 'Focus'}" />
33
+
34
+ <PsInput label="Typing" placeholder="Type to see the effect..." />
35
+
36
+ <PsInput v-bind="{...$props, label: 'Active', active: true }" />
37
+
38
+
39
+ <PsInput v-bind="{...$props, label: 'Error', hasError: true }" />
40
+
41
+ <PsInput v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
42
+
43
+ <PsInput v-bind="{...$props, label: 'Prepend / Append ' }" >
44
+ <template v-slot:append>
45
+ Append
46
+ </template>
47
+ <template v-slot:prepend>
48
+ Prepend
49
+ </template>
50
+ </PsInput>
51
+
52
+
53
+ <PsInput label="Disabled" :disabled="true" value="100,000" />
54
+ <PsInput v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }" />
55
+ <PsInput v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" />
56
+
26
57
  </div>
27
58
  `
28
59
  })
@@ -56,7 +87,7 @@ const TemplateSlots = (args, { argTypes }) => ({
56
87
 
57
88
  export const InputText = TemplateDefault.bind({})
58
89
  InputText.args = {
59
- label: 'Label',
90
+ label: 'Input Text',
60
91
  placeholder: 'Placeholder',
61
92
  hint: 'Optional Assistive text',
62
93
  disabled: false,
@@ -0,0 +1,46 @@
1
+ import PsMiniTag, {
2
+ typeOptions,
3
+ } from '../components/badges-and-tags/PsMiniTag.vue'
4
+
5
+ export default {
6
+ title: 'Components/MiniTag',
7
+ component: PsMiniTag,
8
+ argTypes: {
9
+ type: {
10
+ control: {
11
+ type: 'select',
12
+ options: typeOptions,
13
+ },
14
+ },
15
+ },
16
+ }
17
+
18
+ const Template = (args, { argTypes }) => ({
19
+ props: Object.keys(argTypes),
20
+ components: { PsMiniTag },
21
+ template: '<PsMiniTag v-bind="$props" />',
22
+ })
23
+
24
+ export const Informative = Template.bind({})
25
+ Informative.args = {
26
+ type: 'informative',
27
+ message: 'This is an info alert',
28
+ }
29
+
30
+ export const Success = Template.bind({})
31
+ Success.args = {
32
+ type: 'success',
33
+ message: 'This is a success alert',
34
+ }
35
+
36
+ export const Warning = Template.bind({})
37
+ Warning.args = {
38
+ type: 'warning',
39
+ message: 'This is a warning alert',
40
+ }
41
+
42
+ export const Error = Template.bind({})
43
+ Error.args = {
44
+ type: 'error',
45
+ message: 'This is an error alert',
46
+ }