barbican-reset 3.19.0 → 3.20.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.
Files changed (53) hide show
  1. package/components/BrButton.vue +12 -13
  2. package/components/BrCard.vue +11 -40
  3. package/components/BrCardBody.vue +2 -17
  4. package/components/BrCardSubTitle.vue +1 -10
  5. package/components/BrCardText.vue +1 -1
  6. package/components/BrCardTitle.vue +1 -1
  7. package/components/BrDetails.vue +75 -0
  8. package/components/BrFormCheckbox.vue +48 -3
  9. package/components/BrFormCheckboxGroup.vue +10 -0
  10. package/components/BrFormFieldset.vue +10 -3
  11. package/components/BrFormInput.vue +8 -31
  12. package/components/BrFormLabel.vue +4 -3
  13. package/components/BrFormRadio.vue +50 -7
  14. package/components/BrFormToggle.vue +1 -1
  15. package/components/BrTableHeader.vue +9 -0
  16. package/index.js +5 -5
  17. package/package.json +1 -1
  18. package/scss/_br-form-checkbox.scss +1 -49
  19. package/scss/_br-form-edit.scss +1 -1
  20. package/scss/_br-form-fieldset.scss +22 -10
  21. package/scss/_br-form-radio.scss +5 -0
  22. package/scss/_br-loader.scss +2 -2
  23. package/scss/_br-table-header.scss +60 -0
  24. package/scss/_card-deck.scss +3 -3
  25. package/scss/_variables.scss +194 -0
  26. package/scss/card/_confirm.scss +1 -1
  27. package/scss/card/_login.scss +1 -1
  28. package/scss/card/_membership-new.scss +4 -4
  29. package/scss/card/_membership.scss +4 -4
  30. package/scss/card/_navcard.scss +9 -9
  31. package/scss/card/_password.scss +1 -1
  32. package/scss/card/_related.scss +4 -4
  33. package/scss/card/_slim.scss +2 -3
  34. package/scss/card/_video-help.scss +3 -3
  35. package/scss/card/index.scss +7 -7
  36. package/scss/index.scss +11 -201
  37. package/scss/lists.scss +2 -0
  38. package/scss/mixins/_br-card.scss +43 -10
  39. package/scss/mixins/_br-form-edit.scss +7 -2
  40. package/scss/mixins/_br-form-row.scss +3 -4
  41. package/scss/mixins/_core.scss +3 -3
  42. package/scss/mixins/buttons/_custom.scss +7 -9
  43. package/scss/mixins/input/_checkbox.scss +108 -8
  44. package/scss/mixins/input/_radio.scss +80 -72
  45. package/scss/mixins/table/_preferences.scss +1 -1
  46. package/scss/reset.scss +2 -0
  47. package/scss/typography.scss +2 -0
  48. package/components/AccountTitle.vue +0 -46
  49. package/components/BrFormFieldsetNew.vue +0 -15
  50. package/scss/_br-radio.scss +0 -15
  51. package/scss/_footer.scss +0 -0
  52. package/scss/_header.scss +0 -0
  53. /package/components/{BrContainer/Component.vue → BrContainer.vue} +0 -0
@@ -6,8 +6,7 @@
6
6
  @click="$emit('click')"
7
7
  :aria-busy="loading"
8
8
  aria-live="polite"
9
- :type="type"
10
- >
9
+ :type="type">
11
10
  <remove-ticket v-if="variant === 'remove-ticket'" :state="state">
12
11
  <template v-for="(index, name) in $slots" v-slot:[name]>
13
12
  <slot :name="name" />
@@ -53,45 +52,45 @@
53
52
  </template>
54
53
 
55
54
  <script>
56
- import RemoveTicket from "#components/BrButton/remove_ticket.vue";
57
- import DotTyping from "#components/BrButton/dot_typing.vue";
55
+ import RemoveTicket from '#components/BrButton/remove_ticket.vue'
56
+ import DotTyping from '#components/BrButton/dot_typing.vue'
58
57
 
59
58
  export default {
60
- emits: ["click"],
59
+ emits: ['click'],
61
60
  props: {
62
61
  state: {
63
62
  type: String,
64
- default: "default",
63
+ default: 'default',
65
64
  },
66
65
  variant: {
67
66
  type: String,
68
- default: "secondary",
67
+ default: 'secondary',
69
68
  },
70
69
  type: {
71
70
  type: String,
72
- default: "button",
71
+ default: 'button',
73
72
  },
74
73
  },
75
74
  methods: {
76
75
  titleCase(str) {
77
76
  return str
78
77
  .toLowerCase()
79
- .split(" ")
78
+ .split(' ')
80
79
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
81
- .join(" ");
80
+ .join(' ')
82
81
  },
83
82
  },
84
83
  computed: {
85
84
  loading() {
86
- return this.state === "loading" ? "true" : "false";
85
+ return this.state === 'loading' ? 'true' : 'false'
87
86
  },
88
87
  printClassNames() {
89
- return "btn btn-" + this.variant;
88
+ return 'btn btn-' + this.variant
90
89
  },
91
90
  },
92
91
  components: {
93
92
  RemoveTicket,
94
93
  DotTyping,
95
94
  },
96
- };
95
+ }
97
96
  </script>
@@ -1,52 +1,23 @@
1
1
  <template>
2
- <div :class="containerClasses">
3
- <div v-if="$slots.header" :class="headerClasses">
2
+ <div :class="['br-card', { inline }]">
3
+ <div v-if="$slots.header" class="br-card-header">
4
4
  <slot name="header" />
5
5
  </div>
6
- <template v-if="bodyRequired">
7
- <br-card-body :styles="body">
6
+ <template v-if="$slots.default">
7
+ <br-card-body>
8
8
  <slot />
9
9
  </br-card-body>
10
10
  </template>
11
- <template v-else>
12
- <slot />
13
- </template>
14
11
  </div>
15
12
  </template>
16
13
 
17
- <script>
18
- import BrCardBody from "#components/BrCardBody.vue";
19
-
20
- export default {
21
- components: { BrCardBody },
22
- props: ["container", "header", "body"],
23
- computed: {
24
- bodyRequired() {
25
- if (this.body == "none") return false;
26
- if (!this.$slots.default) return false;
27
- return true;
28
- },
29
- containerClasses() {
30
- let classNames = ["card"];
31
-
32
- if (this.container) classNames.push(this.container);
33
-
34
- return classNames.join(" ");
35
- },
36
- headerClasses() {
37
- let classNames = ["card-header"];
38
-
39
- if (this.header) classNames.push(this.header);
40
-
41
- return classNames.join(" ");
42
- },
43
- bodyClasses() {
44
- let classNames = ["card-body"];
45
-
46
- if (this.body) classNames.push(this.body);
14
+ <script setup>
15
+ import BrCardBody from '#components/BrCardBody.vue'
47
16
 
48
- return classNames.join(" ");
49
- },
17
+ const props = defineProps({
18
+ inline: {
19
+ type: Boolean,
20
+ default: false,
50
21
  },
51
- };
22
+ })
52
23
  </script>
@@ -1,20 +1,5 @@
1
1
  <template>
2
- <div :class="classNames">
3
- <slot></slot>
2
+ <div class="br-card-body">
3
+ <slot>Card body</slot>
4
4
  </div>
5
5
  </template>
6
-
7
- <script>
8
- export default {
9
- props: ["styles"],
10
- computed: {
11
- classNames() {
12
- let classNames = ["card-body"];
13
-
14
- if (this.styles) classNames.push(this.styles);
15
-
16
- return classNames.join(" ");
17
- },
18
- },
19
- };
20
- </script>
@@ -1,12 +1,3 @@
1
1
  <template>
2
- <h6 class="card-subtitle"><slot></slot></h6>
2
+ <h6 class="br-card-subtitle"><slot>Card subtitle</slot></h6>
3
3
  </template>
4
-
5
- <style lang="scss" scoped>
6
- .card-subtitle {
7
- color: var(--color-black-50-lighten);
8
- font-size: var(--font-size-sm);
9
- font-weight: 400;
10
- margin: 0;
11
- }
12
- </style>
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <p class="card-text"><slot></slot></p>
2
+ <p class="br-card-text"><slot>Card text</slot></p>
3
3
  </template>
@@ -1,3 +1,3 @@
1
1
  <template>
2
- <div class="card-title"><slot /></div>
2
+ <div class="br-card-title"><slot>Card title</slot></div>
3
3
  </template>
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <div class="br-details">
3
+ <br-button variant="br-summary" @click="update">
4
+ <div class="br-summary-content">
5
+ <slot name="title">
6
+ <br-card-title>Title goes here</br-card-title>
7
+ </slot>
8
+ </div>
9
+ <span class="br-summary-icon">
10
+ {{ open ? '–' : '+' }}
11
+ </span>
12
+ </br-button>
13
+ <div :class="['br-details-content', { open }]">
14
+ <slot name="content">Content goes here</slot>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup>
20
+ const emit = defineEmits(['update'])
21
+
22
+ const props = defineProps({
23
+ open: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
27
+ })
28
+
29
+ const update = () => emit('update', !props.open)
30
+ </script>
31
+
32
+ <style lang="scss" scoped>
33
+ @use '#styles/helpers' as *;
34
+
35
+ .btn-br-summary {
36
+ @include btn-invisible;
37
+
38
+ & {
39
+ justify-content: space-between;
40
+ align-items: center;
41
+ color: inherit;
42
+ width: 100%;
43
+ }
44
+ }
45
+
46
+ .btn-br-summary {
47
+ &:focus,
48
+ &:hover {
49
+ .br-summary-icon {
50
+ outline-style: dashed;
51
+ }
52
+ }
53
+ }
54
+
55
+ .br-summary-icon {
56
+ font-size: var(--font-size-h1);
57
+ line-height: 0.6875rem;
58
+ font-weight: normal;
59
+ position: relative;
60
+ padding: 0.375rem;
61
+ width: 2.25rem;
62
+ top: 0.125rem;
63
+ height: 2rem;
64
+ }
65
+
66
+ .br-details-content:not(.open) {
67
+ visibility: hidden;
68
+ overflow: hidden;
69
+ height: 0;
70
+ }
71
+
72
+ .br-details-content.open {
73
+ margin-top: var(--margin-xxl);
74
+ }
75
+ </style>
@@ -1,15 +1,60 @@
1
1
  <template>
2
2
  <div class="br-form-checkbox">
3
- <BrFormInput v-bind="$attrs" type="checkbox">
4
- <slot />
5
- </BrFormInput>
3
+ <BrFormLabel
4
+ :class="[{ success }, { error }]"
5
+ :disabled="disabled"
6
+ :id="generateID">
7
+ <BrFormInput
8
+ :class="[{ success }, { error }]"
9
+ :disabled="disabled"
10
+ :id="generateID"
11
+ v-bind="$attrs"
12
+ type="checkbox"
13
+ :error="error" />
14
+ <span class="label-text">
15
+ <slot />
16
+ </span>
17
+ </BrFormLabel>
6
18
  </div>
7
19
  </template>
8
20
 
9
21
  <script setup>
22
+ import { computed } from 'vue'
23
+ import formatKebabCase from '#helpers/formatKebabCase'
24
+ import BrFormLabel from '#components/BrFormLabel.vue'
10
25
  import BrFormInput from '#components/BrFormInput.vue'
11
26
 
12
27
  defineOptions({
13
28
  inheritAttrs: false,
14
29
  })
30
+
31
+ const props = defineProps({
32
+ disabled: {
33
+ default: false,
34
+ type: Boolean,
35
+ },
36
+ success: {
37
+ default: false,
38
+ type: Boolean,
39
+ },
40
+ error: {
41
+ default: false,
42
+ type: Boolean,
43
+ },
44
+ })
45
+
46
+ // @description Returns a string for the "id" attribute
47
+ // @returns {string} result - string based on preceeding conditions
48
+
49
+ const generateID = computed(() => {
50
+ let result
51
+
52
+ if (props.id) {
53
+ result = props.id
54
+ } else {
55
+ result = 'random-' + Math.ceil(Math.random() * 1000000)
56
+ }
57
+
58
+ return formatKebabCase(result)
59
+ })
15
60
  </script>
@@ -6,7 +6,9 @@
6
6
  :key="'checkbox-option-' + index"
7
7
  :disabled="option.disabled"
8
8
  :value="option.value"
9
+ :success="success"
9
10
  v-model="model"
11
+ :error="error"
10
12
  :name="name">
11
13
  <slot v-if="$slots.default" v-bind="option" />
12
14
  <template v-else>{{ option.text }}</template>
@@ -29,5 +31,13 @@ const model = defineModel()
29
31
  const props = defineProps({
30
32
  options: Array,
31
33
  name: String,
34
+ success: {
35
+ default: false,
36
+ type: Boolean,
37
+ },
38
+ error: {
39
+ default: false,
40
+ type: Boolean,
41
+ },
32
42
  })
33
43
  </script>
@@ -1,12 +1,19 @@
1
1
  <template>
2
- <fieldset>
3
- <legend>{{ label }}</legend>
2
+ <div role="group" :aria-labelledby="id" :class="['fieldset', { table }]">
3
+ <div class="wrap-legend">
4
+ <div :id="id" class="legend">{{ label }}</div>
5
+ </div>
4
6
  <slot />
5
- </fieldset>
7
+ </div>
6
8
  </template>
7
9
 
8
10
  <script setup>
9
11
  const props = defineProps({
12
+ table: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
10
16
  label: String,
17
+ id: String,
11
18
  })
12
19
  </script>
@@ -1,20 +1,12 @@
1
1
  <template>
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
-
2
+ <input
3
+ :autocomplete="generateAutoComplete"
4
+ :data-test="generateDataTest"
5
+ class="br-form-input"
6
+ :type="generateType"
7
+ v-model="model"
8
+ v-bind="$attrs"
9
+ :id="id" />
18
10
  </template>
19
11
 
20
12
  <script setup>
@@ -74,19 +66,4 @@ const generateType = computed(() => {
74
66
 
75
67
  return formatKebabCase(result)
76
68
  })
77
-
78
- // @description Returns a string for the "id" attribute
79
- // @returns {string} result - string based on preceeding conditions
80
-
81
- const generateID = computed(() => {
82
- let result
83
-
84
- if (props.id) {
85
- result = props.id
86
- } else {
87
- result = 'random-' + Math.ceil(Math.random() * 1000000)
88
- }
89
-
90
- return formatKebabCase(result)
91
- })
92
69
  </script>
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <component :is="!disabled ? 'label' : 'div'" :for="!disabled ? id : null" class="br-form-label">
2
+ <component
3
+ :class="['br-form-label', { disabled }]"
4
+ :is="!disabled ? 'label' : 'div'"
5
+ :for="!disabled ? id : null">
3
6
  <slot />
4
7
  <span v-if="required"> (required)</span>
5
8
  <span v-if="optional"> (optional)</span>
@@ -7,12 +10,10 @@
7
10
  </template>
8
11
 
9
12
  <script setup>
10
-
11
13
  const props = defineProps({
12
14
  disabled: Boolean,
13
15
  required: Boolean,
14
16
  optional: Boolean,
15
17
  id: String,
16
18
  })
17
-
18
19
  </script>
@@ -1,18 +1,61 @@
1
1
  <template>
2
- <div :class="['br-radio', slots.default ? 'has-label-text' : 'no-label-text']">
3
- <BrFormInput v-bind="$attrs" type="radio">
4
- <slot />
5
- </BrFormInput>
2
+ <div class="br-form-radio">
3
+ <BrFormLabel
4
+ :class="[{ success }, { error }]"
5
+ :disabled="disabled"
6
+ :id="generateID">
7
+ <BrFormInput
8
+ :class="[{ success }, { error }]"
9
+ :disabled="disabled"
10
+ :id="generateID"
11
+ v-bind="$attrs"
12
+ :error="error"
13
+ type="radio" />
14
+ <span class="label-text">
15
+ <slot />
16
+ </span>
17
+ </BrFormLabel>
6
18
  </div>
7
19
  </template>
8
20
 
9
21
  <script setup>
10
- import BrFormInput from '#components/BrFormInput.vue'
11
- import { useSlots } from 'vue';
22
+ import { computed } from 'vue'
23
+ import formatKebabCase from '#helpers/formatKebabCase'
12
24
 
13
- const slots = useSlots()
25
+ import BrFormLabel from '#components/BrFormLabel.vue'
26
+ import BrFormInput from '#components/BrFormInput.vue'
14
27
 
15
28
  defineOptions({
16
29
  inheritAttrs: false,
17
30
  })
31
+
32
+ const props = defineProps({
33
+ disabled: {
34
+ default: false,
35
+ type: Boolean,
36
+ },
37
+ success: {
38
+ default: false,
39
+ type: Boolean,
40
+ },
41
+ error: {
42
+ default: false,
43
+ type: Boolean,
44
+ },
45
+ })
46
+
47
+ // @description Returns a string for the "id" attribute
48
+ // @returns {string} result - string based on preceeding conditions
49
+
50
+ const generateID = computed(() => {
51
+ let result
52
+
53
+ if (props.id) {
54
+ result = props.id
55
+ } else {
56
+ result = 'random-' + Math.ceil(Math.random() * 1000000)
57
+ }
58
+
59
+ return formatKebabCase(result)
60
+ })
18
61
  </script>
@@ -19,7 +19,7 @@ defineOptions({
19
19
  })
20
20
 
21
21
  const props = defineProps({
22
- class: String
22
+ class: String,
23
23
  })
24
24
 
25
25
  const generateClasses = computed(() => {
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div class="br-table-header">
3
+ <div class="br-table-header-title">
4
+ <slot />
5
+ </div>
6
+ <div class="br-table-header-title yes">Yes</div>
7
+ <div class="br-table-header-title no">No</div>
8
+ </div>
9
+ </template>
package/index.js CHANGED
@@ -14,7 +14,8 @@ import BrCollapseContent from '#components/BrCollapse/Content.vue'
14
14
  import BrConfirmDone from '#components/BrConfirmDone.vue'
15
15
  import BrConfirmEmail from '#components/BrConfirmEmail.vue'
16
16
 
17
- import BrContainer from '#components/BrContainer/Component.vue'
17
+ import BrContainer from '#components/BrContainer.vue'
18
+ import BrDetails from '#components/BrDetails.vue'
18
19
  import BrFooterLower from '#components/BrFooterLower.vue'
19
20
  import BrFooterUpper from '#components/BrFooterUpper.vue'
20
21
 
@@ -25,7 +26,6 @@ import BrFormDate from '#components/BrFormDate.vue'
25
26
  import BrFormEdit from '#components/BrFormEdit.vue'
26
27
  import BrFormEmail from '#components/BrFormEmail.vue'
27
28
  import BrFormFieldset from '#components/BrFormFieldset.vue'
28
- import BrFormFieldsetNew from '#components/BrFormFieldsetNew.vue'
29
29
  import BrFormInput from '#components/BrFormInput.vue'
30
30
  import BrFormPassword from '#components/BrFormPassword.vue'
31
31
  import BrFormRadio from '#components/BrFormRadio.vue'
@@ -45,9 +45,9 @@ import BrOverlay from '#components/BrOverlay.vue'
45
45
  import BrLoader from '#components/BrLoader.vue'
46
46
  import BrSkiplink from '#components/BrSkiplink.vue'
47
47
  import BrStatusBars from '#components/BrStatusBars.vue'
48
+ import BrTableHeader from '#components/BrTableHeader.vue'
48
49
  import BrWrap from '#components/BrWrap.vue'
49
50
 
50
- import AccountTitle from '#components/AccountTitle.vue'
51
51
  import EventSummary from '#components/EventSummary.vue'
52
52
  import FluidIframe from '#components/FluidIframe.vue'
53
53
  import SeeInside from '#components/SeeInside.vue'
@@ -67,6 +67,7 @@ export {
67
67
  BrConfirmDone,
68
68
  BrConfirmEmail,
69
69
  BrContainer,
70
+ BrDetails,
70
71
  BrFormDate,
71
72
  BrFooterLower,
72
73
  BrFooterUpper,
@@ -76,7 +77,6 @@ export {
76
77
  BrFormEdit,
77
78
  BrFormEmail,
78
79
  BrFormFieldset,
79
- BrFormFieldsetNew,
80
80
  BrFormInput,
81
81
  BrFormPassword,
82
82
  BrFormRadio,
@@ -94,8 +94,8 @@ export {
94
94
  BrOverlay,
95
95
  BrSkiplink,
96
96
  BrStatusBars,
97
+ BrTableHeader,
97
98
  BrWrap,
98
- AccountTitle,
99
99
  EventSummary,
100
100
  FluidIframe,
101
101
  SeeInside,
package/package.json CHANGED
@@ -137,5 +137,5 @@
137
137
  "style:patterns": "cd patterns && gulp build:css",
138
138
  "build:patterns": "cd patterns && rm -rf html && pug views --out html"
139
139
  },
140
- "version": "3.19.0"
140
+ "version": "3.20.0"
141
141
  }
@@ -1,53 +1,5 @@
1
- @use "mixins/breakpoints" as *;
2
- @use "mixins/core" as *;
3
1
  @use "mixins/input" as *;
4
- @use "mixins/focus" as *;
5
-
6
- /// @deprecated custom-checkbox class. br-form-checkbox is more descriptive
7
2
 
8
3
  .br-form-checkbox {
9
- @include br-form-checkbox; // formerly checkbox-input
10
-
11
- input[table][type='checkbox'] {
12
- @include inset;
13
- margin-top: var(--margin-xs);
14
- position: relative;
15
- display: block;
16
- z-index: 1;
17
-
18
- @include medium-up {
19
- margin-top: 0.625rem;
20
- }
21
-
22
- ~label {
23
- @include sr-only;
24
- }
25
-
26
- @include focus {
27
- ~label {
28
- @include hover-label-table;
29
- }
30
- }
31
-
32
- @include focus-visible {
33
- outline-color: var(--color-black-25-lighten);
34
- outline-offset: var(--border-width-lg);
35
- outline-width: var(--border-width-sm);
36
- outline-style: solid;
37
- }
38
- }
39
-
40
- &:not(:last-of-type) {
41
- margin-bottom: var(--margin-sm);
42
- }
43
- }
44
-
45
- $statuses: 'error', 'success';
46
-
47
- @each $status in $statuses {
48
-
49
- [role='group'][#{$status}] input[type='checkbox'],
50
- input[type='checkbox'][#{$status}] {
51
- @include status-input($status);
52
- }
4
+ @include br-form-checkbox;
53
5
  }
@@ -1,5 +1,5 @@
1
1
  @use "mixins/br-form-edit" as *;
2
2
 
3
- .br-form-edit.active {
3
+ .br-form-edit {
4
4
  @include br-form-edit;
5
5
  }