barbican-reset 1.5.0 → 1.5.4

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,5 +1,8 @@
1
1
  <template>
2
- <b-button @click="$emit('click')" :variant="variant" :type="type">
2
+
3
+ <!-- https://dockyard.com/blog/2020/03/02/accessible-loading-indicatorswith-no-extra-elements -->
4
+
5
+ <b-button @click="$emit('click')" :variant="variant" :type="type" aria-live="polite" :aria-busy="loading">
3
6
 
4
7
  <remove-ticket v-if="variant === 'remove-ticket'" :state="state">
5
8
  <template v-for="(index, name) in $slots" v-slot:[name]>
@@ -69,6 +72,11 @@ export default {
69
72
  default: "button"
70
73
  }
71
74
  },
75
+ computed: {
76
+ loading() {
77
+ return this.state === "loading" ? "true" : "false";
78
+ }
79
+ },
72
80
  components: {
73
81
  BButton,
74
82
  RemoveTicket
@@ -1,3 +1,3 @@
1
1
  // paths more explicit for gulp-sass
2
- @import "variables/index.scss";
3
- @import "mixins/index.scss";
2
+ @import "variables/index";
3
+ @import "mixins/index";
@@ -74,6 +74,7 @@
74
74
  border: $border solid $color;
75
75
  background-color: $color;
76
76
  color: $background;
77
+ outline: none;
77
78
 
78
79
  svg {
79
80
  fill: $background;
@@ -111,6 +112,11 @@
111
112
  @mixin btn-primary {
112
113
  @include button-solid;
113
114
  min-width: 8rem;
115
+
116
+ &[disabled=disabled] {
117
+ @include button-solid($c-grey-night);
118
+ cursor: not-allowed;
119
+ }
114
120
  }
115
121
 
116
122
  @mixin btn-outline-primary {
@@ -1,32 +1,45 @@
1
1
  @mixin focus {
2
- &:focus {
3
- box-shadow: none;
4
- outline: none;
5
- }
6
- &:hover, &[data-focus-visible-added] {
7
- @content;
2
+ &:not([disabled=disabled]) {
3
+ &[data-focus-visible-added],
4
+ &:focus-visible,
5
+ &:hover {
6
+ @content;
7
+ }
8
8
  }
9
9
  }
10
10
 
11
- @mixin double-box($bg: $white, $col: $black, $bg_size: 0.25rem, $col_size: 0.15rem) {
12
- box-shadow: 0 0 0 $bg_size $bg, 0 0 0 ($bg_size + $col_size) $col;
11
+ @mixin box-setup {
13
12
  position: relative;
13
+ outline: none;
14
14
  z-index: 2;
15
15
  }
16
16
 
17
+ @mixin double-box($bg: $white, $col: $black, $bg_size: 0.25rem, $col_size: 0.15rem) {
18
+ @include box-setup;
19
+ box-shadow: 0 0 0 $bg_size $bg, 0 0 0 ($bg_size + $col_size) $col;
20
+ }
21
+
17
22
  @mixin single-box($bg: $white, $size: 0.25rem) {
23
+ @include box-setup;
18
24
  box-shadow: 0 0 0 $size $bg;
19
- position: relative;
20
- z-index: 2;
21
25
  }
22
26
 
23
27
  @mixin link-focus($color: $c-grey-midnight, $border: $white) {
24
28
  @include focus {
25
29
  @include double-box($color, $border);
26
30
  background-color: $color;
27
- position: relative;
28
31
  color: $border;
29
- outline: none;
30
- z-index: 2;
31
32
  }
32
33
  }
34
+
35
+ @mixin input-focus {
36
+ @include single-box($c-grey-steel, 0.0625rem);
37
+ border: 1px solid $c-grey-steel;
38
+ background-color: $c-grey-alpine;
39
+ }
40
+
41
+ @mixin focus_colors {
42
+ background-color: $c-status-neutral-fade;
43
+ border: 1px solid $c-status-neutral;
44
+ color: $c-status-neutral;
45
+ }
@@ -10,9 +10,3 @@
10
10
  }
11
11
  }
12
12
 
13
- @mixin all-text-inputs {
14
- border: solid $border-width $c-border-strong;
15
- padding: 0.875rem 0.875rem 0.75rem;
16
- background-color: $c-grey-alpine;
17
- border-radius: $border-radius-lg;
18
- }
@@ -0,0 +1,7 @@
1
+
2
+ @import "input/generic";
3
+ @import "input/status";
4
+ @import "input/checkbox";
5
+ @import "input/dropdown";
6
+ @import "input/radio";
7
+ @import "input/text";
@@ -1,5 +1,5 @@
1
- // paths more explicit for gulp-sass
2
- @import "~bourbon/core/bourbon.scss";
1
+ // paths more explicit for gulp-sass + iframe overrides
2
+ @import "../../node_modules/bourbon/core/bourbon";
3
3
 
4
4
  @mixin inset($val: 0) {
5
5
  bottom: $val;
@@ -8,16 +8,17 @@
8
8
  top: $val;
9
9
  }
10
10
 
11
- @import "account/orders.scss";
12
- @import "basket.scss";
13
- @import "buttons.scss";
14
- @import "card.scss";
15
- @import "content.scss";
16
- @import "core.scss";
17
- @import "festival.scss";
18
- @import "focus.scss";
19
- @import "font.scss";
20
- @import "loading.scss";
11
+ @import "account/orders";
12
+ @import "basket";
13
+ @import "buttons";
14
+ @import "card";
15
+ @import "content";
16
+ @import "core";
17
+ @import "festival";
18
+ @import "focus";
19
+ @import "font";
20
+ @import "loading";
21
+ @import "input";
21
22
 
22
23
  @mixin table_link {
23
24
  @include focus {
@@ -0,0 +1,6 @@
1
+ @mixin checkbox-input(
2
+ $state: neutral,
3
+ $type: checkbox) {
4
+ @include generic-input($state,$type);
5
+ display: block;
6
+ }
@@ -0,0 +1,9 @@
1
+
2
+ @mixin input-dropdown {
3
+ background-color: $c-grey-alpine;
4
+ border-radius: $border-radius-lg;
5
+ border-color: $c-grey-concrete;
6
+ padding: 0.875rem 0.5rem;
7
+ color: $c-grey-night;
8
+ width: 100%;
9
+ }
@@ -0,0 +1,62 @@
1
+ @mixin generic-input($state,$type) {
2
+ position: relative;
3
+ padding: 0;
4
+
5
+ input[type=#{$type}] {
6
+ $size: 0.875rem;
7
+ position: absolute;
8
+ height: $size;
9
+ margin: auto;
10
+ width: $size;
11
+ right: auto;
12
+ z-index: 3;
13
+ left: 1rem;
14
+ bottom: 0;
15
+ top: 0;
16
+
17
+ @if $state != disabled {
18
+ cursor: pointer;
19
+
20
+ @include focus {
21
+ outline: none;
22
+
23
+ ~ label {
24
+ @include single-box($c-grey-steel, 0.0625rem);
25
+ border: 1px solid $c-grey-steel;
26
+ background-color: $c-grey-alpine;
27
+ }
28
+
29
+ &:checked ~ label {
30
+ @include focus_colors;
31
+ @include single-box($c-status-neutral, 0.0625rem);
32
+ }
33
+ }
34
+
35
+ &:checked ~ label {
36
+ @include focus_colors;
37
+ }
38
+ }
39
+ }
40
+
41
+ label {
42
+ padding: 0.75rem 0.75rem 0.625rem 2.75rem;
43
+ border: 1px solid $c-grey-concrete;
44
+ border-radius: $border-radius-lg;
45
+ background-color: $white;
46
+ font-weight: 400;
47
+
48
+ @if $state != disabled {
49
+ color: $c-grey-night;
50
+ cursor: pointer;
51
+ }
52
+
53
+ @if $state == disabled {
54
+ color: $c-grey-steel;
55
+ cursor: not-allowed;
56
+
57
+ &.spx-label-field__checkout, .spx-data-delivery-type {
58
+ text-decoration: line-through;
59
+ }
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,19 @@
1
+
2
+ @mixin radio-group {
3
+ margin: -0.25rem;
4
+ }
5
+
6
+ @mixin radio-input(
7
+ $state: neutral,
8
+ $type: radio) {
9
+ @include generic-input($state,$type);
10
+ display: inline-block;
11
+ margin: 0.25rem;
12
+ }
13
+
14
+ // margin: 0;
15
+ // gap: 1rem;
16
+
17
+ // &:not(:first-of-type) {
18
+ // margin-top: 1rem;
19
+ // }
@@ -0,0 +1,18 @@
1
+ @mixin status-input($type,$color) {
2
+ input[type=#{$type}] {
3
+ @include focus {
4
+ &:checked ~ label {
5
+ @include single-box(map-get($color, base), 0.0625rem);
6
+ border: 1px solid map-get($color, base);
7
+ background-color: map-get($color, fade);
8
+ color: map-get($color, base);
9
+ }
10
+ }
11
+
12
+ &:checked ~ label {
13
+ border: 1px solid map-get($color, base);
14
+ background-color: map-get($color, fade);
15
+ color: map-get($color, base);
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+
2
+ @mixin all-text-inputs {
3
+ border: solid $border-width $c-border-strong;
4
+ padding: 0.875rem 0.875rem 0.75rem;
5
+ background-color: $c-grey-alpine;
6
+ border-radius: $border-radius-lg;
7
+ }
@@ -1,9 +1,9 @@
1
- @import "grey.scss";
2
- @import "brand.scss";
3
- @import "docs.scss";
4
- @import "status.scss";
5
- @import "wgp.scss";
6
- @import "power.scss";
7
- @import "llf.scss";
1
+ @import "grey";
2
+ @import "brand";
3
+ @import "docs";
4
+ @import "status";
5
+ @import "wgp";
6
+ @import "power";
7
+ @import "llf";
8
8
 
9
- @import "layout.scss";
9
+ @import "layout";
@@ -1,5 +1,5 @@
1
1
  // paths more explicit for gulp-sass
2
- @import "colors/index.scss";
3
- @import "layout.scss";
4
- @import "breakpoints.scss";
5
- @import "typography.scss";
2
+ @import "colors/index";
3
+ @import "layout";
4
+ @import "breakpoints";
5
+ @import "typography";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "1.5.0",
3
+ "version": "1.5.4",
4
4
  "description": "A collection of useful scss imports and js scripts, that provide consistent styling and functionality across barbican projects.",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
@@ -2,84 +2,18 @@
2
2
  .checkbox-group {
3
3
 
4
4
  .custom-control {
5
- position: relative;
5
+ @include checkbox-input;
6
6
 
7
7
  &:not(:last-of-type) {
8
8
  margin-bottom: 0.5rem;
9
- }
10
-
11
- input[type=checkbox] {
12
- $size: 0.875rem;
13
- position: absolute;
14
- cursor: pointer;
15
- height: $size;
16
- margin: auto;
17
- width: $size;
18
- right: auto;
19
- z-index: 3;
20
- left: 1rem;
21
- bottom: 0;
22
- top: 0;
23
-
24
- @mixin focus_colors {
25
- background-color: $c-status-neutral-fade;
26
- border: 1px solid $c-status-neutral;
27
- color: $c-status-neutral;
28
- }
29
-
30
- &:hover, &[data-focus-visible-added] {
31
- &:focus {
32
- box-shadow: none;
33
- outline: none;
34
- }
35
-
36
- ~ label {
37
- @include single-box($c-grey-steel, 0.0625rem);
38
- border: 1px solid $c-grey-steel;
39
- background-color: $c-grey-alpine;
40
- }
41
-
42
- &:checked ~ label {
43
- @include focus_colors;
44
- @include single-box($c-status-neutral, 0.0625rem);
45
- }
46
- }
47
-
48
- &:checked ~ label {
49
- @include focus_colors;
50
- }
51
- }
52
-
53
- label {
54
- padding: 0.875rem 0.75rem 0.625rem 2.5rem;
55
- border: 1px solid $c-grey-concrete;
56
- border-radius: $border-radius-lg;
57
- background-color: $white;
58
- color: $c-grey-night;
59
- cursor: pointer;
60
- }
9
+ }
61
10
  }
62
11
  }
63
12
 
64
13
  @each $status, $color in $statees {
65
14
  @if $status != 'neutral' {
66
15
  .checkbox-group.#{$status} {
67
- input[type=checkbox] {
68
- &:hover, &[data-focus-visible-added] {
69
- &:checked ~ label {
70
- @include single-box(map-get($color, base), 0.0625rem);
71
- border: 1px solid map-get($color, base);
72
- background-color: map-get($color, fade);
73
- color: map-get($color, base);
74
- }
75
- }
76
-
77
- &:checked ~ label {
78
- border: 1px solid map-get($color, base);
79
- background-color: map-get($color, fade);
80
- color: map-get($color, base);
81
- }
82
- }
16
+ @include status-input(checkbox,$color);
83
17
  }
84
18
  }
85
19
  }
@@ -1,57 +1,6 @@
1
1
 
2
2
  .checkbox {
3
- position: relative;
4
- display: grid;
5
-
6
- input[type=checkbox] {
7
- $size: 0.875rem;
8
- position: absolute;
9
- cursor: pointer;
10
- height: $size;
11
- margin: auto;
12
- width: $size;
13
- right: auto;
14
- z-index: 3;
15
- left: 1rem;
16
- bottom: 0;
17
- top: 0;
18
-
19
- @mixin focus_colors {
20
- background-color: $c-status-neutral-fade;
21
- border: 1px solid $c-status-neutral;
22
- color: $c-status-neutral;
23
- }
24
-
25
- &:hover, &[data-focus-visible-added] {
26
- &:focus {
27
- box-shadow: none;
28
- outline: none;
29
- }
30
-
31
- ~ label {
32
- @include single-box($c-grey-steel, 0.0625rem);
33
- border: 1px solid $c-grey-steel;
34
- background-color: $c-grey-alpine;
35
- }
36
- &:checked ~ label {
37
- @include focus_colors;
38
- @include single-box($c-status-neutral, 0.0625rem);
39
- }
40
- }
41
-
42
- &:checked ~ label {
43
- @include focus_colors;
44
- }
45
- }
46
-
47
- label {
48
- padding: 0.875rem 0.75rem 0.625rem 2.5rem;
49
- border: 1px solid $c-grey-concrete;
50
- border-radius: $border-radius-lg;
51
- background-color: $white;
52
- color: $c-grey-night;
53
- cursor: pointer;
54
- }
3
+ @include checkbox-input;
55
4
  }
56
5
 
57
6
  @each $status, $color in $statees {
@@ -1,8 +1,3 @@
1
1
  .custom-select {
2
- background-color: $c-grey-alpine;
3
- border-color: $c-grey-concrete;
4
- border-radius: $border-radius;
5
- padding: 0.75rem 0.5rem;
6
- color: $c-grey-night;
7
- width: 100%;
2
+ @include input-dropdown;
8
3
  }
package/scss/_input.scss CHANGED
@@ -1,10 +1,4 @@
1
1
 
2
- @mixin input-focus {
3
- @include single-box($c-grey-steel, 0.0625rem);
4
- border: 1px solid $c-grey-steel;
5
- background-color: $c-grey-alpine;
6
- }
7
-
8
2
  .form-control {
9
3
  @include focus {
10
4
  @include input-focus;
@@ -1,83 +1,16 @@
1
1
 
2
- $margin-radio: 0.25rem;
3
-
4
2
  .radio-group {
5
- margin: -$margin-radio;
3
+ @include radio-group;
6
4
  }
7
5
 
8
6
  .custom-radio {
9
- display: inline-block;
10
- margin: $margin-radio;
11
- position: relative;
12
- padding: 0;
13
-
14
- input[type=radio] {
15
- $size: 0.875rem;
16
- position: absolute;
17
- cursor: pointer;
18
- height: $size;
19
- margin: auto;
20
- width: $size;
21
- right: auto;
22
- z-index: 3;
23
- left: 1rem;
24
- bottom: 0;
25
- top: 0;
26
-
27
- @mixin focus_colors {
28
- background-color: $c-status-neutral-fade;
29
- border: 1px solid $c-status-neutral;
30
- color: $c-status-neutral;
31
- }
32
-
33
- @include focus {
34
- ~ label {
35
- @include single-box($c-grey-steel, 0.0625rem);
36
- border: 1px solid $c-grey-steel;
37
- background-color: $c-grey-alpine;
38
- }
39
-
40
- &:checked ~ label {
41
- @include focus_colors;
42
- @include single-box($c-status-neutral, 0.0625rem);
43
- }
44
- }
45
-
46
- &:checked ~ label {
47
- @include focus_colors;
48
- }
49
- }
50
-
51
- label {
52
- padding: 0.75rem 0.75rem 0.625rem 2.75rem;
53
- border: 1px solid $c-grey-concrete;
54
- border-radius: $border-radius-lg;
55
- background-color: $white;
56
- color: $c-grey-night;
57
- font-weight: 400;
58
- cursor: pointer;
59
- }
7
+ @include radio-input;
60
8
  }
61
9
 
62
10
  @each $status, $color in $statees {
63
11
  @if $status != 'neutral' {
64
12
  .radio-group.#{$status} {
65
- input[type=radio] {
66
- @include focus {
67
- &:checked ~ label {
68
- @include single-box(map-get($color, base), 0.0625rem);
69
- border: 1px solid map-get($color, base);
70
- background-color: map-get($color, fade);
71
- color: map-get($color, base);
72
- }
73
- }
74
-
75
- &:checked ~ label {
76
- border: 1px solid map-get($color, base);
77
- background-color: map-get($color, fade);
78
- color: map-get($color, base);
79
- }
80
- }
13
+ @include status-input(radio,$color);
81
14
  }
82
15
  }
83
16
  }
@@ -1,12 +1,12 @@
1
1
 
2
- @import "confirm.scss";
3
- @import "login.scss";
4
- @import "password.scss";
5
- @import "account.scss";
6
- @import "video-help.scss";
7
- @import "related.scss";
8
- @import "block.scss";
9
- @import "membership.scss";
2
+ @import "confirm";
3
+ @import "login";
4
+ @import "password";
5
+ @import "account";
6
+ @import "video-help";
7
+ @import "related";
8
+ @import "block";
9
+ @import "membership";
10
10
 
11
11
  .card {
12
12
  border: 1px solid $c-grey-pearl;
package/scss/index.scss CHANGED
@@ -2,33 +2,33 @@
2
2
  @import "node_modules/bootstrap/scss/functions";
3
3
  @import "node_modules/bootstrap/scss/variables";
4
4
  @import "node_modules/bootstrap/scss/mixins";
5
- @import "../helpers/index.scss";
6
-
7
- @import "app.scss";
8
- @import "header.scss";
9
- @import "main.scss";
10
- @import "footer.scss";
11
- @import "klaro.scss";
12
- @import "fonts.scss";
13
- @import "loading-animation.scss";
14
- @import "close-icon.scss";
15
- @import "table/index.scss";
16
- @import "promo.scss";
5
+ @import "../helpers/index";
6
+
7
+ @import "app";
8
+ @import "header";
9
+ @import "main";
10
+ @import "footer";
11
+ @import "klaro";
12
+ @import "fonts";
13
+ @import "loading-animation";
14
+ @import "close-icon";
15
+ @import "table/index";
16
+ @import "promo";
17
17
 
18
18
  // bootstrap component styles
19
- @import "btn.scss";
20
- @import "card/index.scss";
21
- @import "card-group.scss";
22
- @import "checkbox.scss";
23
- @import "checkbox-group.scss";
24
- @import "custom-select.scss";
25
- @import "form.scss";
26
- @import "list.scss";
27
- @import "input.scss";
28
- @import "radio-group.scss";
19
+ @import "btn";
20
+ @import "card/index";
21
+ @import "card-deck";
22
+ @import "checkbox";
23
+ @import "checkbox-group";
24
+ @import "custom-select";
25
+ @import "form";
26
+ @import "list";
27
+ @import "input";
28
+ @import "radio-group";
29
29
 
30
30
  // atomic helper styles
31
- @import "atomic.scss";
31
+ @import "atomic";
32
32
 
33
33
  body {
34
34
  line-height: $line-height-md;
@@ -1,13 +1,13 @@
1
1
 
2
- @import "tickets.scss";
3
- @import "basket.scss";
4
- @import "section.scss";
5
- @import "orders.scss";
6
- @import "details.scss";
7
- @import "preferences.scss";
8
- @import "etickets.scss";
9
- @import "membership.scss";
10
- @import "gifts.scss";
2
+ @import "tickets";
3
+ @import "basket";
4
+ @import "section";
5
+ @import "orders";
6
+ @import "details";
7
+ @import "preferences";
8
+ @import "etickets";
9
+ @import "membership";
10
+ @import "gifts";
11
11
 
12
12
  table {
13
13
  border-spacing: 0;