@usssa/component-library 1.0.0-alpha.151 → 1.0.0-alpha.153

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.150
1
+ # Component Library v1.0.0-alpha.153
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.151",
3
+ "version": "1.0.0-alpha.153",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -212,6 +212,7 @@ watch(
212
212
  minimal
213
213
  :navigation-max-year-month="navigationMaxYearMonth"
214
214
  :navigation-min-year-month="navigationMinYearMonth"
215
+ :options="datePickerOptions"
215
216
  :range="range"
216
217
  />
217
218
  </q-popup-proxy>
@@ -98,6 +98,7 @@ const toLowerCase = (str) => str?.toLowerCase()
98
98
  :hintText="hintText"
99
99
  :isRequired="isRequired"
100
100
  :label="label"
101
+ inputType="tel"
101
102
  leftIcon="true"
102
103
  :mask="mask"
103
104
  :outlined="outlined"
@@ -33,6 +33,10 @@ const props = defineProps({
33
33
  hintText: {
34
34
  type: String,
35
35
  },
36
+ inputType: {
37
+ type: String,
38
+ default: 'text',
39
+ },
36
40
  isRequired: {
37
41
  type: Boolean,
38
42
  default: false,
@@ -143,7 +147,7 @@ const handleRightIconClick = () => {
143
147
  :readonly="readonly"
144
148
  :rules="validationRules"
145
149
  :standout="!outlined"
146
- type="text"
150
+ :type="inputType"
147
151
  >
148
152
  <!--Added below line to resolve "Missing form label" accessibility issue -->
149
153
  <template class="hidden">{{ label }}</template>
@@ -193,7 +197,7 @@ const handleRightIconClick = () => {
193
197
  </div>
194
198
  </div>
195
199
  </template>
196
- <slot name="menu"/>
200
+ <slot name="menu" />
197
201
  </q-input>
198
202
  </div>
199
203
  </template>
@@ -38,7 +38,6 @@ const props = defineProps({
38
38
  },
39
39
  label: {
40
40
  type: String,
41
- default: 'Label',
42
41
  },
43
42
  leftIcon: {
44
43
  type: String,
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, ref, watch } from 'vue'
2
+ import { computed, onMounted, ref, watch } from 'vue'
3
3
  import { useScreenType } from '../../composables/useScreenType'
4
4
  import UAvatar from './UAvatar.vue'
5
5
  import UBtnStd from './UBtnStd.vue'
@@ -74,6 +74,10 @@ const props = defineProps({
74
74
  type: String,
75
75
  default: '',
76
76
  },
77
+ readonly: {
78
+ type: Boolean,
79
+ default: false
80
+ },
77
81
  sheetLabel: {
78
82
  type: String,
79
83
  default: '',
@@ -103,13 +107,7 @@ const initialOptions = ref([...props.options])
103
107
  const placeholderText = ref(props?.placeholder)
104
108
  const search = ref('')
105
109
  const selectedItem = ref(props.modelValue)
106
-
107
- const sheetHeading = computed(() => {
108
- if (props.sheetLabel) {
109
- return props.sheetLabel
110
- }
111
- return props.label
112
- })
110
+ const selectRef = ref(null)
113
111
 
114
112
  const filterOptions = computed(() => {
115
113
  if (!search.value) return initialOptions.value
@@ -126,6 +124,12 @@ const model = computed({
126
124
  return emit('update:modelValue', value)
127
125
  },
128
126
  })
127
+ const sheetHeading = computed(() => {
128
+ if (props.sheetLabel) {
129
+ return props.sheetLabel
130
+ }
131
+ return props.label
132
+ })
129
133
 
130
134
  // sheet apply action
131
135
  const handleApply = () => {
@@ -135,8 +139,16 @@ const handleApply = () => {
135
139
 
136
140
  // for opening the sheet in mobile screen
137
141
  const handleClick = (event) => {
138
- const isSelectElement = event.target.closest('.q-field__control')
139
- if ($screen.value.isMobile && isSelectElement) {
142
+ if(props.readonly) return
143
+ if (!$screen.value.isMobile) return
144
+ const isBorderClick = event.target.classList.contains('q-field__control')
145
+
146
+ if (
147
+ isBorderClick ||
148
+ event.target.closest('.q-field__control') ||
149
+ event.target.closest('.q-field__append')
150
+ ) {
151
+ event.preventDefault()
140
152
  event.stopPropagation()
141
153
  dialogs.value = [
142
154
  {
@@ -217,6 +229,18 @@ const updateVal = (val) => {
217
229
  placeholderText.value = val?.length ? '' : props?.placeholder
218
230
  }
219
231
 
232
+ onMounted(() => {
233
+ // Add click listener to handle border clicks more reliably
234
+ if (selectRef.value) {
235
+ const controlContainer =
236
+ selectRef.value?.$el.querySelector('.q-field__control')
237
+ if (controlContainer) {
238
+ controlContainer.addEventListener('click', handleClick, {
239
+ passive: false,
240
+ })
241
+ }
242
+ }
243
+ })
220
244
  watch(
221
245
  () => props?.placeholder,
222
246
  (value) => {
@@ -234,11 +258,7 @@ watch(
234
258
  </script>
235
259
 
236
260
  <template>
237
- <section
238
- class="column q-gutter-xs"
239
- :dataTestId="dataTestId"
240
- @click="handleClick"
241
- >
261
+ <section class="column q-gutter-xs" :dataTestId="dataTestId">
242
262
  <label class="row items-center" for="select">
243
263
  <div class="u-select-label text-body-sm">
244
264
  <span>{{ label }}</span>
@@ -271,6 +291,7 @@ watch(
271
291
  :color="color"
272
292
  emit-value
273
293
  hide-bottom-space
294
+ :hide-dropdown-icon="$screen.isMobile ? true : false"
274
295
  id="select"
275
296
  map-options
276
297
  :menu-offset="[0, 5]"
@@ -280,7 +301,10 @@ watch(
280
301
  :options="options"
281
302
  outlined
282
303
  :placeholder="placeholderText"
304
+ :readonly="readonly"
305
+ ref="selectRef"
283
306
  :use-input="useInput"
307
+ @click="handleClick"
284
308
  @filter="filterFn"
285
309
  @input="handleInput"
286
310
  @keydown="handleKeydown"
@@ -294,6 +318,13 @@ watch(
294
318
  </q-item-section>
295
319
  </q-item>
296
320
  </template>
321
+ <template v-if="$screen.isMobile && !readonly" v-slot:append>
322
+ <q-icon
323
+ class="cursor-pointer"
324
+ name="arrow_drop_down"
325
+ @click.stop="handleClick"
326
+ />
327
+ </template>
297
328
 
298
329
  <template v-if="leftIcon" v-slot:prepend>
299
330
  <q-icon :class="leftIcon" size="1rem" />
@@ -451,7 +482,7 @@ watch(
451
482
 
452
483
  &::before
453
484
  background: white
454
- border: 1.5px solid $neutral-4
485
+ border: 0.094rem solid $neutral-4
455
486
 
456
487
  &.field-sm
457
488
  .q-field__marginal
@@ -465,16 +496,16 @@ watch(
465
496
  height: $xl
466
497
 
467
498
  &:hover .q-field__control::before
468
- border: 1.5px solid $primary
499
+ border: 0.094rem solid $primary
469
500
 
470
501
  &.q-field--with-bottom
471
502
  padding-bottom: 0
472
503
 
473
504
  .q-field__control:focus-within
474
- box-shadow : 0 0 0 2px rgba(35, 75, 169, .20)
505
+ box-shadow : 0 0 0 0.125rem rgba(35, 75, 169, .20)
475
506
 
476
507
  .q-field__bottom
477
- padding: 4px 0 0 0
508
+ padding: $xxs 0 0 0
478
509
 
479
510
  .q-field__prepend
480
511
  padding-right: $xs
@@ -13,27 +13,58 @@
13
13
  // Tip: Use the "Theme Builder" on Quasar's documentation website.
14
14
 
15
15
  @import 'vars/colors.variables'
16
- $primary : $blue-8
17
- $secondary : $blue-9
18
- $accent : $red-5
19
16
 
20
- $dark : #101114
21
- $dark-page : #121212
22
-
23
- $positive : $green-6
24
- $negative : $red-5
25
- $info : $purple-6
26
- $warning : $orange-7
17
+ // USSSA BRAND COLOR VALUES
18
+ $primary: $blue-8
19
+ $secondary: $blue-9
20
+ $accent: $red-5
21
+ $negative: $red-5
22
+ $warning: $orange-7
23
+ $positive: $green-6
24
+ $info: $purple-6
25
+ $dark: $neutral-13
26
+ $white: $neutral-1
27
+ $description: $neutral-9
28
+ $transparent: rgb(0, 0, 0, .10)
29
+ $dark-page: #121212
30
+
31
+ // BG Hover variables
32
+ $accent-bg-hover: rgb(203, 42, 61, .15)
33
+ $primary-bg-hover: rgb(35, 75, 169, .15)
34
+
35
+ // BODY
36
+ $body-xl: (size: 1.25rem, line-height: 1.75rem, letter-spacing: .03215rem, weight: 400) !default
37
+ $body-lg: (size: 1.125rem, line-height: 1.313rem, letter-spacing: .03215rem, weight: 400) !default
38
+ $body-md: (size: 1.00rem, line-height: 1.188rem, letter-spacing: .01786rem, weight: 400) !default
39
+ $body-sm: (size: 0.875rem, line-height: 1.188rem, letter-spacing: .01786rem, weight: 400) !default
40
+ $body-xs: (size: 0.75rem, line-height: 1.063rem, letter-spacing: .01786rem, weight: 400) !default
41
+ $body-xxs: (size: 0.688rem, line-height: 1.063rem, letter-spacing: .01786rem, weight: 400) !default
42
+
43
+ // BORDER RADIUS
44
+ $border-radius-xs: .25rem
45
+ $border-radius-sm: .5rem
46
+
47
+ // CAPTION
48
+ $caption-lg: (size: 1rem, line-height: 1.063rem, letter-spacing: .03333rem, weight: 500) !default
49
+ $caption-md: (size: 0.875rem, line-height: 1.063rem, letter-spacing: .03333rem, weight: 500) !default
50
+ $caption-sm: (size: 0.75rem, line-height: 1.063rem, letter-spacing: .03333rem, weight: 500) !default
51
+ $caption-xs: (size: 0.688rem, line-height: 1.063rem, letter-spacing: .03333rem, weight: 500) !default
52
+
53
+ // OVERLINE
54
+ $overline-lg: (size: 1.00rem, line-height: 1.50rem, letter-spacing: .53px, weight: 500) !default
55
+ $overline-md: (size: 0.875rem, line-height: 1.5rem, letter-spacing: .03333px, weight: 500) !default
56
+ $overline-sm: (size: 0.75rem, line-height: 1.5rem, letter-spacing: .03333px, weight: 500) !default
57
+ $overline-xs: (size: 0.688rem, line-height: 1.5rem, letter-spacing: .03333px, weight: 500) !default
27
58
 
28
59
  // USSSA TYPOGRAPHY RESET
29
- $h1: (size: 4.063rem, line-height: 5.079rem, letter-spacing: .35px, weight: 700) !default
30
- $h2: (size: 2.5rem, line-height: 3.125rem, letter-spacing: .35px, weight: 700) !default
31
- $h3: (size: 1.5rem, line-height: 1.875rem, letter-spacing: .35px, weight: 700) !default
32
- $h4: (size: 1.25rem, line-height: 1.563rem, letter-spacing: .35px, weight: 700) !default
60
+ $h1: (size: 4.063rem, line-height: 5.079rem, letter-spacing: .35px, weight: 700) !default
61
+ $h2: (size: 2.5rem, line-height: 3.125rem, letter-spacing: .35px, weight: 700) !default
62
+ $h3: (size: 1.5rem, line-height: 1.875rem, letter-spacing: .35px, weight: 700) !default
63
+ $h4: (size: 1.25rem, line-height: 1.563rem, letter-spacing: .35px, weight: 700) !default
33
64
 
34
65
  // QUASAR DEFAULTS
35
- $h5: (size: 1.5rem, line-height: 2rem, letter-spacing: normal, weight: 700) !default
36
- $h6: (size: 1.25rem, line-height: 2rem, letter-spacing: .0125em, weight: 700) !default
66
+ $h5: (size: 1.5rem, line-height: 2rem, letter-spacing: normal, weight: 700) !default
67
+ $h6: (size: 1.25rem, line-height: 2rem, letter-spacing: .0125em, weight: 700) !default
37
68
 
38
69
  // USSSA CUSTOM
39
70
  $h1-md: (size: 3.00rem , line-height: 3.75rem, letter-spacing: .35px, weight: bold) !default
@@ -48,64 +79,45 @@ $h3-sm: (size: 1.250rem , line-height: 1.563rem, letter-spacing: .35px, weight:
48
79
  $h4-md: (size: 1.125rem , line-height: 1.406rem, letter-spacing: .35px, weight: bold) !default
49
80
  $h4-sm: (size: 1.00rem , line-height: 1.25rem, letter-spacing: .35px, weight: bold) !default
50
81
 
82
+ // HEADING
83
+ $heading-xxxl: (size: 3rem, line-height: 5.25rem, letter-spacing: -0.0156rem, weight: 700) !default
84
+ $heading-xxl: (size: 2.5rem, line-height: 3.281rem, letter-spacing: 0rem, weight: 700) !default
85
+ $heading-xl: (size: 2.0rem, line-height: 2.734rem, letter-spacing: 0rem, weight: 700) !default
86
+ $heading-lg: (size: 1.75rem, line-height: 1.75rem, letter-spacing: .00714rem, weight: 700) !default
87
+ $heading-md: (size: 1.5rem, line-height: 1.5rem, letter-spacing: .00714rem, weight: 700) !default
88
+ $heading-sm: (size: 1.25rem, line-height: 1.5rem, letter-spacing: 0rem, weight: 700) !default
89
+ $heading-xs: (size: 1.125rem, line-height: 1.313rem, letter-spacing: .0125rem, weight: 700) !default
90
+ $heading-xxs: (size: 1.0rem, line-height: 1.313rem, letter-spacing: .0125rem, weight: 700) !default
51
91
 
52
- // DESKTOP
53
- $caption-lg: (size: 1rem, line-height: 1.25rem, letter-spacing: .03333rem, weight: 500) !default
54
- $caption-md: (size: 0.875rem, line-height: 1.25rem, letter-spacing: .03333rem, weight: 500) !default
55
- $caption-sm: (size: 0.75rem, line-height: 1.25rem, letter-spacing: .03333rem, weight: 500) !default
56
- $caption-xs: (size: 0.688rem, line-height: 1.25rem, letter-spacing: .03333rem, weight: 500) !default
57
-
58
- $body-xl: (size: 1.25rem, line-height: 2.5rem, letter-spacing: .03215rem, weight: 400) !default
59
- $body-lg: (size: 1.125rem, line-height: 1.75rem, letter-spacing: .03215rem, weight: 400) !default
60
- $body-md: (size: 1.00rem, line-height: 1.188rem, letter-spacing: .01786rem, weight: 400) !default
61
- $body-sm: (size: 0.875rem, line-height: 1.5rem, letter-spacing: .01786rem, weight: 400) !default
62
- $body-xs: (size: 0.75rem, line-height: 1.25rem, letter-spacing: .01786rem, weight: 400) !default
63
- $body-xxs: (size: 0.688rem, line-height: 1.25rem, letter-spacing: .01786rem, weight: 400) !default
64
-
65
- $overline-lg: (size: 1.00rem, line-height: 1.50rem, letter-spacing: .53px, weight: 500) !default
66
- $overline-md: (size: 0.875rem, line-height: 2rem, letter-spacing: .53px, weight: 500) !default
67
- $overline-sm: (size: 0.75rem, line-height: 2rem, letter-spacing: .53px, weight: 500) !default
68
- $overline-xs: (size: 0.688rem, line-height: 2rem, letter-spacing: .53px, weight: 500) !default
69
-
70
- $heading-xxxl: (size: 3rem, line-height: 3.75rem, letter-spacing: -0.0156rem, weight: 700) !default
71
- $heading-xxl: (size: 2.5rem, line-height: 3.125rem, letter-spacing: 0rem, weight: 700) !default
72
- $heading-xl: (size: 2.0rem, line-height: 2.5rem, letter-spacing: 0rem, weight: 700) !default
73
- $heading-lg: (size: 1.75rem, line-height: 2.188rem, letter-spacing: .00714rem, weight: 700) !default
74
- $heading-md: (size: 1.5rem, line-height: 1.5rem, letter-spacing: .00714rem, weight: 700) !default
75
- $heading-sm: (size: 1.25rem, line-height: 1.5rem, letter-spacing: 0rem, weight: 700) !default
76
- $heading-xs: (size: 1.125rem, line-height: 1.406rem, letter-spacing: .0125rem, weight: 700) !default
77
- $heading-xxs: (size: 1.0rem, line-height: 1.5rem, letter-spacing: .0125rem, weight: 700) !default
78
-
79
- // VARIABLE ASSIGNMENT
80
92
  $headings: ('h1': $h1, 'h1-md': $h1-md, 'h1-sm': $h1-sm, 'h2': $h2, 'h2-md': $h2-md, 'h2-sm': $h2-sm, 'h3': $h3, 'h3-md': $h3-md, 'h3-sm': $h3-sm, 'h4': $h4, 'h4-md': $h4-md, 'h4-sm': $h4-sm, 'h5': $h5, 'h6': $h6, 'body-xl': $body-xl, 'body-lg': $body-lg, 'body-md': $body-md, 'body-sm': $body-sm, 'body-xs': $body-xs, 'body-xxs': $body-xxs, 'overline-lg': $overline-lg, 'overline-md': $overline-md, 'overline-sm': $overline-sm,'overline-xs': $overline-xs, 'caption-lg': $caption-lg, 'caption-md': $caption-md, 'caption-sm': $caption-sm, 'caption-xs': $caption-xs, 'heading-xxxl': $heading-xxxl, 'heading-xxl':$heading-xxl,'heading-xl':$heading-xl,'heading-lg':$heading-lg,'heading-md':$heading-md,'heading-sm':$heading-sm,'heading-xs':$heading-xs,'heading-xxs': $heading-xxs) !default
81
93
 
82
94
  // SPACING BASE
83
- $space-base : 1rem !default
84
- $space-x-base : $space-base !default
85
- $space-y-base : $space-base !default
95
+ $space-base: 1rem !default
96
+ $space-x-base: $space-base !default
97
+ $space-y-base: $space-base !default
86
98
 
87
99
  // SPACING SINGLE VARIABLES
88
- $xxs : $space-base * .25 !default
89
- $xs : $space-base * .5 !default
90
- $sm : $space-base * .75 !default
91
- $ms : $space-base * 1.5 !default
92
- $ba : $space-base * 1 !default
93
- $md : $space-base * 2 !default
94
- $lg : $space-base * 2.5 !default
95
- $xl : $space-base * 3 !default
96
- $xxl : $space-base * 3.375 !default
100
+ $xxs: $space-base * .25 !default
101
+ $xs: $space-base * .5 !default
102
+ $sm: $space-base * .75 !default
103
+ $ms: $space-base * 1.5 !default
104
+ $ba: $space-base * 1 !default
105
+ $md: $space-base * 2 !default
106
+ $lg: $space-base * 2.5 !default
107
+ $xl: $space-base * 3 !default
108
+ $xxl: $space-base * 3.375 !default
97
109
 
98
110
  // SPACING VARIABLES FOR QUASAR SPACING UTILITY CLASSES
99
- $space-none : (x: 0, y: 0) !default
100
- $space-xxs : (x: ($space-x-base * .25), y: ($space-y-base * .25)) !default
101
- $space-xs : (x: ($space-x-base * .5), y: ($space-y-base * .5)) !default
102
- $space-sm : (x: ($space-x-base * .75), y: ($space-y-base * .75)) !default
103
- $space-ms : (x: ($space-x-base * 1.5), y: ($space-y-base * 1.5)) !default
104
- $space-ba : (x: ($space-x-base * 1), y: ($space-y-base * 1)) !default
105
- $space-md : (x: $space-x-base * 2, y: $space-y-base * 2) !default
106
- $space-lg : (x: ($space-x-base * 2.5), y: ($space-y-base * 2.5)) !default
107
- $space-xl : (x: ($space-x-base * 3), y: ($space-y-base * 3)) !default
108
- $space-xxl : (x: ($space-x-base * 3.375), y: ($space-y-base * 3.375)) !default
111
+ $space-none: (x: 0, y: 0) !default
112
+ $space-xxs: (x: ($space-x-base * .25), y: ($space-y-base * .25)) !default
113
+ $space-xs: (x: ($space-x-base * .5), y: ($space-y-base * .5)) !default
114
+ $space-sm: (x: ($space-x-base * .75), y: ($space-y-base * .75)) !default
115
+ $space-ms: (x: ($space-x-base * 1.5), y: ($space-y-base * 1.5)) !default
116
+ $space-ba: (x: ($space-x-base * 1), y: ($space-y-base * 1)) !default
117
+ $space-md: (x: $space-x-base * 2, y: $space-y-base * 2) !default
118
+ $space-lg: (x: ($space-x-base * 2.5), y: ($space-y-base * 2.5)) !default
119
+ $space-xl: (x: ($space-x-base * 3), y: ($space-y-base * 3)) !default
120
+ $space-xxl: (x: ($space-x-base * 3.375), y: ($space-y-base * 3.375)) !default
109
121
 
110
122
  $spaces: ('none': $space-none, 'xxs': $space-xxs, 'xs': $space-xs, 'sm': $space-sm, 'ms': $space-ms, 'ba': $space-ba, 'md': $space-md, 'lg': $space-lg, 'xl': $space-xl, 'xxl': $space-xxl) !default
111
123
 
@@ -115,7 +127,14 @@ $shadow-inner: 0px 0px 1px 1px rgb(16, 17, 20, .12) inset
115
127
  $shadow-skeumorphic-primary: 0px 1px 0.4px 0px rgba(136, 136, 138, 0.40) inset, 0px -1px 0.4px 0px rgba(16, 17, 20, 0.40) inset, 0px 4px 10px 0px rgba(16,17,20,0.00), 0px 0px 0px 1px rgb(35,75,169)
116
128
  $stroke-skeuomorphic: 1px solid rgba(255, 255, 255, 0.12)
117
129
  $shadow-2: 0px 0px 8px 0px rgba(16, 17, 20, 0.12)
118
- $accent-bg-hover: rgba(203, 42, 61, 0.15)
119
- $surface-bg-link-hover :rgba(16, 17, 20, .5)
120
- $border-radius-sm: .75rem
121
- $border-radius-xs: .5rem
130
+
131
+ // Surface variables
132
+ $surface-bg-1: $neutral-1
133
+ $surface-bg-link-hover: rgba(16, 17, 20, .5)
134
+
135
+ // Transparent variables
136
+ $accent-transparent: rgba(203, 42, 61, .20)
137
+ $primary-transparent: rgb(35, 75, 169, .20)
138
+
139
+ // Others
140
+ $bg-blue-1: #E1E9F9
@@ -111,17 +111,3 @@ $yellow-6: #EBC321 !default
111
111
  $yellow-7: #D2AB0C !default
112
112
  $yellow-8: #B49104 !default
113
113
  $yellow-9: #8C7000 !default
114
-
115
- // USSSA RED TRANSPARENT
116
- $accent-transparent: rgba(203, 42, 61, .20)
117
- $accent-bg-hover: rgba(203, 42, 61, 0.15)
118
-
119
- // USSSA BLUE TRANSPARENT
120
- $primary-transparent: rgba(35, 75, 169, .20)
121
- $primary-bg-hover: rgba(35, 75, 169, .15)
122
-
123
- //USSSA Description content color
124
- $description : $neutral-9
125
-
126
- $surface-bg-1: #FFFFFF
127
- $bg-blue-1: #E1E9F9