@usssa/component-library 1.0.0-alpha.1 → 1.0.0-alpha.100

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 (128) hide show
  1. package/README.md +18 -37
  2. package/package.json +17 -6
  3. package/src/assets/files.png +0 -0
  4. package/src/assets/logo.svg +19 -0
  5. package/src/assets/no-result.png +0 -0
  6. package/src/assets/quasar-logo-vertical.svg +15 -0
  7. package/src/components/ComponentLink.vue +26 -0
  8. package/src/components/core/UAvatar.vue +179 -0
  9. package/src/components/core/UAvatarGroup.vue +120 -0
  10. package/src/components/core/UBadgeStd.vue +91 -0
  11. package/src/components/core/UBannerStd.vue +142 -0
  12. package/src/components/core/UBreadCrumbs.vue +67 -0
  13. package/src/components/core/UBtnIcon.vue +158 -0
  14. package/src/components/core/UBtnStd.vue +129 -0
  15. package/src/components/core/UBtnToggle.vue +68 -0
  16. package/src/components/core/UCheckboxStd.vue +95 -0
  17. package/src/components/core/UChip.vue +251 -0
  18. package/src/components/core/UDialogStd.vue +244 -0
  19. package/src/components/core/UDrawer.vue +235 -0
  20. package/src/components/core/UInnerLoader.vue +58 -0
  21. package/src/components/core/UInputAddressLookup.vue +470 -0
  22. package/src/components/core/UInputPhoneStd.vue +299 -0
  23. package/src/components/core/UInputTextStd.vue +299 -0
  24. package/src/components/core/UInputTypeaheadAdvanceSearch.vue +59 -0
  25. package/src/components/core/UMenuButtonStd.vue +274 -0
  26. package/src/components/core/UMenuDropdown.vue +72 -0
  27. package/src/components/core/UMenuDropdownAdvancedSearch.vue +301 -0
  28. package/src/components/core/UMenuItem.vue +134 -0
  29. package/src/components/core/UMenuSearch.vue +752 -0
  30. package/src/components/core/UMultiSelectStd.vue +274 -0
  31. package/src/components/core/UPagination.vue +104 -0
  32. package/src/components/core/URadioBtn.vue +116 -0
  33. package/src/components/core/URadioStd.vue +62 -0
  34. package/src/components/core/USelectStd.vue +250 -0
  35. package/src/components/core/UTabBtnStd.vue +176 -0
  36. package/src/components/core/UTable/UTable.vue +93 -0
  37. package/src/components/core/UTable/UTd.vue +63 -0
  38. package/src/components/core/UTable/UTh.vue +48 -0
  39. package/src/components/core/UTable/UTr.vue +20 -0
  40. package/src/components/core/UTableStd.vue +1003 -0
  41. package/src/components/core/UTabsStd.vue +111 -0
  42. package/src/components/core/UToggleStd.vue +159 -0
  43. package/src/components/core/UToolbar.vue +94 -0
  44. package/src/components/core/UTooltip.vue +73 -0
  45. package/src/components/core/UUploader.vue +497 -0
  46. package/src/components/index.js +75 -0
  47. package/src/composables/useNotify.js +79 -0
  48. package/src/composables/useOverlayLoader.js +23 -0
  49. package/src/css/app.sass +159 -0
  50. package/src/css/colors.sass +101 -0
  51. package/src/css/media.sass +1 -0
  52. package/src/css/quasar.variables.sass +121 -0
  53. package/src/css/typography.sass +0 -0
  54. package/src/css/vars/colors.variables.sass +126 -0
  55. package/src/utils/data.ts +146 -0
  56. package/dist/spa/assets/Avatar.45667392.js +0 -9
  57. package/dist/spa/assets/AvatarGroup.99557443.js +0 -9
  58. package/dist/spa/assets/AvatarGroup.bb4cd03a.css +0 -1
  59. package/dist/spa/assets/BadgeStd.ee4129c5.js +0 -6
  60. package/dist/spa/assets/BannerPage.6c6a98c4.js +0 -10
  61. package/dist/spa/assets/BannerPage.d195fcac.css +0 -1
  62. package/dist/spa/assets/BtnIcon.89e50d2e.css +0 -1
  63. package/dist/spa/assets/BtnIcon.934f8c5b.js +0 -10
  64. package/dist/spa/assets/BtnStd.95fc4510.js +0 -11
  65. package/dist/spa/assets/CheckBox.3c204a4b.css +0 -1
  66. package/dist/spa/assets/CheckBox.fbc0bd1a.js +0 -7
  67. package/dist/spa/assets/Chip.49ffc857.js +0 -11
  68. package/dist/spa/assets/Chip.74acaa33.css +0 -1
  69. package/dist/spa/assets/ComponentBase.1ae19b7e.js +0 -1
  70. package/dist/spa/assets/ErrorNotFound.6cccfaee.js +0 -1
  71. package/dist/spa/assets/IndexPage.17d09b76.js +0 -1
  72. package/dist/spa/assets/InputText.19c0d7d1.css +0 -1
  73. package/dist/spa/assets/InputText.3fcd97a4.js +0 -20
  74. package/dist/spa/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff +0 -0
  75. package/dist/spa/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff +0 -0
  76. package/dist/spa/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff +0 -0
  77. package/dist/spa/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff +0 -0
  78. package/dist/spa/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff +0 -0
  79. package/dist/spa/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff +0 -0
  80. package/dist/spa/assets/MainLayout.912bb0f8.js +0 -1
  81. package/dist/spa/assets/MultiSelectStd.644b108c.js +0 -17
  82. package/dist/spa/assets/MultiSelectStd.c7af49eb.css +0 -1
  83. package/dist/spa/assets/QAvatar.5940a79e.js +0 -1
  84. package/dist/spa/assets/QCheckbox.48b43f7d.js +0 -1
  85. package/dist/spa/assets/QPage.ca395ec4.js +0 -1
  86. package/dist/spa/assets/QRadio.0a7f5e2c.js +0 -1
  87. package/dist/spa/assets/QResizeObserver.30c3566c.js +0 -1
  88. package/dist/spa/assets/QSelect.a40eb786.js +0 -1
  89. package/dist/spa/assets/QTabs.72f2507e.js +0 -1
  90. package/dist/spa/assets/QToggle.376c48be.js +0 -1
  91. package/dist/spa/assets/QTooltip.5aa8e325.js +0 -1
  92. package/dist/spa/assets/Radio.0ac35288.js +0 -7
  93. package/dist/spa/assets/Radio.aca54a89.css +0 -1
  94. package/dist/spa/assets/SelectStd.5c6891db.css +0 -1
  95. package/dist/spa/assets/SelectStd.daf1def9.js +0 -16
  96. package/dist/spa/assets/TabButtonPage.20e871dd.js +0 -7
  97. package/dist/spa/assets/TabButtonPage.36ce9f9c.css +0 -1
  98. package/dist/spa/assets/TabsPage.9b94ff39.css +0 -1
  99. package/dist/spa/assets/TabsPage.b92cccee.js +0 -9
  100. package/dist/spa/assets/TogglePage.8129b631.css +0 -1
  101. package/dist/spa/assets/TogglePage.ba6e325c.js +0 -9
  102. package/dist/spa/assets/UAvatar.dda7e478.js +0 -1
  103. package/dist/spa/assets/UAvatar.ea8daa38.css +0 -1
  104. package/dist/spa/assets/UBadgeStd.3965db9a.css +0 -1
  105. package/dist/spa/assets/UBadgeStd.e165ee05.js +0 -1
  106. package/dist/spa/assets/UBtnStd.979ec4e8.js +0 -1
  107. package/dist/spa/assets/UBtnStd.bdd4f5e5.css +0 -1
  108. package/dist/spa/assets/UTooltip.d2e04d0c.js +0 -1
  109. package/dist/spa/assets/UTooltip.efa029a7.css +0 -1
  110. package/dist/spa/assets/dom.e9d4ad51.js +0 -1
  111. package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff +0 -0
  112. package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 +0 -0
  113. package/dist/spa/assets/format.41663636.js +0 -1
  114. package/dist/spa/assets/index.43c62a18.js +0 -21
  115. package/dist/spa/assets/index.4fbd73cf.css +0 -5
  116. package/dist/spa/assets/option-sizes.10cc02d3.js +0 -1
  117. package/dist/spa/assets/render.e67ff27a.js +0 -1
  118. package/dist/spa/assets/tooltip.7c0d0774.js +0 -8
  119. package/dist/spa/assets/touch.9135741d.js +0 -1
  120. package/dist/spa/assets/use-checkbox.44a623c0.js +0 -1
  121. package/dist/spa/favicon.ico +0 -0
  122. package/dist/spa/icons/caret-down.svg +0 -5
  123. package/dist/spa/icons/circle-xmark.svg +0 -6
  124. package/dist/spa/icons/favicon-128x128.png +0 -0
  125. package/dist/spa/icons/favicon-16x16.png +0 -0
  126. package/dist/spa/icons/favicon-32x32.png +0 -0
  127. package/dist/spa/icons/favicon-96x96.png +0 -0
  128. package/dist/spa/index.html +0 -3
@@ -0,0 +1,142 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import UBtnStd from './UBtnStd.vue'
4
+
5
+ const emit = defineEmits(['primaryAction', 'secondaryAction'])
6
+
7
+ const props = defineProps({
8
+ icon: {
9
+ type: String,
10
+ default: 'fa-kit-duotone fa-circle-info',
11
+ },
12
+ message: {
13
+ type: String,
14
+ default: '',
15
+ required: true,
16
+ },
17
+ primaryActionLabel: {
18
+ type: String,
19
+ },
20
+ secondaryActionLabel: {
21
+ type: String,
22
+ },
23
+ show: {
24
+ type: Boolean,
25
+ default: false,
26
+ required: true,
27
+ },
28
+ showBorder: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ type: {
33
+ type: String,
34
+ default: 'info',
35
+ },
36
+ })
37
+
38
+ const bordered = computed(() => {
39
+ if (props.showBorder) {
40
+ return 'bordered'
41
+ }
42
+ return ''
43
+ })
44
+
45
+ const handlePrimaryActionClick = () => {
46
+ emit('primaryAction')
47
+ }
48
+
49
+ const handleSecondaryActionClick = () => {
50
+ emit('secondaryAction')
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <q-banner
56
+ v-if="show && message"
57
+ :class="`u-banner u-banner-${type} ${
58
+ !icon ? 'no-padding-label' : ''
59
+ } ${bordered}`"
60
+ inline-actions
61
+ tabindex="0"
62
+ >
63
+ <template v-slot:avatar>
64
+ <q-icon
65
+ v-if="icon"
66
+ :class="icon"
67
+ alt="Banner Info Icon"
68
+ aria-label="Banner Icon"
69
+ :color="type"
70
+ size="1.5rem"
71
+ />
72
+ </template>
73
+ <span class="text-caption-lg">{{ message }}</span>
74
+ <template v-slot:action>
75
+ <u-btn-std
76
+ v-if="primaryActionLabel"
77
+ :color="type"
78
+ :flat="false"
79
+ :label="primaryActionLabel"
80
+ size="md"
81
+ @onClick="handlePrimaryActionClick"
82
+ />
83
+ <u-btn-std
84
+ v-if="secondaryActionLabel"
85
+ class="q-ml-sm"
86
+ :color="type"
87
+ :label="secondaryActionLabel"
88
+ :outline="true"
89
+ size="md"
90
+ @onClick="handleSecondaryActionClick"
91
+ />
92
+ </template>
93
+ </q-banner>
94
+ </template>
95
+
96
+ <style lang="sass">
97
+ .u-banner
98
+ min-width: 24.563rem
99
+ padding: $sm
100
+ .q-banner__avatar
101
+ align-self: center
102
+
103
+ .q-banner__content
104
+ padding-left: $xs !important
105
+
106
+ .u-banner-positive
107
+ background: $green-1 !important
108
+ color: $green-7 !important
109
+ &.bordered
110
+ border: 1.5px solid $green-7
111
+
112
+ .u-banner-info
113
+ background: $purple-1 !important
114
+ color: $info !important
115
+ &.bordered
116
+ border: 1.5px solid $purple-7
117
+
118
+ .u-banner-warning
119
+ background: $orange-1 !important
120
+ color: $orange-7 !important
121
+ &.bordered
122
+ border: 1.5px solid $orange-7
123
+
124
+ .u-banner-accent
125
+ background: $red-1 !important
126
+ color: $red-7 !important
127
+ &.bordered
128
+ border: 1.5px solid $red-7
129
+
130
+ .u-banner-primary
131
+ background: $blue-1 !important
132
+ color: $primary !important
133
+ &.bordered
134
+ border: 1.5px solid $primary
135
+
136
+ .no-padding-label
137
+ .q-banner__content
138
+ padding-left: 0px !important
139
+
140
+ .bordered
141
+ border-radius: $xs
142
+ </style>
@@ -0,0 +1,67 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ align: {
4
+ type: String,
5
+ default: 'left',
6
+ },
7
+ links: {
8
+ type: Array,
9
+ default: () => [],
10
+ },
11
+ clickable: {
12
+ type: Boolean,
13
+ default: true,
14
+ },
15
+ showActiveRoute: {
16
+ type: Boolean,
17
+ default: true,
18
+ },
19
+ activeColor: {
20
+ type: String,
21
+ default: 'primary',
22
+ },
23
+ })
24
+ </script>
25
+ <template>
26
+ <q-breadcrumbs
27
+ gutter="none"
28
+ v-bind="$attrs"
29
+ class="u-breadcrumb"
30
+ :align="align"
31
+ :active-color="activeColor"
32
+ >
33
+ <q-breadcrumbs-el
34
+ v-for="(link, index) of links"
35
+ :key="index"
36
+ :label="link.label"
37
+ :to="link.to"
38
+ :class="`breadcrumb-label text-caption-lg ${
39
+ index === 0
40
+ ? 'q-mr-xs'
41
+ : index === links.length - 1
42
+ ? 'q-ml-xs'
43
+ : 'q-mx-xs'
44
+ } ${!showActiveRoute ? 'hide-active-route' : null} ${
45
+ !clickable ? 'non-clickable-route' : null
46
+ }`"
47
+ />
48
+ </q-breadcrumbs>
49
+ </template>
50
+ <style lang="sass">
51
+ .u-breadcrumb
52
+ .q-breadcrumbs__separator
53
+ font-size: 1rem
54
+ font-weight: 500
55
+ line-height: 1.25rem
56
+ letter-spacing: 0.03333rem
57
+
58
+ .q-router-link--active
59
+ cursor: default
60
+
61
+ .hide-active-route
62
+ color: $dark !important
63
+
64
+ .non-clickable-route
65
+ cursor: default !important
66
+ pointer-events: none
67
+ </style>
@@ -0,0 +1,158 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import UTooltip from './UTooltip.vue'
4
+ const props = defineProps({
5
+ iconClass: {
6
+ type: String,
7
+ required: true,
8
+ default: 'fa-kit-duotone fa-circle-bolt',
9
+ },
10
+ ariaLabel: {
11
+ type: String,
12
+ default: '',
13
+ },
14
+ color: {
15
+ type: String,
16
+ default: 'primary',
17
+ },
18
+ round: {
19
+ type: Boolean,
20
+ default: true,
21
+ },
22
+ size: {
23
+ type: String,
24
+ default: 'md',
25
+ validator: (val) => ['sm', 'md', 'lg'].includes(val),
26
+ },
27
+ tooltip: {
28
+ type: String,
29
+ default: '',
30
+ },
31
+ tooltipPosition: {
32
+ type: String,
33
+ default: 'top',
34
+ },
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
+ })
48
+
49
+ const emit = defineEmits(['onClick'])
50
+
51
+ const handleClick = () => {
52
+ return emit('onClick')
53
+ }
54
+
55
+ const iconSize = computed(() => {
56
+ if (props.size === 'sm') {
57
+ return 'xs'
58
+ }
59
+ if (props.size === 'md') {
60
+ return 'sm'
61
+ }
62
+ if (props.size === 'lg') {
63
+ return 'md'
64
+ }
65
+
66
+ return props.size
67
+ })
68
+ const iconColor = computed(() => {
69
+ if (props.color === 'neutral') {
70
+ return 'neutral-9'
71
+ }
72
+ return props.color
73
+ })
74
+
75
+ const btnClass = computed(() => {
76
+ if (props.color === 'neutral') {
77
+ return 'neutral-4'
78
+ }
79
+ return props.color
80
+ })
81
+ </script>
82
+
83
+ <template>
84
+ <q-btn
85
+ @click="handleClick"
86
+ flat="flat"
87
+ :round="round"
88
+ :aria-label="ariaLabel"
89
+ class="u-btn-icon"
90
+ :class="`size-${size} ${btnClass}`"
91
+ >
92
+ <template #default>
93
+ <q-icon
94
+ :color="iconColor"
95
+ :aria-hidden="true"
96
+ :class="`${iconClass} size-${size}`"
97
+ :size="iconSize"
98
+ />
99
+
100
+ <UTooltip
101
+ v-if="tooltip"
102
+ :description="tooltip"
103
+ :anchor="anchor"
104
+ :self="self"
105
+ :offset="offset"
106
+ />
107
+ <slot name="menu" />
108
+ </template>
109
+ </q-btn>
110
+ </template>
111
+
112
+ <style lang="sass">
113
+ .u-btn-icon
114
+ &.neutral-4
115
+ color: $neutral-4
116
+
117
+ &.transparent
118
+ color: $neutral-1
119
+
120
+ &.size-sm
121
+ height: $md
122
+ width: $md
123
+
124
+ &.size-md
125
+ height: $lg
126
+ width: $lg
127
+
128
+ &.size-lg
129
+ height: $xl
130
+ width: $xl
131
+
132
+ .q-icon
133
+ &.text-transparent
134
+ color: $neutral-1 !important
135
+
136
+ &.size-sm
137
+ height: $ba
138
+ width: $ba
139
+
140
+ &.size-md
141
+ height: $ms
142
+ width: $ms
143
+
144
+ &.size-lg
145
+ height: $md
146
+ width: $md
147
+ &.neutral-9
148
+ color: $neutral-9
149
+
150
+ &.accent:hover
151
+ background: $accent-bg-hover
152
+
153
+ .icon-tooltip
154
+ background: $dark
155
+ border-radius: $xxs
156
+ padding: $xs $sm
157
+ box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
158
+ </style>
@@ -0,0 +1,129 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+
4
+ const props = defineProps({
5
+ color: {
6
+ type: String,
7
+ default: 'neutral-7',
8
+ },
9
+ disable: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
13
+ flat: {
14
+ type: Boolean,
15
+ default: false,
16
+ },
17
+ label: {
18
+ type: String,
19
+ default: 'Button',
20
+ },
21
+ leftIcon: {
22
+ type: String,
23
+ },
24
+ rightIcon: {
25
+ type: String,
26
+ },
27
+ outline: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ size: {
32
+ type: String,
33
+ default: 'md',
34
+ validator: (val) => ['sm', 'md', 'lg'].includes(val),
35
+ },
36
+ fullWidth: {
37
+ type: Boolean,
38
+ default: false,
39
+ },
40
+ })
41
+
42
+ const emit = defineEmits(['onClick'])
43
+
44
+ const handleClick = () => {
45
+ return emit('onClick')
46
+ }
47
+
48
+ const textClass = computed(() => {
49
+ if (props.color === 'neutral') {
50
+ return 'text-neutral-9'
51
+ }
52
+ return ''
53
+ })
54
+
55
+ const isFullWidth = computed(() => {
56
+ if (props.fullWidth === true) {
57
+ return 'full-width'
58
+ }
59
+ return ''
60
+ })
61
+ </script>
62
+
63
+ <template>
64
+ <q-btn
65
+ class="u-btn q-py-none"
66
+ :class="`size-${size} ${textClass} focus-${color} ${isFullWidth}`"
67
+ :color="color"
68
+ :disable="disable"
69
+ :unelevated="!outline"
70
+ :outline="outline"
71
+ no-caps
72
+ :flat="flat"
73
+ @click="handleClick"
74
+ >
75
+ <template #default>
76
+ <slot name="default">
77
+ <div class="row items-center no-wrap">
78
+ <q-icon
79
+ v-if="leftIcon"
80
+ left
81
+ :class="leftIcon"
82
+ class="q-mr-xs"
83
+ size="1rem"
84
+ />
85
+
86
+ <div class="text-center text-caption-md button-label">
87
+ {{ label }}
88
+ </div>
89
+ <q-icon
90
+ v-if="rightIcon"
91
+ right
92
+ :class="rightIcon"
93
+ class="q-ml-xs"
94
+ size="1rem"
95
+ />
96
+ </div>
97
+ </slot>
98
+
99
+ <slot name="tooltip" />
100
+ <slot name="menu" />
101
+ </template>
102
+ </q-btn>
103
+ </template>
104
+
105
+ <style lang="sass">
106
+ .u-btn
107
+ border-radius: $xs
108
+ min-width: 5.5rem !important
109
+
110
+ &.bg-neutral
111
+ background-color: $neutral-3
112
+
113
+ &.size-sm
114
+ min-height: $md
115
+ padding: 0 $sm !important
116
+
117
+ &.size-md
118
+ min-height: $lg
119
+ padding: 0 $ba !important
120
+
121
+
122
+ &.size-lg
123
+ min-height: $xl
124
+ padding: 0 $ba !important
125
+
126
+
127
+ .button-label
128
+ word-break: break-all
129
+ </style>
@@ -0,0 +1,68 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ options: {
4
+ type: Array,
5
+ require: true,
6
+ },
7
+ })
8
+ const model = defineModel()
9
+ </script>
10
+
11
+ <template>
12
+ <q-btn-toggle
13
+ class="u-btn-toggle"
14
+ v-model="model"
15
+ size="md"
16
+ text-color="dark"
17
+ unelevated
18
+ color="white"
19
+ no-caps
20
+ spread
21
+ toggle-color="primary"
22
+ :options="options"
23
+ >
24
+ <template
25
+ v-for="(option, index) in options"
26
+ v-slot:[option.slot]
27
+ :key="option"
28
+ >
29
+ <div class="row items-center no-wrap slot">
30
+ <q-icon
31
+ :class="options[index].iconClass"
32
+ v-if="options[index].iconClass"
33
+ />
34
+ <div class="text-center text-caption-md">
35
+ {{ options[index].name }}
36
+ </div>
37
+ </div>
38
+ </template>
39
+ </q-btn-toggle>
40
+ </template>
41
+
42
+ <style lang="sass">
43
+ .slot
44
+ gap: $xxs
45
+
46
+ .u-btn-toggle
47
+ &.q-btn-toggle
48
+ border-radius: $xs
49
+ padding: $xxs
50
+ box-shadow: $shadow-inner
51
+
52
+ .q-btn-item
53
+ .q-btn__content
54
+ font-size: 0.875rem
55
+ line-height: 1.25rem
56
+ letter-spacing: .03333rem
57
+ font-weight: 500
58
+
59
+ .q-btn-item
60
+ border-radius: $xxs !important
61
+ padding: $xs $sm !important
62
+ &[aria-pressed="true"]
63
+ &::before
64
+ color: $neutral-1
65
+ box-shadow: $shadow-skeumorphic-primary
66
+ border: $stroke-skeuomorphic
67
+ z-index: 2
68
+ </style>
@@ -0,0 +1,95 @@
1
+ <script setup>
2
+ import { onMounted } from 'vue'
3
+
4
+ const props = defineProps({
5
+ label: {
6
+ type: String,
7
+ default: '',
8
+ },
9
+ name: {
10
+ type: String,
11
+ default: '',
12
+ },
13
+ disabled: {
14
+ type: Boolean,
15
+ default: false,
16
+ },
17
+ showLabel: {
18
+ type: Boolean,
19
+ default: true,
20
+ },
21
+ id: {
22
+ type: [String, Number],
23
+ default: 'u-checkbox',
24
+ required: true, // it is required for to match accessibility crieteria
25
+ },
26
+ indeterminate: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ })
31
+
32
+ const isChecked = defineModel({ default: false, type: Boolean })
33
+
34
+ onMounted(() => {
35
+ const checkboxElement = document.getElementById(`${props.id}`)
36
+ if (checkboxElement) {
37
+ const inputElement = checkboxElement.querySelector('input')
38
+ inputElement.id = `${props.id}`
39
+ } else {
40
+ // need to add if element is not found
41
+ }
42
+ })
43
+ </script>
44
+
45
+ <template>
46
+ <label style="display: none" :for="`${id}`">Checkbox </label>
47
+ <q-checkbox
48
+ :id="`${id}`"
49
+ class="u-checkbox text-caption-lg"
50
+ :name="name"
51
+ v-model="isChecked"
52
+ :disable="disabled"
53
+ :label="showLabel ? label : ''"
54
+ size="md"
55
+ keep-color
56
+ color="primary"
57
+ :toggle-indeterminate="indeterminate"
58
+ v-bind="$attrs"
59
+ />
60
+ </template>
61
+
62
+ <style lang="sass">
63
+ .u-checkbox
64
+ color: $primary
65
+ font-weight: 500
66
+
67
+ .q-checkbox__inner
68
+ display: flex
69
+ justify-content: center
70
+ align-items: center
71
+ height: $ms
72
+ width: $ms
73
+
74
+ .q-checkbox__inner:before
75
+ top: -9px !important
76
+ left: -2px !important
77
+ width: 2.7rem
78
+ height: 2.7rem
79
+ border-radius: 10rem !important
80
+
81
+ .q-checkbox__bg
82
+ border: 0.125rem solid $primary
83
+ border-radius: $xxs
84
+ height: $ms
85
+ width: $ms
86
+ position: static
87
+ display: flex
88
+ justify-content: center
89
+ align-items: center
90
+
91
+ .q-checkbox__svg
92
+ position: static
93
+ height: 1rem !important
94
+ width: 1rem !important
95
+ </style>