@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-beta.10

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 (134) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +74 -67
  3. package/.github/workflows/deploy-storybook.yml +1 -1
  4. package/.storybook/PolicyStudio.ts +11 -0
  5. package/.storybook/eventBus.ts +26 -0
  6. package/.storybook/main.ts +21 -0
  7. package/.storybook/manager.ts +7 -0
  8. package/dist/css/psui_styles.css +4028 -110346
  9. package/package.json +50 -34
  10. package/postcss.config.js +1 -1
  11. package/scripts/kill-port.sh +12 -0
  12. package/src/App.vue +30 -0
  13. package/src/assets/scss/base.scss +27 -23
  14. package/src/assets/scss/components/PsAccordion.scss +1 -1
  15. package/src/assets/scss/components/PsChips.scss +3 -3
  16. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  17. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  18. package/src/assets/scss/components/PsTabHeader.scss +1 -1
  19. package/src/assets/scss/components/PsTableResults.scss +2 -63
  20. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  21. package/src/components/accordion/PsAccordion.vue +20 -21
  22. package/src/components/accordion/PsAccordionItem.vue +30 -8
  23. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +8 -4
  24. package/src/components/badges-and-tags/PsCardInfos.vue +3 -1
  25. package/src/components/badges-and-tags/PsChartLegend.vue +19 -5
  26. package/src/components/badges-and-tags/PsCostEffectBar.vue +4 -5
  27. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +1 -1
  28. package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
  29. package/src/components/badges-and-tags/PsTestimonialCard.vue +6 -4
  30. package/src/components/buttons/PsButton.vue +85 -88
  31. package/src/components/chips/PsChips.vue +5 -2
  32. package/src/components/controls/PsCheckbox.vue +5 -2
  33. package/src/components/controls/PsCheckboxSimple.vue +4 -4
  34. package/src/components/controls/PsDraggable.vue +70 -67
  35. package/src/components/controls/PsInlineSelector.vue +13 -14
  36. package/src/components/controls/PsRadioButton.vue +10 -5
  37. package/src/components/controls/PsRadioButtonSimple.vue +3 -3
  38. package/src/components/controls/PsSlider.vue +6 -6
  39. package/src/components/controls/PsSwitch.vue +13 -3
  40. package/src/components/controls/PsToggle.vue +14 -11
  41. package/src/components/data-graphics/PsBarChart.vue +4 -2
  42. package/src/components/datatable/PsDataTable.vue +14 -5
  43. package/src/components/datatable/PsDataTableItem.vue +17 -4
  44. package/src/components/forms/PsDropdown.vue +8 -5
  45. package/src/components/forms/PsDropdownList.vue +1 -1
  46. package/src/components/forms/PsInput.vue +30 -14
  47. package/src/components/forms/PsInputSelect.vue +33 -11
  48. package/src/components/forms/PsInputTextArea.vue +15 -4
  49. package/src/components/navigations/PsBreadcrumb.vue +1 -1
  50. package/src/components/notifications/PsDialog.vue +11 -5
  51. package/src/components/notifications/PsSimpleAlert.vue +22 -10
  52. package/src/components/notifications/PsToast.vue +8 -3
  53. package/src/components/playground/PsScrollBar.vue +122 -50
  54. package/src/components/table-results/PsTableResults.vue +67 -51
  55. package/src/components/table-results/PsTableResultsBody.vue +3 -1
  56. package/src/components/table-results/PsTableResultsHead.vue +27 -8
  57. package/src/components/table-results/PsTableResultsHeadComparison.vue +24 -8
  58. package/src/components/table-results/PsTableResultsHeadFlexible.vue +18 -6
  59. package/src/components/table-results/PsTableResultsRow.vue +6 -2
  60. package/src/components/tabs/PsTabHeader.vue +19 -16
  61. package/src/components/tooltip/PsDialogTooltip.vue +18 -8
  62. package/src/components/tooltip/PsRichTooltip.vue +12 -5
  63. package/src/components/tooltip/PsTooltip.vue +17 -9
  64. package/src/components/ui/PsDotLoader.vue +5 -5
  65. package/src/components/ui/PsIcon.vue +6 -2
  66. package/src/{index.js → index.ts} +4 -5
  67. package/src/shims-vue.d.ts +11 -0
  68. package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
  69. package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
  70. package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
  71. package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
  72. package/src/stories/Button.stories.ts +48 -0
  73. package/src/stories/Button.vue +59 -0
  74. package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
  75. package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
  76. package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
  77. package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
  78. package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
  79. package/src/stories/ClimateZoneBadge.stories.ts +28 -0
  80. package/src/stories/CostEffectBar.stories.ts +26 -0
  81. package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
  82. package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
  83. package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
  84. package/src/stories/Draggable.stories.ts +32 -0
  85. package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +1 -11
  86. package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
  87. package/src/stories/{ElevationSystem.stories.mdx → ElevationSystem.mdx} +1 -1
  88. package/src/stories/Header.stories.ts +42 -0
  89. package/src/stories/Header.vue +77 -0
  90. package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
  91. package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -1
  92. package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
  93. package/src/stories/{Input.stories.js → Input.stories.ts} +6 -2
  94. package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
  95. package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
  96. package/src/stories/{Introduction.stories.mdx → Introduction.mdx} +101 -101
  97. package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
  98. package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
  99. package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
  100. package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -0
  101. package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
  102. package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
  103. package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
  104. package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
  105. package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +4 -0
  106. package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
  107. package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
  108. package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
  109. package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
  110. package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
  111. package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
  112. package/src/stories/{Typography.stories.mdx → Typography.mdx} +107 -105
  113. package/src/stories/button.css +30 -0
  114. package/src/stories/header.css +32 -0
  115. package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -7
  116. package/src/util/{imageLoader.js → imageLoader.ts} +15 -9
  117. package/tailwind.config.js +11 -2
  118. package/tsconfig.json +47 -0
  119. package/webpack.config.js +36 -0
  120. package/.storybook/PolicyStudio.js +0 -10
  121. package/.storybook/eventBus.js +0 -3
  122. package/.storybook/main.js +0 -25
  123. package/.storybook/manager.js +0 -6
  124. package/babel.config.js +0 -3
  125. package/backup-package-lock.json +0 -37194
  126. package/src/stories/Button.stories.js +0 -130
  127. package/src/stories/ClimateZoneBadge.stories.js +0 -17
  128. package/src/stories/CostEffectBar.stories.js +0 -23
  129. package/src/stories/Draggable.stories.js +0 -22
  130. /package/.storybook/{preview.js → preview.ts} +0 -0
  131. /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
  132. /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
  133. /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
  134. /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
@@ -1,21 +1,24 @@
1
1
  <template>
2
2
  <div
3
3
  ref="tooltip"
4
- class='psui-el-tooltip'
4
+ class="psui-el-tooltip"
5
5
  @mouseenter="open"
6
6
  @mouseleave="close"
7
7
  >
8
- <div ref="tooltiptrigger" class='psui-el-tooltip-trigger'>
9
- <slot name="trigger"></slot>
8
+ <div
9
+ ref="tooltiptrigger"
10
+ class="psui-el-tooltip-trigger"
11
+ >
12
+ <slot name="trigger" />
10
13
  </div>
11
14
 
12
15
  <div
13
- class='psui-el-tooltip-wrapper'
16
+ class="psui-el-tooltip-wrapper"
14
17
  >
15
18
  <div
16
19
  role="menu"
17
20
  ref="dialog"
18
- class='psui-el-tooltip-dialog'
21
+ class="psui-el-tooltip-dialog"
19
22
  :class="cssClass"
20
23
  >
21
24
  <div
@@ -23,9 +26,14 @@
23
26
  aria-orientation="vertical"
24
27
  :class="getComponentClass"
25
28
  >
26
- <h2 v-if="title">{{ title}}</h2>
27
- <div v-else class="psui-el-tooltip-content-wrapper">
28
- <slot name="content"></slot>
29
+ <h2 v-if="title">
30
+ {{ title }}
31
+ </h2>
32
+ <div
33
+ v-else
34
+ class="psui-el-tooltip-content-wrapper"
35
+ >
36
+ <slot name="content" />
29
37
  </div>
30
38
  </div>
31
39
  </div>
@@ -94,7 +102,7 @@ export default {
94
102
  mounted() {
95
103
  document.addEventListener('resize', this.updatePosition)
96
104
  },
97
- beforeDestroy() {
105
+ beforeUnmount() {
98
106
  document.removeEventListener('resize', this.updatePosition)
99
107
  },
100
108
  methods: {
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div class="psui-el-dotloader">
3
- <div class="psui-el-dotloader-wrapper">
4
- <span></span>
5
- <span></span>
6
- <span></span>
7
- </div>
3
+ <div class="psui-el-dotloader-wrapper">
4
+ <span />
5
+ <span />
6
+ <span />
7
+ </div>
8
8
  </div>
9
9
  </template>
10
10
 
@@ -8,7 +8,11 @@
8
8
  >
9
9
  {{ getIcon }}
10
10
  </span>
11
- <img v-else-if="getIconType === 'url'" :src="icon" :class="[iconClasses]" />
11
+ <img
12
+ v-else-if="getIconType === 'url'"
13
+ :src="icon"
14
+ :class="[iconClasses]"
15
+ >
12
16
  <inline-svg
13
17
  v-else
14
18
  :src="icon"
@@ -16,7 +20,7 @@
16
20
  :height="size"
17
21
  :stroke="getColor"
18
22
  :fill="getColor"
19
- ></inline-svg>
23
+ />
20
24
  </div>
21
25
  </template>
22
26
 
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * General Components
4
3
  */
@@ -51,7 +50,7 @@ import PsBreadcrumb from './components/navigations/PsBreadcrumb.vue'
51
50
 
52
51
 
53
52
  export default {
54
- install(Vue) {
53
+ install(Vue:any) {
55
54
  Vue.component('PsButton', PsButton)
56
55
  Vue.component('PsCheckbox', PsCheckbox)
57
56
  Vue.component('PsDialog', PsDialog)
@@ -100,8 +99,8 @@ export default {
100
99
 
101
100
 
102
101
  Vue.directive('click-outside', {
103
- bind: function (el, binding, vnode) {
104
- el.clickOutsideEvent = function (event) {
102
+ bind: function (el:any, binding:any, vnode:any) {
103
+ el.clickOutsideEvent = function (event:any) {
105
104
  // here I check that click was outside the el and his children
106
105
  if (!(el == event.target || el.contains(event.target))) {
107
106
  // and if it did, call method provided in attribute value
@@ -110,7 +109,7 @@ export default {
110
109
  }
111
110
  document.body.addEventListener('click', el.clickOutsideEvent)
112
111
  },
113
- unbind: function (el) {
112
+ unbind: function (el:any) {
114
113
  document.body.removeEventListener('click', el.clickOutsideEvent)
115
114
  },
116
115
  })
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ declare module '*.vue' {
3
+ import type { DefineComponent } from 'vue'
4
+ const component: DefineComponent<{}, {}, any>
5
+ export default component
6
+ }
7
+
8
+ declare module '*.svg' {
9
+ const content: string;
10
+ export default content;
11
+ }
@@ -8,8 +8,8 @@ export default {
8
8
  }
9
9
 
10
10
 
11
- export const Index = (args, { argTypes }) => ({
12
- props: Object.keys(argTypes, args),
11
+ export const Index = (args:any, { argTypes }: { argTypes:any }) => ({
12
+ props: Object.keys({argTypes, args}),
13
13
  components: { PsAccordion, PsAccordionItem },
14
14
  template:
15
15
  `
@@ -7,7 +7,7 @@ export default {
7
7
  },
8
8
  }
9
9
 
10
- const TemplateDefault = (args, {argTypes})=>({
10
+ const TemplateDefault = (args:any, {argTypes}:{argTypes:any})=>({
11
11
  props: Object.keys(argTypes),
12
12
  components:{PsBadgeWithIcon},
13
13
  template: `
@@ -4,7 +4,7 @@ export default {
4
4
  component: PsBarChart,
5
5
  }
6
6
 
7
- const defaultTemplate = (args, {argTypes}) => ({
7
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
8
8
  props: Object.keys(argTypes),
9
9
  components: { PsBarChart },
10
10
  template: `
@@ -11,7 +11,7 @@ const items = [
11
11
  { title: '4th level', route: '' },
12
12
  ]
13
13
 
14
- const Template = (args, { argTypes }) => ({
14
+ const Template = (args:any, { argTypes }:{argTypes:any}) => ({
15
15
  props: Object.keys(argTypes),
16
16
  components: { PsBreadcrumb },
17
17
  template: `
@@ -20,6 +20,3 @@ const Template = (args, { argTypes }) => ({
20
20
  })
21
21
 
22
22
  export const Default = Template.bind({})
23
- Default.args = {
24
- items: items,
25
- }
@@ -0,0 +1,48 @@
1
+ import MyButton from './Button.vue'
2
+
3
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
4
+ export default {
5
+ title: 'Example/Button',
6
+ component: MyButton,
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ backgroundColor: {
10
+ control: 'color',
11
+ },
12
+ onClick: {},
13
+ size: {
14
+ control: {
15
+ type: 'select',
16
+ },
17
+ options: ['small', 'medium', 'large'],
18
+ },
19
+ },
20
+ }
21
+
22
+ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
23
+ export const Primary = {
24
+ args: {
25
+ primary: true,
26
+ label: 'Button',
27
+ },
28
+ }
29
+
30
+ export const Secondary = {
31
+ args: {
32
+ label: 'Button',
33
+ },
34
+ }
35
+
36
+ export const Large = {
37
+ args: {
38
+ size: 'large',
39
+ label: 'Button',
40
+ },
41
+ }
42
+
43
+ export const Small = {
44
+ args: {
45
+ size: 'small',
46
+ label: 'Button',
47
+ },
48
+ }
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <button
3
+ type="button"
4
+ :class="classes"
5
+ @click="onClick"
6
+ :style="style"
7
+ >
8
+ {{ label }}
9
+ </button>
10
+ </template>
11
+
12
+ <script>
13
+ import './button.css'
14
+ import { reactive, computed } from 'vue'
15
+
16
+ export default {
17
+ name: 'MyButton',
18
+
19
+ props: {
20
+ label: {
21
+ type: String,
22
+ required: true,
23
+ },
24
+ primary: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ size: {
29
+ type: String,
30
+ validator: function (value) {
31
+ return ['small', 'medium', 'large'].indexOf(value) !== -1
32
+ },
33
+ },
34
+ backgroundColor: {
35
+ type: String,
36
+ },
37
+ },
38
+
39
+ emits: ['click'],
40
+
41
+ setup(props, { emit }) {
42
+ props = reactive(props)
43
+ return {
44
+ classes: computed(() => ({
45
+ 'storybook-button': true,
46
+ 'storybook-button--primary': props.primary,
47
+ 'storybook-button--secondary': !props.primary,
48
+ [`storybook-button--${props.size || 'medium'}`]: true,
49
+ })),
50
+ style: computed(() => ({
51
+ backgroundColor: props.backgroundColor,
52
+ })),
53
+ onClick() {
54
+ emit('click')
55
+ },
56
+ }
57
+ },
58
+ }
59
+ </script>
@@ -6,11 +6,10 @@ export default {
6
6
  argTypes: {},
7
7
  }
8
8
 
9
- const Template = (args, { argTypes }) => ({
9
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { PsCardInfos },
12
12
  template: '<PsCardInfos v-bind="$props" />',
13
13
  })
14
14
 
15
15
  export const CardInfos = Template.bind({})
16
- CardInfos.args = {}
@@ -6,11 +6,10 @@ export default {
6
6
  argTypes: {},
7
7
  }
8
8
 
9
- const Template = (args, { argTypes }) => ({
9
+ const Template = (args:any, { argTypes } : { argTypes:any }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { PsChartLegend },
12
12
  template: '<PsChartLegend v-bind="$props" />',
13
13
  })
14
14
 
15
15
  export const ChartLegend = Template.bind({})
16
- ChartLegend.args = {}
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsCheckbox,
6
6
  }
7
7
 
8
- const defaultTemplate = (args, {argTypes}) => ({
8
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsCheckbox},
11
11
  template: `
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsCheckboxSimple,
6
6
  }
7
7
 
8
- const defaultTemplate = (args, {argTypes}) => ({
8
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsCheckboxSimple },
11
11
  data: () => ({
@@ -1,31 +1,33 @@
1
1
  import PsChips from '../components/chips/PsChips.vue'
2
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
3
 
3
- export default {
4
- title: 'Components/Chips',
5
- component: PsChips,
4
+ import * as HeaderStories from '../stories/Header.stories'
5
+
6
+ const meta: Meta<typeof PsChips> = {
7
+ component: PsChips
6
8
  }
7
9
 
8
- const Template = (args, { argTypes }) => ({
9
- props: Object.keys(argTypes),
10
- components: { PsChips },
11
- data: ()=>{
12
- return{
13
- isChecked: true,
14
- isCheckedTwo: null,
15
- }
16
- },
17
- template: `<div style="display:flex; gap: 10px;">
18
- <PsChips v-bind='$props' type="button" @update:checked='isChecked = $event' :checked='isChecked'/>
10
+ export default meta
11
+
12
+ type Story = StoryObj<typeof PsChips>
13
+
14
+ export const Primary: Story = {
15
+ render: (args) => ({
16
+ components: { PsChips },
17
+ setup(){
18
+ return { args }
19
+ },
20
+ template: `<div style="display:flex; gap: 10px;">
19
21
  <PsChips v-bind='$props' label="Simple chips with icons" type="button" layout="with-icon" icon="home" @update:checked='isChecked = $event' :checked='isChecked'/>
20
22
  <PsChips v-bind='$props' label="Radio chips" type="radio" @update:checked='isChecked = $event' :checked='isChecked'/>
21
23
  <PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='isCheckedTwo = $event' :checked='isCheckedTwo'/>
22
24
  <PsChips v-bind='$props' label="Rich chips" type="button" layout="rich" icon="text_snippet" @update:checked='isChecked = $event' :checked='isChecked'/>
23
25
  </div>
24
- `
25
- })
26
-
27
- export const Default = Template.bind({})
28
- Default.args = {
29
- label: 'Simple Chip',
30
- icon:'',
31
- }
26
+ `,
27
+ args:{
28
+ label: 'Simple Chip',
29
+ icon:'',
30
+ ...HeaderStories.LoggedIn.args
31
+ }
32
+ })
33
+ }
@@ -0,0 +1,28 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+
3
+ import PsClimateZoneBadge from '../components/badges-and-tags/PsClimateZoneBadge.vue'
4
+
5
+ import * as HeaderStories from '../stories/Header.stories'
6
+
7
+ const meta: Meta<typeof PsClimateZoneBadge> = {
8
+ component: PsClimateZoneBadge
9
+ }
10
+
11
+ export default meta
12
+
13
+ type Story = StoryObj<typeof PsClimateZoneBadge>
14
+
15
+ export const Primary: Story = {
16
+ render: (args) => ({
17
+ components: { PsClimateZoneBadge },
18
+ setup(){
19
+ return { args }
20
+ },
21
+ template: '<PsClimateZoneBadge v-bind="$props" />',
22
+ args:{
23
+ icon: 'area_chart',
24
+ ...HeaderStories.LoggedIn.args
25
+ }
26
+ })
27
+ }
28
+
@@ -0,0 +1,26 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+
3
+ import PsCostEffectBar from '../components/badges-and-tags/PsCostEffectBar.vue'
4
+
5
+ import * as HeaderStories from '../stories/Header.stories'
6
+
7
+ const meta: Meta<typeof PsCostEffectBar> = {
8
+ component: PsCostEffectBar
9
+ }
10
+
11
+ export default meta
12
+
13
+ type Story = StoryObj<typeof PsCostEffectBar>
14
+
15
+ export const Primary: Story = {
16
+ render: (args) => ({
17
+ components: { PsCostEffectBar },
18
+ setup(){
19
+ return { args }
20
+ },
21
+ template: '<PsCostEffectBar v-bind="$props" />',
22
+ args:{
23
+ ...HeaderStories.LoggedIn.args
24
+ }
25
+ })
26
+ }
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import PsDataTable, { alignment } from '../components/datatable/PsDataTable.vue'
2
3
  import PsDataTableItem from '../components/datatable/PsDataTableItem.vue'
3
4
 
@@ -10,7 +11,7 @@ export default {
10
11
  }
11
12
  }
12
13
 
13
- const Template = (args, { argTypes }) => ({
14
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
14
15
  props: Object.keys(argTypes),
15
16
  components: {PsDataTable},
16
17
  template: `
@@ -20,7 +21,7 @@ const Template = (args, { argTypes }) => ({
20
21
  `
21
22
  })
22
23
 
23
- const RichTemplate = (args, { argTypes } ) => ({
24
+ const RichTemplate = (args:any, { argTypes }:{ argTypes:any } ) => ({
24
25
  props: Object.keys(argTypes),
25
26
  components: {PsDataTable, PsDataTableItem},
26
27
  template: `
@@ -34,6 +35,7 @@ const RichTemplate = (args, { argTypes } ) => ({
34
35
 
35
36
 
36
37
  export const Simple = Template.bind({})
38
+ // @ts-ignore
37
39
  Simple.args = {
38
40
  header: ['year', 'month', 'sale'],
39
41
  data: [{ year: '1992', month: '12', sale: '1000.00' }, { year: '1989', month: '02', sale: '1200.00' }],
@@ -42,6 +44,7 @@ Simple.args = {
42
44
  }
43
45
 
44
46
  export const Rich = RichTemplate.bind({})
47
+ // @ts-ignore
45
48
  Rich.args = {
46
49
  header: ['header 1', 'header 2', 'header 3'],
47
50
  data:[[ [ 20, -3], [ 20, 2], [ 20, 2] ], { header4: { value: 20, delta: 2}, header5: { value: 20, delta: 2}, header6: { value: 20, delta: 2} }],
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsDateCardInfo,
6
6
  }
7
7
 
8
- const Template = (args,{argTypes}) => ({
8
+ const Template = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components:{PsDateCardInfo},
11
11
  template: `
@@ -18,7 +18,3 @@ export default {
18
18
  })
19
19
 
20
20
  export const Default = Template.bind({})
21
-
22
- Default.args = {
23
- date: '2021/02/23'
24
- }
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsDialog,
6
6
  }
7
7
 
8
- const TemplateExamples = (args, { argTypes }) => ({
8
+ const TemplateExamples = (args:any, { argTypes }: { argTypes:any }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDialog },
11
11
  template: `
@@ -0,0 +1,32 @@
1
+ import PsDraggable from '../components/controls/PsDraggable.vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
5
+ import * as HeaderStories from '../stories/Header.stories'
6
+
7
+ const meta: Meta<typeof PsDraggable> = {
8
+ component: PsDraggable
9
+ }
10
+
11
+ export default meta
12
+
13
+ type Story = StoryObj<typeof PsDraggable>
14
+
15
+ export const Primary: Story = {
16
+ render: (args) => ({
17
+ components: { PsDraggable },
18
+ setup(){
19
+ return { args }
20
+ },
21
+ template: `
22
+ <div style='width: 300px; font-family: "Lato", sans-serif; font-size: 12px;'>
23
+ <PsDraggable v-bind='$props'/>
24
+ </div>
25
+ `,
26
+ args:{
27
+ ...HeaderStories.LoggedIn.args,
28
+ getColumns: {columnGroups:[{title: 'COST EFFECTIVENESS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}, {title: 'PER HOME RESULTS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}]},
29
+ module: 'comparison'
30
+ }
31
+ })
32
+ }
@@ -5,7 +5,7 @@ export default {
5
5
  component: { PsDropdown, PsDropdownList },
6
6
  }
7
7
 
8
- const Template = (args, { argTypes }) => ({
8
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDropdown, PsDropdownList },
11
11
  template: `
@@ -87,13 +87,3 @@ const Template = (args, { argTypes }) => ({
87
87
  })
88
88
 
89
89
  export const DropdownMenu = Template.bind({})
90
- DropdownMenu.args = {
91
- items: [
92
- 'Selectable option 01',
93
- 'Selectable option 02',
94
- 'Selectable option 03',
95
- 'Selectable option 04',
96
- 'Selectable option 05',
97
- 'Selectable option 06',
98
- ],
99
- }
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import PsDropdownList, { itemStyle } from '../components/forms/PsDropdownList.vue'
2
3
  export default {
3
4
  title: 'Components/Dropdown/Dropdown List',
@@ -17,7 +18,7 @@ export default {
17
18
  }
18
19
  }
19
20
  }
20
-
21
+ // @ts-ignore
21
22
  const Template = (args, { argTypes }) => ({
22
23
  props: Object.keys(argTypes),
23
24
  components: { PsDropdownList },
@@ -205,6 +206,7 @@ const studyData = {
205
206
  }
206
207
 
207
208
  export const DropdownList = Template.bind({})
209
+ // @ts-ignore
208
210
  DropdownList.args = {
209
211
  items: onlyTextItems,
210
212
  study_data: studyData,
@@ -1,4 +1,4 @@
1
- import { Canvas, Meta, Story } from '@storybook/addon-docs';
1
+ import { Meta, Story } from '@storybook/addon-docs';
2
2
 
3
3
  <Meta title="Elevation system" />
4
4
 
@@ -0,0 +1,42 @@
1
+ import MyHeader from './Header.vue'
2
+
3
+ export default {
4
+ title: 'Example/Header',
5
+ component: MyHeader,
6
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
7
+ tags: ['autodocs'],
8
+ // @ts-ignore
9
+ render: (args) => ({
10
+ // Components used in your story `template` are defined in the `components` object
11
+ components: {
12
+ MyHeader,
13
+ },
14
+ // The story's `args` need to be mapped into the template through the `setup()` method
15
+ setup() {
16
+ // Story args can be spread into the returned object
17
+ return {
18
+ ...args,
19
+ }
20
+ },
21
+ // Then, the spread values can be accessed directly in the template
22
+ template: '<my-header :user="user" />',
23
+ }),
24
+ parameters: {
25
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
26
+ layout: 'fullscreen',
27
+ },
28
+ }
29
+
30
+ export const LoggedIn = {
31
+ args: {
32
+ user: {
33
+ name: 'Jane Doe',
34
+ },
35
+ },
36
+ }
37
+
38
+ export const LoggedOut = {
39
+ args: {
40
+ user: null,
41
+ },
42
+ }