barbican-reset 1.5.7 → 1.6.0
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/components/alert.vue +14 -205
- package/components/br_button/components.js +1 -3
- package/components/br_button/remove_ticket.vue +1 -1
- package/components/br_button.vue +11 -14
- package/helpers/mixins/_buttons.scss +4 -0
- package/helpers/mixins/input/_generic.scss +1 -3
- package/helpers/mixins/input/_radio.scss +1 -8
- package/icons/stream/close.vue +3 -3
- package/package.json +1 -1
- package/scss/_alert.scss +140 -0
- package/scss/index.scss +1 -0
- package/components/br_button/outline_primary.vue +0 -60
package/components/alert.vue
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
3
|
-
<div :class="
|
|
4
|
-
<span :class="
|
|
5
|
-
<div
|
|
2
|
+
<div :class="[`br-alert`,{ center }]" :data-test="`alert-${this.getStatus}`">
|
|
3
|
+
<div :class="[`wrap`, getStatus,{ inline },{ toggle }]">
|
|
4
|
+
<span :class="{ flex }">
|
|
5
|
+
<div class="title" v-if="title.length > 0 && !toggle">{{ title }}</div>
|
|
6
6
|
<slot />
|
|
7
7
|
</span>
|
|
8
|
-
<b-button v-if="toggle" variant="invisible" :class="
|
|
9
|
-
<close-icon />
|
|
8
|
+
<b-button v-if="toggle" variant="invisible" :class="[`exit`, getStatus]" @click="$emit('close')">
|
|
9
|
+
<close-icon :status="getStatus" />
|
|
10
10
|
</b-button>
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
@@ -21,6 +21,13 @@ export default {
|
|
|
21
21
|
BButton,
|
|
22
22
|
CloseIcon,
|
|
23
23
|
},
|
|
24
|
+
computed: {
|
|
25
|
+
getStatus() {
|
|
26
|
+
if (this.error) { return "error"; }
|
|
27
|
+
if (this.success) { return "success"; }
|
|
28
|
+
return "neutral";
|
|
29
|
+
}
|
|
30
|
+
},
|
|
24
31
|
props: {
|
|
25
32
|
inline: {
|
|
26
33
|
type: Boolean,
|
|
@@ -42,10 +49,6 @@ export default {
|
|
|
42
49
|
type: Boolean,
|
|
43
50
|
default: false,
|
|
44
51
|
},
|
|
45
|
-
margin: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: null
|
|
48
|
-
},
|
|
49
52
|
title: {
|
|
50
53
|
type: String,
|
|
51
54
|
default: ''
|
|
@@ -54,202 +57,8 @@ export default {
|
|
|
54
57
|
type: Boolean,
|
|
55
58
|
default: false,
|
|
56
59
|
}
|
|
57
|
-
},
|
|
58
|
-
computed: {
|
|
59
|
-
testData() {
|
|
60
|
-
if (this.error) {
|
|
61
|
-
return 'alert-error';
|
|
62
|
-
} else if (this.success) {
|
|
63
|
-
return 'alert-success';
|
|
64
|
-
} return 'alert-neutral';
|
|
65
|
-
},
|
|
66
|
-
styleContainer() {
|
|
67
|
-
let style = this.$style;
|
|
68
|
-
let output = [style.container];
|
|
69
|
-
if (this.center) { output.push(style.center); }
|
|
70
|
-
if (this.margin) {
|
|
71
|
-
switch (this.margin) {
|
|
72
|
-
case 'lg': output.push(style.margin_lg); break;
|
|
73
|
-
case 'md': output.push(style.margin_md); break;
|
|
74
|
-
default: output.push(style.margin_sm); break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return output;
|
|
78
|
-
},
|
|
79
|
-
styleWrap() {
|
|
80
|
-
let style = this.$style;
|
|
81
|
-
let output = [style.wrap];
|
|
82
|
-
if (this.error) { output.push(style.error, 'error'); }
|
|
83
|
-
if (this.success) { output.push(style.success, 'success'); }
|
|
84
|
-
if (this.inline) { output.push(style.inline); }
|
|
85
|
-
if (this.toggle) { output.push(style.toggle); }
|
|
86
|
-
return output;
|
|
87
|
-
},
|
|
88
|
-
styleSpan() {
|
|
89
|
-
let style = this.$style;
|
|
90
|
-
let output = [];
|
|
91
|
-
if (this.flex) { output.push(style.flex); }
|
|
92
|
-
return output;
|
|
93
|
-
},
|
|
94
|
-
styleButton() {
|
|
95
|
-
let style = this.$style;
|
|
96
|
-
let output = [style.button];
|
|
97
|
-
if (this.error) { output.push(style.error); }
|
|
98
|
-
else if (this.success) { output.push(style.success); }
|
|
99
|
-
else { output.push(style.neutral); }
|
|
100
|
-
return output;
|
|
101
|
-
}
|
|
102
60
|
}
|
|
103
61
|
};
|
|
104
|
-
</script>
|
|
105
|
-
|
|
106
|
-
<style lang="scss" module>
|
|
107
|
-
|
|
108
|
-
$neutral-colors: $c-status-neutral, $c-status-neutral-fade;
|
|
109
|
-
$success-colors: $c-status-success, $c-status-success-fade;
|
|
110
|
-
$error-colors: $c-status-error, $c-status-error-fade;
|
|
111
|
-
|
|
112
|
-
@mixin icon($color, $fade) {
|
|
113
|
-
[data-fill] { fill: $fade; }
|
|
114
|
-
[data-outline],
|
|
115
|
-
[data-cross] { fill: $color; }
|
|
116
|
-
|
|
117
|
-
@include focus {
|
|
118
|
-
[data-fill] { fill: $color; }
|
|
119
|
-
[data-cross] { fill: $fade; }
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.container {
|
|
124
|
-
@include media-breakpoint-down(xs) {
|
|
125
|
-
font-size: $font-size-sm;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
&.margin_sm {
|
|
129
|
-
margin-bottom: 1rem;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
&.margin_md {
|
|
133
|
-
margin-bottom: 1.25rem;
|
|
134
|
-
|
|
135
|
-
@include media-breakpoint-up(md) {
|
|
136
|
-
margin-bottom: 2rem;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&.center {
|
|
141
|
-
text-align: center;
|
|
142
|
-
|
|
143
|
-
.wrap {
|
|
144
|
-
justify-content: center;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.wrap {
|
|
150
|
-
background-color: $c-status-neutral-fade;
|
|
151
|
-
border-color: $c-status-neutral-light;
|
|
152
|
-
border-radius: $border-radius;
|
|
153
|
-
border-width: $border-width;
|
|
154
|
-
color: $c-status-neutral;
|
|
155
|
-
border-style: solid;
|
|
156
|
-
padding: $space;
|
|
157
|
-
|
|
158
|
-
&.inline {
|
|
159
|
-
@include inline-block;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&.toggle {
|
|
163
|
-
justify-content: space-between;
|
|
164
|
-
align-items: center;
|
|
165
|
-
display: flex;
|
|
166
|
-
gap: $space;
|
|
167
|
-
|
|
168
|
-
&.inline {
|
|
169
|
-
display: inline-flex;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
a {
|
|
174
|
-
@include focus {
|
|
175
|
-
@include single-box($c-status-neutral);
|
|
176
|
-
background-color: $c-status-neutral;
|
|
177
|
-
color: $c-status-neutral-fade;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
p {
|
|
182
|
-
margin-bottom: 0;
|
|
183
|
-
|
|
184
|
-
+ p {
|
|
185
|
-
margin-top: 1rem;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&.error {
|
|
190
|
-
background-color: $c-status-error-fade;
|
|
191
|
-
border-color: $c-status-error-light;
|
|
192
|
-
color: $c-status-error;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&.success {
|
|
196
|
-
background-color: $c-status-success-fade;
|
|
197
|
-
border-color: $c-status-success-light;
|
|
198
|
-
color: $c-status-success;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
62
|
|
|
202
|
-
|
|
203
|
-
margin-bottom: 0.25rem;
|
|
204
|
-
font-weight: 700;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.flex {
|
|
208
|
-
justify-content: space-between;
|
|
209
|
-
display: flex;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.button.neutral {
|
|
213
|
-
@include icon($neutral-colors...);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.button.success {
|
|
217
|
-
@include icon($success-colors...);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.button.error {
|
|
221
|
-
@include icon($error-colors...);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
</style>
|
|
225
|
-
|
|
226
|
-
<style lang="scss" scoped>
|
|
227
|
-
|
|
228
|
-
@mixin status_focus(
|
|
229
|
-
$color: $c-status-neutral,
|
|
230
|
-
$fade: $c-status-neutral-fade) {
|
|
231
|
-
|
|
232
|
-
@include focus {
|
|
233
|
-
@include single-box($color);
|
|
234
|
-
background-color: $color;
|
|
235
|
-
color: $fade;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.btn.btn-link, a {
|
|
240
|
-
@include status_focus;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.error {
|
|
244
|
-
.btn.btn-link, a {
|
|
245
|
-
@include status_focus($c-status-error, $c-status-error-fade);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.success {
|
|
250
|
-
.btn.btn-link, a {
|
|
251
|
-
@include status_focus($c-status-success, $c-status-success-fade);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
63
|
+
</script>
|
|
254
64
|
|
|
255
|
-
</style>
|
package/components/br_button.vue
CHANGED
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
</remove-ticket>
|
|
12
12
|
|
|
13
|
-
<outline-primary v-else-if="variant === 'outline-primary'" :state="state">
|
|
14
|
-
<template v-for="(index, name) in $slots" v-slot:[name]>
|
|
15
|
-
<slot :name="name" />
|
|
16
|
-
</template>
|
|
17
|
-
</outline-primary>
|
|
18
|
-
|
|
19
13
|
<template v-else>
|
|
20
14
|
|
|
21
15
|
<template v-if="state === 'default'">
|
|
@@ -23,7 +17,7 @@
|
|
|
23
17
|
<slot name="default" />
|
|
24
18
|
</template>
|
|
25
19
|
<template v-else>
|
|
26
|
-
{{ state }}
|
|
20
|
+
{{ titleCase(state) }}
|
|
27
21
|
</template>
|
|
28
22
|
</template>
|
|
29
23
|
|
|
@@ -31,9 +25,7 @@
|
|
|
31
25
|
<template v-if="$slots.loading">
|
|
32
26
|
<slot name="loading" />
|
|
33
27
|
</template>
|
|
34
|
-
<
|
|
35
|
-
{{ state }}
|
|
36
|
-
</template>
|
|
28
|
+
<dot-typing v-else />
|
|
37
29
|
</template>
|
|
38
30
|
|
|
39
31
|
<template v-else-if="state === 'loaded'">
|
|
@@ -41,7 +33,7 @@
|
|
|
41
33
|
<slot name="loaded" />
|
|
42
34
|
</template>
|
|
43
35
|
<template v-else>
|
|
44
|
-
{{ state }}
|
|
36
|
+
{{ titleCase(state) }}
|
|
45
37
|
</template>
|
|
46
38
|
</template>
|
|
47
39
|
|
|
@@ -50,7 +42,7 @@
|
|
|
50
42
|
<slot name="error" />
|
|
51
43
|
</template>
|
|
52
44
|
<template v-else>
|
|
53
|
-
{{ state }}
|
|
45
|
+
{{ titleCase(state) }}
|
|
54
46
|
</template>
|
|
55
47
|
</template>
|
|
56
48
|
|
|
@@ -61,7 +53,7 @@
|
|
|
61
53
|
|
|
62
54
|
<script>
|
|
63
55
|
import { BButton } from 'bootstrap-vue'
|
|
64
|
-
import { RemoveTicket,
|
|
56
|
+
import { RemoveTicket, DotTyping } from './br_button/components'
|
|
65
57
|
|
|
66
58
|
export default {
|
|
67
59
|
name: "BrButton",
|
|
@@ -78,6 +70,11 @@ export default {
|
|
|
78
70
|
default: "button"
|
|
79
71
|
}
|
|
80
72
|
},
|
|
73
|
+
methods: {
|
|
74
|
+
titleCase(str) {
|
|
75
|
+
return str.toLowerCase().split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
|
76
|
+
}
|
|
77
|
+
},
|
|
81
78
|
computed: {
|
|
82
79
|
loading() {
|
|
83
80
|
return this.state === "loading" ? "true" : "false";
|
|
@@ -86,7 +83,7 @@ export default {
|
|
|
86
83
|
components: {
|
|
87
84
|
BButton,
|
|
88
85
|
RemoveTicket,
|
|
89
|
-
|
|
86
|
+
DotTyping
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
89
|
</script>
|
package/icons/stream/close.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg width="28" viewBox="0 0 20 20">
|
|
3
|
-
<path
|
|
4
|
-
<path
|
|
5
|
-
<path
|
|
3
|
+
<path class="tint" fill="#fefbfa" d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10s10-4.5,10-10S15.5,0,10,0z" />
|
|
4
|
+
<path class="cross" fill="#353535" d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10s10-4.5,10-10S15.5,0,10,0z M10,18c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8 S14.4,18,10,18z" />
|
|
5
|
+
<path class="cross" fill="#353535" d="M12.6,6L10,8.6L7.4,6L6,7.4L8.6,10L6,12.6L7.4,14l2.6-2.6l2.6,2.6l1.4-1.4L11.4,10L14,7.4L12.6,6z" />
|
|
6
6
|
</svg>
|
|
7
7
|
</template>
|
package/package.json
CHANGED
package/scss/_alert.scss
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
|
|
2
|
+
$neutral_wrap: $c-status-neutral, $c-status-neutral-fade, $c-status-neutral-light;
|
|
3
|
+
$success_wrap: $c-status-success, $c-status-success-fade, $c-status-success-light;
|
|
4
|
+
$error_wrap: $c-status-error, $c-status-error-fade, $c-status-error-light;
|
|
5
|
+
|
|
6
|
+
$neutral_focus: $c-status-neutral, $c-status-neutral-fade;
|
|
7
|
+
$success_focus: $c-status-success, $c-status-success-fade;
|
|
8
|
+
$error_focus: $c-status-error, $c-status-error-fade;
|
|
9
|
+
|
|
10
|
+
@mixin status_focus($main, $fade) {
|
|
11
|
+
@include focus {
|
|
12
|
+
@include single-box($main);
|
|
13
|
+
background-color: $main;
|
|
14
|
+
color: $fade;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin exit($main, $fade) {
|
|
19
|
+
path.cross {
|
|
20
|
+
fill: $main;
|
|
21
|
+
}
|
|
22
|
+
path.tint {
|
|
23
|
+
fill: $fade;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include focus {
|
|
27
|
+
outline-color: $main;
|
|
28
|
+
|
|
29
|
+
path.cross {
|
|
30
|
+
fill: $fade;
|
|
31
|
+
}
|
|
32
|
+
path.tint {
|
|
33
|
+
fill: $main;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin wrap($main, $fade, $light) {
|
|
39
|
+
background-color: $fade;
|
|
40
|
+
border-color: $light;
|
|
41
|
+
color: $main;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.br-alert {
|
|
45
|
+
@include media-breakpoint-down(xs) {
|
|
46
|
+
font-size: $font-size-sm;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.center {
|
|
50
|
+
text-align: center;
|
|
51
|
+
|
|
52
|
+
.wrap {
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.wrap {
|
|
58
|
+
@include wrap($neutral_wrap...);
|
|
59
|
+
border-radius: $border-radius;
|
|
60
|
+
border-width: $border-width;
|
|
61
|
+
border-style: solid;
|
|
62
|
+
padding: $space;
|
|
63
|
+
|
|
64
|
+
.btn.btn-link, a {
|
|
65
|
+
@include status_focus($neutral_focus...);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.error {
|
|
69
|
+
@include wrap($error_wrap...);
|
|
70
|
+
|
|
71
|
+
.btn.btn-link, a {
|
|
72
|
+
@include status_focus($error_focus...);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.success {
|
|
77
|
+
@include wrap($success_wrap...);
|
|
78
|
+
|
|
79
|
+
.btn.btn-link, a {
|
|
80
|
+
@include status_focus($success_focus...);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.inline {
|
|
85
|
+
@include inline-block;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.toggle {
|
|
89
|
+
justify-content: space-between;
|
|
90
|
+
align-items: center;
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: $space;
|
|
93
|
+
|
|
94
|
+
&.inline {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
p {
|
|
100
|
+
margin-bottom: 0;
|
|
101
|
+
|
|
102
|
+
+ p {
|
|
103
|
+
margin-top: 1rem;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.title {
|
|
109
|
+
margin-bottom: 0.25rem;
|
|
110
|
+
font-weight: 700;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.flex {
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.btn.exit {
|
|
119
|
+
border-radius: 50%;
|
|
120
|
+
border: none;
|
|
121
|
+
padding: 0;
|
|
122
|
+
|
|
123
|
+
@include focus {
|
|
124
|
+
outline: 0.1875rem solid;
|
|
125
|
+
box-shadow: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&.error {
|
|
129
|
+
@include exit($error_focus...);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.success {
|
|
133
|
+
@include exit($success_focus...);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.neutral {
|
|
137
|
+
@include exit($neutral_focus...);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
package/scss/index.scss
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
|
|
4
|
-
<template v-if="state === 'default'">
|
|
5
|
-
<template v-if="$slots.default">
|
|
6
|
-
<slot name="default" />
|
|
7
|
-
</template>
|
|
8
|
-
<template v-else>
|
|
9
|
-
{{ state }}
|
|
10
|
-
</template>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<template v-else-if="state === 'loading'">
|
|
14
|
-
<template v-if="$slots.loading">
|
|
15
|
-
<slot name="loading" />
|
|
16
|
-
</template>
|
|
17
|
-
<dot-typing v-else />
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<template v-else-if="state === 'loaded'">
|
|
21
|
-
<template v-if="$slots.loaded">
|
|
22
|
-
<slot name="loaded" />
|
|
23
|
-
</template>
|
|
24
|
-
<template v-else>
|
|
25
|
-
{{ state }}
|
|
26
|
-
</template>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<template v-else-if="state === 'error'">
|
|
30
|
-
<template v-if="$slots.error">
|
|
31
|
-
<slot name="error" />
|
|
32
|
-
</template>
|
|
33
|
-
<template v-else>
|
|
34
|
-
{{ state }}
|
|
35
|
-
</template>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<script>
|
|
42
|
-
import { DotTyping } from './components'
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
name: 'OutlinePrimary',
|
|
46
|
-
components: {
|
|
47
|
-
DotTyping
|
|
48
|
-
},
|
|
49
|
-
props: {
|
|
50
|
-
state: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: "default"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
<style>
|
|
59
|
-
|
|
60
|
-
</style>
|