barbican-reset 3.22.0 → 3.24.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 (49) hide show
  1. package/components/BrButton copy.vue +112 -0
  2. package/components/BrButton.vue +101 -88
  3. package/components/BrCard.vue +35 -40
  4. package/components/BrCardTearoff.vue +11 -0
  5. package/components/BrDetails.vue +15 -35
  6. package/components/BrLink.vue +22 -0
  7. package/components/BrWrap.vue +22 -2
  8. package/icons/back_arrow.vue +9 -1
  9. package/index.js +2 -0
  10. package/package.json +1 -1
  11. package/scripts/helpers/formatKebabCase.js +1 -1
  12. package/scss/_atomic.scss +16 -1
  13. package/scss/_br-button.scss +26 -2
  14. package/scss/{card/index.scss → _br-card.scss} +13 -11
  15. package/scss/_br-wrap.scss +10 -9
  16. package/scss/_variables.scss +6 -6
  17. package/scss/atomic/_max-widths.scss +29 -0
  18. package/scss/index.scss +1 -2
  19. package/scss/mixins/_br-card.scss +25 -4
  20. package/scss/mixins/_br-form-row.scss +1 -1
  21. package/scss/mixins/_br-wrap.scss +48 -0
  22. package/scss/mixins/_buttons.scss +1 -0
  23. package/scss/mixins/_core.scss +1 -1
  24. package/scss/mixins/buttons/_custom.scss +13 -16
  25. package/scss/mixins/buttons/_setup.scss +10 -48
  26. package/scss/mixins/buttons/_slim.scss +3 -0
  27. package/scss/mixins/buttons/custom/_add-to-wallet.scss +12 -0
  28. package/scss/mixins/buttons/custom/_invisible.scss +10 -0
  29. package/scss/mixins/buttons/custom/_manage-order.scss +11 -0
  30. package/scss/mixins/buttons/custom/_navcard.scss +32 -0
  31. package/scss/mixins/buttons/custom/_outline-alert-neutral.scss +10 -0
  32. package/scss/mixins/buttons/custom/_renew-membership.scss +4 -5
  33. package/scss/mixins/buttons/custom/_summary.scss +28 -0
  34. package/scss/mixins/card/_inline.scss +0 -1
  35. package/scss/{card → mixins/card}/_membership.scss +31 -21
  36. package/scss/mixins/card/_navitem.scss +10 -2
  37. package/scss/mixins/card/_qrcode.scss +21 -0
  38. package/scss/mixins/index.scss +1 -0
  39. package/scss/mixins/table/_details.scss +9 -3
  40. package/scss/mixins/table/_etickets.scss +6 -2
  41. package/scss/mixins/table/_generic.scss +6 -2
  42. package/scss/mixins/table/_gifts.scss +8 -3
  43. package/scss/mixins/table/_orders.scss +3 -1
  44. package/scss/mixins/table/_preferences.scss +6 -2
  45. package/scss/mixins/table/_resale.scss +3 -1
  46. package/scss/mixins/table/_tickets.scss +7 -3
  47. package/scss/_card-deck.scss +0 -26
  48. package/scss/mixins/buttons/custom/_see-tickets-info.scss +0 -18
  49. package/scss/mixins/card/_ticket.scss +0 -11
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <component
3
+ :class="generateComponentClasses"
4
+ :aria-busy="defineAriaBusy"
5
+ :aria-live="defineAriaLive"
6
+ @click="emit('click')"
7
+ :is="defineComponent"
8
+ :type="type"
9
+ :href="href"
10
+ :to="to">
11
+ <template v-if="state == 'default'">
12
+ <slot name="default">default</slot>
13
+ </template>
14
+ <template v-else-if="state == 'loading'">
15
+ <template v-if="$slots.loading">
16
+ <slot name="loading">loading</slot>
17
+ </template>
18
+ <dot-typing v-else />
19
+ </template>
20
+ <template v-else-if="state == 'loaded'">
21
+ <slot name="loaded">loaded</slot>
22
+ </template>
23
+ <template v-else-if="state == 'error'">
24
+ <slot name="error">error</slot>
25
+ </template>
26
+ </component>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { computed } from 'vue'
31
+ import DotTyping from '#components/BrButton/dot_typing.vue'
32
+
33
+ const emit = defineEmits(['click'])
34
+
35
+ const props = defineProps({
36
+ state: {
37
+ type: String,
38
+ default: 'default',
39
+ },
40
+ variant: {
41
+ type: String,
42
+ default: 'secondary',
43
+ },
44
+ type: {
45
+ type: [String, null],
46
+ },
47
+ to: {
48
+ type: [Object, null],
49
+ },
50
+ href: {
51
+ type: [String, null],
52
+ },
53
+ inline: {
54
+ type: Boolean,
55
+ default: false,
56
+ },
57
+ slim: {
58
+ type: Boolean,
59
+ default: false,
60
+ },
61
+ active: {
62
+ type: Boolean,
63
+ default: false,
64
+ },
65
+ })
66
+
67
+ const generateComponentClasses = computed(() => {
68
+ let classnames = ['btn', 'btn-' + props.variant]
69
+
70
+ if (props.inline) {
71
+ classnames.push('btn-inline')
72
+ }
73
+
74
+ if (props.slim) {
75
+ classnames.push('btn-slim')
76
+ }
77
+
78
+ if (props.active) {
79
+ classnames.push('btn-active')
80
+ }
81
+
82
+ return classnames
83
+ })
84
+
85
+ const defineComponent = computed(() => {
86
+ if (props.href) {
87
+ return 'a'
88
+ }
89
+
90
+ if (props.to) {
91
+ return 'router-link'
92
+ }
93
+
94
+ return 'button'
95
+ })
96
+
97
+ const defineAriaBusy = computed(() => {
98
+ if (props.to || props.href) {
99
+ return
100
+ }
101
+
102
+ return props.state == 'loading' ? 'true' : 'false'
103
+ })
104
+
105
+ const defineAriaLive = computed(() => {
106
+ if (props.to || props.href) {
107
+ return
108
+ }
109
+
110
+ return 'polite'
111
+ })
112
+ </script>
@@ -1,102 +1,115 @@
1
- <!-- https://dockyard.com/blog/2020/03/02/accessible-loading-indicatorswith-no-extra-elements -->
2
-
3
1
  <template>
4
- <button
5
- :class="printClassNames"
6
- @click="$emit('click')"
7
- :aria-busy="loading"
8
- aria-live="polite"
2
+ <component
3
+ :class="generateClassnames"
4
+ :aria-busy="defineAriaBusy"
5
+ :aria-live="defineAriaLive"
6
+ @click="emit('click')"
7
+ :is="defineComponent"
9
8
  :type="type"
9
+ :to="to"
10
10
  ref="button"
11
- >
12
- <remove-ticket v-if="variant === 'remove-ticket'" :state="state">
13
- <template v-for="(index, name) in $slots" v-slot:[name]>
14
- <slot :name="name" />
11
+ >
12
+ <template v-if="state == 'default'">
13
+ <slot name="default">default</slot>
14
+ </template>
15
+ <template v-else-if="state == 'loading'">
16
+ <template v-if="$slots.loading">
17
+ <slot name="loading">loading</slot>
15
18
  </template>
16
- </remove-ticket>
19
+ <dot-typing v-else />
20
+ </template>
21
+ <template v-else-if="state == 'loaded'">
22
+ <slot name="loaded">loaded</slot>
23
+ </template>
24
+ <template v-else-if="state == 'error'">
25
+ <slot name="error">error</slot>
26
+ </template>
27
+ </component>
28
+ </template>
17
29
 
18
- <template v-else>
19
- <template v-if="state === 'default'">
20
- <template v-if="$slots.default">
21
- <slot name="default" />
22
- </template>
23
- <template v-else>
24
- {{ titleCase(state) }}
25
- </template>
26
- </template>
30
+ <script setup>
31
+ import { computed, useTemplateRef } from 'vue'
32
+ import DotTyping from '#components/BrButton/dot_typing.vue'
33
+ import BrLink from '#components/BrLink.vue'
27
34
 
28
- <template v-else-if="state === 'loading'">
29
- <template v-if="$slots.loading">
30
- <slot name="loading" />
31
- </template>
32
- <dot-typing v-else />
33
- </template>
35
+ const emit = defineEmits(['click'])
34
36
 
35
- <template v-else-if="state === 'loaded'">
36
- <template v-if="$slots.loaded">
37
- <slot name="loaded" />
38
- </template>
39
- <template v-else>
40
- {{ titleCase(state) }}
41
- </template>
42
- </template>
37
+ const button = useTemplateRef('button')
43
38
 
44
- <template v-else-if="state === 'error'">
45
- <template v-if="$slots.error">
46
- <slot name="error" />
47
- </template>
48
- <template v-else>
49
- {{ titleCase(state) }}
50
- </template>
51
- </template>
52
- </template>
53
- </button>
54
- </template>
39
+ const defineComponent = computed(() => {
40
+ if (props.to && !props.disabled) return BrLink
41
+ return 'button'
42
+ })
55
43
 
56
- <script>
57
- import RemoveTicket from '#components/BrButton/remove_ticket.vue'
58
- import DotTyping from '#components/BrButton/dot_typing.vue'
44
+ const generateClassnames = computed(() => {
45
+ let classnames = ['btn', 'btn-' + props.variant]
46
+
47
+ if (props.inline) {
48
+ classnames.push('btn-inline')
49
+ }
59
50
 
60
- export default {
61
- emits: ['click'],
62
- props: {
63
- state: {
64
- type: String,
65
- default: 'default',
66
- },
67
- variant: {
68
- type: String,
69
- default: 'secondary',
70
- },
71
- type: {
72
- type: String,
73
- default: 'button',
74
- },
51
+ if (props.slim) {
52
+ classnames.push('btn-slim')
53
+ }
54
+
55
+ if (props.active) {
56
+ classnames.push('btn-active')
57
+ }
58
+
59
+ return classnames
60
+ })
61
+
62
+ const defineAriaBusy = computed(() => {
63
+ if (props.to) return
64
+ return props.state == 'loading' ? 'true' : 'false'
65
+ })
66
+
67
+ const defineAriaLive = computed(() => {
68
+ if (props.to) return
69
+ return 'polite'
70
+ })
71
+
72
+ const focusButton = () => {
73
+ if (defineComponent.value == 'button' && button) {
74
+ button.value.focus();
75
+ }
76
+ }
77
+
78
+ const props = defineProps({
79
+ state: {
80
+ type: String,
81
+ default: 'default',
75
82
  },
76
- expose: ['focusButton'],
77
- methods: {
78
- titleCase(str) {
79
- return str
80
- .toLowerCase()
81
- .split(' ')
82
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
83
- .join(' ')
84
- },
85
- focusButton() {
86
- this.$refs.button.focus();
87
- }
83
+ variant: {
84
+ type: String,
85
+ default: 'secondary',
88
86
  },
89
- computed: {
90
- loading() {
91
- return this.state === 'loading' ? 'true' : 'false'
92
- },
93
- printClassNames() {
94
- return 'btn btn-' + this.variant
95
- },
87
+ type: {
88
+ type: String,
96
89
  },
97
- components: {
98
- RemoveTicket,
99
- DotTyping,
90
+ to: {
91
+ type: [Object, String],
100
92
  },
101
- }
102
- </script>
93
+ disabled: {
94
+ type: Boolean,
95
+ default: false,
96
+ },
97
+ inline: {
98
+ type: Boolean,
99
+ default: false,
100
+ },
101
+ slim: {
102
+ type: Boolean,
103
+ default: false,
104
+ },
105
+ active: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+ })
110
+
111
+ defineExpose({
112
+ focusButton
113
+ })
114
+
115
+ </script>
@@ -1,9 +1,5 @@
1
1
  <template>
2
- <component
3
- :class="generateClassnames"
4
- :is="defineComponent"
5
- :to="defineTo"
6
- :href="defineHref">
2
+ <component :class="generateClassnames" :is="defineComponent" :to="defineTo">
7
3
  <div v-if="$slots.header" class="br-card-header">
8
4
  <slot name="header" />
9
5
  </div>
@@ -19,24 +15,44 @@
19
15
  </template>
20
16
 
21
17
  <script setup>
22
- import BrCardBody from '#components/BrCardBody.vue'
23
18
  import { computed } from 'vue'
19
+ import BrCardBody from '#components/BrCardBody.vue'
20
+ import BrLink from '#components/BrLink.vue'
21
+
22
+ const defineComponent = computed(() => {
23
+ if (props.to && !props.disabled) return BrLink
24
+ return 'div'
25
+ })
26
+
27
+ const defineTo = computed(() => {
28
+ if (props.disabled) return
29
+ return props.to
30
+ })
24
31
 
25
32
  const generateClassnames = computed(() => {
26
33
  let classnames = ['br-card']
27
34
 
28
35
  if (props.inline) classnames.push('inline')
29
36
  if (props.navcard) classnames.push('navcard')
30
- if (props.navitem) classnames.push('navitem')
31
37
  if (props.navlink) classnames.push('navlink')
32
- if (props.ticket) classnames.push('ticket')
38
+ if (props.membership) classnames.push('membership')
39
+ if (props.qrcode) classnames.push('qrcode')
40
+
41
+ if (props.navitem) {
42
+ classnames.push('navitem')
43
+
44
+ if (props.disabled) {
45
+ classnames.push('disabled')
46
+ }
47
+ }
33
48
 
34
49
  if (
35
50
  !props.inline &&
36
51
  !props.navcard &&
37
52
  !props.navitem &&
38
53
  !props.navlink &&
39
- !props.ticket
54
+ !props.membership &&
55
+ !props.qrcode
40
56
  ) {
41
57
  classnames.push('default')
42
58
  }
@@ -44,34 +60,6 @@ const generateClassnames = computed(() => {
44
60
  return classnames
45
61
  })
46
62
 
47
- const defineComponent = computed(() => {
48
- if (props.navcard || props.navitem || props.navlink) {
49
- return props.to.startsWith('http') ? 'a' : 'router-link'
50
- }
51
-
52
- return 'div'
53
- })
54
-
55
- const defineTo = computed(() => {
56
- if (props.navcard || props.navitem || props.navlink) {
57
- if (!props.to.startsWith('http')) {
58
- return { name: props.to }
59
- }
60
- }
61
-
62
- return null
63
- })
64
-
65
- const defineHref = computed(() => {
66
- if (props.navcard || props.navitem || props.navlink) {
67
- if (props.to.startsWith('http')) {
68
- return props.to
69
- }
70
- }
71
-
72
- return null
73
- })
74
-
75
63
  const props = defineProps({
76
64
  inline: {
77
65
  type: Boolean,
@@ -89,7 +77,11 @@ const props = defineProps({
89
77
  type: Boolean,
90
78
  default: false,
91
79
  },
92
- ticket: {
80
+ membership: {
81
+ type: Boolean,
82
+ default: false,
83
+ },
84
+ qrcode: {
93
85
  type: Boolean,
94
86
  default: false,
95
87
  },
@@ -102,8 +94,11 @@ const props = defineProps({
102
94
  default: false,
103
95
  },
104
96
  to: {
105
- type: String,
106
- default: '',
97
+ type: Object || String,
98
+ },
99
+ disabled: {
100
+ type: Boolean,
101
+ default: false,
107
102
  },
108
103
  })
109
104
  </script>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="br-card-tearoff">
3
+ <br-card-body>
4
+ <slot>Card tearoff</slot>
5
+ </br-card-body>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup>
10
+ import BrCardBody from '#components/BrCardBody.vue'
11
+ </script>
@@ -1,16 +1,12 @@
1
1
  <template>
2
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>
3
+ <br-button variant="summary" @click="update">
4
+ <div class="wrap-title">
5
+ <slot name="title">Title goes here</slot>
8
6
  </div>
9
- <span class="br-summary-icon">
10
- {{ open ? '–' : '+' }}
11
- </span>
7
+ <span class="wrap-icon">{{ open ? '–' : '+' }}</span>
12
8
  </br-button>
13
- <div :class="['br-details-content', { open }]">
9
+ <div :class="['wrap-content', { open }]">
14
10
  <slot name="content">Content goes here</slot>
15
11
  </div>
16
12
  </div>
@@ -26,50 +22,34 @@ const props = defineProps({
26
22
  },
27
23
  })
28
24
 
29
- const update = () => emit('update', !props.open)
25
+ const update = () => emit('update', { open: !props.open })
30
26
  </script>
31
27
 
32
28
  <style lang="scss" scoped>
33
29
  @use '#styles/helpers' as *;
34
30
 
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 {
31
+ .wrap-icon {
56
32
  font-size: var(--font-size-h1);
57
33
  line-height: 0.6875rem;
58
34
  font-weight: normal;
59
35
  position: relative;
60
36
  padding: 0.375rem;
61
- width: 2.25rem;
62
37
  top: 0.125rem;
63
38
  height: 2rem;
39
+ width: 2rem;
40
+ }
41
+
42
+ .wrap-title {
43
+ align-self: center;
64
44
  }
65
45
 
66
- .br-details-content:not(.open) {
46
+ .wrap-content:not(.open) {
67
47
  visibility: hidden;
68
48
  overflow: hidden;
69
49
  height: 0;
70
50
  }
71
51
 
72
- .br-details-content.open {
73
- margin-top: var(--margin-xxl);
52
+ .wrap-content.open {
53
+ margin-top: var(--margin-md);
74
54
  }
75
55
  </style>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <a v-if="isExternal" :href="to">
3
+ <slot />
4
+ </a>
5
+ <router-link v-else :to="to">
6
+ <slot />
7
+ </router-link>
8
+ </template>
9
+
10
+ <script setup>
11
+ // https://vueschool.io/lessons/extending-router-link-for-external-urls
12
+
13
+ import { computed } from 'vue'
14
+
15
+ const isExternal = computed(() => typeof props.to == 'string')
16
+
17
+ const props = defineProps({
18
+ to: {
19
+ type: Object || String,
20
+ },
21
+ })
22
+ </script>
@@ -10,9 +10,21 @@ import { computed } from 'vue'
10
10
  const generateComponentClasses = computed(() => {
11
11
  let classnames = ['br-wrap']
12
12
 
13
- if (props.navcard) classnames.push('navcard')
13
+ if (props.navcard) {
14
+ classnames.push('navcard')
15
+ }
14
16
 
15
- if (!props.navcard) classnames.push('default')
17
+ if (props.cluster) {
18
+ classnames.push('cluster')
19
+ }
20
+
21
+ if (props.orders) {
22
+ classnames.push('orders')
23
+ }
24
+
25
+ if (!props.navcard && !props.cluster && !props.orders) {
26
+ classnames.push('default')
27
+ }
16
28
 
17
29
  return classnames
18
30
  })
@@ -22,5 +34,13 @@ const props = defineProps({
22
34
  type: Boolean,
23
35
  default: false,
24
36
  },
37
+ cluster: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ orders: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
25
45
  })
26
46
  </script>
@@ -1,3 +1,11 @@
1
1
  <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 16 16"><path d="M16,7H3.83L9.42,1.41l-1.42-1.41L0,8l8,8,1.41-1.41-5.58-5.59h12.17v-2Z" fill="currentColor" /></svg>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="16"
5
+ height="16"
6
+ viewBox="0 0 16 16">
7
+ <path
8
+ d="M16,7H3.83L9.42,1.41l-1.42-1.41L0,8l8,8,1.41-1.41-5.58-5.59h12.17v-2Z"
9
+ fill="currentColor" />
10
+ </svg>
3
11
  </template>
package/index.js CHANGED
@@ -7,6 +7,7 @@ import BrCardBody from '#components/BrCardBody.vue'
7
7
  import BrCardText from '#components/BrCardText.vue'
8
8
  import BrCardTitle from '#components/BrCardTitle.vue'
9
9
  import BrCardSubtitle from '#components/BrCardSubtitle.vue'
10
+ import BrCardTearoff from '#components/BrCardTearoff.vue'
10
11
 
11
12
  import BrCollapseButton from '#components/BrCollapse/Button.vue'
12
13
  import BrCollapseContent from '#components/BrCollapse/Content.vue'
@@ -54,6 +55,7 @@ export {
54
55
  BrCardSubtitle,
55
56
  BrCardText,
56
57
  BrCardTitle,
58
+ BrCardTearoff,
57
59
  BrCollapseButton,
58
60
  BrCollapseContent,
59
61
  BrConfirmDone,
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.22.0"
140
+ "version": "3.24.0"
141
141
  }
@@ -7,5 +7,5 @@
7
7
 
8
8
  export default function (value = '') {
9
9
  value = String(value)
10
- return value.toLowerCase().split(' ').join('-')
10
+ return value.replace("'", '').toLowerCase().split(' ').join('-')
11
11
  }
package/scss/_atomic.scss CHANGED
@@ -1,8 +1,10 @@
1
+ @use "mixins/breakpoints" as *;
1
2
  @use "mixins/core" as *;
2
3
  @use "atomic/colors";
3
4
  @use "atomic/font-sizes";
4
5
  @use "atomic/font-weights";
5
6
  @use "atomic/margins";
7
+ @use "atomic/max-widths";
6
8
  @use "atomic/min-heights";
7
9
  @use "atomic/min-widths";
8
10
  @use "atomic/paddings";
@@ -26,7 +28,20 @@
26
28
  width: 100%;
27
29
  }
28
30
 
29
- /// Class for visually hiding markup, while still allowing screen readers to parse the content
30
31
  .sr-only {
31
32
  @include sr-only;
33
+ }
34
+
35
+ .white-space-nowrap {
36
+ white-space: nowrap;
37
+ }
38
+
39
+ .vertical-align-middle {
40
+ vertical-align: middle;
41
+ }
42
+
43
+ .medium-down {
44
+ @include large-up {
45
+ display: none;
46
+ }
32
47
  }