barbican-reset 3.18.0 → 3.19.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/BrFormFieldsetNew.vue +15 -0
- package/components/BrFormInput.vue +16 -8
- package/components/BrFormRadio.vue +4 -1
- package/index.js +2 -0
- package/package.json +1 -1
- package/scss/_br-form-fieldset.scss +71 -0
- package/scss/_input.scss +6 -7
- package/scss/index.scss +1 -0
- package/scss/lists.scss +0 -16
- package/scss/mixins/input/_radio.scss +87 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div role="group" :aria-labelledby="id" class="fieldset">
|
|
3
|
+
<div class="wrap-legend">
|
|
4
|
+
<div :id="id" class="legend">{{ label }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
label: String,
|
|
13
|
+
id: String,
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
<label :for="generateID">
|
|
3
|
+
|
|
4
|
+
<input
|
|
5
|
+
:autocomplete="generateAutoComplete"
|
|
6
|
+
:data-test="generateDataTest"
|
|
7
|
+
:type="generateType"
|
|
8
|
+
:id="generateID"
|
|
9
|
+
v-model="model"
|
|
10
|
+
v-bind="$attrs" />
|
|
11
|
+
|
|
12
|
+
<span class="label-text">
|
|
13
|
+
<slot />
|
|
14
|
+
</span>
|
|
15
|
+
|
|
16
|
+
</label>
|
|
17
|
+
|
|
10
18
|
</template>
|
|
11
19
|
|
|
12
20
|
<script setup>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="br-radio">
|
|
2
|
+
<div :class="['br-radio', slots.default ? 'has-label-text' : 'no-label-text']">
|
|
3
3
|
<BrFormInput v-bind="$attrs" type="radio">
|
|
4
4
|
<slot />
|
|
5
5
|
</BrFormInput>
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
<script setup>
|
|
10
10
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
11
|
+
import { useSlots } from 'vue';
|
|
12
|
+
|
|
13
|
+
const slots = useSlots()
|
|
11
14
|
|
|
12
15
|
defineOptions({
|
|
13
16
|
inheritAttrs: false,
|
package/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import BrFormDate from '#components/BrFormDate.vue'
|
|
|
25
25
|
import BrFormEdit from '#components/BrFormEdit.vue'
|
|
26
26
|
import BrFormEmail from '#components/BrFormEmail.vue'
|
|
27
27
|
import BrFormFieldset from '#components/BrFormFieldset.vue'
|
|
28
|
+
import BrFormFieldsetNew from '#components/BrFormFieldsetNew.vue'
|
|
28
29
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
29
30
|
import BrFormPassword from '#components/BrFormPassword.vue'
|
|
30
31
|
import BrFormRadio from '#components/BrFormRadio.vue'
|
|
@@ -75,6 +76,7 @@ export {
|
|
|
75
76
|
BrFormEdit,
|
|
76
77
|
BrFormEmail,
|
|
77
78
|
BrFormFieldset,
|
|
79
|
+
BrFormFieldsetNew,
|
|
78
80
|
BrFormInput,
|
|
79
81
|
BrFormPassword,
|
|
80
82
|
BrFormRadio,
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use "./mixins/breakpoints" as *;
|
|
2
|
+
|
|
3
|
+
fieldset, .fieldset {
|
|
4
|
+
padding: var(--padding-lg) var(--padding-lg) var(--padding-md);
|
|
5
|
+
border-color: var(--color-black-25-lighten);
|
|
6
|
+
border-radius: var(--border-radius-sm);
|
|
7
|
+
border-width: var(--border-width-sm);
|
|
8
|
+
margin: var(--margin-lg) 0 0;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.fieldset .legend {
|
|
13
|
+
background-color: white;
|
|
14
|
+
display: inline-block;
|
|
15
|
+
padding: 4px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.fieldset .wrap-legend {
|
|
19
|
+
margin-top: calc(var(--margin-xxl) * -1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include small-up {
|
|
23
|
+
.fieldset.table {
|
|
24
|
+
grid-template-columns: auto repeat(2, 5rem);
|
|
25
|
+
border-radius: 0;
|
|
26
|
+
display: grid;
|
|
27
|
+
padding: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.fieldset .wrap-legend {
|
|
31
|
+
margin-top: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.fieldset.table .legend {
|
|
35
|
+
padding: var(--padding-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.fieldset.table .br-radio {
|
|
39
|
+
border-left-color: var(--color-black-25-lighten);
|
|
40
|
+
border-left-width: var(--border-width-sm);
|
|
41
|
+
border-left-style: solid;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
display: flex;
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fieldset.table .br-radio label {
|
|
49
|
+
padding: var(--padding-sm);
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
border-width: 0;
|
|
52
|
+
|
|
53
|
+
&:has(input:focus) {
|
|
54
|
+
outline-width: var(--border-width-sm);
|
|
55
|
+
outline-style: dashed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:has(input:checked):has(input:focus) {
|
|
59
|
+
outline-width: var(--border-width-sm);
|
|
60
|
+
outline-style: dashed;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.fieldset.table .br-radio input[type=radio] {
|
|
65
|
+
margin-top: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.fieldset.table .br-radio label .label-text {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
package/scss/_input.scss
CHANGED
|
@@ -5,19 +5,18 @@ input::placeholder {
|
|
|
5
5
|
color: var(--color-black-25-lighten);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
input[type=
|
|
9
|
-
input[type=
|
|
10
|
-
margin
|
|
11
|
-
margin-right: var(--margin-sm);
|
|
8
|
+
input[type=checkbox],
|
|
9
|
+
input[type=radio] {
|
|
10
|
+
margin: 0;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
input[type=
|
|
15
|
-
input[type=
|
|
13
|
+
input[type=button],
|
|
14
|
+
input[type=submit] {
|
|
16
15
|
border-radius: var(--border-radius-lg);
|
|
17
16
|
appearance: none;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
input[type=
|
|
19
|
+
input[type=number] {
|
|
21
20
|
@include focus {
|
|
22
21
|
@include input-focus-defaults;
|
|
23
22
|
}
|
package/scss/index.scss
CHANGED
package/scss/lists.scss
CHANGED
|
@@ -8,20 +8,4 @@ ul {
|
|
|
8
8
|
nav>ul {
|
|
9
9
|
list-style: none;
|
|
10
10
|
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
fieldset {
|
|
14
|
-
border-color: var(--color-black-10-lighten);
|
|
15
|
-
border-radius: var(--border-radius-sm);
|
|
16
|
-
border-width: var(--border-width-sm);
|
|
17
|
-
padding-bottom: var(--padding-lg);
|
|
18
|
-
padding-right: var(--padding-lg);
|
|
19
|
-
padding-left: var(--padding-lg);
|
|
20
|
-
padding-top: var(--padding-md);
|
|
21
|
-
border-style: solid;
|
|
22
|
-
margin: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
fieldset+fieldset {
|
|
26
|
-
margin-top: var(--margin-lg);
|
|
27
11
|
}
|
|
@@ -1,11 +1,95 @@
|
|
|
1
1
|
@use "generic" as *;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@mixin br-radio-label-checked {
|
|
4
|
+
&:not(.error):not(.success) {
|
|
5
|
+
background-color: var(--color-status-neutral-10-lighten);
|
|
6
|
+
color: var(--color-status-neutral);
|
|
7
|
+
outline-color: currentColor;
|
|
8
|
+
border-color: currentColor;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.error {
|
|
12
|
+
background-color: var(--color-status-error-10-lighten);
|
|
13
|
+
color: var(--color-status-error);
|
|
14
|
+
outline-color: currentColor;
|
|
15
|
+
border-color: currentColor;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.success {
|
|
19
|
+
background-color: var(--color-status-success-10-lighten);
|
|
20
|
+
color: var(--color-status-success);
|
|
21
|
+
outline-color: currentColor;
|
|
22
|
+
border-color: currentColor;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin br-radio-label--hover {
|
|
27
|
+
background-color: var(--color-black-5-lighten);
|
|
28
|
+
outline-color: var(--color-black-50-lighten);
|
|
29
|
+
}
|
|
4
30
|
|
|
5
31
|
@mixin br-radio($state: neutral) {
|
|
6
|
-
@include generic-input($state, radio);
|
|
7
|
-
display: inline-block;
|
|
8
32
|
margin: var(--margin-xs);
|
|
33
|
+
vertical-align: middle;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
|
|
36
|
+
label {
|
|
37
|
+
border-color: var(--color-black-25-lighten);
|
|
38
|
+
border-radius: var(--border-radius-lg);
|
|
39
|
+
border-width: var(--border-width-sm);
|
|
40
|
+
color: var(--color-black-60-lighten);
|
|
41
|
+
padding: var(--padding-md);
|
|
42
|
+
background-color: white;
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
border-style: solid;
|
|
45
|
+
font-weight: normal;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
@include br-radio-label--hover;
|
|
50
|
+
outline-width: var(--border-width-sm);
|
|
51
|
+
outline-offset: -0.0625rem;
|
|
52
|
+
outline-style: solid;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:has(input:focus) {
|
|
56
|
+
@include br-radio-label--hover;
|
|
57
|
+
outline-width: var(--border-width-md);
|
|
58
|
+
outline-style: solid;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:has(input:checked) {
|
|
62
|
+
@include br-radio-label-checked;
|
|
63
|
+
outline-width: var(--border-width-sm);
|
|
64
|
+
outline-offset: -0.0625rem;
|
|
65
|
+
outline-style: solid;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:has(input:checked):has(input:focus) {
|
|
69
|
+
@include br-radio-label-checked;
|
|
70
|
+
outline-width: var(--border-width-md);
|
|
71
|
+
outline-style: solid;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.has-label-text label {
|
|
76
|
+
gap: var(--gap-sm);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
input[type=radio] {
|
|
80
|
+
height: 0.875rem;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
width: 0.875rem;
|
|
83
|
+
z-index: 3;
|
|
84
|
+
|
|
85
|
+
&:focus {
|
|
86
|
+
outline-style: none;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.has-label-text input[type=radio] {
|
|
91
|
+
margin-top: var(--margin-xs);
|
|
92
|
+
}
|
|
9
93
|
}
|
|
10
94
|
|
|
11
95
|
@mixin br-spx-radio($state: neutral) {
|