@policystudio/policy-studio-ui-vue 1.0.35 → 1.0.38
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/dist/css/psui_styles.css +14 -10
- package/package.json +1 -1
- package/src/assets/scss/components/PsInput.scss +9 -4
- package/src/assets/scss/components/PsSwitch.scss +4 -0
- package/src/components/controls/PsSwitch.vue +8 -1
- package/src/components/forms/PsInput.vue +3 -5
- package/src/stories/Input.stories.js +128 -23
- package/src/stories/Switch.stories.js +2 -2
package/dist/css/psui_styles.css
CHANGED
|
@@ -18309,6 +18309,10 @@ html {
|
|
|
18309
18309
|
border-radius: 1.5rem;
|
|
18310
18310
|
}
|
|
18311
18311
|
|
|
18312
|
+
.psui-el-switch.disabled {
|
|
18313
|
+
pointer-events: none;
|
|
18314
|
+
}
|
|
18315
|
+
|
|
18312
18316
|
.psui-el-switch.size-big{
|
|
18313
18317
|
width: 46px;
|
|
18314
18318
|
height: 24px;
|
|
@@ -20079,11 +20083,11 @@ html {
|
|
|
20079
20083
|
padding: 11.5px 16px;
|
|
20080
20084
|
}
|
|
20081
20085
|
|
|
20082
|
-
.psui-el-input.layout-default.status-resting .psui-el-input-wrapper
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20086
|
+
.psui-el-input.layout-default.status-resting .psui-el-input-wrapper:hover {
|
|
20087
|
+
--border-opacity: 1;
|
|
20088
|
+
border-color: #64B5CE;
|
|
20089
|
+
border-color: rgba(100, 181, 206, var(--border-opacity))
|
|
20090
|
+
}
|
|
20087
20091
|
|
|
20088
20092
|
.psui-el-input.layout-default.status-active .psui-el-input-wrapper {
|
|
20089
20093
|
--border-opacity: 1;
|
|
@@ -20099,11 +20103,11 @@ html {
|
|
|
20099
20103
|
padding: 7px 8px;
|
|
20100
20104
|
}
|
|
20101
20105
|
|
|
20102
|
-
.psui-el-input.layout-mini.status-resting .psui-el-input-wrapper
|
|
20103
|
-
|
|
20104
|
-
|
|
20105
|
-
|
|
20106
|
-
|
|
20106
|
+
.psui-el-input.layout-mini.status-resting .psui-el-input-wrapper:hover {
|
|
20107
|
+
--border-opacity: 1;
|
|
20108
|
+
border-color: #5DB883;
|
|
20109
|
+
border-color: rgba(93, 184, 131, var(--border-opacity))
|
|
20110
|
+
}
|
|
20107
20111
|
|
|
20108
20112
|
.psui-el-input.layout-mini.status-active .psui-el-input-wrapper {
|
|
20109
20113
|
--border-opacity: 1;
|
package/package.json
CHANGED
|
@@ -63,9 +63,12 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
&.status-resting {
|
|
66
|
-
.psui-el-input-wrapper
|
|
67
|
-
|
|
66
|
+
.psui-el-input-wrapper{
|
|
67
|
+
&:hover {
|
|
68
|
+
@apply psui-border-blue-50
|
|
69
|
+
}
|
|
68
70
|
}
|
|
71
|
+
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
&.status-active {
|
|
@@ -86,8 +89,10 @@
|
|
|
86
89
|
padding: 7px 8px;
|
|
87
90
|
}
|
|
88
91
|
&.status-resting {
|
|
89
|
-
.psui-el-input-wrapper
|
|
90
|
-
|
|
92
|
+
.psui-el-input-wrapper {
|
|
93
|
+
&:hover {
|
|
94
|
+
@apply psui-border-green-20
|
|
95
|
+
}
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
&.status-active {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class='psui-el-switch' :class="getComponentClass" @click="change()">
|
|
2
|
+
<div class='psui-el-switch' :class="[getComponentClass, {'disabled':disabled}]" @click="change()">
|
|
3
3
|
<input type="checkbox" :checked="value" />
|
|
4
4
|
<label class='psui-el-switch-button' :class="[getToggleClass]" />
|
|
5
5
|
</div>
|
|
@@ -23,6 +23,13 @@ export default {
|
|
|
23
23
|
value:{
|
|
24
24
|
type: Boolean,
|
|
25
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* It sets disabling mode.
|
|
28
|
+
*/
|
|
29
|
+
disabled:{
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
26
33
|
/**
|
|
27
34
|
* It sets the size of the switch button. eg: small and big.
|
|
28
35
|
*/
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
<label v-if="label"> {{ label }} </label>
|
|
5
5
|
|
|
6
6
|
<div
|
|
7
|
-
class="psui-el-input-wrapper"
|
|
8
|
-
@mouseenter="
|
|
9
|
-
@mouseleave="
|
|
10
|
-
:class="{ 'hover' : isHoveringInputWrapper }"
|
|
7
|
+
class="psui-el-input-wrapper"
|
|
8
|
+
@mouseenter="$emit('mouseenter',$event)"
|
|
9
|
+
@mouseleave="$emit('mouseleave',$event)"
|
|
11
10
|
>
|
|
12
11
|
|
|
13
12
|
<div v-if="$slots.prepend" class="psui-el-input-prepend">
|
|
@@ -108,7 +107,6 @@ export default {
|
|
|
108
107
|
},
|
|
109
108
|
},
|
|
110
109
|
data: () => ({
|
|
111
|
-
isHoveringInputWrapper: false,
|
|
112
110
|
isFocus: false,
|
|
113
111
|
}),
|
|
114
112
|
computed: {
|
|
@@ -7,8 +7,8 @@ export default {
|
|
|
7
7
|
required: { control: 'boolean' },
|
|
8
8
|
},
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
|
|
11
|
+
const TemplateInputText = (args, { argTypes }) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
13
13
|
components: { PsInput },
|
|
14
14
|
data: () => {
|
|
@@ -21,19 +21,19 @@ const TemplateDefault = (args, { argTypes }) => ({
|
|
|
21
21
|
},
|
|
22
22
|
template: `
|
|
23
23
|
<div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-3 psui-gap-6">
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
<div class="psui-col-span-3 psui-mt-8">
|
|
26
26
|
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSInput Layout Default</h1>
|
|
27
27
|
</div>
|
|
28
|
-
|
|
29
|
-
<PsInput v-bind="{...$props, label: 'Resting with hint', placeholder: '', value: '' }" />
|
|
28
|
+
|
|
29
|
+
<PsInput v-bind="{...$props, label: 'Resting with hint', placeholder: '', value: '' }" />
|
|
30
30
|
<PsInput label="Resting without hint" />
|
|
31
31
|
<PsInput label="Resting with Placeholder" placeholder="This is a placeholder" />
|
|
32
32
|
|
|
33
33
|
<PsInput v-bind="{...$props, label: 'Focus'}" />
|
|
34
34
|
<PsInput label="Typing" placeholder="Type to see the effect..." />
|
|
35
35
|
<PsInput v-bind="{...$props, label: 'Active', active: true }" />
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
<PsInput v-bind="{...$props, label: 'Error', hasError: true }" />
|
|
38
38
|
<PsInput v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
|
|
39
39
|
<PsInput v-bind="{...$props, label: 'Prepend / Append ' }" >
|
|
@@ -44,17 +44,17 @@ const TemplateDefault = (args, { argTypes }) => ({
|
|
|
44
44
|
Prepend
|
|
45
45
|
</template>
|
|
46
46
|
</PsInput>
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
<PsInput label="Disabled" :disabled="true" value="100,000" />
|
|
49
49
|
<PsInput v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }" />
|
|
50
50
|
<PsInput v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" />
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
54
|
<div class="psui-col-span-3 psui-mt-8">
|
|
55
55
|
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSInput Layout Mini</h1>
|
|
56
56
|
</div>
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
<PsInput layout="mini" label="Resting with hint" hint="This is a hint" value="1,653" />
|
|
59
59
|
<PsInput layout="mini" label="Resting without hint" />
|
|
60
60
|
<PsInput layout="mini" label="Resting with Placeholder" placeholder="This is a placeholder" />
|
|
@@ -62,7 +62,7 @@ const TemplateDefault = (args, { argTypes }) => ({
|
|
|
62
62
|
<PsInput layout="mini" v-bind="{...$props, label: 'Focus'}" />
|
|
63
63
|
<PsInput layout="mini" label="Typing" placeholder="Type to see the effect..." />
|
|
64
64
|
<PsInput layout="mini" v-bind="{...$props, label: 'Active', active: true }" />
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
<PsInput layout="mini" v-bind="{...$props, label: 'Error', hasError: true }" />
|
|
67
67
|
<PsInput layout="mini" v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
|
|
68
68
|
<PsInput layout="mini" v-bind="{...$props, label: 'Prepend / Append ' }" >
|
|
@@ -73,15 +73,120 @@ const TemplateDefault = (args, { argTypes }) => ({
|
|
|
73
73
|
Prepend
|
|
74
74
|
</template>
|
|
75
75
|
</PsInput>
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
<PsInput layout="mini" label="Disabled" :disabled="true" value="100,000" />
|
|
78
78
|
<PsInput layout="mini" v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }" />
|
|
79
79
|
<PsInput layout="mini" v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" />
|
|
80
|
-
|
|
81
|
-
</div>
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
82
|
`
|
|
83
83
|
})
|
|
84
|
-
|
|
84
|
+
|
|
85
|
+
const TemplateInputPassword = (args, { argTypes }) => ({
|
|
86
|
+
props: Object.keys(argTypes),
|
|
87
|
+
components: { PsInput },
|
|
88
|
+
data: () => {
|
|
89
|
+
return {
|
|
90
|
+
validator: {
|
|
91
|
+
hasError: true,
|
|
92
|
+
label: 'Error message!'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
template: `
|
|
97
|
+
<div class="psui-p-8 psui-bg-gray-10 psui-grid psui-grid-cols-3 psui-gap-6">
|
|
98
|
+
|
|
99
|
+
<div class="psui-col-span-3 psui-mt-8">
|
|
100
|
+
<h1 class="psui-font-bold psui-border-b psui-border-gray-30">PSInput Password Layout Default</h1>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<PsInput v-bind="{...$props, label: 'Resting with hint', placeholder: '', value: '', hint: 'Between 8 and 16 characters' }" >
|
|
104
|
+
<template v-slot:append>
|
|
105
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
106
|
+
visibility_off
|
|
107
|
+
</span>
|
|
108
|
+
</template>
|
|
109
|
+
</PsInput>
|
|
110
|
+
|
|
111
|
+
<PsInput label="Resting without hint" hint="Between 8 and 16 characters">
|
|
112
|
+
<template v-slot:append>
|
|
113
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
114
|
+
visibility_off
|
|
115
|
+
</span>
|
|
116
|
+
</template>
|
|
117
|
+
</PsInput>
|
|
118
|
+
|
|
119
|
+
<PsInput label="Resting with Placeholder" placeholder="This is a placeholder" hint="Between 8 and 16 characters">
|
|
120
|
+
<template v-slot:append>
|
|
121
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
122
|
+
visibility_off
|
|
123
|
+
</span>
|
|
124
|
+
</template>
|
|
125
|
+
</PsInput>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<PsInput v-bind="{...$props, label: 'Focus'}" hint="Between 8 and 16 characters">
|
|
129
|
+
<template v-slot:append>
|
|
130
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
131
|
+
visibility_off
|
|
132
|
+
</span>
|
|
133
|
+
</template>
|
|
134
|
+
</PsInput>
|
|
135
|
+
|
|
136
|
+
<PsInput v-bind="{...$props, label: 'Typing', placeholder: 'Type to see the effect...', value: '' }" hint="Between 8 and 16 characters" >
|
|
137
|
+
<template v-slot:append>
|
|
138
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
139
|
+
visibility_off
|
|
140
|
+
</span>
|
|
141
|
+
</template>
|
|
142
|
+
</PsInput>
|
|
143
|
+
|
|
144
|
+
<PsInput v-bind="{label: 'Active', active: true }" value="Password123" hint="Between 8 and 16 characters">
|
|
145
|
+
<template v-slot:append>
|
|
146
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
147
|
+
visibility
|
|
148
|
+
</span>
|
|
149
|
+
</template>
|
|
150
|
+
</PsInput>
|
|
151
|
+
|
|
152
|
+
<PsInput v-bind="{...$props, label: 'Error', hasError: true }" hint="Between 8 and 16 characters" />
|
|
153
|
+
<PsInput v-bind="{...$props, label: 'Error with custom message', hasError: 'Format invalid' }" />
|
|
154
|
+
<PsInput v-bind="{...$props, label: 'Prepend / Append ' }" hint="Between 8 and 16 characters">
|
|
155
|
+
<template v-slot:append>
|
|
156
|
+
Append
|
|
157
|
+
</template>
|
|
158
|
+
<template v-slot:prepend>
|
|
159
|
+
Prepend
|
|
160
|
+
</template>
|
|
161
|
+
</PsInput>
|
|
162
|
+
|
|
163
|
+
<PsInput label="Disabled" :disabled="true" value="100,000" hint="Between 8 and 16 characters">
|
|
164
|
+
<template v-slot:append>
|
|
165
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
166
|
+
visibility
|
|
167
|
+
</span>
|
|
168
|
+
</template>
|
|
169
|
+
</PsInput>
|
|
170
|
+
|
|
171
|
+
<PsInput v-bind="{...$props, label: 'Disabled without value', disabled: true, value: '', hint: false }">
|
|
172
|
+
<template v-slot:append>
|
|
173
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
174
|
+
visibility_off
|
|
175
|
+
</span>
|
|
176
|
+
</template>
|
|
177
|
+
</PsInput>
|
|
178
|
+
|
|
179
|
+
<PsInput v-bind="{...$props, label: 'Active/Disabled', disabled: true, active: true }" hint="Between 8 and 16 characters">
|
|
180
|
+
<template v-slot:append>
|
|
181
|
+
<span class="material-icons-round psui-text-gray-50 psui-mr-2">
|
|
182
|
+
visibility_off
|
|
183
|
+
</span>
|
|
184
|
+
</template>
|
|
185
|
+
</PsInput>
|
|
186
|
+
</div>
|
|
187
|
+
`
|
|
188
|
+
})
|
|
189
|
+
|
|
85
190
|
const TemplateSlots = (args, { argTypes }) => ({
|
|
86
191
|
props: Object.keys(argTypes),
|
|
87
192
|
components: { PsInput },
|
|
@@ -91,12 +196,12 @@ const TemplateSlots = (args, { argTypes }) => ({
|
|
|
91
196
|
<template v-slot:append>
|
|
92
197
|
ft²
|
|
93
198
|
</template>
|
|
94
|
-
</PsInput>
|
|
199
|
+
</PsInput>
|
|
95
200
|
<PsInput v-bind="$props" class="psui-mb-4">
|
|
96
201
|
<template v-slot:prepend>
|
|
97
202
|
ft²
|
|
98
203
|
</template>
|
|
99
|
-
</PsInput>
|
|
204
|
+
</PsInput>
|
|
100
205
|
<PsInput v-bind="$props" class="psui-mb-4">
|
|
101
206
|
<template v-slot:prepend>
|
|
102
207
|
ft²
|
|
@@ -108,8 +213,8 @@ const TemplateSlots = (args, { argTypes }) => ({
|
|
|
108
213
|
</div>
|
|
109
214
|
`
|
|
110
215
|
})
|
|
111
|
-
|
|
112
|
-
export const InputText =
|
|
216
|
+
|
|
217
|
+
export const InputText = TemplateInputText.bind({})
|
|
113
218
|
InputText.args = {
|
|
114
219
|
label: 'Input Text',
|
|
115
220
|
placeholder: 'Placeholder',
|
|
@@ -118,8 +223,8 @@ InputText.args = {
|
|
|
118
223
|
required: false,
|
|
119
224
|
value: 10,
|
|
120
225
|
}
|
|
121
|
-
|
|
122
|
-
export const InputPassword =
|
|
226
|
+
|
|
227
|
+
export const InputPassword = TemplateInputPassword.bind({})
|
|
123
228
|
InputPassword.args = {
|
|
124
229
|
type: 'password',
|
|
125
230
|
label: 'Password',
|
|
@@ -127,7 +232,7 @@ InputPassword.args = {
|
|
|
127
232
|
disabled: false,
|
|
128
233
|
required: false,
|
|
129
234
|
}
|
|
130
|
-
|
|
235
|
+
|
|
131
236
|
export const InputSlots = TemplateSlots.bind({})
|
|
132
237
|
InputSlots.args = {
|
|
133
238
|
label: 'Label',
|
|
@@ -22,8 +22,8 @@ const Template = (args, { argTypes }) => ({
|
|
|
22
22
|
</div>
|
|
23
23
|
<div style='display: flex; gap: 10px; flex-direction: column;'>
|
|
24
24
|
<span>Disable</span>
|
|
25
|
-
<PsSwitch v-bind="$props" v-model="dt" label='Switch1'
|
|
26
|
-
<PsSwitch v-bind="$props" v-model="dt" label='Switch2' size='small'/>
|
|
25
|
+
<PsSwitch v-bind="$props" v-model="dt" label='Switch1' disabled size='big'/>
|
|
26
|
+
<PsSwitch v-bind="$props" v-model="dt" label='Switch2' disabled size='small'/>
|
|
27
27
|
</div>
|
|
28
28
|
<div style='display: flex; gap: 10px; flex-direction: column;'>
|
|
29
29
|
<span>Enable</span>
|