@usssa/component-library 1.0.0-alpha.40 → 1.0.0-alpha.42

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,6 +1,6 @@
1
1
  # Component Library
2
2
 
3
- This library provides custom UI components for USSSA applications.
3
+ **This library provides custom UI components for USSSA applications.**
4
4
 
5
5
  ## Installation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.40",
3
+ "version": "1.0.0-alpha.42",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -13,6 +13,9 @@ const props = defineProps({
13
13
  type: String,
14
14
  default: 'default',
15
15
  },
16
+ customSize: {
17
+ type: String,
18
+ },
16
19
  headingCaption: String,
17
20
  leftIcon: String,
18
21
  closeIcon: String,
@@ -34,6 +37,11 @@ const handleBackClick = () => {
34
37
  const headerClass = computed(() => {
35
38
  return props.divider ? 'divider' : ''
36
39
  })
40
+
41
+ const dialogStyle = computed(() => ({
42
+ '--customSize': props.customSize
43
+ }))
44
+
37
45
  </script>
38
46
 
39
47
  <template>
@@ -43,6 +51,7 @@ const headerClass = computed(() => {
43
51
  :position="position"
44
52
  full-width
45
53
  :class="`dialog-${size}`"
54
+ :style="dialogStyle"
46
55
  v-model="model"
47
56
  v-bind="$attrs"
48
57
  >
@@ -176,6 +185,11 @@ const headerClass = computed(() => {
176
185
  .action-wrapper
177
186
  padding: $ba $ms
178
187
 
188
+ .dialog-custom
189
+ .q-dialog__inner
190
+ padding: $ba 0
191
+ width: var(--customSize)
192
+
179
193
  .dialog-default
180
194
  .q-dialog__inner
181
195
  padding: $ba 0
@@ -0,0 +1,94 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import UBtnIcon from './UBtnIcon.vue'
4
+ import UBtnStd from './UBtnStd.vue';
5
+
6
+
7
+ const emit = defineEmits(['navigateBack'])
8
+ const props = defineProps({
9
+ isMiniState: {
10
+ type: Boolean,
11
+ required: true,
12
+ },
13
+ title: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ isSubPage: {
18
+ type: Boolean,
19
+ required: true,
20
+ },
21
+ })
22
+
23
+ // Computed property for the title text
24
+ const pageTitle = computed(() => {
25
+ return props.isSubPage ? `Back to ${props.title} ` : props.title
26
+ })
27
+
28
+ // Function to handle the back navigation
29
+ const handleClick = () => {
30
+ emit('navigateBack')
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <q-toolbar class="u-header-toolbar-container">
36
+ <!-- Expand icon to open sidebar or drawer-->
37
+ <UBtnIcon
38
+ v-if="isMiniState"
39
+ ariaLabel="Sidebar expand icon"
40
+ color="primary"
41
+ class="q-ml-xxs"
42
+ iconClass="fa-kit-duotone fa-sidebar-shrink"
43
+ size="md"
44
+ />
45
+
46
+ <section class="fit row justify-between items-center q-mx-ms">
47
+ <!-- Title container with dynamic title and optional back button -->
48
+ <UBtnStd
49
+ v-if="isSubPage"
50
+ :aria-label="pageTitle"
51
+ class="back_to_button"
52
+ color="primary"
53
+ :flat="true"
54
+ :label="pageTitle"
55
+ left-icon="fa-kit-duotone fa-circle-arrow-left"
56
+ @click="handleClick"
57
+ />
58
+ <span v-else class="q-my-none text-heading-sm">{{ pageTitle }}</span>
59
+
60
+ <!-- Action element container -->
61
+ <div class="u-header-toolbar-action-container">
62
+ <slot name="right_section"/>
63
+ </div>
64
+ </section>
65
+ </q-toolbar>
66
+ </template>
67
+
68
+ <style lang="sass">
69
+ .u-header-toolbar-container
70
+ background-color: white
71
+ width: 100%
72
+ padding: 0px
73
+ display: flex
74
+ align-items: center
75
+ align-self: stretch
76
+ padding: $sm 0
77
+
78
+ .u-header-toolbar-inner-container
79
+ width: 100%
80
+
81
+ .u-header-toolbar-title-container
82
+ display: flex
83
+ align-items: center
84
+ gap: $xs
85
+
86
+ .u-header-toolbar-action-container
87
+ display: flex
88
+ align-items: center
89
+ gap: $sm
90
+
91
+ .back_to_button
92
+ .button-label
93
+ color: $dark !important
94
+ </style>
@@ -28,6 +28,8 @@ import UMenuDropdown from './core/UMenuDropdown.vue'
28
28
  import UMenuButtonStd from './core/UMenuButtonStd.vue'
29
29
  import UBreadCrumbs from './core/UBreadCrumbs.vue'
30
30
  import UMenuDropdownAdvancedSearch from './core/UMenuDropdownAdvancedSearch.vue'
31
+ import UToolbar from './core/UToolbar.vue'
32
+
31
33
  import { useNotify } from '../composables/useNotify.js'
32
34
  import { useOverlayLoader } from '../composables/useOverlayLoader.js'
33
35
 
@@ -63,4 +65,5 @@ export {
63
65
  UToggleStd,
64
66
  UTooltip,
65
67
  UMenuDropdownAdvancedSearch,
68
+ UToolbar,
66
69
  }
@@ -114,6 +114,10 @@ const components = [
114
114
  title: 'Tab Button',
115
115
  path: '/tab-button',
116
116
  },
117
+ {
118
+ title: 'Toolbar',
119
+ path: '/toolbar',
120
+ },
117
121
  {
118
122
  title: 'Tooltip',
119
123
  path: '/tooltip',
@@ -130,10 +134,6 @@ const components = [
130
134
  title: 'Inner Loader',
131
135
  path: '/inner-loader',
132
136
  },
133
- {
134
- title: 'Typeahead Dropdown Search',
135
- path: '/typeahead-advance-search',
136
- },
137
137
  {
138
138
  title: 'Overlay Loader',
139
139
  path: '/overlay-loader',
@@ -17,11 +17,13 @@ const caption = ref('This is the caption')
17
17
  const divider = ref(true)
18
18
  const size = ref('half')
19
19
  const tab = ref('movie')
20
+ const customSize = ref('75%')
20
21
 
21
22
  const htmlContent = `<UDialogStd
22
23
  :heading="heading"
23
24
  :position="position"
24
25
  :size="size"
26
+ :customSize="customSize"
25
27
  :headingCaption="caption"
26
28
  @onBackIconClick="handleBackclick()"
27
29
  :showActionButtons="showActionButtons"
@@ -80,6 +82,7 @@ const showDialog = () => {
80
82
  :heading="heading"
81
83
  :position="position"
82
84
  :size="size"
85
+ :customSize="customSize"
83
86
  :headingCaption="caption"
84
87
  @onBackIconClick="handleBackclick()"
85
88
  :showActionButtons="showActionButtons"
@@ -158,6 +161,18 @@ const showDialog = () => {
158
161
  label="Full"
159
162
  class="q-pa-sm"
160
163
  />
164
+ <q-radio
165
+ dense
166
+ v-model="size"
167
+ val="custom"
168
+ label="Custom"
169
+ class="q-pa-sm"
170
+ />
171
+ <q-input
172
+ v-if="size === 'custom'"
173
+ label="Custom Size"
174
+ v-model="customSize"
175
+ />
161
176
  </div>
162
177
  </div>
163
178
  <div class="column">
@@ -0,0 +1,104 @@
1
+ <script setup>
2
+ import { ref } from 'vue'
3
+ import ComponentBase from './ComponentBase.vue'
4
+ import { UToolbar, UBtnIcon, UMenuButtonStd } from 'src/components'
5
+
6
+ defineOptions({
7
+ name: 'ToolbarPages',
8
+ })
9
+
10
+ const htmlContent = `<UToolbar
11
+ :isMiniState="isMiniState"
12
+ :isSubPage="false" // Dynamic
13
+ title="Team Management" // Dynamic
14
+ @navigateBack="navigateBack"
15
+ />`
16
+
17
+ const isMiniState = ref(false)
18
+ const subPage = ref('Hide')
19
+
20
+ const navigateBack = () => {
21
+ subPage.value = 'Hide'
22
+ }
23
+ </script>
24
+
25
+ <template>
26
+ <q-page class="flex flex-center">
27
+ <ComponentBase
28
+ figmaUrl="https://www.figma.com/design/2FoTrjVL4ZrTdsvB4DcSao/Components?node-id=4963-84250&node-type=canvas&t=8c9AFBd3MDUS3kt3-0"
29
+ cardWidth="90%"
30
+ >
31
+ <template v-slot:component>
32
+ <div class="shadow-2 q-mt-xs">
33
+ <!-- Toolbar component -->
34
+ <UToolbar
35
+ :isMiniState="isMiniState"
36
+ :isSubPage="subPage == 'Hide' ? false : true"
37
+ :title="subPage == 'Hide' ? 'Team Management' : 'teams'"
38
+ @navigateBack="navigateBack"
39
+ >
40
+ <!-- Contain action elements -->
41
+ <template #right_section>
42
+ <UBtnIcon
43
+ aria-label="Shopping cart icon"
44
+ class="icon-secondary-opacity toolbar-icon"
45
+ iconClass="fa-kit-duotone fa-cart-shopping"
46
+ size="md"
47
+ />
48
+ <UBtnIcon
49
+ aria-label="Notification icon"
50
+ class="icon-secondary-opacity toolbar-icon"
51
+ iconClass="fa-kit-duotone fa-bell"
52
+ size="md"
53
+ />
54
+ <UMenuButtonStd
55
+ aria-label="Menu button item"
56
+ avatarUrl="https://cdn.quasar.dev/img/avatar1.jpg"
57
+ color="neutral-2"
58
+ displayName="Henry Finkle"
59
+ states="Avatar"
60
+ />
61
+ </template>
62
+ </UToolbar>
63
+ </div>
64
+ </template>
65
+
66
+ <!-- Properties -->
67
+ <template v-slot:properties>
68
+ <div class="column">
69
+ <span class="text-grey-8 text-caption-sm">Show</span>
70
+ <div>
71
+ <q-radio
72
+ v-model="subPage"
73
+ class="q-pa-sm"
74
+ dense
75
+ label="Hide sub page"
76
+ val="Hide"
77
+ />
78
+ <q-radio v-model="subPage" dense label="Show sub page" val="Show" />
79
+ </div>
80
+ </div>
81
+ <div class="column q-mt-sm">
82
+ <span class="text-grey-8 text-caption-sm">Sidebar</span>
83
+ <div>
84
+ <q-radio
85
+ v-model="isMiniState"
86
+ class="q-pa-sm"
87
+ dense
88
+ label="Expand"
89
+ :val="false"
90
+ />
91
+ <q-radio v-model="isMiniState" dense label="Collapse" :val="true" />
92
+ </div>
93
+ </div>
94
+ </template>
95
+
96
+ <!-- Component structure -->
97
+ <template v-slot:code>
98
+ <pre>{{ htmlContent }}</pre>
99
+ </template>
100
+ </ComponentBase>
101
+ </q-page>
102
+ </template>
103
+
104
+ <style lang="sass"></style>
@@ -135,6 +135,10 @@ const routes = [
135
135
  path: 'overlay-loader',
136
136
  component: () => import('src/pages/OverlayLoader.vue'),
137
137
  },
138
+ {
139
+ path: 'toolbar',
140
+ component: () => import('src/pages/Toolbar.vue'),
141
+ },
138
142
  ],
139
143
  },
140
144