@policystudio/policy-studio-ui-vue 1.0.17 → 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 (66) hide show
  1. package/.eslintrc.js +67 -0
  2. package/.storybook/main.js +11 -2
  3. package/.storybook/preview.js +1 -1
  4. package/README.md +8 -0
  5. package/babel.config.js +3 -0
  6. package/backup-package-lock.json +37194 -0
  7. package/{src/assets/scss/tailwind.css → dist/css/psui_styles.css} +16720 -17120
  8. package/package.json +32 -19
  9. package/postcss.config.js +2 -0
  10. package/src/assets/images/check-checkbox-button.svg +1 -0
  11. package/src/assets/images/radio-checked-button.svg +1 -0
  12. package/src/assets/scss/base.scss +6 -5
  13. package/src/assets/scss/components/PsInput.scss +89 -0
  14. package/src/components/accordion/PsAccordion.vue +40 -0
  15. package/src/components/accordion/PsAccordionItem.vue +102 -0
  16. package/src/components/badges-and-tags/PsChartLegend.vue +128 -0
  17. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
  18. package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
  19. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
  20. package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
  21. package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
  22. package/src/components/buttons/PsButton.vue +36 -13
  23. package/src/components/chips/PsChips.vue +154 -0
  24. package/src/components/controls/PsCheckbox.vue +30 -17
  25. package/src/components/controls/PsDraggable.vue +174 -3
  26. package/src/components/controls/PsRadioButton.vue +67 -60
  27. package/src/components/controls/PsSlider.vue +13 -12
  28. package/src/components/controls/PsSwitch.vue +76 -76
  29. package/src/components/datatable/PsDataTable.vue +89 -0
  30. package/src/components/datatable/PsDataTableItem.vue +57 -0
  31. package/src/components/forms/PsDropdown.vue +196 -0
  32. package/src/components/forms/PsInput.vue +122 -99
  33. package/src/components/notifications/PsDialog.vue +37 -18
  34. package/src/components/tabs/PsTabHeader.vue +20 -21
  35. package/src/components/tooltip/PsDialogTooltip.vue +79 -0
  36. package/src/components/tooltip/PsRichTooltip.vue +44 -0
  37. package/src/components/tooltip/PsTooltip.vue +118 -0
  38. package/src/components/ui/PsIcon.vue +128 -0
  39. package/src/index.js +53 -24
  40. package/src/stories/Accordion.stories.js +41 -0
  41. package/src/stories/Button.stories.js +11 -11
  42. package/src/stories/ChartLegend.stories.js +16 -0
  43. package/src/stories/Checkbox.stories.js +21 -14
  44. package/src/stories/Chips.stories.js +55 -0
  45. package/src/stories/ClimateZoneBadge.stories.js +24 -0
  46. package/src/stories/Colors.stories.mdx +36 -35
  47. package/src/stories/CostEffectBar.stories.js +23 -0
  48. package/src/stories/Datatable.stories.js +50 -0
  49. package/src/stories/Dialog.stories.js +150 -17
  50. package/src/stories/Draggable.stories.js +22 -0
  51. package/src/stories/Dropdown.stories.js +32 -0
  52. package/src/stories/HighlightRippleDot.stories.js +16 -0
  53. package/src/stories/Input.stories.js +46 -15
  54. package/src/stories/MiniTag.stories.js +46 -0
  55. package/src/stories/ProgressBar.stories.js +23 -0
  56. package/src/stories/RadioButton.stories.js +25 -9
  57. package/src/stories/Slider.stories.js +9 -9
  58. package/src/stories/Swith.stories.js +10 -10
  59. package/src/stories/TabHeader.stories.js +9 -9
  60. package/src/stories/Toast.stories.js +13 -13
  61. package/src/stories/Toggle.stories.js +30 -7
  62. package/src/stories/Tooltip.stories.js +114 -0
  63. package/src/util/GeneralFunctions.js +22 -0
  64. package/src/util/imageLoader.js +50 -0
  65. package/tailwind.config.js +82 -45
  66. 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>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div style="display: contents">
3
+ <span
4
+ v-if="getIconType === 'material-icons'"
5
+ class="material-icons-round"
6
+ :class="[getIconClasses]"
7
+ >
8
+ {{ getIcon }}
9
+ </span>
10
+ <img v-else-if="getIconType === 'url'" :src="icon" :class="[iconClasses]" />
11
+ <inline-svg
12
+ v-else
13
+ :src="icon"
14
+ :width="getWidth"
15
+ :height="getHeight"
16
+ :stroke="getColor"
17
+ :fill="getColor"
18
+ ></inline-svg>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import tailwindConfig from '../../../tailwind.config'
24
+ import imageLoader from '../../util/imageLoader'
25
+ export default {
26
+ name: 'AppIcon',
27
+ props: {
28
+ icon: {
29
+ type: String,
30
+ required: true
31
+ },
32
+ type: {
33
+ type: String,
34
+ },
35
+ iconClasses: {
36
+ type: String
37
+ },
38
+ size: {
39
+ type: [Number, String],
40
+ },
41
+ width: {
42
+ type: Number,
43
+ default: 24
44
+ },
45
+ height: {
46
+ type: Number,
47
+ default: 24
48
+ },
49
+ stroke: {
50
+ type: String,
51
+ default: null
52
+ },
53
+ color: {
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
75
+ }
76
+ },
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
+ },
91
+ getIconClasses() {
92
+ if(this.iconClasses) return this.iconClasses
93
+ return `${this.size} ${this.color}`
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
+ }
126
+ }
127
+ }
128
+ </script>
package/src/index.js CHANGED
@@ -1,28 +1,48 @@
1
- import PsButton from './components/buttons/PsButton.vue';
2
- import PsCheckbox from './components/controls/PsCheckbox.vue';
3
- import PsRadioButton from './components/controls/PsRadioButton.vue';
4
- import PsSlider from './components/controls/PsSlider.vue';
5
- import PsSwitch from './components/controls/PsSwitch.vue';
6
- import PsToggle from './components/controls/PsToggle.vue';
7
- import PsInput from './components/forms/PsInput.vue';
8
- import PsDialog from './components/notifications/PsDialog.vue';
9
- import PsToast from './components/notifications/PsToast.vue';
10
- import PsTabHeader from './components/tabs/PsTabHeader.vue';
1
+ import PsButton from './components/buttons/PsButton.vue'
2
+ import PsCheckbox from './components/controls/PsCheckbox.vue'
3
+ import PsRadioButton from './components/controls/PsRadioButton.vue'
4
+ import PsSlider from './components/controls/PsSlider.vue'
5
+ import PsSwitch from './components/controls/PsSwitch.vue'
6
+ import PsToggle from './components/controls/PsToggle.vue'
7
+ import PsInput from './components/forms/PsInput.vue'
8
+ import PsDialog from './components/notifications/PsDialog.vue'
9
+ import PsToast from './components/notifications/PsToast.vue'
10
+ import PsTabHeader from './components/tabs/PsTabHeader.vue'
11
+ import PsAccordion from './components/accordion/PsAccordion.vue'
12
+ import PsAccordionItem from './components/accordion/PsAccordionItem.vue'
13
+ import PsChips from './components/chips/PsChips.vue'
14
+ import PsDataTable from './components/datatable/PsDataTable.vue'
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'
11
21
 
12
22
  export default {
13
23
  install(Vue) {
14
- Vue.component('PsButton', PsButton);
15
- Vue.component('PsCheckbox', PsCheckbox);
16
- Vue.component('PsDialog', PsDialog);
17
- Vue.component('PsToast', PsToast);
18
- Vue.component('PsTabHeader', PsTabHeader);
19
- Vue.component('PsRadioButton', PsRadioButton);
20
- Vue.component('PsSlider', PsSlider);
21
- Vue.component('PsSwitch', PsSwitch);
22
- Vue.component('PsInput', PsInput);
23
- Vue.component('PsToggle', PsToggle);
24
- }
25
- };
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
+ Vue.component('PsSlider', PsSlider)
31
+ Vue.component('PsSwitch', PsSwitch)
32
+ Vue.component('PsInput', PsInput)
33
+ Vue.component('PsToggle', PsToggle)
34
+ Vue.component('PsAccordion', PsAccordion)
35
+ Vue.component('PsAccordionItem', PsAccordionItem)
36
+ Vue.component('PsChips', PsChips)
37
+ Vue.component('PsDataTable', PsDataTable)
38
+ Vue.component('PsDataTableItem', PsDataTableItem)
39
+ Vue.component('PsIcon', PsIcon)
40
+ Vue.component('PsTooltip', PsTooltip)
41
+ Vue.component('PsRichTooltip', PsRichTooltip)
42
+ Vue.component('PsDialogTooltip', PsDialogTooltip)
43
+ Vue.component('PsDraggable', PsDraggable)
44
+ },
45
+ }
26
46
 
27
47
  export {
28
48
  PsButton,
@@ -34,5 +54,14 @@ export {
34
54
  PsSlider,
35
55
  PsSwitch,
36
56
  PsInput,
37
- PsToggle
38
- }
57
+ PsToggle,
58
+ PsAccordion,
59
+ PsAccordionItem,
60
+ PsChips,
61
+ PsDataTable,
62
+ PsDataTableItem,
63
+ PsTooltip,
64
+ PsRichTooltip,
65
+ PsDialogTooltip,
66
+ PsDraggable,
67
+ }
@@ -0,0 +1,41 @@
1
+ import PsAccordionItem, {
2
+ iconTypes,
3
+ fontCss,
4
+ } from '../components/accordion/PsAccordionItem.vue'
5
+ import PsAccordion, { sizes } from '../components/accordion/PsAccordion.vue'
6
+
7
+ export default {
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
+ },
19
+ }
20
+
21
+ export const AccordionItem = (args, { argTypes }) => ({
22
+ props: Object.keys(argTypes, args),
23
+ components: { 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
+ `,
29
+ })
30
+ AccordionItem.parameters = {
31
+ controls: {
32
+ include: ['title', 'iconType', 'fontCss'],
33
+ },
34
+ }
35
+
36
+ export const Accordion = (args, { argTypes }) => ({
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>',
41
+ })
@@ -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,7 +9,7 @@ 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
14
  const Template = (args, { argTypes }) => ({
15
15
  props: Object.keys(argTypes),
@@ -17,38 +17,38 @@ const Template = (args, { argTypes }) => ({
17
17
  template: `
18
18
  <PsButton v-bind="$props" />
19
19
  `
20
- });
20
+ })
21
21
 
22
- export const Solid = Template.bind({});
22
+ export const Solid = Template.bind({})
23
23
  Solid.args = {
24
24
  label: 'Solid button',
25
25
  size: 'big',
26
26
  disabled: false,
27
27
  iconRight: 'add_circle'
28
- };
28
+ }
29
29
 
30
- export const Outline = Template.bind({});
30
+ export const Outline = Template.bind({})
31
31
  Outline.args = {
32
32
  label: 'Outline button',
33
33
  size: 'big',
34
34
  disabled: false,
35
35
  icon: 'add_circle',
36
36
  outline: true
37
- };
37
+ }
38
38
 
39
- export const Ghost = Template.bind({});
39
+ export const Ghost = Template.bind({})
40
40
  Ghost.args = {
41
41
  label: 'Ghost button',
42
42
  size: 'big',
43
43
  disabled: false,
44
44
  ghost: true
45
- };
45
+ }
46
46
 
47
- export const TextOnly = Template.bind({});
47
+ export const TextOnly = Template.bind({})
48
48
  TextOnly.args = {
49
49
  label: 'TextOnly button',
50
50
  disabled: false,
51
51
  icon: 'add_circle',
52
52
  size: 'big',
53
53
  textOnly: true,
54
- };
54
+ }
@@ -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,41 +1,48 @@
1
- import PsCheckbox, { sizes } from '../components/controls/PsCheckbox.vue';
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),
13
13
  components: { PsCheckbox },
14
14
  data: () => {
15
15
  return {
16
- items: [
17
- { label: 'Label 1', id: 1 },
18
- { label: 'Label 2', id: 2 },
19
- { label: 'Label 3', id: 3 }
20
- ],
16
+ items: {
17
+ BUILDING_TYPE: {
18
+ label: 'Building Type',
19
+ key: 'BUILDING_TYPE'
20
+ },
21
+ CLIMATE_ZONE: {
22
+ label: 'Climate Zone',
23
+ key: 'CLIMATE_ZONE'
24
+ },
25
+ YEAR: {
26
+ label: "Year",
27
+ key: "YEAR"
28
+ }
29
+ },
21
30
  selected: []
22
31
  }
23
32
  },
24
33
  template: `
25
34
  <div>
26
- <PsCheckbox v-bind="$props" label="Label 1" inputValue="1" v-model="selected" />
27
- <PsCheckbox v-bind="$props" label="Label 2" inputValue="2" v-model="selected" />
28
- <PsCheckbox v-bind="$props" label="Label 3" inputValue="3" v-model="selected" />
35
+ <PsCheckbox v-bind="$props" v-for="(item, key) in items" :label="item.label" :inputValue="item.key" v-model="selected" />
29
36
  <p>Checked: {{ selected }}</p>
30
37
  </div>
31
38
  `
32
- });
39
+ })
33
40
 
34
- export const Default = Template.bind({});
41
+ export const Default = Template.bind({})
35
42
  Default.args = {
36
43
  size: 18,
37
44
  disabled: false,
38
45
  label: 'Label',
39
46
  labelClasses: '',
40
- };
47
+ }
41
48
 
@@ -0,0 +1,55 @@
1
+ import PsChips from "../components/chips/PsChips.vue"
2
+
3
+ export default {
4
+ title: 'Components/Chips',
5
+ component: PsChips,
6
+ }
7
+
8
+ const Template = (args, { argTypes }) => ({
9
+ props: Object.keys(argTypes),
10
+ components: { PsChips },
11
+ data: ()=>{
12
+ return{
13
+ isChecked: null,
14
+ }
15
+ },
16
+ template: `<div >
17
+ <PsChips v-bind='$props' @update:checked='isChecked = $event' :checked='isChecked'/>
18
+ <pre>{{isChecked}}</pre>
19
+ </div>
20
+ `
21
+ })
22
+
23
+ export const Simple = Template.bind({})
24
+ Simple.args = {
25
+ title: 'Simple Chip',
26
+ icon:"",
27
+ type: 'text'
28
+ }
29
+
30
+ export const SimpleWithIcon = Template.bind({})
31
+ SimpleWithIcon.args = {
32
+ title: 'Simple With Icon',
33
+ icon: 'home',
34
+ type: 'text'
35
+ }
36
+
37
+ export const Radio = Template.bind({})
38
+ Radio.args = {
39
+ title: 'Radio Chip',
40
+ type:'radio'
41
+ }
42
+
43
+ export const Checkbox = Template.bind({})
44
+ Checkbox.args = {
45
+ title: 'Checkbox Chip',
46
+ type: 'checkbox'
47
+ }
48
+
49
+ export const Rich = Template.bind({})
50
+ Rich.args = {
51
+ title: 'Rich chips',
52
+ type: 'text',
53
+ icon: 'description',
54
+ rich: true
55
+ }
@@ -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
+ }