barbican-reset 1.2.5 → 1.2.6

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.
@@ -0,0 +1,92 @@
1
+ <template>
2
+ <div :class="$style.container">
3
+ <label v-if="label" :for="id">
4
+ <strong>{{ label }}</strong> <span v-if="label && required">(required)</span><span v-if="label && optional">(optional)</span>
5
+ </label>
6
+ <div :class="styleContent">
7
+ <slot />
8
+ </div>
9
+ </div>
10
+ </template>
11
+
12
+ <script type="text/javascript">
13
+ export default {
14
+ name: 'FormGroup',
15
+ props: {
16
+ label: {
17
+ type: String
18
+ },
19
+ required: {
20
+ type: Boolean
21
+ },
22
+ optional: {
23
+ type: Boolean
24
+ },
25
+ submit: {
26
+ type: Boolean
27
+ }
28
+ },
29
+ computed: {
30
+ styleContent() {
31
+ const style = this.$style;
32
+ let output = [style.content];
33
+ if (!this.label) { output.push(style.no_label); }
34
+ if (this.submit) { output.push(style.submit); }
35
+ return output;
36
+ },
37
+ id() {
38
+ return this.label.toLowerCase().split(" ").join("_");
39
+ }
40
+ }
41
+ }
42
+ </script>
43
+
44
+ <style lang="scss" module>
45
+
46
+ .container {
47
+
48
+ &:not(:last-of-type) {
49
+ margin-bottom: 1rem;
50
+ }
51
+
52
+ @include media-breakpoint-up(sm) {
53
+ grid-template-columns: 33fr 67fr;
54
+ align-items: center;
55
+ gap: $gap-account;
56
+ display: grid;
57
+ }
58
+
59
+ label {
60
+ font-weight: normal;
61
+
62
+ @include media-breakpoint-down(sm) {
63
+ margin-bottom: 0.5rem;
64
+ }
65
+ }
66
+
67
+ input {
68
+ width: 100%;
69
+ margin: 0;
70
+ }
71
+ }
72
+
73
+ .content {
74
+
75
+ &.no_label {
76
+ @include media-breakpoint-up(sm) {
77
+ grid-column: 2 / 3;
78
+ }
79
+ }
80
+
81
+ &.submit {
82
+ text-align: right;
83
+
84
+ @include media-breakpoint-down(sm) {
85
+ > button {
86
+ width: 100%;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ </style>
package/index.js CHANGED
@@ -17,6 +17,7 @@ import Carousel from './components/carousel'
17
17
  import CardDeck from './components/card_deck'
18
18
  import FormSection from './components/form_section'
19
19
  import FormUpdate from './components/form_update'
20
+ import FormGroup from './components/form_group'
20
21
 
21
22
  export {
22
23
  LoadingAnimation,
@@ -33,6 +34,7 @@ export {
33
34
  Placeholder,
34
35
  FormSection,
35
36
  FormUpdate,
37
+ FormGroup,
36
38
  TableRow,
37
39
  Block,
38
40
  EventSummary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
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": {
package/scss/_atomic.scss CHANGED
@@ -16,6 +16,10 @@ $aligns: "left", "center", "right";
16
16
  }
17
17
  }
18
18
 
19
+ .margin-0 {
20
+ margin: 0;
21
+ }
22
+
19
23
  .width-100 {
20
24
  width: 100%;
21
25
  }
@@ -34,4 +38,10 @@ $aligns: "left", "center", "right";
34
38
 
35
39
  .c-brand-orange {
36
40
  color: $c-brand-orange;
41
+ }
42
+
43
+ .list-style-none {
44
+ list-style-type: none;
45
+ padding: 0;
46
+ margin: 0;
37
47
  }
package/scss/index.scss CHANGED
@@ -17,7 +17,6 @@
17
17
  @import "checkbox.scss";
18
18
  @import "checkbox-group.scss";
19
19
  @import "form.scss";
20
- @import "form-group.scss";
21
20
  @import "list.scss";
22
21
  @import "input.scss";
23
22
  @import "radio-group.scss";
@@ -0,0 +1,48 @@
1
+ table.orders {
2
+
3
+ thead {
4
+ background-color: $c-grey-alpine;
5
+ margin-bottom: 1rem;
6
+ font-weight: 700;
7
+ display: block;
8
+
9
+ @include media-breakpoint-down(md) {
10
+ display: none;
11
+ }
12
+ }
13
+
14
+ tr {
15
+ border: 1px solid $c-grey-pearl;
16
+ display: grid;
17
+
18
+ @include media-breakpoint-up(md) {
19
+ grid-template-columns: 9rem 8rem auto 7rem;
20
+ }
21
+
22
+ @include media-breakpoint-down(md) {
23
+ border-radius: $border-radius-lg;
24
+ }
25
+ }
26
+
27
+ th, td {
28
+ padding: 0.75rem;
29
+
30
+ @include media-breakpoint-up(md) {
31
+ &:not(:last-of-type) {
32
+ border-right: 1px solid $c-grey-pearl;
33
+ }
34
+
35
+ &:last-of-type {
36
+ text-align: right;
37
+ }
38
+ }
39
+ }
40
+
41
+ label {
42
+ font-size: $font-size-lg;
43
+
44
+ @include media-breakpoint-up(md) {
45
+ display: none;
46
+ }
47
+ }
48
+ }
@@ -2,6 +2,7 @@
2
2
  @import "tickets.scss";
3
3
  @import "basket.scss";
4
4
  @import "section.scss";
5
+ @import "orders.scss";
5
6
 
6
7
  table {
7
8
  border-spacing: 0;
@@ -1,59 +0,0 @@
1
-
2
- form > .form-group {
3
- @include media-breakpoint-up(sm) {
4
- grid-template-columns: 33fr 67fr;
5
- align-items: center;
6
- gap: $gap-account;
7
- display: grid;
8
- }
9
-
10
- > div:first-child {
11
- @include media-breakpoint-up(sm) {
12
- grid-column: 2 / 3;
13
- }
14
- }
15
- }
16
-
17
- .form-group {
18
- &:not(:last-of-type) {
19
- margin-bottom: 1rem;
20
- }
21
-
22
- legend {
23
- padding: 0 !important;
24
- font-weight: 700;
25
-
26
- @include media-breakpoint-down(sm) {
27
- margin-bottom: 0.5rem;
28
- }
29
- }
30
- }
31
-
32
- .form-group[submit] {
33
- text-align: right;
34
-
35
- @include media-breakpoint-down(sm) {
36
- button {
37
- width: 100%;
38
- }
39
- }
40
- }
41
-
42
- @mixin label-status($content: '(required)') {
43
- margin-left: 0.375rem;
44
- display: inline-block;
45
- content: $content;
46
- font-weight: 400;
47
- }
48
-
49
- .form-group[required] {
50
- legend::after {
51
- @include label-status;
52
- }
53
- }
54
-
55
- .form-group[optional] {
56
- legend::after {
57
- @include label-status('(optional)');
58
- }
59
- }