@usssa/component-library 1.0.0-alpha.123 → 1.0.0-alpha.124

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Component Library v1.0.0-alpha.122
1
+ # Component Library v1.0.0-alpha.124
2
2
 
3
3
  **This library provides custom UI components for USSSA applications.**
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.123",
3
+ "version": "1.0.0-alpha.124",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -1,11 +1,12 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import UTooltip from './UTooltip.vue'
4
+
5
+ const emit = defineEmits(['onClick'])
4
6
  const props = defineProps({
5
- iconClass: {
7
+ anchor: {
6
8
  type: String,
7
- required: true,
8
- default: 'fa-kit-duotone fa-circle-bolt',
9
+ default: 'center left',
9
10
  },
10
11
  ariaLabel: {
11
12
  type: String,
@@ -15,10 +16,27 @@ const props = defineProps({
15
16
  type: String,
16
17
  default: 'primary',
17
18
  },
19
+ dataTestId: {
20
+ type: String,
21
+ default: 'button-icon',
22
+ },
23
+ iconClass: {
24
+ type: String,
25
+ required: true,
26
+ default: 'fa-kit-duotone fa-circle-bolt',
27
+ },
28
+ offset: {
29
+ type: Array,
30
+ default: () => [4, 4],
31
+ },
18
32
  round: {
19
33
  type: Boolean,
20
34
  default: true,
21
35
  },
36
+ self: {
37
+ type: String,
38
+ default: 'center end',
39
+ },
22
40
  size: {
23
41
  type: String,
24
42
  default: 'md',
@@ -32,26 +50,20 @@ const props = defineProps({
32
50
  type: String,
33
51
  default: 'top',
34
52
  },
35
- anchor: {
36
- type: String,
37
- default: 'center left',
38
- },
39
- self: {
40
- type: String,
41
- default: 'center end',
42
- },
43
- offset: {
44
- type: Array,
45
- default: () => [4, 4],
46
- },
47
53
  })
48
54
 
49
- const emit = defineEmits(['onClick'])
50
-
51
- const handleClick = () => {
52
- return emit('onClick')
53
- }
54
-
55
+ const btnClass = computed(() => {
56
+ if (props.color === 'neutral') {
57
+ return 'neutral-4'
58
+ }
59
+ return props.color
60
+ })
61
+ const iconColor = computed(() => {
62
+ if (props.color === 'neutral') {
63
+ return 'neutral-9'
64
+ }
65
+ return props.color
66
+ })
55
67
  const iconSize = computed(() => {
56
68
  if (props.size === 'sm') {
57
69
  return 'xs'
@@ -62,47 +74,37 @@ const iconSize = computed(() => {
62
74
  if (props.size === 'lg') {
63
75
  return 'md'
64
76
  }
65
-
66
77
  return props.size
67
78
  })
68
- const iconColor = computed(() => {
69
- if (props.color === 'neutral') {
70
- return 'neutral-9'
71
- }
72
- return props.color
73
- })
74
79
 
75
- const btnClass = computed(() => {
76
- if (props.color === 'neutral') {
77
- return 'neutral-4'
78
- }
79
- return props.color
80
- })
80
+ const handleClick = () => {
81
+ return emit('onClick')
82
+ }
81
83
  </script>
82
84
 
83
85
  <template>
84
86
  <q-btn
85
- @click="handleClick"
87
+ :class="`u-btn-icon size-${size} ${btnClass}`"
88
+ :aria-label="ariaLabel"
89
+ :dataTestId="dataTestId"
86
90
  flat="flat"
87
91
  :round="round"
88
- :aria-label="ariaLabel"
89
- class="u-btn-icon"
90
- :class="`size-${size} ${btnClass}`"
92
+ @click="handleClick"
91
93
  >
92
94
  <template #default>
93
95
  <q-icon
94
- :color="iconColor"
95
- :aria-hidden="true"
96
96
  :class="`${iconClass} size-${size}`"
97
+ :aria-hidden="true"
98
+ :color="iconColor"
97
99
  :size="iconSize"
98
100
  />
99
101
 
100
102
  <UTooltip
101
103
  v-if="tooltip"
102
- :description="tooltip"
103
104
  :anchor="anchor"
104
- :self="self"
105
+ :description="tooltip"
105
106
  :offset="offset"
107
+ :self="self"
106
108
  />
107
109
  <slot name="menu" />
108
110
  </template>
@@ -17,21 +17,25 @@ const open = defineModel('open', {
17
17
  type: Boolean,
18
18
  })
19
19
  const props = defineProps({
20
- menu: {
21
- default: () => [],
22
- type: Array,
23
- },
24
20
  brandLogo: {
25
21
  default: '',
26
22
  },
27
23
  brandMiniLogo: {
28
24
  default: '',
29
25
  },
26
+ dataTestId:{
27
+ default:'drawer-std',
28
+ type: String
29
+ },
30
30
  homeLink: {
31
31
  required: true,
32
32
  default: '/home',
33
33
  type: String,
34
34
  },
35
+ menu: {
36
+ default: () => [],
37
+ type: Array,
38
+ }
35
39
  })
36
40
 
37
41
  const $router = useRouter()
@@ -64,6 +68,7 @@ const handleCloseDrawer = () => {
64
68
  v-model="open"
65
69
  :class="`u-drawer ${miniState ? 'u-mini-drawer' : ''}`"
66
70
  :breakpoint="400"
71
+ :dataTestId="dataTestId"
67
72
  :mini="miniState"
68
73
  :mini-width="64"
69
74
  show-if-above
@@ -183,7 +188,7 @@ const handleCloseDrawer = () => {
183
188
  outline: auto !important
184
189
  .q-focus-helper
185
190
  display: none
186
-
191
+
187
192
  .u-drawer-scrollable-area
188
193
  height: calc(100% - 0px)
189
194
  margin-top: 0px
@@ -1,23 +1,27 @@
1
1
  <script setup>
2
- import { computed, useSlots } from 'vue'
2
+ import { computed, useSlots } from 'vue'
3
3
 
4
4
  const props = defineProps({
5
- icon: {
5
+ anchor: {
6
6
  type: String,
7
7
  },
8
- description: {
8
+ dataTestId: {
9
9
  type: String,
10
- required: true,
10
+ default: 'tooltip-std',
11
11
  },
12
- anchor: {
12
+ description: {
13
13
  type: String,
14
+ required: true,
14
15
  },
15
- self: {
16
+ icon: {
16
17
  type: String,
17
18
  },
18
19
  offset: {
19
20
  type: Array,
20
21
  },
22
+ self: {
23
+ type: String,
24
+ },
21
25
  target: {
22
26
  type: String,
23
27
  default: '',
@@ -40,17 +44,18 @@ const getTooltipText = computed(() => {
40
44
 
41
45
  <template>
42
46
  <q-tooltip
43
- v-if="getTooltipText || slots.item"
44
47
  v-bind="$attrs"
48
+ v-if="getTooltipText || slots.item"
45
49
  class="u-tooltip shadow-2 bg-dark row"
46
50
  :anchor="anchor"
51
+ :dataTestId="dataTestId"
47
52
  :offset="offset"
48
53
  :self="self"
49
54
  :target="target"
50
55
  >
51
56
  <div class="row no-wrap tooltip-content">
52
57
  <div v-if="icon" class="flex items-center">
53
- <q-icon :class="icon" size="1rem"></q-icon>
58
+ <q-icon :class="icon" size="1rem" />
54
59
  </div>
55
60
  <div class="text-body-xs tooltip-text">{{ getTooltipText }}</div>
56
61
  <slot name="item" />