@pocketprep/ui-kit 3.4.44 → 3.4.46

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,7 +1,8 @@
1
1
  <template>
2
2
  <div
3
3
  class="uikit-flag-toggle"
4
- tabindex="0"
4
+ :class="{ 'uikit-flag-toggle--disabled': disabled }"
5
+ :tabindex="disabled ? '-1' : '0'"
5
6
  :aria-checked="isFlagged"
6
7
  aria-label="Flag question"
7
8
  role="checkbox"
@@ -14,7 +15,7 @@
14
15
  @blur="showFlagTooltip = false"
15
16
  >
16
17
  <Tooltip
17
- v-if="showFlagTooltip && enableFlagTooltip"
18
+ v-if="showFlagTooltip && enableFlagTooltip && !disabled"
18
19
  :key="isFlagged"
19
20
  class="uikit-flag-toggle__tooltip"
20
21
  :styles="{
@@ -28,6 +29,7 @@
28
29
  class="uikit-flag-toggle__icon"
29
30
  :class="{
30
31
  'uikit-flag-toggle__icon--active': isFlagged,
32
+ 'uikit-flag-toggle__icon--disabled': disabled
31
33
  }"
32
34
  :type="isFlagged ? 'flag-filled' : 'flag'"
33
35
  />
@@ -50,6 +52,7 @@ export default class FlagToggle extends Vue {
50
52
  @Prop() isFlagged!: boolean
51
53
  @Prop({ default: false }) enableFlagKeyboardShortcut!: boolean
52
54
  @Prop({ default: true }) enableFlagTooltip!: boolean
55
+ @Prop({ default: false }) disabled!: boolean
53
56
 
54
57
  brandColors = BrandColors
55
58
  showFlagTooltip = false
@@ -65,12 +68,20 @@ export default class FlagToggle extends Vue {
65
68
  }
66
69
 
67
70
  keydownListener (e: KeyboardEvent) {
71
+ if (this.disabled) {
72
+ return
73
+ }
74
+
68
75
  if (e.code === 'KeyP') {
69
76
  this.emitToggleFlag(!this.isFlagged)
70
77
  }
71
78
  }
72
79
 
73
80
  toggleFlag () {
81
+ if (this.disabled) {
82
+ return
83
+ }
84
+
74
85
  this.emitToggleFlag(!this.isFlagged)
75
86
  }
76
87
 
@@ -107,12 +118,25 @@ export default class FlagToggle extends Vue {
107
118
  }
108
119
  }
109
120
 
121
+ &--disabled {
122
+ opacity: 0.35;
123
+
124
+ &:focus::before {
125
+ display: none;
126
+ }
127
+ }
128
+
110
129
  &__icon {
111
130
  cursor: pointer;
112
131
 
113
132
  &--active {
114
133
  color: $banana-bread;
115
134
  }
135
+
136
+ &--disabled {
137
+ cursor: default;
138
+ color: $white !important;
139
+ }
116
140
  }
117
141
 
118
142
  &__tooltip {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.4.44",
3
+ "version": "3.4.46",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {