@usssa/component-library 1.0.0-alpha.132 → 1.0.0-alpha.133

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.132
1
+ # Component Library v1.0.0-alpha.133
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.132",
3
+ "version": "1.0.0-alpha.133",
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,10 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
+ import { useScreenType } from '../../composables/useScreenType'
3
4
  import URadioStd from './URadioStd.vue'
4
5
 
5
6
  const emit = defineEmits(['onClick', 'onButtonClick'])
6
-
7
7
  const model = defineModel()
8
-
9
8
  const props = defineProps({
10
9
  altText: {
11
10
  type: String,
@@ -46,6 +45,8 @@ const props = defineProps({
46
45
  },
47
46
  })
48
47
 
48
+ const $screen = useScreenType()
49
+
49
50
  const activeClass = computed(() => {
50
51
  if (model.value === props.value) {
51
52
  return 'active'
@@ -53,6 +54,8 @@ const activeClass = computed(() => {
53
54
  return ''
54
55
  })
55
56
 
57
+ const isMobile = computed(() => $screen.value.isMobile)
58
+
56
59
  const handleChange = () => {
57
60
  model.value = props.value
58
61
  }
@@ -60,33 +63,44 @@ const handleChange = () => {
60
63
 
61
64
  <template>
62
65
  <q-btn
63
- :class="`u-radio-btn ${activeClass}`"
66
+ :class="`u-radio-btn ${activeClass}${isMobile ? ' full-width' : ''}`"
64
67
  :dataTestId="dataTestId"
65
68
  flat
66
69
  @click="handleChange"
67
70
  >
68
- <div class="radio-btn-content flex items-center">
69
- <URadioStd v-model="model" :aria-label="label" :id="id" :value="value" />
70
- <div class="button-text">
71
- <div class="text-caption-lg">{{ label }}</div>
72
- <div class="description-text text-body-sm">{{ description }}</div>
71
+ <div class="radio-btn-content flex items-center justify-between full-width">
72
+ <div
73
+ class="flex items-center justify-center radio-btn-text-wrapper no-wrap"
74
+ >
75
+ <URadioStd
76
+ v-model="model"
77
+ :aria-label="label"
78
+ :id="id"
79
+ :value="value"
80
+ />
81
+ <div class="button-text">
82
+ <div class="text-caption-lg">{{ label }}</div>
83
+ <div class="description-text text-body-sm">{{ description }}</div>
84
+ </div>
73
85
  </div>
74
86
 
75
- <img
76
- v-if="image"
77
- class="radio-btn-img"
78
- :alt="altText"
79
- :aria-label="imgAriaLabel"
80
- size="1.5rem"
81
- :src="image"
82
- />
83
- <q-icon
84
- v-if="iconClass"
85
- :class="iconClass"
86
- :aria-label="imgAriaLabel"
87
- :color="iconColor"
88
- size="1.5rem"
89
- />
87
+ <div class="flex items-center">
88
+ <img
89
+ v-if="image"
90
+ class="radio-btn-img"
91
+ :alt="altText"
92
+ :aria-label="imgAriaLabel"
93
+ size="1.5rem"
94
+ :src="image"
95
+ />
96
+ <q-icon
97
+ v-if="iconClass"
98
+ :class="iconClass"
99
+ :aria-label="imgAriaLabel"
100
+ :color="iconColor"
101
+ size="1.5rem"
102
+ />
103
+ </div>
90
104
  </div>
91
105
  </q-btn>
92
106
  </template>
@@ -123,4 +137,7 @@ const handleChange = () => {
123
137
 
124
138
  .q-radio .q-radio__inner
125
139
  color: $primary !important
140
+
141
+ .radio-btn-text-wrapper
142
+ gap: $xs
126
143
  </style>