@iqual/nuxt-icms 1.5.7 → 1.5.9
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/assets/css/components/ck-content.css +18 -1
- package/components/DesignSystem/Atoms/Button.vue +23 -19
- package/components/DesignSystem/Organisms/SpotlightCard.vue +2 -1
- package/components/DesignSystem/Organisms/TeaserCard.vue +13 -7
- package/components/Drupal/Webform/index.vue +1 -1
- package/components/Form/CheckboxInput.vue +4 -4
- package/components/Form/CheckboxInputs.vue +7 -4
- package/components/Form/FileInput.vue +7 -9
- package/components/Form/RadioButtonsInput.vue +7 -4
- package/components/Form/SelectInput.vue +41 -16
- package/components/Form/TextAreaInput.vue +54 -15
- package/components/Form/TextEmailInput.vue +43 -10
- package/components/Form/TextInput.vue +43 -10
- package/components/Form/TextPhoneInput.vue +43 -10
- package/components/Paragraph/FAQ/Layout/index.vue +2 -2
- package/components/Search/Facets/FacetDropdownUI.vue +62 -35
- package/components/Search/Facets/FacetedSearchUI.vue +8 -14
- package/components/Section/Header/Buttons.vue +3 -1
- package/components/Section/Header/Logo.vue +2 -2
- package/components/Section/Header/MainButtons.vue +3 -1
- package/components/Section/Header/MetaButtons.vue +3 -1
- package/components/Section/Header/MetaMenu.vue +1 -1
- package/components/Section/Header/MobileMainMenu.vue +1 -1
- package/components/Section/Header/MobileMainMenuItem.vue +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
.ck-content {
|
|
2
2
|
@apply break-words;
|
|
3
3
|
|
|
4
|
+
h1:not(:first-of-type),
|
|
5
|
+
.h1:not(:first-of-type),
|
|
6
|
+
h2:not(:first-of-type),
|
|
7
|
+
.h2:not(:first-of-type),
|
|
8
|
+
h3:not(:first-of-type),
|
|
9
|
+
.h3:not(:first-of-type),
|
|
10
|
+
h4:not(:first-of-type),
|
|
11
|
+
.h4:not(:first-of-type) {
|
|
12
|
+
@apply mt-4;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
h5:not(:first-of-type),
|
|
16
|
+
.h5:not(:first-of-type),
|
|
17
|
+
h6:not(:first-of-type),
|
|
18
|
+
.h6:not(:first-of-type) {
|
|
19
|
+
@apply mt-2;
|
|
20
|
+
}
|
|
21
|
+
|
|
4
22
|
ol,
|
|
5
23
|
ul {
|
|
6
24
|
@apply mb-6;
|
|
@@ -36,4 +54,3 @@
|
|
|
36
54
|
@apply text-sm;
|
|
37
55
|
}
|
|
38
56
|
}
|
|
39
|
-
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
:title="title"
|
|
7
7
|
:target="targetBlank ? '_blank' : '_self'"
|
|
8
8
|
:ui="{
|
|
9
|
-
base:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
base: cn(
|
|
10
|
+
button({
|
|
11
|
+
colorScheme: colorScheme,
|
|
12
|
+
style: buttonStyle,
|
|
13
|
+
}),
|
|
14
|
+
buttonClass,
|
|
15
|
+
),
|
|
16
|
+
label: cn(themedClass('labelClass', 'font-medium'), labelClass),
|
|
14
17
|
}"
|
|
15
18
|
/>
|
|
16
19
|
</template>
|
|
@@ -18,6 +21,7 @@
|
|
|
18
21
|
<script lang="ts" setup>
|
|
19
22
|
import type { ColorScheme, ButtonStyle } from '@iqual/nuxt-icms/types/global'
|
|
20
23
|
import { useTheme } from '@iqual/nuxt-icms/composables/useTheme'
|
|
24
|
+
import cn from '@iqual/nuxt-icms/composables/useCn'
|
|
21
25
|
import { tv } from 'tailwind-variants'
|
|
22
26
|
|
|
23
27
|
const themedClass = useTheme('DesignSystemAtomsButton')
|
|
@@ -51,7 +55,7 @@ const linkComplete = computed(() => {
|
|
|
51
55
|
const button = tv({
|
|
52
56
|
base: themedClass(
|
|
53
57
|
'buttonClass',
|
|
54
|
-
'rounded-none cursor-pointer py-3 px-10 block w-full
|
|
58
|
+
'rounded-none cursor-pointer py-3 px-10 block w-full sm:w-fit motion-safe:transition-colors motion-safe:duration-200 motion-safe:ease-in-out',
|
|
55
59
|
),
|
|
56
60
|
variants: {
|
|
57
61
|
colorScheme: {
|
|
@@ -65,7 +69,7 @@ const button = tv({
|
|
|
65
69
|
focus: themedClass('buttonVariantsStyleFocus', 'border text-center'),
|
|
66
70
|
minimal: themedClass(
|
|
67
71
|
'buttonVariantsStyleMinimal',
|
|
68
|
-
'bg-transparent w-fit p-0 underline hover:bg-transparent',
|
|
72
|
+
'bg-transparent w-fit p-0 underline hover:bg-transparent active:bg-transparent',
|
|
69
73
|
),
|
|
70
74
|
},
|
|
71
75
|
},
|
|
@@ -75,7 +79,7 @@ const button = tv({
|
|
|
75
79
|
style: 'normal',
|
|
76
80
|
class: themedClass(
|
|
77
81
|
'buttonCompoundVariantsNoneNormal',
|
|
78
|
-
'bg-transparent text-primary-500 border-primary-500 hover:bg-primary-500 hover:text-white',
|
|
82
|
+
'bg-transparent text-primary-500 border-primary-500 hover:bg-primary-500 hover:text-white active:bg-primary-500 active:text-white',
|
|
79
83
|
),
|
|
80
84
|
},
|
|
81
85
|
{
|
|
@@ -83,7 +87,7 @@ const button = tv({
|
|
|
83
87
|
style: 'focus',
|
|
84
88
|
class: themedClass(
|
|
85
89
|
'buttonCompoundVariantsNoneFocus',
|
|
86
|
-
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600',
|
|
90
|
+
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600 active:bg-primary-600 active:border-primary-600',
|
|
87
91
|
),
|
|
88
92
|
},
|
|
89
93
|
{
|
|
@@ -91,7 +95,7 @@ const button = tv({
|
|
|
91
95
|
style: 'minimal',
|
|
92
96
|
class: themedClass(
|
|
93
97
|
'buttonCompoundVariantsNoneMinimal',
|
|
94
|
-
'text-primary-500 hover:text-gray-950',
|
|
98
|
+
'text-primary-500 hover:text-gray-950 active:text-gray-950',
|
|
95
99
|
),
|
|
96
100
|
},
|
|
97
101
|
{
|
|
@@ -99,7 +103,7 @@ const button = tv({
|
|
|
99
103
|
style: 'normal',
|
|
100
104
|
class: themedClass(
|
|
101
105
|
'buttonCompoundVariantsDarkNormal',
|
|
102
|
-
'bg-transparent text-gray-200 border-gray-200 hover:bg-gray-200 hover:text-gray-950',
|
|
106
|
+
'bg-transparent text-gray-200 border-gray-200 hover:bg-gray-200 hover:text-gray-950 active:bg-gray-200 active:text-gray-950',
|
|
103
107
|
),
|
|
104
108
|
},
|
|
105
109
|
{
|
|
@@ -107,7 +111,7 @@ const button = tv({
|
|
|
107
111
|
style: 'focus',
|
|
108
112
|
class: themedClass(
|
|
109
113
|
'buttonCompoundVariantsDarkFocus',
|
|
110
|
-
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600',
|
|
114
|
+
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600 active:bg-primary-600 active:border-primary-600',
|
|
111
115
|
),
|
|
112
116
|
},
|
|
113
117
|
{
|
|
@@ -115,7 +119,7 @@ const button = tv({
|
|
|
115
119
|
style: 'minimal',
|
|
116
120
|
class: themedClass(
|
|
117
121
|
'buttonCompoundVariantsDarkMinimal',
|
|
118
|
-
'text-gray-200 hover:text-primary-500',
|
|
122
|
+
'text-gray-200 hover:text-primary-500 active:text-primary-500',
|
|
119
123
|
),
|
|
120
124
|
},
|
|
121
125
|
{
|
|
@@ -123,7 +127,7 @@ const button = tv({
|
|
|
123
127
|
style: 'normal',
|
|
124
128
|
class: themedClass(
|
|
125
129
|
'buttonCompoundVariantsLightNormal',
|
|
126
|
-
'bg-transparent text-primary-500 border-primary-500 hover:bg-primary-500 hover:text-white',
|
|
130
|
+
'bg-transparent text-primary-500 border-primary-500 hover:bg-primary-500 hover:text-white active:bg-primary-500 active:text-white',
|
|
127
131
|
),
|
|
128
132
|
},
|
|
129
133
|
{
|
|
@@ -131,7 +135,7 @@ const button = tv({
|
|
|
131
135
|
style: 'focus',
|
|
132
136
|
class: themedClass(
|
|
133
137
|
'buttonCompoundVariantsLightFocus',
|
|
134
|
-
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600',
|
|
138
|
+
'bg-primary-500 text-white border-primary-500 hover:bg-primary-600 hover:border-primary-600 active:bg-primary-600 active:border-primary-600',
|
|
135
139
|
),
|
|
136
140
|
},
|
|
137
141
|
{
|
|
@@ -139,7 +143,7 @@ const button = tv({
|
|
|
139
143
|
style: 'minimal',
|
|
140
144
|
class: themedClass(
|
|
141
145
|
'buttonCompoundVariantsLightMinimal',
|
|
142
|
-
'text-primary-500 hover:text-gray-950',
|
|
146
|
+
'text-primary-500 hover:text-gray-950 active:text-gray-950',
|
|
143
147
|
),
|
|
144
148
|
},
|
|
145
149
|
{
|
|
@@ -147,7 +151,7 @@ const button = tv({
|
|
|
147
151
|
style: 'normal',
|
|
148
152
|
class: themedClass(
|
|
149
153
|
'buttonCompoundVariantsAccentNormal',
|
|
150
|
-
'bg-transparent text-white border-white hover:bg-white hover:text-gray-950',
|
|
154
|
+
'bg-transparent text-white border-white hover:bg-white hover:text-gray-950 active:bg-white active:text-gray-950',
|
|
151
155
|
),
|
|
152
156
|
},
|
|
153
157
|
{
|
|
@@ -155,7 +159,7 @@ const button = tv({
|
|
|
155
159
|
style: 'focus',
|
|
156
160
|
class: themedClass(
|
|
157
161
|
'buttonCompoundVariantsAccentFocus',
|
|
158
|
-
'bg-gray-950 text-white border-gray-950 hover:bg-white hover:text-gray-950 hover:border-white',
|
|
162
|
+
'bg-gray-950 text-white border-gray-950 hover:bg-white hover:text-gray-950 hover:border-white active:bg-white active:text-gray-950 active:border-white',
|
|
159
163
|
),
|
|
160
164
|
},
|
|
161
165
|
{
|
|
@@ -163,7 +167,7 @@ const button = tv({
|
|
|
163
167
|
style: 'minimal',
|
|
164
168
|
class: themedClass(
|
|
165
169
|
'buttonCompoundVariantsAccentMinimal',
|
|
166
|
-
'text-white hover:text-gray-950',
|
|
170
|
+
'text-white hover:text-gray-950 active:text-gray-950',
|
|
167
171
|
),
|
|
168
172
|
},
|
|
169
173
|
],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:class="
|
|
26
26
|
themedClass(
|
|
27
27
|
'contentContainerClass',
|
|
28
|
-
'card-grid-item z-3 flex flex-col p-6 lg:p-8',
|
|
28
|
+
'card-grid-item z-3 flex flex-col justify-between gap-8 p-6 lg:p-8',
|
|
29
29
|
)
|
|
30
30
|
"
|
|
31
31
|
>
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
<slot name="content">
|
|
44
44
|
<DesignSystemOrganismsContentBlock
|
|
45
|
+
class="mt-auto"
|
|
45
46
|
:pretitle="pretitle"
|
|
46
47
|
:pretitleClass="
|
|
47
48
|
themedClass(
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:media="image"
|
|
8
8
|
imageSizes="xs:100vw sm:100vw md:420px lg:420px"
|
|
9
9
|
imageAspectRatios="16/9"
|
|
10
|
-
:mediaClass="themedClass('mediaClass', '
|
|
10
|
+
:mediaClass="themedClass('mediaClass', 'w-full')"
|
|
11
11
|
:figcaptionClass="themedClass('figcaptionClass')"
|
|
12
12
|
:elementClass="themedClass('elementClass', 'w-full')"
|
|
13
13
|
/>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
:class="
|
|
18
18
|
themedClass(
|
|
19
19
|
'textContainerClass',
|
|
20
|
-
'flex h-full flex-col @xl:w-1/2 @xl:p-0 @7xl:p-12',
|
|
20
|
+
'flex h-full flex-col @xl:max-w-1/2 @xl:basis-1/2 @xl:p-0 @7xl:p-12',
|
|
21
21
|
)
|
|
22
22
|
"
|
|
23
23
|
>
|
|
@@ -131,15 +131,21 @@ const teaserCard = tv({
|
|
|
131
131
|
})
|
|
132
132
|
|
|
133
133
|
const mediaContainer = tv({
|
|
134
|
-
base: themedClass(
|
|
134
|
+
base: themedClass(
|
|
135
|
+
'mediaContainerBase',
|
|
136
|
+
'w-full aspect-video @xl:basis-1/2 @xl:max-w-1/2',
|
|
137
|
+
),
|
|
135
138
|
variants: {
|
|
136
139
|
colorScheme: {
|
|
137
|
-
none: themedClass('mediaContainerVariantsColorSchemeNone', 'bg-
|
|
138
|
-
dark: themedClass('mediaContainerVariantsColorSchemeDark', 'bg-gray-
|
|
139
|
-
light: themedClass(
|
|
140
|
+
none: themedClass('mediaContainerVariantsColorSchemeNone', 'bg-white'),
|
|
141
|
+
dark: themedClass('mediaContainerVariantsColorSchemeDark', 'bg-gray-950'),
|
|
142
|
+
light: themedClass(
|
|
143
|
+
'mediaContainerVariantsColorSchemeLight',
|
|
144
|
+
'bg-gray-50',
|
|
145
|
+
),
|
|
140
146
|
accent: themedClass(
|
|
141
147
|
'mediaContainerVariantsColorSchemeAccent',
|
|
142
|
-
'bg-primary-
|
|
148
|
+
'bg-primary-600',
|
|
143
149
|
),
|
|
144
150
|
},
|
|
145
151
|
},
|
|
@@ -27,19 +27,19 @@ const checkboxBase = tv({
|
|
|
27
27
|
colorScheme: {
|
|
28
28
|
none: themedClass(
|
|
29
29
|
'checkboxBaseVariantsColorSchemeNone',
|
|
30
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
30
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
31
31
|
),
|
|
32
32
|
dark: themedClass(
|
|
33
33
|
'checkboxBaseVariantsColorSchemeDark',
|
|
34
|
-
'ring-gray-700 dark:ring-gray-700',
|
|
34
|
+
'bg-gray-800 dark:bg-gray-800 ring-gray-700 dark:ring-gray-700',
|
|
35
35
|
),
|
|
36
36
|
light: themedClass(
|
|
37
37
|
'checkboxBaseVariantsColorSchemeLight',
|
|
38
|
-
'bg-white ring-gray-200 dark:ring-gray-200',
|
|
38
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
39
39
|
),
|
|
40
40
|
accent: themedClass(
|
|
41
41
|
'checkboxBaseVariantsColorSchemeAccent',
|
|
42
|
-
'bg-white ring-gray-200 dark:ring-gray-200',
|
|
42
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
43
43
|
),
|
|
44
44
|
},
|
|
45
45
|
},
|
|
@@ -75,19 +75,19 @@ const checkboxBase = tv({
|
|
|
75
75
|
colorScheme: {
|
|
76
76
|
none: themedClass(
|
|
77
77
|
'checkboxBaseVariantsColorSchemeNone',
|
|
78
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
78
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
79
79
|
),
|
|
80
80
|
dark: themedClass(
|
|
81
81
|
'checkboxBaseVariantsColorSchemeDark',
|
|
82
|
-
'ring-gray-700 dark:ring-gray-700',
|
|
82
|
+
'bg-gray-800 dark:bg-gray-800 ring-gray-700 dark:ring-gray-700',
|
|
83
83
|
),
|
|
84
84
|
light: themedClass(
|
|
85
85
|
'checkboxBaseVariantsColorSchemeLight',
|
|
86
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
86
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
87
87
|
),
|
|
88
88
|
accent: themedClass(
|
|
89
89
|
'checkboxBaseVariantsColorSchemeAccent',
|
|
90
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
90
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
91
91
|
),
|
|
92
92
|
},
|
|
93
93
|
},
|
|
@@ -143,6 +143,7 @@ const checkboxDescription = tv({
|
|
|
143
143
|
},
|
|
144
144
|
},
|
|
145
145
|
})
|
|
146
|
+
|
|
146
147
|
const checkboxIndicator = tv({
|
|
147
148
|
base: themedClass('checkboxIndicatorBase'),
|
|
148
149
|
variants: {
|
|
@@ -175,8 +176,10 @@ const checkboxIndicator = tv({
|
|
|
175
176
|
:required="Boolean(formElement.metadata.required)"
|
|
176
177
|
:description="cleanDescription"
|
|
177
178
|
:ui="{
|
|
179
|
+
labelWrapper: themedClass('formFieldLabelWrapper', 'mb-1'),
|
|
178
180
|
label: formFieldLabel({ colorScheme }),
|
|
179
181
|
description: formFieldDescription({ colorScheme }),
|
|
182
|
+
wrapper: themedClass('formFieldWrapper', 'mb-2'),
|
|
180
183
|
}"
|
|
181
184
|
>
|
|
182
185
|
<UCheckboxGroup
|
|
@@ -278,8 +278,10 @@ const fileUploadIcon = tv({
|
|
|
278
278
|
:required="formElement.metadata.required"
|
|
279
279
|
:description="floatingLabels ? undefined : formElement.metadata.description"
|
|
280
280
|
:ui="{
|
|
281
|
+
labelWrapper: themedClass('formFieldLabelWrapper', 'mb-1'),
|
|
281
282
|
label: formFieldLabel({ colorScheme }),
|
|
282
283
|
description: formFieldDescription({ colorScheme }),
|
|
284
|
+
wrapper: themedClass('formFieldWrapper', 'mb-2'),
|
|
283
285
|
}"
|
|
284
286
|
>
|
|
285
287
|
<div :class="themedClass('fileUploadWrapper', 'relative')">
|
|
@@ -296,18 +298,14 @@ const fileUploadIcon = tv({
|
|
|
296
298
|
fileSize: fileUploadFileSize({ colorScheme }),
|
|
297
299
|
}"
|
|
298
300
|
>
|
|
299
|
-
<template
|
|
300
|
-
v-if="!floatingLabels"
|
|
301
|
-
#description
|
|
302
|
-
>
|
|
301
|
+
<template v-if="!floatingLabels" #description>
|
|
303
302
|
<span v-html="formElement.metadata.description" />
|
|
304
303
|
</template>
|
|
305
304
|
</UFileUpload>
|
|
306
|
-
<label
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<span :class="floatingLabelText({ colorScheme })">{{ formElement.metadata.title }}</span>
|
|
305
|
+
<label v-if="floatingLabels" :class="floatingLabel({ colorScheme })">
|
|
306
|
+
<span :class="floatingLabelText({ colorScheme })">{{
|
|
307
|
+
formElement.metadata.title
|
|
308
|
+
}}</span>
|
|
311
309
|
</label>
|
|
312
310
|
</div>
|
|
313
311
|
<div
|
|
@@ -75,19 +75,19 @@ const radioBase = tv({
|
|
|
75
75
|
colorScheme: {
|
|
76
76
|
none: themedClass(
|
|
77
77
|
'radioBaseVariantsColorSchemeNone',
|
|
78
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
78
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
79
79
|
),
|
|
80
80
|
dark: themedClass(
|
|
81
81
|
'radioBaseVariantsColorSchemeDark',
|
|
82
|
-
'ring-gray-700 dark:ring-gray-700',
|
|
82
|
+
'bg-gray-800 dark:bg-gray-800 ring-gray-700 dark:ring-gray-700',
|
|
83
83
|
),
|
|
84
84
|
light: themedClass(
|
|
85
85
|
'radioBaseVariantsColorSchemeLight',
|
|
86
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
86
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
87
87
|
),
|
|
88
88
|
accent: themedClass(
|
|
89
89
|
'radioBaseVariantsColorSchemeAccent',
|
|
90
|
-
'ring-gray-200 dark:ring-gray-200',
|
|
90
|
+
'bg-white dark:bg-white ring-gray-200 dark:ring-gray-200',
|
|
91
91
|
),
|
|
92
92
|
},
|
|
93
93
|
},
|
|
@@ -169,14 +169,17 @@ const radioIndicator = tv({
|
|
|
169
169
|
:required="Boolean(formElement.metadata.required)"
|
|
170
170
|
:description="cleanDescription"
|
|
171
171
|
:ui="{
|
|
172
|
+
labelWrapper: themedClass('formFieldLabelWrapper', 'mb-1'),
|
|
172
173
|
label: formFieldLabel({ colorScheme }),
|
|
173
174
|
description: formFieldDescription({ colorScheme }),
|
|
175
|
+
wrapper: themedClass('formFieldWrapper', 'mb-2'),
|
|
174
176
|
}"
|
|
175
177
|
>
|
|
176
178
|
<URadioGroup
|
|
177
179
|
v-model="model"
|
|
178
180
|
:items="formattedOptions"
|
|
179
181
|
:ui="{
|
|
182
|
+
fieldset: themedClass('radioFieldset', 'gap-y-3'),
|
|
180
183
|
container: themedClass('radioContainer', 'cursor-pointer'),
|
|
181
184
|
base: radioBase({ colorScheme }),
|
|
182
185
|
indicator: radioIndicator({ colorScheme }),
|
|
@@ -71,7 +71,10 @@ const formFieldDescription = tv({
|
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
const selectBase = tv({
|
|
74
|
-
base: themedClass(
|
|
74
|
+
base: themedClass(
|
|
75
|
+
'selectBase',
|
|
76
|
+
'text-base px-4 rounded-none w-full cursor-pointer',
|
|
77
|
+
),
|
|
75
78
|
variants: {
|
|
76
79
|
colorScheme: {
|
|
77
80
|
none: themedClass(
|
|
@@ -104,19 +107,19 @@ const selectPlaceholder = tv({
|
|
|
104
107
|
colorScheme: {
|
|
105
108
|
none: themedClass(
|
|
106
109
|
'selectPlaceholderVariantsColorSchemeNone',
|
|
107
|
-
'text-gray-
|
|
110
|
+
'text-gray-500',
|
|
108
111
|
),
|
|
109
112
|
dark: themedClass(
|
|
110
113
|
'selectPlaceholderVariantsColorSchemeDark',
|
|
111
|
-
'text-gray-
|
|
114
|
+
'text-gray-500',
|
|
112
115
|
),
|
|
113
116
|
light: themedClass(
|
|
114
117
|
'selectPlaceholderVariantsColorSchemeLight',
|
|
115
|
-
'text-gray-
|
|
118
|
+
'text-gray-500',
|
|
116
119
|
),
|
|
117
120
|
accent: themedClass(
|
|
118
121
|
'selectPlaceholderVariantsColorSchemeAccent',
|
|
119
|
-
'text-gray-
|
|
122
|
+
'text-gray-500',
|
|
120
123
|
),
|
|
121
124
|
},
|
|
122
125
|
},
|
|
@@ -281,23 +284,26 @@ const selectFloatingLabel = tv({
|
|
|
281
284
|
colorScheme: {
|
|
282
285
|
none: themedClass(
|
|
283
286
|
'selectFloatingLabelVariantsColorSchemeNone',
|
|
284
|
-
'text-gray-
|
|
287
|
+
'text-gray-500 group-focus-within:text-primary-600 dark:text-gray-500 dark:group-focus-within:text-primary-400',
|
|
285
288
|
),
|
|
286
289
|
dark: themedClass(
|
|
287
290
|
'selectFloatingLabelVariantsColorSchemeDark',
|
|
288
|
-
'text-gray-
|
|
291
|
+
'text-gray-500 group-focus-within:text-primary-400 dark:text-gray-500 dark:group-focus-within:text-primary-400',
|
|
289
292
|
),
|
|
290
293
|
light: themedClass(
|
|
291
294
|
'selectFloatingLabelVariantsColorSchemeLight',
|
|
292
|
-
'text-gray-
|
|
295
|
+
'text-gray-500 group-focus-within:text-primary-600 dark:text-gray-500 dark:group-focus-within:text-primary-400',
|
|
293
296
|
),
|
|
294
297
|
accent: themedClass(
|
|
295
298
|
'selectFloatingLabelVariantsColorSchemeAccent',
|
|
296
|
-
'text-gray-
|
|
299
|
+
'text-gray-500 group-focus-within:text-primary-600 dark:text-gray-500 dark:group-focus-within:text-primary-400',
|
|
297
300
|
),
|
|
298
301
|
},
|
|
299
302
|
floating: {
|
|
300
|
-
true: themedClass(
|
|
303
|
+
true: themedClass(
|
|
304
|
+
'selectFloatingLabelVariantsFloatingTrue',
|
|
305
|
+
'-top-2 translate-y-0 text-xs font-medium',
|
|
306
|
+
),
|
|
301
307
|
false: themedClass(
|
|
302
308
|
'selectFloatingLabelVariantsFloatingFalse',
|
|
303
309
|
'top-1/2 -translate-y-1/2 text-base font-normal',
|
|
@@ -334,8 +340,7 @@ const selectFloatingLabelText = tv({
|
|
|
334
340
|
})
|
|
335
341
|
|
|
336
342
|
const hasSelectedValue = computed(() => {
|
|
337
|
-
if (Array.isArray(model.value))
|
|
338
|
-
return model.value.length > 0
|
|
343
|
+
if (Array.isArray(model.value)) return model.value.length > 0
|
|
339
344
|
|
|
340
345
|
return model.value !== '' && model.value !== null && model.value !== undefined
|
|
341
346
|
})
|
|
@@ -349,18 +354,22 @@ const hasSelectedValue = computed(() => {
|
|
|
349
354
|
:description="floatingLabels ? undefined : cleanDescription"
|
|
350
355
|
:help="floatingLabels ? cleanDescription : undefined"
|
|
351
356
|
:ui="{
|
|
357
|
+
labelWrapper: themedClass('formFieldLabelWrapper', 'mb-1'),
|
|
352
358
|
label: formFieldLabel({ colorScheme }),
|
|
353
359
|
help: formFieldDescription({ colorScheme }),
|
|
354
360
|
description: formFieldDescription({ colorScheme }),
|
|
361
|
+
wrapper: themedClass('formFieldWrapper', 'mb-2'),
|
|
355
362
|
}"
|
|
356
363
|
>
|
|
357
|
-
<div :class="themedClass('selectWrapper', 'relative
|
|
364
|
+
<div :class="themedClass('selectWrapper', 'group relative')">
|
|
358
365
|
<USelect
|
|
359
366
|
v-model="model"
|
|
360
367
|
:id="formElement.metadata.key"
|
|
361
368
|
:items="formattedOptions"
|
|
362
369
|
:multiple="Boolean(formElement.metadata.multiple)"
|
|
363
|
-
:placeholder="
|
|
370
|
+
:placeholder="
|
|
371
|
+
floatingLabels ? undefined : formElement.emptyOption?.title
|
|
372
|
+
"
|
|
364
373
|
:ui="{
|
|
365
374
|
base: selectBase({ colorScheme, floating: floatingLabels }),
|
|
366
375
|
placeholder: selectPlaceholder({ colorScheme }),
|
|
@@ -375,10 +384,26 @@ const hasSelectedValue = computed(() => {
|
|
|
375
384
|
/>
|
|
376
385
|
<label
|
|
377
386
|
v-if="floatingLabels"
|
|
378
|
-
:class="
|
|
387
|
+
:class="
|
|
388
|
+
selectFloatingLabel({ colorScheme, floating: hasSelectedValue })
|
|
389
|
+
"
|
|
379
390
|
:for="formElement.metadata.key"
|
|
380
391
|
>
|
|
381
|
-
<span :class="selectFloatingLabelText({ colorScheme })">
|
|
392
|
+
<span :class="selectFloatingLabelText({ colorScheme })">
|
|
393
|
+
{{ formElement.metadata.title }}
|
|
394
|
+
<template v-if="formElement.metadata.required">
|
|
395
|
+
<span
|
|
396
|
+
:class="
|
|
397
|
+
themedClass(
|
|
398
|
+
'floatingLabelRequiredStarClass',
|
|
399
|
+
'ml-0.5 inline-block text-red-600',
|
|
400
|
+
)
|
|
401
|
+
"
|
|
402
|
+
>
|
|
403
|
+
*
|
|
404
|
+
</span>
|
|
405
|
+
</template>
|
|
406
|
+
</span>
|
|
382
407
|
</label>
|
|
383
408
|
</div>
|
|
384
409
|
</UFormField>
|
|
@@ -24,7 +24,11 @@ const floatingLabels = inject<boolean>('floatingLabels', true)
|
|
|
24
24
|
const isTextAreaFocused = ref(false)
|
|
25
25
|
|
|
26
26
|
const textAreaHasValue = computed(() => {
|
|
27
|
-
return
|
|
27
|
+
return (
|
|
28
|
+
model.value !== null &&
|
|
29
|
+
model.value !== undefined &&
|
|
30
|
+
`${model.value}`.length > 0
|
|
31
|
+
)
|
|
28
32
|
})
|
|
29
33
|
|
|
30
34
|
const textAreaShouldFloat = computed(() => {
|
|
@@ -88,19 +92,19 @@ const textAreaBase = tv({
|
|
|
88
92
|
colorScheme: {
|
|
89
93
|
none: themedClass(
|
|
90
94
|
'textAreaBaseVariantsColorSchemeNone',
|
|
91
|
-
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-
|
|
95
|
+
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-500',
|
|
92
96
|
),
|
|
93
97
|
dark: themedClass(
|
|
94
98
|
'textAreaBaseVariantsColorSchemeDark',
|
|
95
|
-
'bg-gray-800 text-gray-200 ring-gray-700 dark:bg-gray-800 dark:ring-gray-700 dark:text-gray-200 placeholder:text-gray-
|
|
99
|
+
'bg-gray-800 text-gray-200 ring-gray-700 dark:bg-gray-800 dark:ring-gray-700 dark:text-gray-200 placeholder:text-gray-500',
|
|
96
100
|
),
|
|
97
101
|
light: themedClass(
|
|
98
102
|
'textAreaBaseVariantsColorSchemeLight',
|
|
99
|
-
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-
|
|
103
|
+
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-500',
|
|
100
104
|
),
|
|
101
105
|
accent: themedClass(
|
|
102
106
|
'textAreaBaseVariantsColorSchemeAccent',
|
|
103
|
-
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-
|
|
107
|
+
'bg-white text-gray-950 ring-gray-200 dark:bg-white dark:ring-gray-200 dark:text-gray-950 placeholder:text-gray-500',
|
|
104
108
|
),
|
|
105
109
|
},
|
|
106
110
|
},
|
|
@@ -115,27 +119,36 @@ const floatingLabel = tv({
|
|
|
115
119
|
colorScheme: {
|
|
116
120
|
none: themedClass(
|
|
117
121
|
'floatingLabelVariantsColorSchemeNone',
|
|
118
|
-
'text-gray-
|
|
122
|
+
'text-gray-500 dark:text-gray-500',
|
|
119
123
|
),
|
|
120
124
|
dark: themedClass(
|
|
121
125
|
'floatingLabelVariantsColorSchemeDark',
|
|
122
|
-
'text-gray-
|
|
126
|
+
'text-gray-500 dark:text-gray-500',
|
|
123
127
|
),
|
|
124
128
|
light: themedClass(
|
|
125
129
|
'floatingLabelVariantsColorSchemeLight',
|
|
126
|
-
'text-gray-
|
|
130
|
+
'text-gray-500 dark:text-gray-500',
|
|
127
131
|
),
|
|
128
132
|
accent: themedClass(
|
|
129
133
|
'floatingLabelVariantsColorSchemeAccent',
|
|
130
|
-
'text-gray-
|
|
134
|
+
'text-gray-500 dark:text-gray-500',
|
|
131
135
|
),
|
|
132
136
|
},
|
|
133
137
|
floating: {
|
|
134
|
-
true: themedClass(
|
|
135
|
-
|
|
138
|
+
true: themedClass(
|
|
139
|
+
'floatingLabelVariantsFloatingTrue',
|
|
140
|
+
'-top-2 text-xs font-medium',
|
|
141
|
+
),
|
|
142
|
+
false: themedClass(
|
|
143
|
+
'floatingLabelVariantsFloatingFalse',
|
|
144
|
+
'top-4 text-base font-normal',
|
|
145
|
+
),
|
|
136
146
|
},
|
|
137
147
|
focused: {
|
|
138
|
-
true: themedClass(
|
|
148
|
+
true: themedClass(
|
|
149
|
+
'floatingLabelVariantsFocusedTrue',
|
|
150
|
+
'text-primary-500 dark:text-primary-500',
|
|
151
|
+
),
|
|
139
152
|
false: themedClass('floatingLabelVariantsFocusedFalse', ''),
|
|
140
153
|
},
|
|
141
154
|
},
|
|
@@ -177,16 +190,22 @@ const floatingLabelText = tv({
|
|
|
177
190
|
:description="floatingLabels ? undefined : cleanDescription"
|
|
178
191
|
:help="floatingLabels ? cleanDescription : undefined"
|
|
179
192
|
:ui="{
|
|
193
|
+
labelWrapper: themedClass('formFieldLabelWrapper', 'mb-1'),
|
|
180
194
|
label: formFieldLabel({ colorScheme }),
|
|
181
195
|
help: formFieldDescription({ colorScheme }),
|
|
182
196
|
description: formFieldDescription({ colorScheme }),
|
|
197
|
+
wrapper: themedClass('formFieldWrapper', 'mb-2'),
|
|
183
198
|
}"
|
|
184
199
|
>
|
|
185
200
|
<div :class="themedClass('textAreaWrapper', 'relative')">
|
|
186
201
|
<UTextarea
|
|
187
202
|
v-model="model"
|
|
188
203
|
:id="formElement.metadata.key"
|
|
189
|
-
:placeholder="
|
|
204
|
+
:placeholder="
|
|
205
|
+
floatingLabels
|
|
206
|
+
? formElement.placeholder || ' '
|
|
207
|
+
: formElement.placeholder
|
|
208
|
+
"
|
|
190
209
|
:maxlength="formElement.maxlength"
|
|
191
210
|
:minlength="formElement.minlength"
|
|
192
211
|
:pattern="formElement.pattern?.rule"
|
|
@@ -200,10 +219,30 @@ const floatingLabelText = tv({
|
|
|
200
219
|
/>
|
|
201
220
|
<label
|
|
202
221
|
v-if="floatingLabels"
|
|
203
|
-
:class="
|
|
222
|
+
:class="
|
|
223
|
+
floatingLabel({
|
|
224
|
+
colorScheme,
|
|
225
|
+
floating: textAreaShouldFloat,
|
|
226
|
+
focused: isTextAreaFocused,
|
|
227
|
+
})
|
|
228
|
+
"
|
|
204
229
|
:for="formElement.metadata.key"
|
|
205
230
|
>
|
|
206
|
-
<span :class="floatingLabelText({ colorScheme })">
|
|
231
|
+
<span :class="floatingLabelText({ colorScheme })">
|
|
232
|
+
{{ formElement.metadata.title }}
|
|
233
|
+
<template v-if="formElement.metadata.required">
|
|
234
|
+
<span
|
|
235
|
+
:class="
|
|
236
|
+
themedClass(
|
|
237
|
+
'floatingLabelRequiredStarClass',
|
|
238
|
+
'ml-0.5 inline-block text-red-600',
|
|
239
|
+
)
|
|
240
|
+
"
|
|
241
|
+
>
|
|
242
|
+
*
|
|
243
|
+
</span>
|
|
244
|
+
</template>
|
|
245
|
+
</span>
|
|
207
246
|
</label>
|
|
208
247
|
</div>
|
|
209
248
|
</UFormField>
|