srcdev-nuxt-forms 2.1.7 → 2.1.8

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.
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="input-checkbox-wrapper" :data-form-theme="formTheme" :class="[size, { error: fieldHasError }]">
3
+ <Icon :name="icon" class="input-checkbox-decorator" />
3
4
  <input
4
5
  type="checkbox"
5
6
  :true-value="trueValue"
@@ -13,9 +14,6 @@
13
14
  v-model="modelValue"
14
15
  ref="inputField"
15
16
  />
16
- <div class="input-checkbox-decorator" :class="[size, stateIcon]">
17
- <Icon :name="icon" class="icon" />
18
- </div>
19
17
  </div>
20
18
  </template>
21
19
 
@@ -105,15 +103,15 @@ const icon = computed(() => {
105
103
  <style scoped lang="css">
106
104
  .input-checkbox-wrapper {
107
105
  --_checkbox-size: initial;
108
- --_wrapper-size: calc(var(--_checkbox-size) - 5px);
109
106
  --_outline-width: var(--input-outline-width-thin);
110
107
  --_border-width: var(--input-border-width-default);
111
108
  --_box-shadow: none;
112
109
 
113
110
  display: grid;
114
111
  grid-template-areas: 'element-stack';
115
- height: var(--_wrapper-size);
116
- width: var(--_wrapper-size);
112
+
113
+ background-color: var(--theme-form-radio-bg);
114
+ border-radius: 4px;
117
115
 
118
116
  &:has(.input-checkbox-core:focus-visible) {
119
117
  --_box-shadow: var(--theme-form-focus-box-shadow);
@@ -137,24 +135,11 @@ const icon = computed(() => {
137
135
  }
138
136
 
139
137
  .input-checkbox-decorator {
140
- --_padding: 5px;
141
- display: grid;
142
138
  grid-area: element-stack;
143
- background-color: var(--theme-form-checkbox-bg);
144
- border-radius: 2px;
145
- place-content: center;
146
- position: relative;
147
- height: var(--_wrapper-size);
148
- width: var(--_wrapper-size);
149
- z-index: -1;
150
-
151
- .icon {
152
- grid-area: stack;
153
- color: var(--theme-form-radio-symbol);
154
- height: var(--_checkbox-size);
155
- width: var(--_checkbox-size);
156
- box-shadow: var(--_box-shadow);
157
- }
139
+ color: var(--theme-form-radio-symbol);
140
+ height: var(--_checkbox-size);
141
+ width: var(--_checkbox-size);
142
+ box-shadow: var(--_box-shadow);
158
143
  }
159
144
 
160
145
  .input-checkbox-core {
@@ -167,6 +152,11 @@ const icon = computed(() => {
167
152
  &:hover {
168
153
  cursor: pointer;
169
154
  }
155
+
156
+ &:focus {
157
+ border: var(--_border-width) solid var(--theme-form-input-border);
158
+ outline: var(--_outline-width) solid hsl(from var(--theme-form-input-outline) h s 50%);
159
+ }
170
160
  }
171
161
  }
172
162
  </style>
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="input-radiobutton-wrapper" :data-form-theme="formTheme" :class="[size, { error: fieldHasError }]">
3
+ <Icon :name="icon" class="input-radiobutton-decorator" />
3
4
  <input
4
5
  type="radio"
5
6
  :true-value="trueValue"
@@ -13,9 +14,6 @@
13
14
  v-model="modelValue"
14
15
  ref="inputField"
15
16
  />
16
- <div class="input-radiobutton-decorator" :class="[size]">
17
- <Icon :name="icon" class="icon" />
18
- </div>
19
17
  </div>
20
18
  </template>
21
19
 
@@ -103,6 +101,18 @@ const isChecked = computed(() => {
103
101
  const icon = computed(() => {
104
102
  return isChecked.value ? stateIcon.checked : stateIcon.unchecked;
105
103
  });
104
+
105
+ const useCustomizeIcon = (content: string, name: string, prefix: string, provider: string) => {
106
+ console.log('useCustomizeIcon');
107
+ // if (prefix !== 'carbon') return content; // Ignore Prefix
108
+
109
+ return content
110
+ .replace(/stroke-width="[^"]*"/g, `stroke-width="2"`) // Change stroke width to 2
111
+ .replace(/stroke="[^"]*"/g, `stroke="#ff0000"`) // Change stroke color to red
112
+ .replace(/fill="[^"]*"/g, `fill="#00ff00"`) // Change fill color to green
113
+ .replace(/animation-duration="[^"]*"/g, `animation-duration="1s"`) // Change animation duration to 1s (for animated icons)
114
+ .replace(/opacity="[^"]*"/g, `opacity="0.8"`); // Change opacity to 0.8
115
+ };
106
116
  </script>
107
117
 
108
118
  <style scoped lang="css">
@@ -114,9 +124,9 @@ const icon = computed(() => {
114
124
 
115
125
  display: grid;
116
126
  grid-template-areas: 'element-stack';
117
- height: var(--_checkbox-size);
118
- width: var(--_checkbox-size);
119
- overflow: hidden;
127
+
128
+ background-color: var(--theme-form-radio-bg);
129
+ border-radius: 50%;
120
130
 
121
131
  &:has(.input-radiobutton-core:focus-visible) {
122
132
  --_box-shadow: var(--theme-form-focus-box-shadow);
@@ -140,25 +150,11 @@ const icon = computed(() => {
140
150
  }
141
151
 
142
152
  .input-radiobutton-decorator {
143
- --_padding: 5px;
144
- display: grid;
145
153
  grid-area: element-stack;
146
- background-color: var(--theme-form-checkbox-bg);
147
- border-radius: 100%;
148
- place-content: center;
149
- position: relative;
154
+ color: var(--theme-form-radio-symbol);
150
155
  height: var(--_checkbox-size);
151
156
  width: var(--_checkbox-size);
152
- z-index: -1;
153
-
154
- .icon {
155
- grid-area: stack;
156
- color: var(--theme-form-radio-symbol);
157
- height: var(--_checkbox-size);
158
- width: var(--_checkbox-size);
159
- box-shadow: var(--_box-shadow);
160
- outline: 1px solid yellow;
161
- }
157
+ box-shadow: var(--_box-shadow);
162
158
  }
163
159
 
164
160
  .input-radiobutton-core {
@@ -176,13 +172,6 @@ const icon = computed(() => {
176
172
  border: var(--_border-width) solid var(--theme-form-input-border);
177
173
  outline: var(--_outline-width) solid hsl(from var(--theme-form-input-outline) h s 50%);
178
174
  }
179
-
180
- &:checked::after {
181
- display: grid;
182
- font-family: var(--font-family);
183
- place-content: center;
184
- font-size: calc(var(--_checkbox-size) * 0.75);
185
- }
186
175
  }
187
176
  }
188
177
  </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-forms",
3
3
  "type": "module",
4
- "version": "2.1.7",
4
+ "version": "2.1.8",
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",