barbican-reset 3.19.0 → 3.21.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 +12 -13
- package/components/BrCard.vue +92 -35
- package/components/BrCardBody.vue +2 -17
- package/components/BrCardSubTitle.vue +1 -10
- package/components/BrCardText.vue +1 -1
- package/components/BrCardTitle.vue +1 -1
- package/components/BrContainer.vue +62 -0
- package/components/BrDetails.vue +75 -0
- package/components/BrFormCheckbox.vue +48 -3
- package/components/BrFormCheckboxGroup.vue +10 -0
- package/components/BrFormFieldset.vue +10 -3
- package/components/BrFormInput.vue +8 -31
- package/components/BrFormLabel.vue +4 -3
- package/components/BrFormRadio.vue +50 -7
- package/components/BrFormToggle.vue +1 -1
- package/components/BrTableHeader.vue +9 -0
- package/components/BrWrap.vue +20 -18
- package/index.js +7 -22
- package/package.json +1 -1
- package/scss/_br-button.scss +4 -0
- package/scss/_br-container.scss +25 -36
- package/scss/_br-form-checkbox.scss +1 -49
- package/scss/_br-form-edit.scss +1 -1
- package/scss/_br-form-fieldset.scss +22 -10
- package/scss/_br-form-radio.scss +5 -0
- package/scss/_br-loader.scss +2 -2
- package/scss/_br-table-header.scss +60 -0
- package/scss/_br-wrap.scss +11 -11
- package/scss/_card-deck.scss +3 -3
- package/scss/_variables.scss +195 -0
- package/scss/card/_confirm.scss +1 -1
- package/scss/card/_login.scss +1 -1
- package/scss/card/_membership-new.scss +4 -4
- package/scss/card/_membership.scss +4 -4
- package/scss/card/_password.scss +1 -1
- package/scss/card/_related.scss +4 -4
- package/scss/card/_slim.scss +2 -3
- package/scss/card/_video-help.scss +3 -3
- package/scss/card/index.scss +7 -8
- package/scss/index.scss +11 -203
- package/scss/lists.scss +2 -0
- package/scss/mixins/_br-card.scss +57 -14
- package/scss/mixins/_br-form-edit.scss +7 -2
- package/scss/mixins/_br-form-row.scss +3 -4
- package/scss/mixins/_core.scss +3 -3
- package/scss/mixins/buttons/_custom.scss +17 -40
- package/scss/mixins/buttons/custom/_outline-primary.scss +10 -0
- package/scss/mixins/buttons/custom/_outline-secondary.scss +5 -0
- package/scss/mixins/buttons/custom/_primary.scss +14 -0
- package/scss/mixins/buttons/custom/_secondary.scss +5 -0
- package/scss/mixins/buttons/custom/_see-tickets-info.scss +18 -0
- package/scss/mixins/card/_default.scss +13 -0
- package/scss/mixins/card/_inline.scss +4 -0
- package/scss/mixins/card/_navcard.scss +66 -0
- package/scss/mixins/card/_navitem.scss +51 -0
- package/scss/mixins/card/_navlink.scss +30 -0
- package/scss/mixins/card/_ticket.scss +11 -0
- package/scss/mixins/input/_checkbox.scss +108 -8
- package/scss/mixins/input/_radio.scss +80 -72
- package/scss/mixins/table/_preferences.scss +1 -1
- package/scss/reset.scss +2 -0
- package/scss/typography.scss +2 -0
- package/components/AccountTitle.vue +0 -46
- package/components/BrContainer/Component.vue +0 -84
- package/components/BrFormFieldsetNew.vue +0 -15
- package/components/BrNavCard.vue +0 -56
- package/components/BrNavCardWrap.vue +0 -5
- package/components/BrNavLink.vue +0 -21
- package/components/EventSummary.vue +0 -149
- package/components/FluidIframe.vue +0 -39
- package/components/SeeInside.vue +0 -134
- package/components/VideoContent.vue +0 -74
- package/scss/_br-nav-card-wrap.scss +0 -11
- package/scss/_br-navlink.scss +0 -51
- package/scss/_br-radio.scss +0 -15
- package/scss/_footer.scss +0 -0
- package/scss/_header.scss +0 -0
- package/scss/card/_navcard.scss +0 -133
package/components/BrButton.vue
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
@click="$emit('click')"
|
|
7
7
|
:aria-busy="loading"
|
|
8
8
|
aria-live="polite"
|
|
9
|
-
:type="type"
|
|
10
|
-
>
|
|
9
|
+
:type="type">
|
|
11
10
|
<remove-ticket v-if="variant === 'remove-ticket'" :state="state">
|
|
12
11
|
<template v-for="(index, name) in $slots" v-slot:[name]>
|
|
13
12
|
<slot :name="name" />
|
|
@@ -53,45 +52,45 @@
|
|
|
53
52
|
</template>
|
|
54
53
|
|
|
55
54
|
<script>
|
|
56
|
-
import RemoveTicket from
|
|
57
|
-
import DotTyping from
|
|
55
|
+
import RemoveTicket from '#components/BrButton/remove_ticket.vue'
|
|
56
|
+
import DotTyping from '#components/BrButton/dot_typing.vue'
|
|
58
57
|
|
|
59
58
|
export default {
|
|
60
|
-
emits: [
|
|
59
|
+
emits: ['click'],
|
|
61
60
|
props: {
|
|
62
61
|
state: {
|
|
63
62
|
type: String,
|
|
64
|
-
default:
|
|
63
|
+
default: 'default',
|
|
65
64
|
},
|
|
66
65
|
variant: {
|
|
67
66
|
type: String,
|
|
68
|
-
default:
|
|
67
|
+
default: 'secondary',
|
|
69
68
|
},
|
|
70
69
|
type: {
|
|
71
70
|
type: String,
|
|
72
|
-
default:
|
|
71
|
+
default: 'button',
|
|
73
72
|
},
|
|
74
73
|
},
|
|
75
74
|
methods: {
|
|
76
75
|
titleCase(str) {
|
|
77
76
|
return str
|
|
78
77
|
.toLowerCase()
|
|
79
|
-
.split(
|
|
78
|
+
.split(' ')
|
|
80
79
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
81
|
-
.join(
|
|
80
|
+
.join(' ')
|
|
82
81
|
},
|
|
83
82
|
},
|
|
84
83
|
computed: {
|
|
85
84
|
loading() {
|
|
86
|
-
return this.state ===
|
|
85
|
+
return this.state === 'loading' ? 'true' : 'false'
|
|
87
86
|
},
|
|
88
87
|
printClassNames() {
|
|
89
|
-
return
|
|
88
|
+
return 'btn btn-' + this.variant
|
|
90
89
|
},
|
|
91
90
|
},
|
|
92
91
|
components: {
|
|
93
92
|
RemoveTicket,
|
|
94
93
|
DotTyping,
|
|
95
94
|
},
|
|
96
|
-
}
|
|
95
|
+
}
|
|
97
96
|
</script>
|
package/components/BrCard.vue
CHANGED
|
@@ -1,52 +1,109 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
2
|
+
<component
|
|
3
|
+
:class="generateClassnames"
|
|
4
|
+
:is="defineComponent"
|
|
5
|
+
:to="defineTo"
|
|
6
|
+
:href="defineHref">
|
|
7
|
+
<div v-if="$slots.header" class="br-card-header">
|
|
4
8
|
<slot name="header" />
|
|
5
9
|
</div>
|
|
6
|
-
<template v-if="
|
|
7
|
-
<
|
|
10
|
+
<template v-if="$slots.default">
|
|
11
|
+
<template v-if="noBody">
|
|
12
|
+
<slot />
|
|
13
|
+
</template>
|
|
14
|
+
<br-card-body v-else :class="{ center }">
|
|
8
15
|
<slot />
|
|
9
16
|
</br-card-body>
|
|
10
17
|
</template>
|
|
11
|
-
|
|
12
|
-
<slot />
|
|
13
|
-
</template>
|
|
14
|
-
</div>
|
|
18
|
+
</component>
|
|
15
19
|
</template>
|
|
16
20
|
|
|
17
|
-
<script>
|
|
18
|
-
import BrCardBody from
|
|
21
|
+
<script setup>
|
|
22
|
+
import BrCardBody from '#components/BrCardBody.vue'
|
|
23
|
+
import { computed } from 'vue'
|
|
24
|
+
|
|
25
|
+
const generateClassnames = computed(() => {
|
|
26
|
+
let classnames = ['br-card']
|
|
27
|
+
|
|
28
|
+
if (props.inline) classnames.push('inline')
|
|
29
|
+
if (props.navcard) classnames.push('navcard')
|
|
30
|
+
if (props.navitem) classnames.push('navitem')
|
|
31
|
+
if (props.navlink) classnames.push('navlink')
|
|
32
|
+
if (props.ticket) classnames.push('ticket')
|
|
19
33
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
containerClasses() {
|
|
30
|
-
let classNames = ["card"];
|
|
34
|
+
if (
|
|
35
|
+
!props.inline &&
|
|
36
|
+
!props.navcard &&
|
|
37
|
+
!props.navitem &&
|
|
38
|
+
!props.navlink &&
|
|
39
|
+
!props.ticket
|
|
40
|
+
) {
|
|
41
|
+
classnames.push('default')
|
|
42
|
+
}
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
return classnames
|
|
45
|
+
})
|
|
33
46
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
const defineComponent = computed(() => {
|
|
48
|
+
if (props.navcard || props.navitem || props.navlink) {
|
|
49
|
+
return props.to.startsWith('http') ? 'a' : 'router-link'
|
|
50
|
+
}
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
return 'div'
|
|
53
|
+
})
|
|
40
54
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
const defineTo = computed(() => {
|
|
56
|
+
if (props.navcard || props.navitem || props.navlink) {
|
|
57
|
+
if (!props.to.startsWith('http')) {
|
|
58
|
+
return { name: props.to }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
return null
|
|
63
|
+
})
|
|
47
64
|
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
const defineHref = computed(() => {
|
|
66
|
+
if (props.navcard || props.navitem || props.navlink) {
|
|
67
|
+
if (props.to.startsWith('http')) {
|
|
68
|
+
return props.to
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return null
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const props = defineProps({
|
|
76
|
+
inline: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
navcard: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
navitem: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
navlink: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false,
|
|
91
|
+
},
|
|
92
|
+
ticket: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
center: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false,
|
|
99
|
+
},
|
|
100
|
+
noBody: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false,
|
|
103
|
+
},
|
|
104
|
+
to: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: '',
|
|
50
107
|
},
|
|
51
|
-
}
|
|
108
|
+
})
|
|
52
109
|
</script>
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<slot
|
|
2
|
+
<div class="br-card-body">
|
|
3
|
+
<slot>Card body</slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export default {
|
|
9
|
-
props: ["styles"],
|
|
10
|
-
computed: {
|
|
11
|
-
classNames() {
|
|
12
|
-
let classNames = ["card-body"];
|
|
13
|
-
|
|
14
|
-
if (this.styles) classNames.push(this.styles);
|
|
15
|
-
|
|
16
|
-
return classNames.join(" ");
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
</script>
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div class="br-card-subtitle"><slot>Card subtitle</slot></div>
|
|
3
3
|
</template>
|
|
4
|
-
|
|
5
|
-
<style lang="scss" scoped>
|
|
6
|
-
.card-subtitle {
|
|
7
|
-
color: var(--color-black-50-lighten);
|
|
8
|
-
font-size: var(--font-size-sm);
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
margin: 0;
|
|
11
|
-
}
|
|
12
|
-
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="generateComponentClasses">
|
|
3
|
+
<div :class="generateOuterClasses">
|
|
4
|
+
<div :class="generateInnerClasses">
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div v-if="$slots.image" class="br-container--image">
|
|
9
|
+
<slot name="image" />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed } from 'vue'
|
|
16
|
+
|
|
17
|
+
const generateComponentClasses = computed(() => {
|
|
18
|
+
let classnames = ['br-container']
|
|
19
|
+
|
|
20
|
+
if (props.masthead) classnames.push('masthead')
|
|
21
|
+
|
|
22
|
+
return classnames
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const generateOuterClasses = computed(() => {
|
|
26
|
+
let classnames = ['br-container--outer']
|
|
27
|
+
|
|
28
|
+
if (props.masthead) classnames.push('masthead')
|
|
29
|
+
|
|
30
|
+
return classnames
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const generateInnerClasses = computed(() => {
|
|
34
|
+
let classnames = ['br-container--inner']
|
|
35
|
+
|
|
36
|
+
if (props.masthead) classnames.push('masthead')
|
|
37
|
+
if (props.thin) classnames.push('thin')
|
|
38
|
+
if (props.header) classnames.push('header')
|
|
39
|
+
if (props.footer) classnames.push('footer')
|
|
40
|
+
|
|
41
|
+
return classnames
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
masthead: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
thin: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
header: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
footer: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="br-details">
|
|
3
|
+
<br-button variant="br-summary" @click="update">
|
|
4
|
+
<div class="br-summary-content">
|
|
5
|
+
<slot name="title">
|
|
6
|
+
<br-card-title>Title goes here</br-card-title>
|
|
7
|
+
</slot>
|
|
8
|
+
</div>
|
|
9
|
+
<span class="br-summary-icon">
|
|
10
|
+
{{ open ? '–' : '+' }}
|
|
11
|
+
</span>
|
|
12
|
+
</br-button>
|
|
13
|
+
<div :class="['br-details-content', { open }]">
|
|
14
|
+
<slot name="content">Content goes here</slot>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
const emit = defineEmits(['update'])
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
open: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const update = () => emit('update', !props.open)
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
@use '#styles/helpers' as *;
|
|
34
|
+
|
|
35
|
+
.btn-br-summary {
|
|
36
|
+
@include btn-invisible;
|
|
37
|
+
|
|
38
|
+
& {
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
align-items: center;
|
|
41
|
+
color: inherit;
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.btn-br-summary {
|
|
47
|
+
&:focus,
|
|
48
|
+
&:hover {
|
|
49
|
+
.br-summary-icon {
|
|
50
|
+
outline-style: dashed;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.br-summary-icon {
|
|
56
|
+
font-size: var(--font-size-h1);
|
|
57
|
+
line-height: 0.6875rem;
|
|
58
|
+
font-weight: normal;
|
|
59
|
+
position: relative;
|
|
60
|
+
padding: 0.375rem;
|
|
61
|
+
width: 2.25rem;
|
|
62
|
+
top: 0.125rem;
|
|
63
|
+
height: 2rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.br-details-content:not(.open) {
|
|
67
|
+
visibility: hidden;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
height: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.br-details-content.open {
|
|
73
|
+
margin-top: var(--margin-xxl);
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -1,15 +1,60 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="br-form-checkbox">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<BrFormLabel
|
|
4
|
+
:class="[{ success }, { error }]"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:id="generateID">
|
|
7
|
+
<BrFormInput
|
|
8
|
+
:class="[{ success }, { error }]"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
:id="generateID"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
type="checkbox"
|
|
13
|
+
:error="error" />
|
|
14
|
+
<span class="label-text">
|
|
15
|
+
<slot />
|
|
16
|
+
</span>
|
|
17
|
+
</BrFormLabel>
|
|
6
18
|
</div>
|
|
7
19
|
</template>
|
|
8
20
|
|
|
9
21
|
<script setup>
|
|
22
|
+
import { computed } from 'vue'
|
|
23
|
+
import formatKebabCase from '#helpers/formatKebabCase'
|
|
24
|
+
import BrFormLabel from '#components/BrFormLabel.vue'
|
|
10
25
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
11
26
|
|
|
12
27
|
defineOptions({
|
|
13
28
|
inheritAttrs: false,
|
|
14
29
|
})
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
disabled: {
|
|
33
|
+
default: false,
|
|
34
|
+
type: Boolean,
|
|
35
|
+
},
|
|
36
|
+
success: {
|
|
37
|
+
default: false,
|
|
38
|
+
type: Boolean,
|
|
39
|
+
},
|
|
40
|
+
error: {
|
|
41
|
+
default: false,
|
|
42
|
+
type: Boolean,
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// @description Returns a string for the "id" attribute
|
|
47
|
+
// @returns {string} result - string based on preceeding conditions
|
|
48
|
+
|
|
49
|
+
const generateID = computed(() => {
|
|
50
|
+
let result
|
|
51
|
+
|
|
52
|
+
if (props.id) {
|
|
53
|
+
result = props.id
|
|
54
|
+
} else {
|
|
55
|
+
result = 'random-' + Math.ceil(Math.random() * 1000000)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return formatKebabCase(result)
|
|
59
|
+
})
|
|
15
60
|
</script>
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
:key="'checkbox-option-' + index"
|
|
7
7
|
:disabled="option.disabled"
|
|
8
8
|
:value="option.value"
|
|
9
|
+
:success="success"
|
|
9
10
|
v-model="model"
|
|
11
|
+
:error="error"
|
|
10
12
|
:name="name">
|
|
11
13
|
<slot v-if="$slots.default" v-bind="option" />
|
|
12
14
|
<template v-else>{{ option.text }}</template>
|
|
@@ -29,5 +31,13 @@ const model = defineModel()
|
|
|
29
31
|
const props = defineProps({
|
|
30
32
|
options: Array,
|
|
31
33
|
name: String,
|
|
34
|
+
success: {
|
|
35
|
+
default: false,
|
|
36
|
+
type: Boolean,
|
|
37
|
+
},
|
|
38
|
+
error: {
|
|
39
|
+
default: false,
|
|
40
|
+
type: Boolean,
|
|
41
|
+
},
|
|
32
42
|
})
|
|
33
43
|
</script>
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<fieldset>
|
|
3
|
-
<
|
|
2
|
+
<div role="group" :aria-labelledby="id" :class="['fieldset', { table }]">
|
|
3
|
+
<div class="wrap-legend">
|
|
4
|
+
<div :id="id" class="legend">{{ label }}</div>
|
|
5
|
+
</div>
|
|
4
6
|
<slot />
|
|
5
|
-
</
|
|
7
|
+
</div>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
8
10
|
<script setup>
|
|
9
11
|
const props = defineProps({
|
|
12
|
+
table: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
10
16
|
label: String,
|
|
17
|
+
id: String,
|
|
11
18
|
})
|
|
12
19
|
</script>
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
v-bind="$attrs" />
|
|
11
|
-
|
|
12
|
-
<span class="label-text">
|
|
13
|
-
<slot />
|
|
14
|
-
</span>
|
|
15
|
-
|
|
16
|
-
</label>
|
|
17
|
-
|
|
2
|
+
<input
|
|
3
|
+
:autocomplete="generateAutoComplete"
|
|
4
|
+
:data-test="generateDataTest"
|
|
5
|
+
class="br-form-input"
|
|
6
|
+
:type="generateType"
|
|
7
|
+
v-model="model"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
:id="id" />
|
|
18
10
|
</template>
|
|
19
11
|
|
|
20
12
|
<script setup>
|
|
@@ -74,19 +66,4 @@ const generateType = computed(() => {
|
|
|
74
66
|
|
|
75
67
|
return formatKebabCase(result)
|
|
76
68
|
})
|
|
77
|
-
|
|
78
|
-
// @description Returns a string for the "id" attribute
|
|
79
|
-
// @returns {string} result - string based on preceeding conditions
|
|
80
|
-
|
|
81
|
-
const generateID = computed(() => {
|
|
82
|
-
let result
|
|
83
|
-
|
|
84
|
-
if (props.id) {
|
|
85
|
-
result = props.id
|
|
86
|
-
} else {
|
|
87
|
-
result = 'random-' + Math.ceil(Math.random() * 1000000)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return formatKebabCase(result)
|
|
91
|
-
})
|
|
92
69
|
</script>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
2
|
+
<component
|
|
3
|
+
:class="['br-form-label', { disabled }]"
|
|
4
|
+
:is="!disabled ? 'label' : 'div'"
|
|
5
|
+
:for="!disabled ? id : null">
|
|
3
6
|
<slot />
|
|
4
7
|
<span v-if="required"> (required)</span>
|
|
5
8
|
<span v-if="optional"> (optional)</span>
|
|
@@ -7,12 +10,10 @@
|
|
|
7
10
|
</template>
|
|
8
11
|
|
|
9
12
|
<script setup>
|
|
10
|
-
|
|
11
13
|
const props = defineProps({
|
|
12
14
|
disabled: Boolean,
|
|
13
15
|
required: Boolean,
|
|
14
16
|
optional: Boolean,
|
|
15
17
|
id: String,
|
|
16
18
|
})
|
|
17
|
-
|
|
18
19
|
</script>
|
|
@@ -1,18 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="br-form-radio">
|
|
3
|
+
<BrFormLabel
|
|
4
|
+
:class="[{ success }, { error }]"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:id="generateID">
|
|
7
|
+
<BrFormInput
|
|
8
|
+
:class="[{ success }, { error }]"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
:id="generateID"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:error="error"
|
|
13
|
+
type="radio" />
|
|
14
|
+
<span class="label-text">
|
|
15
|
+
<slot />
|
|
16
|
+
</span>
|
|
17
|
+
</BrFormLabel>
|
|
6
18
|
</div>
|
|
7
19
|
</template>
|
|
8
20
|
|
|
9
21
|
<script setup>
|
|
10
|
-
import
|
|
11
|
-
import
|
|
22
|
+
import { computed } from 'vue'
|
|
23
|
+
import formatKebabCase from '#helpers/formatKebabCase'
|
|
12
24
|
|
|
13
|
-
|
|
25
|
+
import BrFormLabel from '#components/BrFormLabel.vue'
|
|
26
|
+
import BrFormInput from '#components/BrFormInput.vue'
|
|
14
27
|
|
|
15
28
|
defineOptions({
|
|
16
29
|
inheritAttrs: false,
|
|
17
30
|
})
|
|
31
|
+
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
disabled: {
|
|
34
|
+
default: false,
|
|
35
|
+
type: Boolean,
|
|
36
|
+
},
|
|
37
|
+
success: {
|
|
38
|
+
default: false,
|
|
39
|
+
type: Boolean,
|
|
40
|
+
},
|
|
41
|
+
error: {
|
|
42
|
+
default: false,
|
|
43
|
+
type: Boolean,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// @description Returns a string for the "id" attribute
|
|
48
|
+
// @returns {string} result - string based on preceeding conditions
|
|
49
|
+
|
|
50
|
+
const generateID = computed(() => {
|
|
51
|
+
let result
|
|
52
|
+
|
|
53
|
+
if (props.id) {
|
|
54
|
+
result = props.id
|
|
55
|
+
} else {
|
|
56
|
+
result = 'random-' + Math.ceil(Math.random() * 1000000)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return formatKebabCase(result)
|
|
60
|
+
})
|
|
18
61
|
</script>
|