@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.
- package/.eslintignore +1 -0
- package/.eslintrc.js +74 -67
- package/.github/workflows/deploy-storybook.yml +1 -1
- package/.storybook/PolicyStudio.ts +11 -0
- package/.storybook/eventBus.ts +26 -0
- package/.storybook/main.ts +21 -0
- package/.storybook/manager.ts +7 -0
- package/dist/css/psui_styles.css +4028 -110346
- package/package.json +50 -34
- package/postcss.config.js +1 -1
- package/scripts/kill-port.sh +12 -0
- package/src/App.vue +30 -0
- package/src/assets/scss/base.scss +27 -23
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +3 -3
- package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
- package/src/assets/scss/components/PsProgressBar.scss +4 -4
- package/src/assets/scss/components/PsTabHeader.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +2 -63
- package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
- package/src/components/accordion/PsAccordion.vue +20 -21
- package/src/components/accordion/PsAccordionItem.vue +30 -8
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +8 -4
- package/src/components/badges-and-tags/PsCardInfos.vue +3 -1
- package/src/components/badges-and-tags/PsChartLegend.vue +19 -5
- package/src/components/badges-and-tags/PsCostEffectBar.vue +4 -5
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +1 -1
- package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
- package/src/components/badges-and-tags/PsTestimonialCard.vue +6 -4
- package/src/components/buttons/PsButton.vue +85 -88
- package/src/components/chips/PsChips.vue +5 -2
- package/src/components/controls/PsCheckbox.vue +5 -2
- package/src/components/controls/PsCheckboxSimple.vue +4 -4
- package/src/components/controls/PsDraggable.vue +70 -67
- package/src/components/controls/PsInlineSelector.vue +13 -14
- package/src/components/controls/PsRadioButton.vue +10 -5
- package/src/components/controls/PsRadioButtonSimple.vue +3 -3
- package/src/components/controls/PsSlider.vue +6 -6
- package/src/components/controls/PsSwitch.vue +13 -3
- package/src/components/controls/PsToggle.vue +14 -11
- package/src/components/data-graphics/PsBarChart.vue +4 -2
- package/src/components/datatable/PsDataTable.vue +14 -5
- package/src/components/datatable/PsDataTableItem.vue +17 -4
- package/src/components/forms/PsDropdown.vue +8 -5
- package/src/components/forms/PsDropdownList.vue +1 -1
- package/src/components/forms/PsInput.vue +30 -14
- package/src/components/forms/PsInputSelect.vue +33 -11
- package/src/components/forms/PsInputTextArea.vue +15 -4
- package/src/components/navigations/PsBreadcrumb.vue +1 -1
- package/src/components/notifications/PsDialog.vue +11 -5
- package/src/components/notifications/PsSimpleAlert.vue +22 -10
- package/src/components/notifications/PsToast.vue +8 -3
- package/src/components/playground/PsScrollBar.vue +122 -50
- package/src/components/table-results/PsTableResults.vue +67 -51
- package/src/components/table-results/PsTableResultsBody.vue +3 -1
- package/src/components/table-results/PsTableResultsHead.vue +27 -8
- package/src/components/table-results/PsTableResultsHeadComparison.vue +24 -8
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +18 -6
- package/src/components/table-results/PsTableResultsRow.vue +6 -2
- package/src/components/tabs/PsTabHeader.vue +19 -16
- package/src/components/tooltip/PsDialogTooltip.vue +18 -8
- package/src/components/tooltip/PsRichTooltip.vue +12 -5
- package/src/components/tooltip/PsTooltip.vue +17 -9
- package/src/components/ui/PsDotLoader.vue +5 -5
- package/src/components/ui/PsIcon.vue +6 -2
- package/src/{index.js → index.ts} +4 -5
- package/src/shims-vue.d.ts +11 -0
- package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
- package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
- package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
- package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
- package/src/stories/Button.stories.ts +48 -0
- package/src/stories/Button.vue +59 -0
- package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
- package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
- package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
- package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
- package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
- package/src/stories/ClimateZoneBadge.stories.ts +28 -0
- package/src/stories/CostEffectBar.stories.ts +26 -0
- package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
- package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
- package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
- package/src/stories/Draggable.stories.ts +32 -0
- package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +1 -11
- package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
- package/src/stories/{ElevationSystem.stories.mdx → ElevationSystem.mdx} +1 -1
- package/src/stories/Header.stories.ts +42 -0
- package/src/stories/Header.vue +77 -0
- package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
- package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -1
- package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
- package/src/stories/{Input.stories.js → Input.stories.ts} +6 -2
- package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
- package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
- package/src/stories/{Introduction.stories.mdx → Introduction.mdx} +101 -101
- package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
- package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
- package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
- package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -0
- package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
- package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
- package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
- package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
- package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +4 -0
- package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
- package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
- package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
- package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
- package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
- package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
- package/src/stories/{Typography.stories.mdx → Typography.mdx} +107 -105
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -7
- package/src/util/{imageLoader.js → imageLoader.ts} +15 -9
- package/tailwind.config.js +11 -2
- package/tsconfig.json +47 -0
- package/webpack.config.js +36 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -3
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -6
- package/babel.config.js +0 -3
- package/backup-package-lock.json +0 -37194
- package/src/stories/Button.stories.js +0 -130
- package/src/stories/ClimateZoneBadge.stories.js +0 -17
- package/src/stories/CostEffectBar.stories.js +0 -23
- package/src/stories/Draggable.stories.js +0 -22
- /package/.storybook/{preview.js → preview.ts} +0 -0
- /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
- /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
- /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
- /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
}
|
|
7
7
|
const items = ['Option 1', 'Option 2', 'Option 3']
|
|
8
8
|
const selected = 'Option 2'
|
|
9
|
-
|
|
9
|
+
// @ts-ignore
|
|
10
10
|
const Template = (args, { argTypes }) => ({
|
|
11
11
|
props: Object.keys(argTypes),
|
|
12
12
|
components: { PsToggle },
|
|
@@ -16,6 +16,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
export const Default = Template.bind({})
|
|
19
|
+
// @ts-ignore
|
|
19
20
|
Default.args = {
|
|
20
21
|
items: items,
|
|
21
22
|
selected: selected,
|
|
@@ -28,13 +29,15 @@ Default.args = {
|
|
|
28
29
|
* Se quiser dar uma melhorada nessa parte, fique a vontade meu chegado! TMJ
|
|
29
30
|
*/
|
|
30
31
|
window.addEventListener('click', (ev) => {
|
|
32
|
+
// @ts-ignore
|
|
31
33
|
if (ev.target.classList.contains('click-to-copy')) {
|
|
34
|
+
// @ts-ignore
|
|
32
35
|
copyText(ev.target.dataset.toCopy)
|
|
33
36
|
}
|
|
34
37
|
})
|
|
35
|
-
|
|
38
|
+
// @ts-ignore
|
|
36
39
|
function copyText(textToCopy) {
|
|
37
|
-
|
|
40
|
+
const myTemporaryInputElement = document.createElement('input')
|
|
38
41
|
myTemporaryInputElement.type = 'text'
|
|
39
42
|
myTemporaryInputElement.value = textToCopy
|
|
40
43
|
document.body.appendChild(myTemporaryInputElement)
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
subcomponents: {PsRichTooltip, PsDialogTooltip}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const TemplateDialog = (args, {argTypes}) => ({
|
|
11
|
+
const TemplateDialog = (args:any, {argTypes}:{argTypes:any}) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
13
13
|
components: {PsDialogTooltip},
|
|
14
14
|
template: `
|
|
@@ -41,7 +41,7 @@ const TemplateDialog = (args, {argTypes}) => ({
|
|
|
41
41
|
`,
|
|
42
42
|
})
|
|
43
43
|
|
|
44
|
-
const TemplateRich = (args,{argTypes})=>({
|
|
44
|
+
const TemplateRich = (args:any, {argTypes}:{argTypes:any})=>({
|
|
45
45
|
props: Object.keys(argTypes),
|
|
46
46
|
components: {PsRichTooltip},
|
|
47
47
|
template: `
|
|
@@ -74,7 +74,7 @@ const TemplateRich = (args,{argTypes})=>({
|
|
|
74
74
|
`
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
-
const TemplateDefault = (args, {argTypes}) => ({
|
|
77
|
+
const TemplateDefault = (args:any, {argTypes}:{argTypes:any}) => ({
|
|
78
78
|
props: Object.keys(argTypes),
|
|
79
79
|
components: {PsTooltip},
|
|
80
80
|
template: `
|
|
@@ -1,111 +1,7 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
2
|
|
|
3
3
|
<Meta title="Typography" />
|
|
4
4
|
|
|
5
|
-
<style>{`
|
|
6
|
-
.subheading {
|
|
7
|
-
--mediumdark: '#999999';
|
|
8
|
-
font-weight: 900;
|
|
9
|
-
font-size: 13px;
|
|
10
|
-
color: #999;
|
|
11
|
-
letter-spacing: 6px;
|
|
12
|
-
line-height: 24px;
|
|
13
|
-
text-transform: uppercase;
|
|
14
|
-
margin-bottom: 12px;
|
|
15
|
-
margin-top: 40px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.link-list {
|
|
19
|
-
display: grid;
|
|
20
|
-
grid-template-columns: 1fr;
|
|
21
|
-
grid-template-rows: 1fr 1fr;
|
|
22
|
-
row-gap: 10px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@media (min-width: 620px) {
|
|
26
|
-
.link-list {
|
|
27
|
-
row-gap: 20px;
|
|
28
|
-
column-gap: 20px;
|
|
29
|
-
grid-template-columns: 1fr 1fr;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@media all and (-ms-high-contrast:none) {
|
|
34
|
-
.link-list {
|
|
35
|
-
display: -ms-grid;
|
|
36
|
-
-ms-grid-columns: 1fr 1fr;
|
|
37
|
-
-ms-grid-rows: 1fr 1fr;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.link-item {
|
|
42
|
-
display: block;
|
|
43
|
-
padding: 20px 30px 20px 15px;
|
|
44
|
-
border: 1px solid #00000010;
|
|
45
|
-
border-radius: 5px;
|
|
46
|
-
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
47
|
-
color: #333333;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: flex-start;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.link-item:hover {
|
|
53
|
-
border-color: #1EA7FD50;
|
|
54
|
-
transform: translate3d(0, -3px, 0);
|
|
55
|
-
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.link-item:active {
|
|
59
|
-
border-color: #1EA7FD;
|
|
60
|
-
transform: translate3d(0, 0, 0);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.link-item strong {
|
|
64
|
-
font-weight: 700;
|
|
65
|
-
display: block;
|
|
66
|
-
margin-bottom: 2px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.link-item img {
|
|
70
|
-
height: 40px;
|
|
71
|
-
width: 40px;
|
|
72
|
-
margin-right: 15px;
|
|
73
|
-
flex: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.link-item span {
|
|
77
|
-
font-size: 14px;
|
|
78
|
-
line-height: 20px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.tip {
|
|
82
|
-
display: inline-block;
|
|
83
|
-
border-radius: 1em;
|
|
84
|
-
font-size: 11px;
|
|
85
|
-
line-height: 12px;
|
|
86
|
-
font-weight: 700;
|
|
87
|
-
background: #E7FDD8;
|
|
88
|
-
color: #66BF3C;
|
|
89
|
-
padding: 4px 12px;
|
|
90
|
-
margin-right: 10px;
|
|
91
|
-
vertical-align: top;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.tip-wrapper {
|
|
95
|
-
font-size: 13px;
|
|
96
|
-
line-height: 20px;
|
|
97
|
-
margin-top: 40px;
|
|
98
|
-
margin-bottom: 40px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.tip-wrapper code {
|
|
102
|
-
font-size: 12px;
|
|
103
|
-
display: inline-block;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
`}</style>
|
|
108
|
-
|
|
109
5
|
# Typography
|
|
110
6
|
Typography serves to present your design and content as clearly and efficiently as possible.
|
|
111
7
|
|
|
@@ -208,3 +104,109 @@ Keeping typography consistent and sticking to logical hierarchies ensures that e
|
|
|
208
104
|
</tr>
|
|
209
105
|
</table>
|
|
210
106
|
|
|
107
|
+
<style>
|
|
108
|
+
{`
|
|
109
|
+
.subheading {
|
|
110
|
+
--mediumdark: '#999999';
|
|
111
|
+
font-weight: 900;
|
|
112
|
+
font-size: 13px;
|
|
113
|
+
color: #999;
|
|
114
|
+
letter-spacing: 6px;
|
|
115
|
+
line-height: 24px;
|
|
116
|
+
text-transform: uppercase;
|
|
117
|
+
margin-bottom: 12px;
|
|
118
|
+
margin-top: 40px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.link-list {
|
|
122
|
+
display: grid;
|
|
123
|
+
grid-template-columns: 1fr;
|
|
124
|
+
grid-template-rows: 1fr 1fr;
|
|
125
|
+
row-gap: 10px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 620px) {
|
|
129
|
+
.link-list {
|
|
130
|
+
row-gap: 20px;
|
|
131
|
+
column-gap: 20px;
|
|
132
|
+
grid-template-columns: 1fr 1fr;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media all and (-ms-high-contrast:none) {
|
|
137
|
+
.link-list {
|
|
138
|
+
display: -ms-grid;
|
|
139
|
+
-ms-grid-columns: 1fr 1fr;
|
|
140
|
+
-ms-grid-rows: 1fr 1fr;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.link-item {
|
|
145
|
+
display: block;
|
|
146
|
+
padding: 20px 30px 20px 15px;
|
|
147
|
+
border: 1px solid #00000010;
|
|
148
|
+
border-radius: 5px;
|
|
149
|
+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
150
|
+
color: #333333;
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: flex-start;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.link-item:hover {
|
|
156
|
+
border-color: #1EA7FD50;
|
|
157
|
+
transform: translate3d(0, -3px, 0);
|
|
158
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.link-item:active {
|
|
162
|
+
border-color: #1EA7FD;
|
|
163
|
+
transform: translate3d(0, 0, 0);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.link-item strong {
|
|
167
|
+
font-weight: 700;
|
|
168
|
+
display: block;
|
|
169
|
+
margin-bottom: 2px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.link-item img {
|
|
173
|
+
height: 40px;
|
|
174
|
+
width: 40px;
|
|
175
|
+
margin-right: 15px;
|
|
176
|
+
flex: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.link-item span {
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
line-height: 20px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.tip {
|
|
185
|
+
display: inline-block;
|
|
186
|
+
border-radius: 1em;
|
|
187
|
+
font-size: 11px;
|
|
188
|
+
line-height: 12px;
|
|
189
|
+
font-weight: 700;
|
|
190
|
+
background: #E7FDD8;
|
|
191
|
+
color: #66BF3C;
|
|
192
|
+
padding: 4px 12px;
|
|
193
|
+
margin-right: 10px;
|
|
194
|
+
vertical-align: top;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.tip-wrapper {
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
line-height: 20px;
|
|
200
|
+
margin-top: 40px;
|
|
201
|
+
margin-bottom: 40px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.tip-wrapper code {
|
|
205
|
+
font-size: 12px;
|
|
206
|
+
display: inline-block;
|
|
207
|
+
}
|
|
208
|
+
`}
|
|
209
|
+
</style>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.storybook-button {
|
|
2
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
+
font-weight: 700;
|
|
4
|
+
border: 0;
|
|
5
|
+
border-radius: 3em;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
line-height: 1;
|
|
9
|
+
}
|
|
10
|
+
.storybook-button--primary {
|
|
11
|
+
color: white;
|
|
12
|
+
background-color: #1ea7fd;
|
|
13
|
+
}
|
|
14
|
+
.storybook-button--secondary {
|
|
15
|
+
color: #333;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
18
|
+
}
|
|
19
|
+
.storybook-button--small {
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
padding: 10px 16px;
|
|
22
|
+
}
|
|
23
|
+
.storybook-button--medium {
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
padding: 11px 20px;
|
|
26
|
+
}
|
|
27
|
+
.storybook-button--large {
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
padding: 12px 24px;
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.storybook-header {
|
|
2
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
4
|
+
padding: 15px 20px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.storybook-header svg {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
vertical-align: top;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.storybook-header h1 {
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
font-size: 20px;
|
|
18
|
+
line-height: 1;
|
|
19
|
+
margin: 6px 0 6px 10px;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
vertical-align: top;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.storybook-header button + button {
|
|
25
|
+
margin-left: 10px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.storybook-header .welcome {
|
|
29
|
+
color: #333;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
margin-right: 10px;
|
|
32
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export const randomString = (length) => {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const randomString = (length:any) => {
|
|
2
|
+
let result = ''
|
|
3
|
+
const characters =
|
|
4
4
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
5
|
-
|
|
6
|
-
for (
|
|
5
|
+
const charactersLength = characters.length
|
|
6
|
+
for (let i = 0; i < length; i++) {
|
|
7
7
|
result += characters.charAt(Math.floor(Math.random() * charactersLength))
|
|
8
8
|
}
|
|
9
9
|
return result
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const getParentScrollableEl = (node) => {
|
|
12
|
+
export const getParentScrollableEl = (node:any):any => {
|
|
13
13
|
if (node == null) {
|
|
14
14
|
return null
|
|
15
15
|
}
|
|
@@ -21,7 +21,7 @@ export const getParentScrollableEl = (node) => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const getParentVueComponentByName = (comp, name) => {
|
|
24
|
+
export const getParentVueComponentByName = (comp:any, name:any):any => {
|
|
25
25
|
if (comp.$options.name === name) {
|
|
26
26
|
return comp
|
|
27
27
|
} else {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
|
|
3
|
+
export default ({ imageUrl, onProgress = null, returnsBase64 = true }:{imageUrl:any, onProgress:any, returnsBase64:any}) => {
|
|
2
4
|
return new Promise((resolve, reject) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
const xhr = new XMLHttpRequest()
|
|
6
|
+
let notifiedNotComputable = false
|
|
5
7
|
|
|
6
8
|
xhr.open('GET', imageUrl, true)
|
|
7
9
|
xhr.responseType = 'arraybuffer'
|
|
8
10
|
|
|
9
|
-
xhr.onprogress = (ev) => {
|
|
11
|
+
xhr.onprogress = (ev:any) => {
|
|
10
12
|
if (ev.lengthComputable) {
|
|
11
|
-
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
const progress = parseInt((ev.loaded / ev.total) * 100)
|
|
12
15
|
if(onProgress) onProgress(progress)
|
|
13
16
|
} else {
|
|
14
17
|
if (!notifiedNotComputable) {
|
|
@@ -20,6 +23,7 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
|
|
|
20
23
|
|
|
21
24
|
xhr.onloadend = () => {
|
|
22
25
|
const contentType = xhr.getResponseHeader('Content-Type')
|
|
26
|
+
// @ts-ignore
|
|
23
27
|
if (!contentType.includes('image')) {
|
|
24
28
|
reject(xhr)
|
|
25
29
|
} else {
|
|
@@ -28,13 +32,15 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
|
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
if(!returnsBase64) {
|
|
35
|
+
// @ts-ignore
|
|
31
36
|
resolve()
|
|
32
37
|
} else {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const options = {}
|
|
39
|
+
const headers = xhr.getAllResponseHeaders()
|
|
40
|
+
const mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
|
|
41
|
+
// @ts-ignore
|
|
36
42
|
if (mime && mime[1]) options.type = mime[1]
|
|
37
|
-
|
|
43
|
+
const blob = new Blob([xhr.response], options)
|
|
38
44
|
resolve(window.URL.createObjectURL(blob))
|
|
39
45
|
}
|
|
40
46
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
|
|
1
3
|
module.exports = {
|
|
2
4
|
prefix: 'psui-',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
content: [
|
|
6
|
+
'./index.html',
|
|
7
|
+
'./src/**/*.vue',
|
|
8
|
+
'./src/**/*.js',
|
|
9
|
+
'./src/**/*.ts',
|
|
10
|
+
'./src/**/*.jsx',
|
|
11
|
+
'./src/**/*.tsx',
|
|
12
|
+
],
|
|
13
|
+
darkMode: 'media', // or 'media' or 'class'
|
|
5
14
|
theme: {
|
|
6
15
|
colors: {
|
|
7
16
|
'white': '#ffffff ',
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"noEmitOnError": false,
|
|
9
|
+
"outDir": "./dist",
|
|
10
|
+
"rootDir": "./src",
|
|
11
|
+
"skipLibCheck": true, //this make ts ignore error
|
|
12
|
+
"skipDefaultLibCheck": true, //this make ts ignore error
|
|
13
|
+
"noEmit": true, //this make ts ignore error
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"allowSyntheticDefaultImports": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"useDefineForClassFields": true,
|
|
18
|
+
"sourceMap": true,
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"types": [
|
|
21
|
+
"webpack-env"
|
|
22
|
+
],
|
|
23
|
+
"paths": {
|
|
24
|
+
"@/*": [
|
|
25
|
+
"src/*"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"lib": [
|
|
29
|
+
"esnext",
|
|
30
|
+
"dom",
|
|
31
|
+
"dom.iterable",
|
|
32
|
+
"scripthost"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"include": [
|
|
36
|
+
"src/**/*.ts",
|
|
37
|
+
"src/**/*.tsx",
|
|
38
|
+
"src/**/*.d.ts",
|
|
39
|
+
"src/**/*.vue",
|
|
40
|
+
"src/**/*.stories.ts",
|
|
41
|
+
"tests/**/*.ts",
|
|
42
|
+
"tests/**/*.tsx",
|
|
43
|
+
],
|
|
44
|
+
"exclude": [
|
|
45
|
+
"node_modules"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const { VueLoaderPlugin} = require('vue-loader')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
resolve: {
|
|
5
|
+
alias: {
|
|
6
|
+
vue: '@vue/compat'
|
|
7
|
+
},
|
|
8
|
+
extensions: ['.js','.ts','.vue']
|
|
9
|
+
},
|
|
10
|
+
module: {
|
|
11
|
+
rules: [
|
|
12
|
+
{
|
|
13
|
+
test: /\.vue$/,
|
|
14
|
+
loader: 'vue-loader',
|
|
15
|
+
options: {
|
|
16
|
+
compilerOptions: {
|
|
17
|
+
compatConfig: {
|
|
18
|
+
MODE: 2
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
test: /\.tsx?$/,
|
|
25
|
+
loader: 'ts-loader',
|
|
26
|
+
options: {
|
|
27
|
+
appendTsSuffixTo: [/\.vue$/],
|
|
28
|
+
},
|
|
29
|
+
exclude: /node_modules/,
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
plugins:[
|
|
34
|
+
new VueLoaderPlugin()
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { create } from '@storybook/theming';
|
|
2
|
-
import logo from '../src/assets/images/policy-studio.svg';
|
|
3
|
-
|
|
4
|
-
export default create({
|
|
5
|
-
base: 'light',
|
|
6
|
-
brandTitle: 'Policy Studio UI Vue',
|
|
7
|
-
brandUrl: 'https://policystudio.co/',
|
|
8
|
-
brandImage: logo,
|
|
9
|
-
brandTarget: '_blank',
|
|
10
|
-
});
|
package/.storybook/eventBus.js
DELETED
package/.storybook/main.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"stories": [
|
|
3
|
-
"../src/**/*.stories.mdx",
|
|
4
|
-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
|
5
|
-
],
|
|
6
|
-
previewHead: (head) => (`
|
|
7
|
-
${head}
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap" rel="stylesheet">
|
|
11
|
-
`),
|
|
12
|
-
"addons": [
|
|
13
|
-
"@storybook/addon-links",
|
|
14
|
-
"@storybook/addon-essentials",
|
|
15
|
-
{
|
|
16
|
-
name: '@storybook/addon-postcss',
|
|
17
|
-
options: {
|
|
18
|
-
postcssLoaderOptions: {
|
|
19
|
-
implementation: require('postcss'),
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
"framework": "@storybook/vue"
|
|
25
|
-
}
|
package/.storybook/manager.js
DELETED
package/babel.config.js
DELETED