barbican-reset 3.33.0 → 3.34.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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="br-details">
3
- <br-button variant="summary" @click="update">
3
+ <br-button variant="summary" @click="update" :data-test="'toggle-' + label">
4
4
  <div class="wrap-title">
5
5
  <slot name="title">Title goes here</slot>
6
6
  </div>
@@ -20,6 +20,10 @@ const props = defineProps({
20
20
  type: Boolean,
21
21
  default: false,
22
22
  },
23
+ label: {
24
+ type: String,
25
+ default: 'details',
26
+ },
23
27
  })
24
28
 
25
29
  const update = () => emit('update', { open: !props.open })
@@ -50,6 +54,6 @@ const update = () => emit('update', { open: !props.open })
50
54
  }
51
55
 
52
56
  .wrap-content.open {
53
- margin-top: var(--margin-xl);
57
+ margin-top: var(--margin-xxl);
54
58
  }
55
59
  </style>
@@ -10,8 +10,8 @@
10
10
  <br-form-label
11
11
  :class="[{ success }, { error }]"
12
12
  :disabled="disabled"
13
- :id="generateID"
14
- :table="table">
13
+ :returns="returns"
14
+ :id="generateID">
15
15
  <br-form-input
16
16
  :class="[{ success }, { error }]"
17
17
  :disabled="disabled"
@@ -67,7 +67,7 @@ const props = defineProps({
67
67
  success: Boolean,
68
68
  error: Boolean,
69
69
  block: Boolean,
70
- table: Boolean,
70
+ returns: Boolean,
71
71
  })
72
72
 
73
73
  // @description Returns a string for the "id" attribute
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <component
3
- :class="['br-form-label', { disabled }, { table }]"
3
+ :class="['br-form-label', { disabled }, { returns }]"
4
4
  :is="!disabled ? 'label' : 'div'"
5
5
  :for="!disabled ? id : null">
6
6
  <slot />
@@ -14,7 +14,7 @@ const props = defineProps({
14
14
  disabled: Boolean,
15
15
  required: Boolean,
16
16
  optional: Boolean,
17
- table: Boolean,
17
+ returns: Boolean,
18
18
  id: String,
19
19
  })
20
20
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="br-form-radio">
2
+ <div :class="generateClassnames">
3
3
  <br-form-label
4
4
  :class="[{ success }, { error }]"
5
5
  :disabled="disabled"
@@ -11,7 +11,7 @@
11
11
  v-bind="$attrs"
12
12
  :error="error"
13
13
  type="radio" />
14
- <span class="label-text">
14
+ <span v-if="$slots.default" class="label-text">
15
15
  <slot />
16
16
  </span>
17
17
  </br-form-label>
@@ -25,6 +25,20 @@ import formatKebabCase from '#helpers/formatKebabCase'
25
25
  import BrFormLabel from '#components/BrFormLabel.vue'
26
26
  import BrFormInput from '#components/BrFormInput.vue'
27
27
 
28
+ const generateClassnames = computed(() => {
29
+ let classnames = ['br-form-radio']
30
+
31
+ if (props.table) {
32
+ classnames.push('table')
33
+ }
34
+
35
+ if (!props.table) {
36
+ classnames.push('default')
37
+ }
38
+
39
+ return classnames
40
+ })
41
+
28
42
  defineOptions({
29
43
  inheritAttrs: false,
30
44
  })
@@ -45,6 +59,10 @@ const props = defineProps({
45
59
  default: false,
46
60
  type: Boolean,
47
61
  },
62
+ table: {
63
+ default: false,
64
+ type: Boolean,
65
+ },
48
66
  })
49
67
 
50
68
  // @description Returns a string for the "id" attribute
@@ -22,6 +22,18 @@ const generateClassnames = computed(() => {
22
22
  classnames.push('align-center')
23
23
  }
24
24
 
25
+ if (props.radio) {
26
+ classnames.push('radio')
27
+ }
28
+
29
+ if (props.returns) {
30
+ classnames.push('returns')
31
+ }
32
+
33
+ if (!props.radio && !props.returns) {
34
+ classnames.push('default')
35
+ }
36
+
25
37
  return classnames
26
38
  })
27
39
 
@@ -30,7 +42,9 @@ const props = defineProps({
30
42
  type: String,
31
43
  default: 'stretch',
32
44
  },
45
+ returns: Boolean,
33
46
  right: Boolean,
34
47
  center: Boolean,
48
+ radio: Boolean,
35
49
  })
36
50
  </script>
@@ -1,19 +1,5 @@
1
1
  <template>
2
- <div :class="generateClassnames">
2
+ <div class="br-table-row">
3
3
  <slot />
4
4
  </div>
5
5
  </template>
6
-
7
- <script setup>
8
- import { computed } from 'vue'
9
-
10
- const generateClassnames = computed(() => {
11
- let classnames = ['br-table-row']
12
- return classnames
13
- })
14
-
15
- const props = defineProps({
16
- right: Boolean,
17
- center: Boolean,
18
- })
19
- </script>
@@ -17,11 +17,13 @@ const generateComponentClasses = computed(() => {
17
17
  if (props.cluster) {
18
18
  classnames.push('cluster')
19
19
  classnames.push('align-' + props.align)
20
+ classnames.push('size-' + props.size)
20
21
  }
21
22
 
22
23
  if (props.orders) {
23
24
  classnames.push('orders')
24
25
  classnames.push('align-' + props.align)
26
+ classnames.push('size-' + props.size)
25
27
  }
26
28
 
27
29
  if (props.preferences) {
@@ -44,5 +46,9 @@ const props = defineProps({
44
46
  type: String,
45
47
  default: 'middle',
46
48
  },
49
+ size: {
50
+ type: String,
51
+ default: 'xs',
52
+ },
47
53
  })
48
54
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "3.33.0",
3
+ "version": "3.34.0",
4
4
  "description": "Shared design system for Barbican projects, providing SCSS utilities, animations, icons, Vue components, and JS helpers for consistent styling and behaviour.",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -0,0 +1,3 @@
1
+ .br-form-label {
2
+ font-weight: bold;
3
+ }
@@ -1,5 +1,21 @@
1
1
  @use "mixins/input" as *;
2
+ @use "mixins/breakpoints" as *;
2
3
 
3
- .br-form-radio {
4
+ .br-form-radio.default {
4
5
  @include br-form-radio;
6
+ }
7
+
8
+ .br-form-radio.table {
9
+ @include br-form-radio;
10
+
11
+ @include medium-up {
12
+ .br-form-label {
13
+ padding: var(--padding-sm);
14
+ border-radius: 50%;
15
+ }
16
+
17
+ .label-text {
18
+ display: none;
19
+ }
20
+ }
5
21
  }
@@ -1,58 +1,75 @@
1
1
  @use "mixins/breakpoints" as *;
2
2
  @use "mixins/br-wrap" as *;
3
3
 
4
- @include medium-up {
5
- .br-table-cell:not(.activeReturn) {
4
+ @mixin br-table-cell--default {
5
+ @include medium-up {
6
6
  padding: var(--padding-md);
7
- }
8
-
9
- .br-table-cell:not(.width-stretch) {
10
- flex-shrink: 0;
11
- }
12
7
 
13
- .br-table-cell:not(:first-child) {
14
- border-left-color: var(--color-black-25-lighten);
15
- border-left-width: var(--border-width-sm);
16
- border-left-style: solid;
17
- }
8
+ &:not(:first-child) {
9
+ border-left-color: var(--color-black-25-lighten);
10
+ border-left-width: var(--border-width-sm);
11
+ border-left-style: solid;
12
+ }
18
13
 
19
- .br-table-cell.align-right {
20
- text-align: right;
21
- }
14
+ &.align-right {
15
+ text-align: right;
16
+ }
22
17
 
23
- .br-table-cell.align-center {
24
- text-align: center;
25
- }
18
+ &.align-center {
19
+ text-align: center;
20
+ }
26
21
 
27
- .br-table-cell label {
28
- display: none;
29
- }
22
+ &:not(.width-stretch) {
23
+ flex-shrink: 0;
24
+ }
30
25
 
31
- .br-table-cell.cluster {
32
- @include br-wrap--cluster;
26
+ >label {
27
+ display: none;
28
+ }
33
29
  }
34
30
 
35
- .br-table-cell.cluster>* {
36
- vertical-align: middle;
37
- display: inline-block;
31
+ @include medium-down {
32
+ margin: var(--margin-sm);
38
33
  }
39
34
  }
40
35
 
41
- @include medium-down {
42
- .br-table-cell:not(.activeReturn) {
43
- @include br-wrap--cluster;
36
+ @mixin br-table-cell--radio {
37
+ @include br-table-cell--default;
44
38
 
45
- & {
39
+ @include medium-down {
40
+ &:not(.width-stretch) {
41
+ display: inline-block;
46
42
  width: initial;
47
43
  }
48
44
  }
45
+ }
49
46
 
50
- .br-table-cell:not(.activeReturn):not(:last-child) {
51
- margin-bottom: var(--margin-sm);
47
+ @mixin br-table-cell--returns {
48
+ @include br-table-cell--default;
49
+
50
+ @include medium-up {
51
+ padding: 0;
52
52
  }
53
53
 
54
- .br-table-cell:not(.activeReturn)>* {
55
- vertical-align: middle;
56
- display: inline-block;
54
+ @include medium-down {
55
+ border-bottom-color: var(--color-black-25-lighten);
56
+ border-bottom-width: var(--border-width-sm);
57
+ border-bottom-style: dashed;
58
+ margin-right: -0.5rem;
59
+ margin-left: -0.5rem;
60
+ margin-bottom: 1rem;
61
+ margin-top: -0.5rem;
57
62
  }
63
+ }
64
+
65
+ .br-table-cell.default {
66
+ @include br-table-cell--default;
67
+ }
68
+
69
+ .br-table-cell.radio {
70
+ @include br-table-cell--radio;
71
+ }
72
+
73
+ .br-table-cell.returns {
74
+ @include br-table-cell--returns;
58
75
  }
@@ -1,24 +1,24 @@
1
1
  @use "mixins/breakpoints" as *;
2
2
 
3
- .br-table-row {
3
+ @mixin br-table-row--default {
4
4
  border-color: var(--color-black-25-lighten);
5
5
  border-width: var(--border-width-sm);
6
6
  border-style: solid;
7
- }
8
7
 
9
- .br-table-row:not(:last-child) {
10
- margin-bottom: var(--margin-md);
11
- }
8
+ &:not(:last-child) {
9
+ margin-bottom: var(--margin-md);
10
+ }
12
11
 
13
- @include medium-up {
14
- .br-table-row {
12
+ @include medium-up {
15
13
  display: flex;
16
14
  }
17
- }
18
15
 
19
- @include medium-down {
20
- .br-table-row {
16
+ @include medium-down {
21
17
  border-radius: var(--border-radius-lg);
22
- padding: var(--padding-md);
18
+ padding: var(--padding-sm);
23
19
  }
20
+ }
21
+
22
+ .br-table-row {
23
+ @include br-table-row--default;
24
24
  }
@@ -344,6 +344,7 @@
344
344
  --line-height-xs: 1;
345
345
  --line-height-sm: 1.15;
346
346
  --line-height-md: 1.35;
347
+ --line-height-lg: 1.5;
347
348
 
348
349
  // Fixed line height for button/menu items (`38px`).
349
350
  --line-height-button-menu: 2.375rem;
package/scss/index.scss CHANGED
@@ -8,6 +8,7 @@
8
8
  @use "br-form-checkbox";
9
9
  @use "br-form-edit";
10
10
  @use "br-form-fieldset";
11
+ @use "br-form-label";
11
12
  @use "br-form-radio";
12
13
  @use "br-form-row";
13
14
  @use "br-form-textarea";
@@ -15,14 +15,14 @@
15
15
  @mixin br-form-radio--input {
16
16
  cursor: pointer;
17
17
 
18
- &:focus {
18
+ &:focus-visible {
19
19
  outline-color: var(--color-black-25-lighten);
20
20
  outline-offset: var(--outline-offset-lg);
21
21
  outline-width: var(--border-width-sm);
22
22
  outline-style: dashed;
23
23
  }
24
24
 
25
- &:checked:focus {
25
+ &:checked:focus-visible {
26
26
  @include br-form-radio--input-colors;
27
27
  }
28
28
  }
@@ -84,7 +84,7 @@
84
84
  cursor: pointer;
85
85
 
86
86
  &:hover,
87
- &:has(input:focus) {
87
+ &:has(input:focus-visible) {
88
88
  @include br-form-radio-label--disabled;
89
89
  @include br-form-radio-label--hover;
90
90
  }
@@ -1,5 +1,7 @@
1
1
  @use "../mixins/breakpoints" as *;
2
2
 
3
+ $sizes: xs, sm, md, lg;
4
+
3
5
  @mixin br-wrap--default {
4
6
  max-width: var(--width-layout-sm);
5
7
  margin-right: auto;
@@ -17,10 +19,14 @@
17
19
  }
18
20
 
19
21
  @mixin br-wrap--cluster {
20
- margin: var(--margin-wrap-xs);
22
+ @each $size in $sizes {
23
+ &.size-#{$size} {
24
+ margin: var(--margin-wrap-#{$size});
21
25
 
22
- >* {
23
- margin: var(--margin-xs);
26
+ >* {
27
+ margin: var(--margin-#{$size});
28
+ }
29
+ }
24
30
  }
25
31
 
26
32
  &.align-middle>* {
@@ -45,21 +51,19 @@
45
51
  @mixin br-wrap--orders {
46
52
  @include br-wrap--cluster;
47
53
 
48
- $margin: calc(var(--margin-xs) * 2);
54
+ @each $size in $sizes {
55
+ $margin: calc(var(--margin-#{$size}) * 2);
49
56
 
50
- @include medium-down {
51
- >* {
52
- width: calc(100% - $margin);
53
- }
54
- }
55
-
56
- @include medium-up {
57
- >* {
58
- width: calc(50% - $margin);
59
- }
57
+ &.size-#{$size} {
58
+ >* {
59
+ @include medium-down {
60
+ width: calc(100% - $margin);
61
+ }
60
62
 
61
- >*.open {
62
- width: calc(100% - $margin);
63
+ @include medium-up {
64
+ width: calc(50% - $margin);
65
+ }
66
+ }
63
67
  }
64
68
  }
65
69
  }
@@ -15,14 +15,14 @@
15
15
  }
16
16
 
17
17
  @mixin br-form-checkbox--input {
18
- &:focus {
18
+ &:focus-visible {
19
19
  outline-color: var(--color-black-50-lighten);
20
20
  outline-offset: var(--outline-offset-lg);
21
21
  outline-width: var(--border-width-sm);
22
22
  outline-style: dashed;
23
23
  }
24
24
 
25
- &:checked:focus {
25
+ &:checked:focus-visible {
26
26
  @include br-form-checkbox--input-colors;
27
27
  }
28
28
  }
@@ -81,7 +81,7 @@
81
81
  }
82
82
  }
83
83
 
84
- &.table {
84
+ &.returns {
85
85
  border-bottom-right-radius: 0;
86
86
  border-bottom-left-radius: 0;
87
87
  border-width: 0;
@@ -90,13 +90,17 @@
90
90
  border-top-right-radius: 0;
91
91
  border-top-left-radius: 0;
92
92
  }
93
+
94
+ @include medium-down {
95
+ padding: var(--padding-lg);
96
+ }
93
97
  }
94
98
 
95
99
  &:not(.disabled) {
96
100
  cursor: pointer;
97
101
 
98
102
  &:hover,
99
- &:has(input:focus) {
103
+ &:has(input:focus-visible) {
100
104
  @include br-form-checkbox-label--disabled;
101
105
  @include br-form-checkbox-label--hover;
102
106
  }