@saasmakers/ui 2.0.37 → 2.0.39
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/app/components/bases/BaseEmoji.vue +3 -2
- package/app/components/fields/FieldSelect.vue +15 -11
- package/app/components/layout/LayoutBottomSheet.vue +2 -2
- package/app/components/layout/LayoutModal.vue +2 -2
- package/app/types/fields.d.ts +2 -1
- package/app/types/layout.d.ts +2 -2
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ function onKeyDown(event: KeyboardEvent) {
|
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
31
|
<span
|
|
32
|
-
class="flex items-center justify-center transition"
|
|
32
|
+
class="flex select-none items-center justify-center transition"
|
|
33
33
|
:class="{
|
|
34
34
|
'relative': legend,
|
|
35
35
|
'border base-border': hasBox,
|
|
@@ -59,7 +59,8 @@ function onKeyDown(event: KeyboardEvent) {
|
|
|
59
59
|
>
|
|
60
60
|
<img
|
|
61
61
|
v-if="emoji"
|
|
62
|
-
class="pointer-events-none block"
|
|
62
|
+
class="pointer-events-none block select-none"
|
|
63
|
+
draggable="false"
|
|
63
64
|
:class="{
|
|
64
65
|
'h-2.5 w-2.5': size === '3xs',
|
|
65
66
|
'h-3 w-3': size === '2xs',
|
|
@@ -10,8 +10,8 @@ const props = withDefaults(defineProps<Omit<FieldSelect, 'modelValue'>>(), {
|
|
|
10
10
|
description: '',
|
|
11
11
|
direction: 'bottom',
|
|
12
12
|
disabled: false,
|
|
13
|
-
hideError: false,
|
|
14
13
|
hideCaret: false,
|
|
14
|
+
hideError: false,
|
|
15
15
|
hideLabel: false,
|
|
16
16
|
label: '',
|
|
17
17
|
labelIcon: undefined,
|
|
@@ -24,6 +24,7 @@ const props = withDefaults(defineProps<Omit<FieldSelect, 'modelValue'>>(), {
|
|
|
24
24
|
searchable: false,
|
|
25
25
|
searchPlaceholder: '',
|
|
26
26
|
size: 'base',
|
|
27
|
+
square: false,
|
|
27
28
|
validation: undefined,
|
|
28
29
|
})
|
|
29
30
|
|
|
@@ -190,7 +191,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
190
191
|
<template>
|
|
191
192
|
<div
|
|
192
193
|
class="flex flex-col"
|
|
193
|
-
:class="{ 'w-fit': hideLabel }"
|
|
194
|
+
:class="{ 'w-fit': hideLabel || square }"
|
|
194
195
|
>
|
|
195
196
|
<FieldLabel
|
|
196
197
|
v-if="label"
|
|
@@ -210,14 +211,14 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
210
211
|
:class="{
|
|
211
212
|
'field-disabled': disabled,
|
|
212
213
|
'cursor-pointer': !disabled,
|
|
213
|
-
'w-fit': hideLabel,
|
|
214
|
+
'w-fit': hideLabel || square,
|
|
214
215
|
}"
|
|
215
216
|
>
|
|
216
217
|
<div
|
|
217
218
|
class="relative"
|
|
218
219
|
:class="{
|
|
219
220
|
'shadow-sm': border === 'full',
|
|
220
|
-
'w-fit': hideLabel,
|
|
221
|
+
'w-fit': hideLabel || square,
|
|
221
222
|
}"
|
|
222
223
|
>
|
|
223
224
|
<div
|
|
@@ -229,12 +230,15 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
229
230
|
'base-border-active': opened,
|
|
230
231
|
'base-border-hover': !opened && !disabled,
|
|
231
232
|
'base-border-interactive-focus-visible': !disabled,
|
|
232
|
-
'px-3': padding && !hideLabel,
|
|
233
|
-
'px-2': padding && hideLabel,
|
|
234
233
|
'text-xs h-10': size === 'sm',
|
|
235
234
|
'text-sm h-12': size === 'base',
|
|
236
235
|
'text-base h-14': size === 'lg',
|
|
237
|
-
'
|
|
236
|
+
'px-3': padding && !hideLabel && !square,
|
|
237
|
+
'px-2': padding && hideLabel && !square,
|
|
238
|
+
'inline-flex w-fit gap-1': hideLabel && !square,
|
|
239
|
+
'justify-center w-10': square && size === 'sm',
|
|
240
|
+
'justify-center w-12': square && size === 'base',
|
|
241
|
+
'justify-center w-14': square && size === 'lg',
|
|
238
242
|
}"
|
|
239
243
|
role="button"
|
|
240
244
|
:aria-disabled="disabled"
|
|
@@ -250,7 +254,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
250
254
|
<BaseEmoji
|
|
251
255
|
v-if="selectedOption.emoji"
|
|
252
256
|
class="pointer-events-none shrink-0"
|
|
253
|
-
:class="{ 'mr-2': !hideLabel }"
|
|
257
|
+
:class="{ 'mr-2': !hideLabel && !square }"
|
|
254
258
|
:clickable="false"
|
|
255
259
|
:emoji="selectedOption.emoji"
|
|
256
260
|
size="sm"
|
|
@@ -259,13 +263,13 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
259
263
|
<BaseIcon
|
|
260
264
|
v-else-if="selectedOption.icon"
|
|
261
265
|
class="pointer-events-none"
|
|
262
|
-
:class="{ 'mr-2': !hideLabel }"
|
|
266
|
+
:class="{ 'mr-2': !hideLabel && !square }"
|
|
263
267
|
:color="selectedOption.iconColor"
|
|
264
268
|
:icon="selectedOption.icon"
|
|
265
269
|
/>
|
|
266
270
|
|
|
267
271
|
<span
|
|
268
|
-
v-if="selectedOption.text && !hideLabel"
|
|
272
|
+
v-if="selectedOption.text && !hideLabel && !square"
|
|
269
273
|
class="flex-1 truncate font-medium"
|
|
270
274
|
>
|
|
271
275
|
{{ selectedOption.text }}
|
|
@@ -280,7 +284,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
280
284
|
</span>
|
|
281
285
|
|
|
282
286
|
<BaseIcon
|
|
283
|
-
v-if="caret && !hideCaret"
|
|
287
|
+
v-if="caret && !hideCaret && !square"
|
|
284
288
|
class="flex-initial"
|
|
285
289
|
:class="{
|
|
286
290
|
'ml-2': !hideLabel,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { LayoutBottomSheet } from '../../types/layout'
|
|
3
3
|
|
|
4
|
-
withDefaults(defineProps<LayoutBottomSheet>(), {
|
|
4
|
+
const props = withDefaults(defineProps<LayoutBottomSheet>(), { 'aria-label': undefined })
|
|
5
5
|
|
|
6
6
|
defineSlots<{
|
|
7
7
|
default?: () => VNode[]
|
|
@@ -199,7 +199,7 @@ watch(visible, (isVisible) => {
|
|
|
199
199
|
<div
|
|
200
200
|
v-if="visible"
|
|
201
201
|
ref="panelRef"
|
|
202
|
-
:aria-label="
|
|
202
|
+
:aria-label="props['aria-label']"
|
|
203
203
|
aria-modal="true"
|
|
204
204
|
class="layout-bottom-sheet fixed bottom-0 left-0 right-0 z-[60] mx-auto max-h-[85dvh] max-w-screen-md flex flex-col rounded-t-2xl bg-white text-gray-900 app-text shadow-lg outline-none safe-bottom dark:bg-gray-900 dark:text-gray-100"
|
|
205
205
|
:class="{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { LayoutModal } from '../../types/layout'
|
|
3
3
|
|
|
4
|
-
withDefaults(defineProps<LayoutModal>(), {
|
|
4
|
+
const props = withDefaults(defineProps<LayoutModal>(), { 'aria-label': undefined })
|
|
5
5
|
|
|
6
6
|
defineSlots<{
|
|
7
7
|
default?: () => VNode[]
|
|
@@ -39,7 +39,7 @@ function onClose() {
|
|
|
39
39
|
>
|
|
40
40
|
<div
|
|
41
41
|
ref="panelRef"
|
|
42
|
-
:aria-label="
|
|
42
|
+
:aria-label="props['aria-label']"
|
|
43
43
|
aria-modal="true"
|
|
44
44
|
class="scroll-y-stable pointer-events-auto max-h-[85dvh] max-w-md w-full rounded-2xl bg-white p-5 text-gray-900 app-text shadow-lg outline-none dark:bg-gray-900 dark:text-gray-100"
|
|
45
45
|
role="dialog"
|
package/app/types/fields.d.ts
CHANGED
|
@@ -121,8 +121,8 @@ export interface FieldSelect {
|
|
|
121
121
|
description?: BaseTextText
|
|
122
122
|
direction?: FieldSelectDirection
|
|
123
123
|
disabled?: boolean
|
|
124
|
-
hideError?: boolean
|
|
125
124
|
hideCaret?: boolean
|
|
125
|
+
hideError?: boolean
|
|
126
126
|
hideLabel?: boolean
|
|
127
127
|
label?: BaseTextText
|
|
128
128
|
labelIcon?: string
|
|
@@ -136,6 +136,7 @@ export interface FieldSelect {
|
|
|
136
136
|
searchable?: boolean
|
|
137
137
|
searchPlaceholder?: string
|
|
138
138
|
size?: FieldSize
|
|
139
|
+
square?: boolean
|
|
139
140
|
validation?: VuelidateValidation
|
|
140
141
|
}
|
|
141
142
|
|
package/app/types/layout.d.ts
CHANGED