srcdev-nuxt-forms 2.4.18 → 2.4.19

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.
@@ -0,0 +1,20 @@
1
+ :root {
2
+ [data-btn-theme='input-action-underlined'] {
3
+ --theme-btn-bg: transparent;
4
+ --theme-btn-border: transparent;
5
+ --theme-btn-outline: transparent;
6
+ --theme-btn-text: var(--_input-text-core-color);
7
+
8
+ --theme-btn-bg-hover: var(--blue-8);
9
+ --theme-btn-border-hover: var(--blue-8);
10
+ --theme-btn-outline-hover: var(--blue-8);
11
+ --theme-btn-text-hover: var(--gray-00);
12
+
13
+ --theme-btn-bg-focus: var(--blue-8);
14
+ --theme-btn-border-focus: var(--blue-8);
15
+ --theme-btn-outline-focus: var(--blue-8);
16
+ --theme-btn-text-focus: var(--gray-00);
17
+
18
+ --theme-form-focus-box-shadow: transparent;
19
+ }
20
+ }
@@ -6,3 +6,4 @@
6
6
  @import './_success';
7
7
  @import './_warning';
8
8
  @import './_input-action';
9
+ @import './_input-action-underlined';
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="input-error-message" :id :class="[elementClasses, { show: showError }, { detached: isDetached }, { hide: !showError }]" :data-Testid>
2
+ <div class="input-error-message" :id :class="[inputVariant, elementClasses, { show: showError }, { detached: isDetached }, { hide: !showError }]" :data-Testid>
3
3
  <div class="inner" :class="[{ show: showError }]">
4
4
  <div class="inner-content">
5
5
  <div class="inner-icon">
@@ -19,6 +19,8 @@
19
19
  </template>
20
20
 
21
21
  <script setup lang="ts">
22
+ import propValidators from '../c12/prop-validators';
23
+
22
24
  const props = defineProps({
23
25
  dataTestid: {
24
26
  type: String,
@@ -48,6 +50,13 @@ const props = defineProps({
48
50
  type: Boolean,
49
51
  required: true,
50
52
  },
53
+ inputVariant: {
54
+ type: String as PropType<string>,
55
+ default: 'normal',
56
+ validator(value: string) {
57
+ return propValidators.inputVariant.includes(value);
58
+ },
59
+ },
51
60
  });
52
61
 
53
62
  const isArray = computed(() => {
@@ -72,12 +81,14 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
72
81
  --_gutter-inline: var(--_gutter);
73
82
  --_transition-duration: 500ms;
74
83
  --_transition-timing-function: linear;
75
- --_message-translate-y-hide: calc(var(--_gutter) * -2);
76
- --_message-translate-y-show: 0;
77
- --_message-translate-y: var(--_message-translate-y-hide);
78
- --_padding-message-show: var(--_gutter);
79
- --_padding-message-hide: 0;
80
- --_padding-message: var(--_padding-message-hide);
84
+ --_padding-message: 1.2rem 1rem;
85
+
86
+ &.show {
87
+ --_grid-template-rows: 1fr;
88
+ --_opacity: var(--_opacity-show);
89
+ --_display: var(--_display-show);
90
+ --_gutter-block: var(--_gutter);
91
+ }
81
92
 
82
93
  grid-row: 2;
83
94
  grid-column: 1;
@@ -98,23 +109,10 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
98
109
  margin-block-start: 2rem;
99
110
  }
100
111
 
101
- /* &.mbs-12 {
102
- transition: margin-block-start var(--_transition-duration) var(--_transition-timing-function);
103
- &.hide {
104
- margin-block-start: 0;
105
- }
106
- &.show {
107
- margin-block-start: 1.2rem;
108
- }
109
- } */
112
+ &.outlined {
113
+ }
110
114
 
111
- &.show {
112
- --_grid-template-rows: 1fr;
113
- --_opacity: var(--_opacity-show);
114
- --_display: var(--_display-show);
115
- --_message-translate-y: var(--_message-translate-y-show);
116
- --_gutter-block: var(--_gutter);
117
- --_padding-message: var(--_padding-message-show);
115
+ &.underlined {
118
116
  }
119
117
 
120
118
  .inner {
@@ -123,11 +121,6 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
123
121
  overflow: hidden;
124
122
  transition: opacity var(--_transition-duration) var(--_transition-timing-function), display var(--_transition-duration) var(--_transition-timing-function) allow-discrete;
125
123
 
126
- &.show {
127
- display: var(--_display-show);
128
- opacity: var(--_opacity-show);
129
- }
130
-
131
124
  .inner-content {
132
125
  display: flex;
133
126
  align-items: center;
@@ -150,11 +143,6 @@ const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.
150
143
  font-weight: 500;
151
144
  padding-block: var(--_padding-message);
152
145
  padding-inline: var(--_gutter-inline);
153
- transform: translateY(var(--_message-translate-y));
154
-
155
- transition-property: transform, padding;
156
- transition-duration: var(--_transition-duration);
157
- transition-timing-function: linear;
158
146
 
159
147
  .message-single {
160
148
  color: white;
@@ -21,7 +21,7 @@
21
21
  @click.stop.prevent="toggleDisplayPassword"
22
22
  :is-pending="false"
23
23
  :buttonText
24
- theme="input-action"
24
+ :theme="buttonTheme"
25
25
  :size
26
26
  @focusin="updateFocus(name, true)"
27
27
  @focusout="updateFocus(name, false)"
@@ -102,6 +102,10 @@ const formTheme = computed(() => {
102
102
  return props.fieldHasError ? 'error' : props.theme;
103
103
  });
104
104
 
105
+ const buttonTheme = computed(() => {
106
+ return props.inputVariant === 'underlined' ? 'input-action-underlined' : 'input-action';
107
+ });
108
+
105
109
  const modelValue = defineModel();
106
110
 
107
111
  const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
@@ -35,7 +35,7 @@
35
35
  </template>
36
36
  </InputTextCore>
37
37
 
38
- <InputError :errorMessage="errorMessage" :showError="fieldHasError" :id="errorId" :isDetached="false" />
38
+ <InputError :errorMessage :showError="fieldHasError" :id="errorId" :isDetached="false" :inputVariant />
39
39
  </div>
40
40
 
41
41
  <div v-if="inputVariant !== 'normal' && hasDescriptionSlot" :id="`${id}-description`">
@@ -205,7 +205,7 @@ watch(
205
205
  --_label-offset: 1rem 0;
206
206
  --_input-text-with-label-background-color: var(--theme-form-input-bg-normal);
207
207
 
208
- --_input-text-wrapper-padding-block: 0.4em;
208
+ --_input-text-wrapper-padding-block: 0.4em 0;
209
209
 
210
210
  &:has(.input-text-wrapper.active),
211
211
  &:has(.input-text-wrapper.dirty) {
@@ -240,6 +240,7 @@ watch(
240
240
 
241
241
  background-color: var(--_input-text-with-label-background-color);
242
242
  border-radius: var(--_input-text-wrapper-border-radius);
243
+
243
244
  /* overflow: clip; */
244
245
 
245
246
  &.underlined {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-forms",
3
3
  "type": "module",
4
- "version": "2.4.18",
4
+ "version": "2.4.19",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",