@policystudio/policy-studio-ui-vue 1.0.19 → 1.0.23
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.
- package/.eslintrc.js +1 -2
- package/.storybook/main.js +10 -2
- package/.storybook/preview.js +1 -1
- package/README.md +8 -0
- package/babel.config.js +3 -0
- package/backup-package-lock.json +37194 -0
- package/dist/css/psui_styles.css +15709 -14658
- package/package.json +32 -21
- package/postcss.config.js +2 -0
- package/src/assets/scss/base.scss +9 -29
- package/src/assets/scss/components/PsAccordion.scss +63 -0
- package/src/assets/scss/components/PsButton.scss +145 -0
- package/src/assets/scss/components/PsInput.scss +104 -0
- package/src/components/accordion/PsAccordion.vue +30 -21
- package/src/components/accordion/PsAccordionItem.vue +29 -67
- package/src/components/badges-and-tags/PsCardInfos.vue +38 -0
- package/src/components/badges-and-tags/PsChartLegend.vue +43 -0
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
- package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
- package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
- package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
- package/src/components/buttons/PsButton.vue +43 -75
- package/src/components/chips/PsChips.vue +46 -38
- package/src/components/controls/PsCheckbox.vue +29 -16
- package/src/components/controls/PsDraggable.vue +174 -3
- package/src/components/controls/PsRadioButton.vue +74 -43
- package/src/components/controls/PsSwitch.vue +75 -76
- package/src/components/controls/PsToggle.vue +1 -1
- package/src/components/datatable/PsDataTable.vue +25 -29
- package/src/components/datatable/PsDataTableItem.vue +2 -2
- package/src/components/forms/PsInput.vue +122 -102
- package/src/components/notifications/PsDialog.vue +37 -18
- package/src/components/tabs/PsTabHeader.vue +3 -2
- package/src/components/tooltip/PsDialogTooltip.vue +79 -0
- package/src/components/tooltip/PsRichTooltip.vue +44 -0
- package/src/components/tooltip/PsTooltip.vue +118 -0
- package/src/components/ui/PsIcon.vue +87 -24
- package/src/index.js +29 -9
- package/src/stories/Accordion.stories.js +88 -28
- package/src/stories/Button.stories.js +86 -38
- package/src/stories/CardInfos.stories.js +16 -0
- package/src/stories/ChartLegend.stories.js +16 -0
- package/src/stories/Checkbox.stories.js +6 -6
- package/src/stories/Chips.stories.js +14 -8
- package/src/stories/ClimateZoneBadge.stories.js +24 -0
- package/src/stories/Colors.stories.mdx +35 -35
- package/src/stories/CostEffectBar.stories.js +23 -0
- package/src/stories/Datatable.stories.js +15 -8
- package/src/stories/Dialog.stories.js +150 -17
- package/src/stories/Draggable.stories.js +22 -0
- package/src/stories/Dropdown.stories.js +8 -10
- package/src/stories/HighlightRippleDot.stories.js +16 -0
- package/src/stories/Input.stories.js +71 -19
- package/src/stories/MiniTag.stories.js +46 -0
- package/src/stories/ProgressBar.stories.js +23 -0
- package/src/stories/RadioButton.stories.js +15 -15
- package/src/stories/Slider.stories.js +9 -9
- package/src/stories/Swith.stories.js +10 -10
- package/src/stories/TabHeader.stories.js +9 -9
- package/src/stories/Toast.stories.js +13 -13
- package/src/stories/Toggle.stories.js +12 -13
- package/src/stories/Tooltip.stories.js +114 -0
- package/src/util/GeneralFunctions.js +11 -12
- package/src/util/imageLoader.js +50 -0
- package/tailwind.config.js +71 -47
- package/src/assets/scss/tailwind.css +0 -70643
- package/src/assets/scss/tailwind.scss +0 -61088
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PsInput from '../components/forms/PsInput.vue'
|
|
1
|
+
import PsInput from '../components/forms/PsInput.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Input',
|
|
4
4
|
component: PsInput,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
disabled: { control: 'boolean' },
|
|
7
7
|
required: { control: 'boolean' },
|
|
8
8
|
},
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
const TemplateDefault = (args, { argTypes }) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
@@ -19,13 +19,68 @@ const TemplateDefault = (args, { argTypes }) => ({
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
template: `
|
|
23
|
-
<div class="psui-p-8 psui-bg-gray-10">
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
22
|
+
template: `
|
|
23
|
+
<div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-3 psui-gap-6">
|
|
24
|
+
|
|
25
|
+
<div class="psui-col-span-3 psui-mt-8">
|
|
26
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSInput Layout Default</h1>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<PsInput v-bind="{...$props, label: 'Resting with hint', placeholder: '', value: '' }" />
|
|
30
|
+
<PsInput label="Resting without hint" />
|
|
31
|
+
<PsInput label="Resting with Placeholder" placeholder="This is a placeholder" />
|
|
32
|
+
|
|
33
|
+
<PsInput v-bind="{...$props, label: 'Focus'}" />
|
|
34
|
+
<PsInput label="Typing" placeholder="Type to see the effect..." />
|
|
35
|
+
<PsInput v-bind="{...$props, label: 'Active', active: true }" />
|
|
36
|
+
|
|
37
|
+
<PsInput v-bind="{...$props, label: 'Error', hasError: true }" />
|
|
38
|
+
<PsInput v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
|
|
39
|
+
<PsInput v-bind="{...$props, label: 'Prepend / Append ' }" >
|
|
40
|
+
<template v-slot:append>
|
|
41
|
+
Append
|
|
42
|
+
</template>
|
|
43
|
+
<template v-slot:prepend>
|
|
44
|
+
Prepend
|
|
45
|
+
</template>
|
|
46
|
+
</PsInput>
|
|
47
|
+
|
|
48
|
+
<PsInput label="Disabled" :disabled="true" value="100,000" />
|
|
49
|
+
<PsInput v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }" />
|
|
50
|
+
<PsInput v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" />
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<div class="psui-col-span-3 psui-mt-8">
|
|
55
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSInput Layout Mini</h1>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<PsInput layout="mini" label="Resting with hint" hint="This is a hint" value="1,653" />
|
|
59
|
+
<PsInput layout="mini" label="Resting without hint" />
|
|
60
|
+
<PsInput layout="mini" label="Resting with Placeholder" placeholder="This is a placeholder" />
|
|
61
|
+
|
|
62
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Focus'}" />
|
|
63
|
+
<PsInput layout="mini" label="Typing" placeholder="Type to see the effect..." />
|
|
64
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Active', active: true }" />
|
|
65
|
+
|
|
66
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Error', hasError: true }" />
|
|
67
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
|
|
68
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Prepend / Append ' }" >
|
|
69
|
+
<template v-slot:append>
|
|
70
|
+
Append
|
|
71
|
+
</template>
|
|
72
|
+
<template v-slot:prepend>
|
|
73
|
+
Prepend
|
|
74
|
+
</template>
|
|
75
|
+
</PsInput>
|
|
76
|
+
|
|
77
|
+
<PsInput layout="mini" label="Disabled" :disabled="true" value="100,000" />
|
|
78
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }" />
|
|
79
|
+
<PsInput layout="mini" v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" />
|
|
80
|
+
|
|
81
|
+
</div>
|
|
27
82
|
`
|
|
28
|
-
})
|
|
83
|
+
})
|
|
29
84
|
|
|
30
85
|
const TemplateSlots = (args, { argTypes }) => ({
|
|
31
86
|
props: Object.keys(argTypes),
|
|
@@ -52,35 +107,32 @@ const TemplateSlots = (args, { argTypes }) => ({
|
|
|
52
107
|
</PsInput>
|
|
53
108
|
</div>
|
|
54
109
|
`
|
|
55
|
-
})
|
|
110
|
+
})
|
|
56
111
|
|
|
57
|
-
export const InputText = TemplateDefault.bind({})
|
|
112
|
+
export const InputText = TemplateDefault.bind({})
|
|
58
113
|
InputText.args = {
|
|
59
|
-
label: '
|
|
114
|
+
label: 'Input Text',
|
|
60
115
|
placeholder: 'Placeholder',
|
|
61
116
|
hint: 'Optional Assistive text',
|
|
62
117
|
disabled: false,
|
|
63
118
|
required: false,
|
|
64
|
-
mini: false,
|
|
65
119
|
value: 10,
|
|
66
|
-
}
|
|
120
|
+
}
|
|
67
121
|
|
|
68
|
-
export const InputPassword = TemplateDefault.bind({})
|
|
122
|
+
export const InputPassword = TemplateDefault.bind({})
|
|
69
123
|
InputPassword.args = {
|
|
70
124
|
type: 'password',
|
|
71
125
|
label: 'Password',
|
|
72
126
|
hint: 'Optional Assistive text',
|
|
73
127
|
disabled: false,
|
|
74
128
|
required: false,
|
|
75
|
-
|
|
76
|
-
};
|
|
129
|
+
}
|
|
77
130
|
|
|
78
|
-
export const InputSlots = TemplateSlots.bind({})
|
|
131
|
+
export const InputSlots = TemplateSlots.bind({})
|
|
79
132
|
InputSlots.args = {
|
|
80
133
|
label: 'Label',
|
|
81
134
|
placeholder: 'Placeholder',
|
|
82
135
|
hint: 'Optional Assistive text',
|
|
83
136
|
disabled: false,
|
|
84
137
|
required: false,
|
|
85
|
-
|
|
86
|
-
};
|
|
138
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import PsProgressBar from '../components/badges-and-tags/PsProgressBar.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/ProgressBar',
|
|
5
|
+
component: PsProgressBar,
|
|
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: { PsProgressBar },
|
|
19
|
+
template: '<PsProgressBar v-bind="$props" />',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const ProgressBar = Template.bind({})
|
|
23
|
+
ProgressBar.args = {}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import PsRadioButton from '../components/controls/PsRadioButton.vue'
|
|
1
|
+
import PsRadioButton from '../components/controls/PsRadioButton.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Radio Button',
|
|
5
5
|
component: PsRadioButton,
|
|
6
6
|
argTypes: {},
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
|
|
9
9
|
const Template = (args, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { PsRadioButton },
|
|
12
12
|
data: () => {
|
|
13
13
|
return {
|
|
14
|
-
selectedValue:
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
methods: {
|
|
18
|
-
changeValue(newValue) {
|
|
19
|
-
this.selectedValue = newValue
|
|
14
|
+
selectedValue: 2,
|
|
20
15
|
}
|
|
21
16
|
},
|
|
22
17
|
template: `
|
|
23
18
|
<div>
|
|
24
19
|
<div>
|
|
25
|
-
<PsRadioButton v-bind="$props" name="options" label="Label 1" value="1"
|
|
26
|
-
<PsRadioButton v-bind="$props" name="options" label="Label 2" value="2"
|
|
27
|
-
<PsRadioButton v-bind="$props" name="options" label="Label 3" value="3"
|
|
20
|
+
<PsRadioButton v-bind="$props" name="options" label="Label 1" value="1" v-model="selectedValue" />
|
|
21
|
+
<PsRadioButton v-bind="$props" name="options" label="Label 2" value="2" v-model="selectedValue" />
|
|
22
|
+
<PsRadioButton v-bind="$props" name="options" label="Label 3" value="3" v-model="selectedValue" />
|
|
28
23
|
<div class="result">
|
|
29
24
|
Radio button selection: {{selectedValue}}
|
|
30
25
|
</div>
|
|
31
26
|
</div>
|
|
32
27
|
</div>
|
|
33
|
-
|
|
34
|
-
})
|
|
28
|
+
`,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind({})
|
|
32
|
+
Default.args = {}
|
|
35
33
|
|
|
36
|
-
export const
|
|
37
|
-
|
|
34
|
+
export const Small = Template.bind({})
|
|
35
|
+
Small.args = {
|
|
36
|
+
small: true,
|
|
37
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import PsSlider from '../components/controls/PsSlider.vue'
|
|
1
|
+
import PsSlider from '../components/controls/PsSlider.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Slider',
|
|
4
4
|
component: PsSlider,
|
|
5
5
|
argTypes: {
|
|
6
6
|
},
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
|
|
9
9
|
const Template = (args, { argTypes }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
@@ -14,27 +14,27 @@ const Template = (args, { argTypes }) => ({
|
|
|
14
14
|
<PsSlider v-bind="$props" :value.sync="value" />
|
|
15
15
|
</div>
|
|
16
16
|
`
|
|
17
|
-
})
|
|
17
|
+
})
|
|
18
18
|
|
|
19
|
-
export const Label = Template.bind({})
|
|
19
|
+
export const Label = Template.bind({})
|
|
20
20
|
Label.args = {
|
|
21
21
|
min: 1,
|
|
22
22
|
max: 100,
|
|
23
23
|
value: 30,
|
|
24
24
|
label: 'Score Label'
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
export const NoLabel = Template.bind({})
|
|
27
|
+
export const NoLabel = Template.bind({})
|
|
28
28
|
NoLabel.args = {
|
|
29
29
|
min: 1,
|
|
30
30
|
max: 100,
|
|
31
31
|
value: 15
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
export const Bubble = Template.bind({})
|
|
34
|
+
export const Bubble = Template.bind({})
|
|
35
35
|
Bubble.args = {
|
|
36
36
|
min: 1,
|
|
37
37
|
max: 100,
|
|
38
38
|
value: 23,
|
|
39
39
|
bubble: true
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import PsSwitch, { sizes } from '../components/controls/PsSwitch.vue'
|
|
1
|
+
import PsSwitch, { sizes } from '../components/controls/PsSwitch.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Switch',
|
|
4
4
|
component: PsSwitch,
|
|
5
5
|
argTypes: {
|
|
6
6
|
size: { control: { type: 'select', options: sizes } }
|
|
7
7
|
},
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
|
|
10
10
|
const Template = (args, { argTypes }) => ({
|
|
11
11
|
props: Object.keys(argTypes),
|
|
@@ -17,22 +17,22 @@ const Template = (args, { argTypes }) => ({
|
|
|
17
17
|
},
|
|
18
18
|
template: `
|
|
19
19
|
<div>
|
|
20
|
-
<PsSwitch v-bind="$props"
|
|
20
|
+
<PsSwitch v-bind="$props" v-model="model" />
|
|
21
|
+
<p>{{ model }}</p>
|
|
21
22
|
</div>
|
|
22
23
|
`
|
|
23
|
-
})
|
|
24
|
+
})
|
|
24
25
|
|
|
25
|
-
export const Big = Template.bind({})
|
|
26
|
+
export const Big = Template.bind({})
|
|
26
27
|
Big.args = {
|
|
27
28
|
size: 'big',
|
|
28
|
-
active: true,
|
|
29
29
|
label: 'Switch Big',
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
-
export const Small = Template.bind({})
|
|
32
|
+
export const Small = Template.bind({})
|
|
33
33
|
Small.args = {
|
|
34
34
|
size: 'small',
|
|
35
|
-
active: true,
|
|
36
35
|
label: 'Switch Small',
|
|
37
|
-
|
|
36
|
+
small: true
|
|
37
|
+
}
|
|
38
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PsTabHeader from '../components/tabs/PsTabHeader.vue'
|
|
1
|
+
import PsTabHeader from '../components/tabs/PsTabHeader.vue'
|
|
2
2
|
const items = ['Existing Buildings', 'New Constructions', 'Other tab']
|
|
3
3
|
const item = items[0]
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
title: 'Components/Tab Header',
|
|
7
7
|
component: PsTabHeader,
|
|
8
8
|
argTypes: {}
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
const Template = (args, { argTypes }) => ({
|
|
11
11
|
props: Object.keys(argTypes),
|
|
12
12
|
components: { PsTabHeader },
|
|
@@ -28,25 +28,25 @@ const Template = (args, { argTypes }) => ({
|
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
`
|
|
31
|
-
})
|
|
31
|
+
})
|
|
32
32
|
|
|
33
|
-
export const Standard = Template.bind({})
|
|
33
|
+
export const Standard = Template.bind({})
|
|
34
34
|
Standard.args = {
|
|
35
35
|
theme: 'standard',
|
|
36
36
|
items: items,
|
|
37
37
|
selected: item
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
export const Underline = Template.bind({})
|
|
40
|
+
export const Underline = Template.bind({})
|
|
41
41
|
Underline.args = {
|
|
42
42
|
theme: 'underline',
|
|
43
43
|
items: items,
|
|
44
44
|
selected: item
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
export const Folder = Template.bind({})
|
|
47
|
+
export const Folder = Template.bind({})
|
|
48
48
|
Folder.args = {
|
|
49
49
|
theme: 'folder',
|
|
50
50
|
items: items,
|
|
51
51
|
selected: item
|
|
52
|
-
}
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PsToast, { typeOptions, fillOptions } from '../components/notifications/PsToast.vue'
|
|
1
|
+
import PsToast, { typeOptions, fillOptions } from '../components/notifications/PsToast.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Toast',
|
|
4
4
|
component: PsToast,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
type: { control: { type: 'select', options: typeOptions } },
|
|
7
7
|
fill: { control: { type: 'select', options: fillOptions } }
|
|
8
8
|
},
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
|
|
11
11
|
const Template = (args, { argTypes }) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
@@ -21,33 +21,33 @@ const Template = (args, { argTypes }) => ({
|
|
|
21
21
|
<template v-if="${'default' in args}" v-slot>${args.default}</template>
|
|
22
22
|
</PsToast>
|
|
23
23
|
`
|
|
24
|
-
})
|
|
24
|
+
})
|
|
25
25
|
|
|
26
|
-
export const Info = Template.bind({})
|
|
26
|
+
export const Info = Template.bind({})
|
|
27
27
|
Info.args = {
|
|
28
28
|
type: 'info',
|
|
29
29
|
message: 'This is an info alert',
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
-
export const Success = Template.bind({})
|
|
32
|
+
export const Success = Template.bind({})
|
|
33
33
|
Success.args = {
|
|
34
34
|
type: 'success',
|
|
35
35
|
message: 'This is a success alert',
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
export const Warning = Template.bind({})
|
|
38
|
+
export const Warning = Template.bind({})
|
|
39
39
|
Warning.args = {
|
|
40
40
|
type: 'warning',
|
|
41
41
|
message: 'This is a warning alert',
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
|
|
44
|
-
export const Error = Template.bind({})
|
|
44
|
+
export const Error = Template.bind({})
|
|
45
45
|
Error.args = {
|
|
46
46
|
type: 'error',
|
|
47
47
|
message: 'This is an error alert',
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
export const Actions = Template.bind({})
|
|
50
|
+
export const Actions = Template.bind({})
|
|
51
51
|
Actions.args = {
|
|
52
52
|
type: 'info',
|
|
53
53
|
message: 'This is an info alert with actions',
|
|
@@ -55,4 +55,4 @@ Actions.args = {
|
|
|
55
55
|
<span class="psui-cursor-pointer" @click="teste('Callback Action 1')">ACTION1</span>
|
|
56
56
|
<span class="psui-cursor-pointer" @click="teste('Callback Action 2')">ACTION2</span>
|
|
57
57
|
`
|
|
58
|
-
}
|
|
58
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import PsToggle from '../components/controls/PsToggle.vue'
|
|
1
|
+
import PsToggle from '../components/controls/PsToggle.vue'
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Components/Toggle',
|
|
4
4
|
component: PsToggle,
|
|
5
5
|
argTypes: {},
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
const items = ['Option 1', 'Option 2', 'Option 3']
|
|
8
8
|
const selected = 'Option 2'
|
|
9
9
|
|
|
@@ -12,15 +12,14 @@ const Template = (args, { argTypes }) => ({
|
|
|
12
12
|
components: { PsToggle },
|
|
13
13
|
template: `
|
|
14
14
|
<PsToggle v-bind="$props" :selected.sync="selected" />
|
|
15
|
-
|
|
16
|
-
})
|
|
15
|
+
`,
|
|
16
|
+
})
|
|
17
17
|
|
|
18
|
-
export const Default = Template.bind({})
|
|
18
|
+
export const Default = Template.bind({})
|
|
19
19
|
Default.args = {
|
|
20
20
|
items: items,
|
|
21
|
-
selected: selected
|
|
22
|
-
}
|
|
23
|
-
|
|
21
|
+
selected: selected,
|
|
22
|
+
}
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* Hey Luciano!
|
|
@@ -29,18 +28,18 @@ Default.args = {
|
|
|
29
28
|
* Se quiser dar uma melhorada nessa parte, fique a vontade meu chegado! TMJ
|
|
30
29
|
*/
|
|
31
30
|
window.addEventListener('click', (ev) => {
|
|
32
|
-
if(ev.target.classList.contains('click-to-copy')) {
|
|
31
|
+
if (ev.target.classList.contains('click-to-copy')) {
|
|
33
32
|
copyText(ev.target.dataset.toCopy)
|
|
34
33
|
}
|
|
35
34
|
})
|
|
36
35
|
|
|
37
|
-
function copyText(textToCopy) {
|
|
38
|
-
var myTemporaryInputElement = document.createElement(
|
|
39
|
-
myTemporaryInputElement.type =
|
|
36
|
+
function copyText(textToCopy) {
|
|
37
|
+
var myTemporaryInputElement = document.createElement('input')
|
|
38
|
+
myTemporaryInputElement.type = 'text'
|
|
40
39
|
myTemporaryInputElement.value = textToCopy
|
|
41
40
|
document.body.appendChild(myTemporaryInputElement)
|
|
42
41
|
myTemporaryInputElement.select()
|
|
43
|
-
document.execCommand(
|
|
42
|
+
document.execCommand('Copy')
|
|
44
43
|
document.body.removeChild(myTemporaryInputElement)
|
|
45
44
|
alert('Item copied to clipboard!')
|
|
46
45
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import PsTooltip from '../components/tooltip/PsTooltip.vue'
|
|
2
|
+
import PsRichTooltip from '../components/tooltip/PsRichTooltip.vue'
|
|
3
|
+
import PsDialogTooltip,{ CSSCOLORS} from '../components/tooltip/PsDialogTooltip.vue'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Tooltip',
|
|
7
|
+
component: PsTooltip,
|
|
8
|
+
subcomponents: {PsRichTooltip, PsDialogTooltip}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const TemplateDialog = (args, {argTypes}) => ({
|
|
12
|
+
props: Object.keys(argTypes),
|
|
13
|
+
components: {PsDialogTooltip},
|
|
14
|
+
template: `
|
|
15
|
+
<div style='display: flex; justify-content: flex-end;'>
|
|
16
|
+
<PsDialogTooltip v-bind='$props'>
|
|
17
|
+
<p>Trigger</p>
|
|
18
|
+
</PsDialogTooltip>
|
|
19
|
+
<div>
|
|
20
|
+
`,
|
|
21
|
+
argTypes:{
|
|
22
|
+
type: { control : { type: 'select', options: CSSCOLORS}}
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const TemplateRich = (args,{argTypes})=>({
|
|
27
|
+
props: Object.keys(argTypes),
|
|
28
|
+
components: {PsRichTooltip},
|
|
29
|
+
template: `
|
|
30
|
+
<div style='display: flex; justify-content: flex-end;'>
|
|
31
|
+
<PsRichTooltip v-bind='$props'>
|
|
32
|
+
<p>Trigger</p>
|
|
33
|
+
</PsRichTooltip>
|
|
34
|
+
</div>
|
|
35
|
+
`
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
const TemplateRight = (args,{argTypes})=>({
|
|
40
|
+
props: Object.keys(argTypes),
|
|
41
|
+
components: {PsTooltip},
|
|
42
|
+
template: `
|
|
43
|
+
<div style='display: flex; justify-content: flex-end;'>
|
|
44
|
+
<PsTooltip v-bind='$props'>
|
|
45
|
+
<template v-slot:trigger>
|
|
46
|
+
Trigger
|
|
47
|
+
</template>
|
|
48
|
+
</PsTooltip>
|
|
49
|
+
</div>
|
|
50
|
+
`
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const TemplateMiddle = (args, {argTypes})=> ({
|
|
54
|
+
props: Object.keys(argTypes),
|
|
55
|
+
components: {PsTooltip},
|
|
56
|
+
template: `
|
|
57
|
+
<div style='display: flex; justify-content: center;'>
|
|
58
|
+
<PsTooltip v-bind='$props'>
|
|
59
|
+
<template v-slot:trigger>
|
|
60
|
+
Trigger
|
|
61
|
+
</template>
|
|
62
|
+
</PsTooltip>
|
|
63
|
+
</div>
|
|
64
|
+
`
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const TemplateLeft = (args, {argTypes}) => ({
|
|
68
|
+
props: Object.keys(argTypes),
|
|
69
|
+
components: {PsTooltip},
|
|
70
|
+
template: `
|
|
71
|
+
<div style='display: flex; justify-content: flex-start;'>
|
|
72
|
+
<PsTooltip v-bind='$props'>
|
|
73
|
+
<template v-slot:trigger>
|
|
74
|
+
Trigger
|
|
75
|
+
</template>
|
|
76
|
+
</PsTooltip>
|
|
77
|
+
</div>
|
|
78
|
+
`
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
export const Dialog = TemplateDialog.bind({})
|
|
82
|
+
Dialog.args = {
|
|
83
|
+
text: 'Air seal all ductwork to a final duct leakage value of 10% of nominal airflow.',
|
|
84
|
+
title: 'Duct Sealing',
|
|
85
|
+
buttonText: 'More info',
|
|
86
|
+
cssClass: 'psui-w-32',
|
|
87
|
+
type: 'color'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Rich = TemplateRich.bind({})
|
|
91
|
+
Rich.args = {
|
|
92
|
+
type: 'blue',
|
|
93
|
+
title: 'This is a test!!',
|
|
94
|
+
text: 'Here goes your text',
|
|
95
|
+
cssClass: 'psui-w-32'
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const RightSide = TemplateRight.bind({})
|
|
99
|
+
RightSide.args = {
|
|
100
|
+
title: 'This is a test!!!',
|
|
101
|
+
type: 'red',
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const Middle = TemplateMiddle.bind({})
|
|
105
|
+
Middle.args = {
|
|
106
|
+
title: 'This is a test!!!',
|
|
107
|
+
type: 'blue',
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const Left = TemplateLeft.bind({})
|
|
111
|
+
Left.args = {
|
|
112
|
+
title: 'This is a test!!!',
|
|
113
|
+
type: 'gray',
|
|
114
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
export const randomString = (length) => {
|
|
2
|
-
var result
|
|
3
|
-
var characters
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var result = ''
|
|
3
|
+
var characters =
|
|
4
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
5
|
+
var charactersLength = characters.length
|
|
6
|
+
for (var i = 0; i < length; i++) {
|
|
7
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength))
|
|
7
8
|
}
|
|
8
|
-
return result
|
|
9
|
+
return result
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const getParentScrollableEl = (node) => {
|
|
12
|
-
|
|
13
13
|
if (node == null) {
|
|
14
|
-
return null
|
|
14
|
+
return null
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if (node.scrollHeight > node.clientHeight) {
|
|
18
|
-
return node
|
|
18
|
+
return node
|
|
19
19
|
} else {
|
|
20
|
-
return getParentScrollableEl(node.parentNode)
|
|
20
|
+
return getParentScrollableEl(node.parentNode)
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
}
|
|
22
|
+
}
|