@usssa/component-library 1.0.0-alpha.27 → 1.0.0-alpha.271

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 (105) hide show
  1. package/README.md +8 -5
  2. package/package.json +30 -8
  3. package/src/assets/VS.svg +5 -0
  4. package/src/assets/fonts/CorneroRegular.woff +0 -0
  5. package/src/assets/fonts/CorneroRegular.woff2 +0 -0
  6. package/src/assets/logo.svg +19 -0
  7. package/src/assets/no-result.svg +25 -0
  8. package/src/assets/upload-illustration.svg +48 -0
  9. package/src/components/core/UAccordionSelect.vue +237 -0
  10. package/src/components/core/UAvatar.vue +90 -26
  11. package/src/components/core/UAvatarGroup.vue +62 -52
  12. package/src/components/core/UBadgeStd.vue +6 -1
  13. package/src/components/core/UBannerStd.vue +100 -31
  14. package/src/components/core/UBracket.vue +2181 -0
  15. package/src/components/core/UBreadCrumbs.vue +171 -0
  16. package/src/components/core/UBtnIcon.vue +106 -53
  17. package/src/components/core/UBtnStd.vue +38 -31
  18. package/src/components/core/UBtnToggle.vue +11 -6
  19. package/src/components/core/UCheckboxStd.vue +26 -20
  20. package/src/components/core/UChip.vue +107 -58
  21. package/src/components/core/UDate.vue +627 -0
  22. package/src/components/core/UDialogStd.vue +456 -58
  23. package/src/components/core/UDrawer/UDrawer.vue +479 -0
  24. package/src/components/core/UDrawer/UDrawerMenuItem.vue +130 -0
  25. package/src/components/core/UEventCard.vue +463 -0
  26. package/src/components/core/UExpansionStd.vue +380 -0
  27. package/src/components/core/UExpansionTableStd.vue +311 -0
  28. package/src/components/core/UFilter.vue +99 -0
  29. package/src/components/core/UGameObject.vue +478 -0
  30. package/src/components/core/UInnerLoader.vue +69 -0
  31. package/src/components/core/UInputAddressLookup.vue +535 -0
  32. package/src/components/core/UInputPhoneStd.vue +74 -67
  33. package/src/components/core/UInputTextStd.vue +99 -64
  34. package/src/components/core/UInputTypeahead.vue +44 -0
  35. package/src/components/core/UInputTypeaheadAdvanceSearch.vue +134 -0
  36. package/src/components/core/UMatchup.vue +404 -0
  37. package/src/components/core/UMenuButtonStd.vue +280 -0
  38. package/src/components/core/UMenuDropdown.vue +38 -33
  39. package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
  40. package/src/components/core/UMenuItem.vue +226 -0
  41. package/src/components/core/UMenuSearch.vue +73 -0
  42. package/src/components/core/UModal.vue +660 -0
  43. package/src/components/core/UMultiSelectStd.vue +521 -63
  44. package/src/components/core/UPagination.vue +76 -24
  45. package/src/components/core/URadioBtn.vue +66 -43
  46. package/src/components/core/URadioStd.vue +23 -14
  47. package/src/components/core/USelectStd.vue +441 -84
  48. package/src/components/core/USheet.vue +349 -0
  49. package/src/components/core/UStepper/UProgress.vue +157 -0
  50. package/src/components/core/UStepper/UStepper.vue +214 -0
  51. package/src/components/core/UTabBtnStd.vue +36 -22
  52. package/src/components/core/UTable/UTable.vue +2269 -57
  53. package/src/components/core/UTableStd.vue +1436 -286
  54. package/src/components/core/UTabsStd.vue +53 -23
  55. package/src/components/core/UToggleStd.vue +18 -13
  56. package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
  57. package/src/components/core/UToolbar/UToolbar.vue +226 -0
  58. package/src/components/core/UTooltip.vue +32 -10
  59. package/src/components/core/UTypeahead.vue +890 -0
  60. package/src/components/core/UUploader.vue +757 -0
  61. package/src/components/core/UVenueCard.vue +221 -0
  62. package/src/components/index.js +83 -30
  63. package/src/composables/useNotify.js +16 -16
  64. package/src/composables/useOverlayLoader.js +23 -0
  65. package/src/composables/useScreenType.js +30 -0
  66. package/src/css/app.sass +69 -36
  67. package/src/css/colors.sass +2 -0
  68. package/src/css/quasar.variables.sass +102 -70
  69. package/src/css/vars/colors.variables.sass +28 -41
  70. package/src/utils/bracket.json +1538 -0
  71. package/src/utils/data.ts +179 -0
  72. package/src/App.vue +0 -9
  73. package/src/boot/.gitkeep +0 -0
  74. package/src/components/core/UMenutem.vue +0 -130
  75. package/src/layouts/MainLayout.vue +0 -145
  76. package/src/pages/Avatar.vue +0 -77
  77. package/src/pages/AvatarGroup.vue +0 -139
  78. package/src/pages/BadgeStd.vue +0 -83
  79. package/src/pages/BannerPage.vue +0 -76
  80. package/src/pages/BtnIcon.vue +0 -120
  81. package/src/pages/BtnStd.vue +0 -126
  82. package/src/pages/BtnToggle.vue +0 -131
  83. package/src/pages/CheckBox.vue +0 -62
  84. package/src/pages/Chip.vue +0 -108
  85. package/src/pages/ComponentBase.vue +0 -54
  86. package/src/pages/Dialog.vue +0 -206
  87. package/src/pages/ErrorNotFound.vue +0 -11
  88. package/src/pages/IndexPage.vue +0 -11
  89. package/src/pages/InputPhone.vue +0 -152
  90. package/src/pages/InputText.vue +0 -140
  91. package/src/pages/MenuDropdown.vue +0 -79
  92. package/src/pages/MenuItem.vue +0 -68
  93. package/src/pages/MultiSelectStd.vue +0 -174
  94. package/src/pages/NotifyPage.vue +0 -109
  95. package/src/pages/Pagination.vue +0 -71
  96. package/src/pages/Radio.vue +0 -80
  97. package/src/pages/RadioBtn.vue +0 -104
  98. package/src/pages/SelectStd.vue +0 -160
  99. package/src/pages/TabButtonPage.vue +0 -126
  100. package/src/pages/TablePage.vue +0 -375
  101. package/src/pages/TabsPage.vue +0 -261
  102. package/src/pages/TogglePage.vue +0 -58
  103. package/src/pages/TooltipPage.vue +0 -125
  104. package/src/router/index.js +0 -34
  105. package/src/router/routes.js +0 -121
@@ -1,14 +1,28 @@
1
1
  <script setup>
2
- import { ref, watch } from 'vue'
2
+ import { computed, ref, watch } from 'vue'
3
+ import { useScreenType } from '../../composables/useScreenType'
3
4
  import USelectStd from './USelectStd.vue'
5
+
6
+ const emit = defineEmits(['update:modelValue', 'onRowChange', 'onPageChange'])
7
+
8
+ const model = defineModel()
9
+
4
10
  const props = defineProps({
5
- modelValue: {
6
- type: Number,
7
- default: 1,
11
+ applyLabel: {
12
+ type: String,
13
+ default: 'Apply',
8
14
  },
9
- rowPerPage: {
10
- type: Number,
11
- default: 5,
15
+ cancelLabel: {
16
+ type: String,
17
+ default: 'Cancel',
18
+ },
19
+ closeIconLabel: {
20
+ type: String,
21
+ default: 'Close icon'
22
+ },
23
+ dataTestId: {
24
+ type: String,
25
+ default: 'pagination-std',
12
26
  },
13
27
  maxPageLink: {
14
28
  //Maximum number of page links to display at a time
@@ -17,7 +31,11 @@ const props = defineProps({
17
31
  },
18
32
  maxPages: {
19
33
  type: Number,
20
- default: 10,
34
+ default: 1,
35
+ },
36
+ modelValue: {
37
+ type: Number,
38
+ default: 1,
21
39
  },
22
40
  perPageOptions: {
23
41
  type: Array,
@@ -28,45 +46,78 @@ const props = defineProps({
28
46
  { label: '20 / per page', value: 20 },
29
47
  ],
30
48
  },
49
+ rowPerPage: {
50
+ type: Number,
51
+ default: 5,
52
+ },
53
+ sheetLabel: {
54
+ type: String,
55
+ default: 'Selections Per Page',
56
+ },
31
57
  })
32
- const emit = defineEmits(['update:modelValue', 'onRowChange', 'onPageChange'])
33
- const rowPerPage = ref(props.rowPerPage)
58
+
59
+ const $screen = useScreenType()
60
+
61
+ // refs
34
62
  const currentPage = ref(props.modelValue)
63
+ const rowPerPage = ref(props.rowPerPage)
35
64
 
36
- watch(currentPage, (newValue) => {
37
- emit('update:modelValue', newValue)
38
- emit('onPageChange', newValue)
65
+ const perPageOptionsList = computed(() => {
66
+ if ($screen.value.isMobile) {
67
+ return [...props.perPageOptions].map((option) => ({
68
+ ...option,
69
+ label: option.label.split(' ')[0],
70
+ }))
71
+ }
72
+ return props.perPageOptions
39
73
  })
74
+
75
+ // custom functions
40
76
  const onPageChange = (newPage) => {
41
77
  currentPage.value = newPage
42
78
  }
43
79
  const onRowChange = (newRowPerPage) => {
44
80
  emit('onRowChange', newRowPerPage)
45
81
  }
82
+
83
+ // watcher function
84
+ watch(currentPage, (newValue) => {
85
+ emit('update:modelValue', newValue)
86
+ emit('onPageChange', newValue)
87
+ })
46
88
  </script>
47
89
 
48
90
  <template>
49
- <div class="row u-pagination-container">
91
+ <div
92
+ :class="`row u-pagination-container no-wrap items-center ${
93
+ $screen.isMobile ? 'justify-between' : 'justify-end'
94
+ }`"
95
+ >
50
96
  <q-pagination
97
+ v-model="model"
51
98
  class="u-pagination"
52
- v-model="currentPage"
99
+ active-color="primary"
100
+ boundary-numbers
101
+ color="dark"
102
+ :dataTestId="dataTestId"
53
103
  direction-links
54
104
  flat
55
- color="dark"
56
- active-color="primary"
105
+ gutter="sm"
57
106
  :max="maxPages"
58
107
  :max-pages="maxPageLink"
59
- boundary-numbers
60
108
  @update:model-value="onPageChange"
61
- gutter="sm"
62
109
  />
63
110
 
64
111
  <USelectStd
65
- class="q-gutter-x-sm text-body-sm perpage-dropdown"
66
112
  v-model="rowPerPage"
67
- color="primary"
68
- :options="perPageOptions"
113
+ class="q-gutter-x-sm text-body-sm perpage-dropdown"
69
114
  popupClass="pagination-dropdown"
115
+ :apply-label="applyLabel"
116
+ :cancel-label="cancelLabel"
117
+ :close-icon-label="closeIconLabel"
118
+ color="primary"
119
+ :options="perPageOptionsList"
120
+ :sheetLabel="sheetLabel"
70
121
  @update:model-value="onRowChange"
71
122
  />
72
123
  </div>
@@ -77,12 +128,13 @@ const onRowChange = (newRowPerPage) => {
77
128
  width: auto !important
78
129
 
79
130
  .perpage-dropdown
80
- width: 9.375rem
81
131
  .q-field__marginal
82
132
  padding-left: $xs
133
+ .q-field--outlined
134
+ margin-top: 0 !important
83
135
  .q-field--outlined .q-field__control
84
136
  display: inline-flex
85
- width: 8.75rem
137
+ max-width: 8.75rem
86
138
 
87
139
  .u-pagination
88
140
  .q-icon
@@ -1,23 +1,32 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import URadioStd from './URadioStd.vue'
4
+ import { useScreenType } from '../../composables/useScreenType'
5
+
6
+ const emit = defineEmits(['onClick', 'onButtonClick'])
7
+ const model = defineModel()
4
8
  const props = defineProps({
5
- iconClass: {
9
+ altText: {
6
10
  type: String,
7
11
  default: '',
8
12
  },
9
- label: {
13
+ dataTestId: {
10
14
  type: String,
11
- default: '',
15
+ default: 'radio-btn-std',
12
16
  },
13
17
  description: {
14
18
  type: String,
15
19
  default: '',
16
20
  },
17
- value: {
21
+ iconClass: {
18
22
  type: String,
19
23
  default: '',
20
24
  },
25
+ iconColor: {
26
+ type: String,
27
+ default: 'primary',
28
+ },
29
+ id: { String },
21
30
  image: {
22
31
  type: String,
23
32
  default: '',
@@ -26,24 +35,17 @@ const props = defineProps({
26
35
  type: String,
27
36
  default: '',
28
37
  },
29
- altText: {
38
+ label: {
30
39
  type: String,
31
40
  default: '',
32
41
  },
33
- iconColor: {
42
+ value: {
34
43
  type: String,
35
- default: 'primary',
44
+ default: '',
36
45
  },
37
-
38
- id: { String },
39
46
  })
40
47
 
41
- const emit = defineEmits(['onClick', 'onButtonClick'])
42
- const model = defineModel()
43
-
44
- const handleChange = () => {
45
- model.value = props.value
46
- }
48
+ const $screen = useScreenType()
47
49
 
48
50
  const activeClass = computed(() => {
49
51
  if (model.value === props.value) {
@@ -51,32 +53,56 @@ const activeClass = computed(() => {
51
53
  }
52
54
  return ''
53
55
  })
56
+
57
+ const isMobile = computed(() => $screen.value.isMobile)
58
+
59
+ const handleChange = () => {
60
+ model.value = props.value
61
+ }
54
62
  </script>
55
63
 
56
64
  <template>
57
- <q-btn flat class="u-radio-btn" @click="handleChange" :class="activeClass">
58
- <div class="radio-btn-content flex items-center">
59
- <URadioStd v-model="model" :value="value" :id="id" :aria-label="label" />
60
- <div class="button-text">
61
- <div class="text-caption-lg">{{ label }}</div>
62
- <div class="description-text text-body-sm">{{ description }}</div>
65
+ <q-btn
66
+ :class="`u-radio-btn ${activeClass}${isMobile ? ' full-width' : ''}`"
67
+ :dataTestId="dataTestId"
68
+ flat
69
+ @click="handleChange"
70
+ >
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 q-ml-xs">
82
+ <div class="text-caption-lg">{{ label }}</div>
83
+ <div class="description-text text-body-sm">
84
+ {{ description }}
85
+ </div>
86
+ </div>
63
87
  </div>
64
88
 
65
- <img
66
- class="radio-btn-img"
67
- v-if="image"
68
- size="1.5rem"
69
- :src="image"
70
- :alt="altText"
71
- :aria-label="imgAriaLabel"
72
- />
73
- <q-icon
74
- v-if="iconClass"
75
- :aria-label="imgAriaLabel"
76
- :color="iconColor"
77
- size="1.5rem"
78
- :class="iconClass"
79
- />
89
+ <div class="flex items-center">
90
+ <img
91
+ v-if="image"
92
+ class="radio-btn-img"
93
+ :alt="altText"
94
+ :aria-label="imgAriaLabel"
95
+ size="1.5rem"
96
+ :src="image"
97
+ />
98
+ <q-icon
99
+ v-if="iconClass"
100
+ :class="iconClass"
101
+ :aria-label="imgAriaLabel"
102
+ :color="iconColor"
103
+ size="1.5rem"
104
+ />
105
+ </div>
80
106
  </div>
81
107
  </q-btn>
82
108
  </template>
@@ -84,31 +110,28 @@ const activeClass = computed(() => {
84
110
  <style lang="sass">
85
111
  .u-radio-btn
86
112
  padding: $xs $sm
87
- border: 2px solid $neutral-4
113
+ border: 0.125rem solid $neutral-4
88
114
  border-radius: $xs
89
115
  min-height: $lg
90
116
  .q-radio__label
91
117
  padding-left: 0 !important
92
118
 
93
- .radio-btn-content
94
- gap: $xs
95
-
96
119
  .button-text
97
120
  text-align: left !important
98
- min-width: 6.063rem
99
121
 
100
122
  .description-text
101
123
  color: $description
124
+ white-space: nowrap
102
125
 
103
126
  .radio-btn-img
104
127
  width: $ms
105
128
  height: $ms
106
129
 
107
130
  .active
108
- border: 2px solid $primary
131
+ border: 0.125rem solid $primary
109
132
 
110
133
  .u-radio-btn:hover
111
- border: 2px solid $primary
134
+ border: 0.125rem solid $primary
112
135
  background-color: $primary-transparent
113
136
 
114
137
  .q-radio .q-radio__inner
@@ -1,15 +1,15 @@
1
1
  <script setup>
2
2
  import { onMounted } from 'vue'
3
3
 
4
+ const radioValue = defineModel()
5
+
4
6
  const props = defineProps({
5
- label: {
6
- type: String,
7
- },
8
7
  ariaLabel: {
9
8
  type: String,
10
9
  },
11
- value: {
10
+ dataTestId: {
12
11
  type: String,
12
+ default: 'radio-std',
13
13
  },
14
14
  disable: {
15
15
  type: Boolean,
@@ -20,34 +20,43 @@ const props = defineProps({
20
20
  default: 'u-radio',
21
21
  required: true, // it is required for to match accessibility crieteria
22
22
  },
23
+ label: {
24
+ type: String,
25
+ },
26
+ value: {
27
+ type: String,
28
+ },
23
29
  })
24
30
  onMounted(() => {
25
31
  const radioElement = document.getElementById(props.id)
26
32
  if (radioElement) {
27
33
  const inputElement = radioElement.querySelector('input')
28
- inputElement.id = props.id
34
+ if (inputElement) {
35
+ inputElement.id = props.id
36
+ }
29
37
  }
30
38
  })
31
-
32
- const radioValue = defineModel()
33
39
  </script>
34
40
 
35
41
  <template>
36
- <label class="hidden" :for="id" v-if="label || ariaLabel">{{
37
- label || ariaLabel
38
- }}</label>
42
+ <label v-if="label || ariaLabel" class="hidden" :for="id">
43
+ {{ label || ariaLabel }}
44
+ </label>
39
45
  <q-radio
46
+ v-bind="$attrs"
40
47
  v-model="radioValue"
48
+ :aria-label="ariaLabel"
41
49
  class="u-radio"
42
- :val="value"
43
50
  color="primary"
44
- keep-color
51
+ :dataTestId="dataTestId"
45
52
  dense
46
- size="3rem"
47
53
  :disable="disable"
48
54
  :id="id"
55
+ keep-color
56
+ size="3rem"
57
+ :val="value"
49
58
  >
50
- <div class="text-center text-caption-lg radio-label" v-if="label">
59
+ <div v-if="label" class="text-center text-caption-lg radio-label">
51
60
  {{ label }}
52
61
  </div>
53
62
  </q-radio>