barbican-reset 3.24.0 → 3.26.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/BrButton.vue +13 -7
- package/components/BrCard.vue +1 -1
- package/components/BrFormCheckbox.vue +6 -3
- package/components/BrFormRadio.vue +6 -3
- package/components/BrFormRadioGroup.vue +14 -11
- package/components/BrFormRow.vue +4 -3
- package/components/BrLink.vue +1 -1
- package/package.json +1 -1
- package/scss/_form.scss +0 -5
- package/scss/_variables.scss +1 -1
- package/scss/mixins/{input/_radio.scss → _br-form-radio.scss} +7 -3
- package/scss/mixins/_br-form-row.scss +16 -10
- package/scss/mixins/_input.scss +1 -1
- package/components/BrButton copy.vue +0 -112
package/components/BrButton.vue
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
+
:type="defineType(defineComponent)"
|
|
3
4
|
:class="generateClassnames"
|
|
4
5
|
:aria-busy="defineAriaBusy"
|
|
5
6
|
:aria-live="defineAriaLive"
|
|
6
7
|
@click="emit('click')"
|
|
7
8
|
:is="defineComponent"
|
|
8
|
-
:type="type"
|
|
9
9
|
:to="to"
|
|
10
|
-
ref="button"
|
|
11
|
-
>
|
|
10
|
+
ref="button">
|
|
12
11
|
<template v-if="state == 'default'">
|
|
13
12
|
<slot name="default">default</slot>
|
|
14
13
|
</template>
|
|
@@ -71,10 +70,18 @@ const defineAriaLive = computed(() => {
|
|
|
71
70
|
|
|
72
71
|
const focusButton = () => {
|
|
73
72
|
if (defineComponent.value == 'button' && button) {
|
|
74
|
-
button.value.focus()
|
|
73
|
+
button.value.focus()
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
|
|
77
|
+
const defineType = function (component) {
|
|
78
|
+
if (props.type) return props.type
|
|
79
|
+
|
|
80
|
+
if (component == 'button') return 'button'
|
|
81
|
+
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
const props = defineProps({
|
|
79
86
|
state: {
|
|
80
87
|
type: String,
|
|
@@ -109,7 +116,6 @@ const props = defineProps({
|
|
|
109
116
|
})
|
|
110
117
|
|
|
111
118
|
defineExpose({
|
|
112
|
-
focusButton
|
|
119
|
+
focusButton,
|
|
113
120
|
})
|
|
114
|
-
|
|
115
|
-
</script>
|
|
121
|
+
</script>
|
package/components/BrCard.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="br-form-checkbox">
|
|
3
|
-
<
|
|
3
|
+
<br-form-label
|
|
4
4
|
:class="[{ success }, { error }]"
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:id="generateID">
|
|
7
|
-
<
|
|
7
|
+
<br-form-input
|
|
8
8
|
:class="[{ success }, { error }]"
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
:id="generateID"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<span class="label-text">
|
|
15
15
|
<slot />
|
|
16
16
|
</span>
|
|
17
|
-
</
|
|
17
|
+
</br-form-label>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
@@ -29,6 +29,9 @@ defineOptions({
|
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
const props = defineProps({
|
|
32
|
+
id: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
32
35
|
disabled: {
|
|
33
36
|
default: false,
|
|
34
37
|
type: Boolean,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="br-form-radio">
|
|
3
|
-
<
|
|
3
|
+
<br-form-label
|
|
4
4
|
:class="[{ success }, { error }]"
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:id="generateID">
|
|
7
|
-
<
|
|
7
|
+
<br-form-input
|
|
8
8
|
:class="[{ success }, { error }]"
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
:id="generateID"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<span class="label-text">
|
|
15
15
|
<slot />
|
|
16
16
|
</span>
|
|
17
|
-
</
|
|
17
|
+
</br-form-label>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
@@ -30,6 +30,9 @@ defineOptions({
|
|
|
30
30
|
})
|
|
31
31
|
|
|
32
32
|
const props = defineProps({
|
|
33
|
+
id: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
33
36
|
disabled: {
|
|
34
37
|
default: false,
|
|
35
38
|
type: Boolean,
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div role="radiogroup">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
<br-wrap cluster>
|
|
4
|
+
<br-form-radio
|
|
5
|
+
v-for="(option, index) in options"
|
|
6
|
+
:data-test="option['data-test']"
|
|
7
|
+
:key="'radio-option-' + index"
|
|
8
|
+
:disabled="option.disabled"
|
|
9
|
+
:value="option.value"
|
|
10
|
+
v-model="model"
|
|
11
|
+
:name="name">
|
|
12
|
+
<slot v-if="$slots.default" v-bind="option" />
|
|
13
|
+
<template v-else>{{ option.text }}</template>
|
|
14
|
+
</br-form-radio>
|
|
15
|
+
</br-wrap>
|
|
14
16
|
</div>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
17
19
|
<script setup>
|
|
18
20
|
import BrFormRadio from '#components/BrFormRadio.vue'
|
|
21
|
+
import BrWrap from '#components/BrWrap.vue'
|
|
19
22
|
|
|
20
23
|
const model = defineModel()
|
|
21
24
|
|
package/components/BrFormRow.vue
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="generateClasses">
|
|
3
|
-
<
|
|
3
|
+
<br-form-label
|
|
4
4
|
v-if="label"
|
|
5
5
|
:id="generateFor"
|
|
6
6
|
:required="required"
|
|
7
|
-
v-bind="$attrs"
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
row>
|
|
8
9
|
{{ label }}
|
|
9
|
-
</
|
|
10
|
+
</br-form-label>
|
|
10
11
|
<div :class="[`content`, { label }, { submit }, { radios }]">
|
|
11
12
|
<slot />
|
|
12
13
|
</div>
|
package/components/BrLink.vue
CHANGED
package/package.json
CHANGED
package/scss/_form.scss
CHANGED
package/scss/_variables.scss
CHANGED
|
@@ -101,9 +101,13 @@
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
@mixin br-form-radio {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
|
|
106
|
+
/// @TODO: block variant
|
|
107
|
+
|
|
108
|
+
// &:not(:last-child) {
|
|
109
|
+
// margin-bottom: var(--margin-sm);
|
|
110
|
+
// }
|
|
107
111
|
|
|
108
112
|
.br-form-label {
|
|
109
113
|
@include br-form-radio--label;
|
|
@@ -14,30 +14,36 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
@mixin br-form-row {
|
|
17
|
+
& {
|
|
18
|
+
row-gap: var(--gap-md);
|
|
19
|
+
display: grid;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
&:not(:last-of-type) {
|
|
18
23
|
margin-bottom: var(--margin-md);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
@include small-up {
|
|
22
27
|
grid-template-columns: 33fr 67fr;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
column-gap: var(--gap-xl);
|
|
29
|
+
align-items: start;
|
|
30
|
+
|
|
31
|
+
>.br-form-label {
|
|
32
|
+
margin-top: var(--margin-lg);
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
|
|
28
|
-
>label,
|
|
29
36
|
>.br-form-label {
|
|
30
|
-
|
|
37
|
+
font-weight: bold;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
|
-
.br-form-input[type=
|
|
40
|
+
.br-form-input[type=text],
|
|
41
|
+
.br-form-input[type=email],
|
|
42
|
+
.br-form-input[type=tel],
|
|
43
|
+
.br-form-input[type=date] {
|
|
34
44
|
width: 100%;
|
|
35
45
|
}
|
|
36
46
|
|
|
37
|
-
.content.radios {
|
|
38
|
-
margin: var(--margin-wrap-xs);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
47
|
.content>fieldset {
|
|
42
48
|
margin-top: var(--margin-lg);
|
|
43
49
|
}
|
package/scss/mixins/_input.scss
CHANGED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:class="generateComponentClasses"
|
|
4
|
-
:aria-busy="defineAriaBusy"
|
|
5
|
-
:aria-live="defineAriaLive"
|
|
6
|
-
@click="emit('click')"
|
|
7
|
-
:is="defineComponent"
|
|
8
|
-
:type="type"
|
|
9
|
-
:href="href"
|
|
10
|
-
:to="to">
|
|
11
|
-
<template v-if="state == 'default'">
|
|
12
|
-
<slot name="default">default</slot>
|
|
13
|
-
</template>
|
|
14
|
-
<template v-else-if="state == 'loading'">
|
|
15
|
-
<template v-if="$slots.loading">
|
|
16
|
-
<slot name="loading">loading</slot>
|
|
17
|
-
</template>
|
|
18
|
-
<dot-typing v-else />
|
|
19
|
-
</template>
|
|
20
|
-
<template v-else-if="state == 'loaded'">
|
|
21
|
-
<slot name="loaded">loaded</slot>
|
|
22
|
-
</template>
|
|
23
|
-
<template v-else-if="state == 'error'">
|
|
24
|
-
<slot name="error">error</slot>
|
|
25
|
-
</template>
|
|
26
|
-
</component>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script setup>
|
|
30
|
-
import { computed } from 'vue'
|
|
31
|
-
import DotTyping from '#components/BrButton/dot_typing.vue'
|
|
32
|
-
|
|
33
|
-
const emit = defineEmits(['click'])
|
|
34
|
-
|
|
35
|
-
const props = defineProps({
|
|
36
|
-
state: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: 'default',
|
|
39
|
-
},
|
|
40
|
-
variant: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: 'secondary',
|
|
43
|
-
},
|
|
44
|
-
type: {
|
|
45
|
-
type: [String, null],
|
|
46
|
-
},
|
|
47
|
-
to: {
|
|
48
|
-
type: [Object, null],
|
|
49
|
-
},
|
|
50
|
-
href: {
|
|
51
|
-
type: [String, null],
|
|
52
|
-
},
|
|
53
|
-
inline: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false,
|
|
56
|
-
},
|
|
57
|
-
slim: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: false,
|
|
60
|
-
},
|
|
61
|
-
active: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false,
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const generateComponentClasses = computed(() => {
|
|
68
|
-
let classnames = ['btn', 'btn-' + props.variant]
|
|
69
|
-
|
|
70
|
-
if (props.inline) {
|
|
71
|
-
classnames.push('btn-inline')
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (props.slim) {
|
|
75
|
-
classnames.push('btn-slim')
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (props.active) {
|
|
79
|
-
classnames.push('btn-active')
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return classnames
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
const defineComponent = computed(() => {
|
|
86
|
-
if (props.href) {
|
|
87
|
-
return 'a'
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (props.to) {
|
|
91
|
-
return 'router-link'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return 'button'
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
const defineAriaBusy = computed(() => {
|
|
98
|
-
if (props.to || props.href) {
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return props.state == 'loading' ? 'true' : 'false'
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
const defineAriaLive = computed(() => {
|
|
106
|
-
if (props.to || props.href) {
|
|
107
|
-
return
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return 'polite'
|
|
111
|
-
})
|
|
112
|
-
</script>
|