barbican-reset 1.5.3 → 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.
@@ -112,6 +112,11 @@
112
112
  @mixin btn-primary {
113
113
  @include button-solid;
114
114
  min-width: 8rem;
115
+
116
+ &[disabled=disabled] {
117
+ @include button-solid($c-grey-night);
118
+ cursor: not-allowed;
119
+ }
115
120
  }
116
121
 
117
122
  @mixin btn-outline-primary {
@@ -1,11 +1,11 @@
1
1
  @mixin focus {
2
- // &:focus { <-- better remove this, but could cause bugs
3
- // box-shadow: none;
4
- // outline: none;
5
- // }
6
- &:hover, &:focus-visible, &[data-focus-visible-added] {
7
- @content;
8
- }
2
+ &:not([disabled=disabled]) {
3
+ &[data-focus-visible-added],
4
+ &:focus-visible,
5
+ &:hover {
6
+ @content;
7
+ }
8
+ }
9
9
  }
10
10
 
11
11
  @mixin box-setup {
@@ -1,19 +1,7 @@
1
1
 
2
+ @import "input/generic";
3
+ @import "input/status";
2
4
  @import "input/checkbox";
5
+ @import "input/dropdown";
3
6
  @import "input/radio";
4
-
5
- @mixin all-text-inputs {
6
- border: solid $border-width $c-border-strong;
7
- padding: 0.875rem 0.875rem 0.75rem;
8
- background-color: $c-grey-alpine;
9
- border-radius: $border-radius-lg;
10
- }
11
-
12
- @mixin input-dropdown {
13
- background-color: $c-grey-alpine;
14
- border-radius: $border-radius-lg;
15
- border-color: $c-grey-concrete;
16
- padding: 0.875rem 0.5rem;
17
- color: $c-grey-night;
18
- width: 100%;
19
- }
7
+ @import "input/text";
@@ -1,46 +1,6 @@
1
- @mixin checkbox-input {
2
- position: relative;
3
- display: grid;
4
-
5
- input[type=checkbox] {
6
- $size: 0.875rem;
7
- position: absolute;
8
- cursor: pointer;
9
- height: $size;
10
- margin: auto;
11
- width: $size;
12
- right: auto;
13
- z-index: 3;
14
- left: 1rem;
15
- bottom: 0;
16
- top: 0;
17
-
18
- @include focus {
19
- outline: none;
20
-
21
- ~ label {
22
- @include single-box($c-grey-steel, 0.0625rem);
23
- border: 1px solid $c-grey-steel;
24
- background-color: $c-grey-alpine;
25
- }
26
- &:checked ~ label {
27
- @include focus_colors;
28
- @include single-box($c-status-neutral, 0.0625rem);
29
- }
30
- }
31
-
32
- &:checked ~ label {
33
- @include focus_colors;
34
- }
35
- }
36
-
37
- label {
38
- padding: 0.875rem 0.75rem 0.625rem 2.5rem;
39
- border: 1px solid $c-grey-concrete;
40
- border-radius: $border-radius-lg;
41
- background-color: $white;
42
- color: $c-grey-night;
43
- font-weight: normal;
44
- cursor: pointer;
45
- }
1
+ @mixin checkbox-input(
2
+ $state: neutral,
3
+ $type: checkbox) {
4
+ @include generic-input($state,$type);
5
+ display: block;
46
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
+ }
@@ -3,77 +3,17 @@
3
3
  margin: -0.25rem;
4
4
  }
5
5
 
6
- @mixin radio-input($state:neutral,$display:inline-block) {
7
- position: relative;
8
- display: $display;
9
- padding: 0;
10
-
11
- @if $display != flex {
12
- margin: 0.25rem;
13
- } @else {
14
- margin: 0;
15
- gap: 1rem;
16
-
17
- &:not(:first-of-type) {
18
- margin-top: 1rem;
19
- }
20
- }
21
-
22
- input[type=radio] {
23
- $size: 0.875rem;
24
- position: absolute;
25
- height: $size;
26
- margin: auto;
27
- width: $size;
28
- right: auto;
29
- z-index: 3;
30
- left: 1rem;
31
- bottom: 0;
32
- top: 0;
33
-
34
- @if $state != disabled {
35
- cursor: pointer;
36
-
37
- @include focus {
38
- outline: none;
39
-
40
- ~ label {
41
- @include single-box($c-grey-steel, 0.0625rem);
42
- border: 1px solid $c-grey-steel;
43
- background-color: $c-grey-alpine;
44
- }
45
-
46
- &:checked ~ label {
47
- @include focus_colors;
48
- @include single-box($c-status-neutral, 0.0625rem);
49
- }
50
- }
51
-
52
- &:checked ~ label {
53
- @include focus_colors;
54
- }
55
- }
56
- }
57
-
58
- label {
59
- padding: 0.75rem 0.75rem 0.625rem 2.75rem;
60
- border: 1px solid $c-grey-concrete;
61
- border-radius: $border-radius-lg;
62
- background-color: $white;
63
- font-weight: 400;
64
-
65
- @if $state != disabled {
66
- color: $c-grey-night;
67
- cursor: pointer;
68
- }
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
+ }
69
13
 
70
- @if $state == disabled {
71
- color: $c-grey-steel;
72
- cursor: not-allowed;
14
+ // margin: 0;
15
+ // gap: 1rem;
73
16
 
74
- .spx-data-delivery-type {
75
- text-decoration: line-through;
76
- }
77
- }
78
- }
79
- }
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "1.5.3",
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
  }
package/scss/_input.scss CHANGED
@@ -1,6 +1,4 @@
1
1
 
2
- @import "input/radio";
3
-
4
2
  .form-control {
5
3
  @include focus {
6
4
  @include input-focus;
@@ -0,0 +1,16 @@
1
+
2
+ .radio-group {
3
+ @include radio-group;
4
+ }
5
+
6
+ .custom-radio {
7
+ @include radio-input;
8
+ }
9
+
10
+ @each $status, $color in $statees {
11
+ @if $status != 'neutral' {
12
+ .radio-group.#{$status} {
13
+ @include status-input(radio,$color);
14
+ }
15
+ }
16
+ }
package/scss/index.scss CHANGED
@@ -18,7 +18,7 @@
18
18
  // bootstrap component styles
19
19
  @import "btn";
20
20
  @import "card/index";
21
- @import "card-group";
21
+ @import "card-deck";
22
22
  @import "checkbox";
23
23
  @import "checkbox-group";
24
24
  @import "custom-select";
@@ -1,31 +0,0 @@
1
-
2
- .radio-group {
3
- @include radio-group;
4
- }
5
-
6
- .custom-radio {
7
- @include radio-input;
8
- }
9
-
10
- @each $status, $color in $statees {
11
- @if $status != 'neutral' {
12
- .radio-group.#{$status} {
13
- input[type=radio] {
14
- @include focus {
15
- &:checked ~ label {
16
- @include single-box(map-get($color, base), 0.0625rem);
17
- border: 1px solid map-get($color, base);
18
- background-color: map-get($color, fade);
19
- color: map-get($color, base);
20
- }
21
- }
22
-
23
- &:checked ~ label {
24
- border: 1px solid map-get($color, base);
25
- background-color: map-get($color, fade);
26
- color: map-get($color, base);
27
- }
28
- }
29
- }
30
- }
31
- }