srcdev-nuxt-forms 2.1.9 → 2.1.11

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.
@@ -8,17 +8,24 @@
8
8
  --theme-form-input-outline-active: var(--red-6);
9
9
  --theme-form-input-outline-focus: var(--red-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--red-12);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--red-12), var(--red-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--red-12), var(--red-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--red-1), var(--red-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--red-6);
16
- --theme-form-checkbox-symbol: var(--red-8);
19
+ --theme-form-checkbox-symbol: var(--red-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--red-12), var(--red-12));
23
+ --theme-form-radio-outline: light-dark(var(--red-1), var(--red-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--red-6);
21
- --theme-form-radio-symbol: var(--red-8);
26
+ --theme-form-radio-symbol: var(--red-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--red-12), var(--red-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='error'] {
@@ -37,9 +44,6 @@
37
44
  --theme-btn-outline-focus: var(--red-0);
38
45
  --theme-btn-text-focus: var(--red-12);
39
46
 
40
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--red-12);
47
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--red-12), var(--red-2));
41
48
  }
42
-
43
- --theme-error-surface: var(--red-12);
44
- --theme-error-text: var(--red-0);
45
49
  }
@@ -8,35 +8,42 @@
8
8
  --theme-form-input-outline-active: var(--gray-6);
9
9
  --theme-form-input-outline-focus: var(--gray-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--gray-1);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--gray-12), var(--gray-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--gray-12), var(--gray-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--gray-1), var(--gray-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--gray-6);
16
- --theme-form-checkbox-symbol: var(--gray-8);
19
+ --theme-form-checkbox-symbol: var(--gray-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--gray-12), var(--gray-12));
23
+ --theme-form-radio-outline: light-dark(var(--gray-1), var(--gray-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--gray-6);
21
- --theme-form-radio-symbol: var(--gray-8);
26
+ --theme-form-radio-symbol: var(--gray-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--gray-12), var(--gray-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='ghost'] {
25
- --theme-btn-bg: var(--gray-0);
26
- --theme-btn-border: transparent;
27
- --theme-btn-outline: transparent;
28
- --theme-btn-text: var(--gray-12);
29
-
30
- --theme-btn-bg-hover: var(--gray-2);
31
- --theme-btn-border-hover: transparent;
32
- --theme-btn-outline-hover: transparent;
32
+ --theme-btn-bg: var(--gray-12);
33
+ --theme-btn-border: var(--gray-0);
34
+ --theme-btn-outline: var(--gray-12);
35
+ --theme-btn-text: var(--gray-0);
36
+
37
+ --theme-btn-bg-hover: var(--gray-0);
38
+ --theme-btn-border-hover: var(--gray-12);
39
+ --theme-btn-outline-hover: var(--gray-0);
33
40
  --theme-btn-text-hover: var(--gray-12);
34
41
 
35
- --theme-btn-bg-focus: var(--gray-1);
36
- --theme-btn-border-focus: transparent;
37
- --theme-btn-outline-focus: transparent;
42
+ --theme-btn-bg-focus: var(--gray-0);
43
+ --theme-btn-border-focus: var(--gray-12);
44
+ --theme-btn-outline-focus: var(--gray-0);
38
45
  --theme-btn-text-focus: var(--gray-12);
39
46
 
40
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--gray-1);
47
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--gray-12), var(--gray-2));
41
48
  }
42
49
  }
@@ -12,14 +12,20 @@
12
12
  --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--blue-12), var(--blue-2));
13
13
 
14
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--blue-12), var(--blue-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--blue-1), var(--blue-1));
15
17
  --theme-form-checkbox-shadow: transparent;
16
18
  --theme-form-checkbox-shadow-focus: var(--blue-6);
17
19
  --theme-form-checkbox-symbol: var(--blue-12);
18
20
 
19
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--blue-12), var(--blue-12));
23
+ --theme-form-radio-outline: light-dark(var(--blue-1), var(--blue-1));
20
24
  --theme-form-radio-shadow: transparent;
21
25
  --theme-form-radio-shadow-focus: var(--blue-6);
22
26
  --theme-form-radio-symbol: var(--blue-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--blue-12), var(--blue-3));
23
29
  }
24
30
 
25
31
  [data-btn-theme='primary'] {
@@ -8,17 +8,24 @@
8
8
  --theme-form-input-outline-active: var(--gray-6);
9
9
  --theme-form-input-outline-focus: var(--gray-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--gray-12);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--gray-12), var(--gray-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--gray-12), var(--gray-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--gray-1), var(--gray-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--gray-6);
16
- --theme-form-checkbox-symbol: var(--gray-8);
19
+ --theme-form-checkbox-symbol: var(--gray-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--gray-12), var(--gray-12));
23
+ --theme-form-radio-outline: light-dark(var(--gray-1), var(--gray-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--gray-6);
21
- --theme-form-radio-symbol: var(--gray-8);
26
+ --theme-form-radio-symbol: var(--gray-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--gray-12), var(--gray-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='secondary'] {
@@ -37,6 +44,6 @@
37
44
  --theme-btn-outline-focus: var(--gray-0);
38
45
  --theme-btn-text-focus: var(--gray-12);
39
46
 
40
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--gray-12);
47
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--gray-12), var(--gray-2));
41
48
  }
42
49
  }
@@ -8,17 +8,24 @@
8
8
  --theme-form-input-outline-active: var(--green-6);
9
9
  --theme-form-input-outline-focus: var(--green-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--green-12);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--green-12), var(--green-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--green-12), var(--green-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--green-1), var(--green-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--green-6);
16
- --theme-form-checkbox-symbol: var(--green-8);
19
+ --theme-form-checkbox-symbol: var(--green-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--green-12), var(--green-12));
23
+ --theme-form-radio-outline: light-dark(var(--green-1), var(--green-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--green-6);
21
- --theme-form-radio-symbol: var(--green-8);
26
+ --theme-form-radio-symbol: var(--green-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--green-12), var(--green-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='success'] {
@@ -37,6 +44,6 @@
37
44
  --theme-btn-outline-focus: var(--green-0);
38
45
  --theme-btn-text-focus: var(--green-12);
39
46
 
40
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--green-12);
47
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--green-12), var(--green-2));
41
48
  }
42
49
  }
@@ -8,17 +8,24 @@
8
8
  --theme-form-input-outline-active: var(--gray-6);
9
9
  --theme-form-input-outline-focus: var(--gray-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--gray-12);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--gray-12), var(--gray-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--gray-12), var(--gray-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--gray-1), var(--gray-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--gray-6);
16
- --theme-form-checkbox-symbol: var(--gray-8);
19
+ --theme-form-checkbox-symbol: var(--gray-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--gray-12), var(--gray-12));
23
+ --theme-form-radio-outline: light-dark(var(--gray-1), var(--gray-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--gray-6);
21
- --theme-form-radio-symbol: var(--gray-8);
26
+ --theme-form-radio-symbol: var(--gray-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--gray-12), var(--gray-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='tertiary'] {
@@ -8,17 +8,24 @@
8
8
  --theme-form-input-outline-active: var(--orange-6);
9
9
  --theme-form-input-outline-focus: var(--orange-6);
10
10
  --theme-form-input-text: light-dark(var(--gray-10), var(--gray-11));
11
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--orange-12);
11
+
12
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--orange-12), var(--orange-2));
12
13
 
13
14
  --theme-form-checkbox-bg: light-dark(var(--gray-1), var(--gray-4));
15
+ --theme-form-checkbox-border: light-dark(var(--orange-12), var(--orange-12));
16
+ --theme-form-checkbox-outline: light-dark(var(--orange-1), var(--orange-1));
14
17
  --theme-form-checkbox-shadow: transparent;
15
18
  --theme-form-checkbox-shadow-focus: var(--orange-6);
16
- --theme-form-checkbox-symbol: var(--orange-8);
19
+ --theme-form-checkbox-symbol: var(--orange-12);
17
20
 
18
21
  --theme-form-radio-bg: light-dark(var(--gray-1), var(--gray-4));
22
+ --theme-form-radio-border: light-dark(var(--orange-12), var(--orange-12));
23
+ --theme-form-radio-outline: light-dark(var(--orange-1), var(--orange-1));
19
24
  --theme-form-radio-shadow: transparent;
20
25
  --theme-form-radio-shadow-focus: var(--orange-6);
21
- --theme-form-radio-symbol: var(--orange-8);
26
+ --theme-form-radio-symbol: var(--orange-12);
27
+
28
+ --theme-form-range-accent-color: light-dark(var(--orange-12), var(--orange-3));
22
29
  }
23
30
 
24
31
  [data-btn-theme='warning'] {
@@ -37,6 +44,6 @@
37
44
  --theme-btn-outline-focus: var(--orange-0);
38
45
  --theme-btn-text-focus: var(--orange-12);
39
46
 
40
- --theme-form-focus-box-shadow: 1px 1px 8px 1px var(--orange-12);
47
+ --theme-form-focus-box-shadow: 1px 1px 8px 1px light-dark(var(--orange-12), var(--orange-2));
41
48
  }
42
49
  }
@@ -1,6 +1,9 @@
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
+ <slot name="checkedIcon" v-if="isChecked">
4
+ <Icon name="material-symbols:check-small" class="input-checked-icon" />
5
+ </slot>
6
+
4
7
  <input
5
8
  type="checkbox"
6
9
  :true-value="trueValue"
@@ -19,7 +22,7 @@
19
22
 
20
23
  <script setup lang="ts">
21
24
  import propValidators from '../c12/prop-validators';
22
- const { id, name, required, trueValue, falseValue, multipleOptions, theme, styleClassPassthrough, size, stateIcon, fieldHasError } = defineProps({
25
+ const { id, name, required, trueValue, falseValue, multipleOptions, theme, styleClassPassthrough, size, fieldHasError } = defineProps({
23
26
  id: {
24
27
  type: String,
25
28
  required: true,
@@ -58,13 +61,6 @@ const { id, name, required, trueValue, falseValue, multipleOptions, theme, style
58
61
  return propValidators.size.includes(value);
59
62
  },
60
63
  },
61
- stateIcon: {
62
- type: Object as PropType<{ checked: string; unchecked: string }>,
63
- default: {
64
- checked: 'carbon:checkbox-checked',
65
- unchecked: 'carbon:checkbox',
66
- },
67
- },
68
64
  fieldHasError: {
69
65
  type: Boolean,
70
66
  default: false,
@@ -94,24 +90,29 @@ const isChecked = computed(() => {
94
90
  return modelValue.value === trueValue;
95
91
  }
96
92
  });
97
-
98
- const icon = computed(() => {
99
- return isChecked.value ? stateIcon.checked : stateIcon.unchecked;
100
- });
101
93
  </script>
102
94
 
103
- <style scoped lang="css">
95
+ <style lang="css">
104
96
  .input-checkbox-wrapper {
105
97
  --_checkbox-size: initial;
106
98
  --_outline-width: var(--input-outline-width-thin);
107
99
  --_border-width: var(--input-border-width-default);
100
+ --_border-color: var(--theme-form-checkbox-border);
101
+ --_outline-color: var(--theme-form-checkbox-outline);
108
102
  --_box-shadow: none;
109
103
 
110
104
  display: grid;
111
105
  grid-template-areas: 'element-stack';
106
+ place-content: center;
112
107
 
113
- background-color: var(--theme-form-radio-bg);
108
+ background-color: var(--theme-form-checkbox-bg);
114
109
  border-radius: 4px;
110
+ border: var(--_border-width) solid var(--_border-color);
111
+ outline: 1px solid var(--_outline-color);
112
+ box-shadow: var(--_box-shadow);
113
+
114
+ height: var(--_checkbox-size);
115
+ width: var(--_checkbox-size);
115
116
 
116
117
  &:has(.input-checkbox-core:focus-visible) {
117
118
  --_box-shadow: var(--theme-form-focus-box-shadow);
@@ -134,9 +135,9 @@ const icon = computed(() => {
134
135
  --_checkbox-size: 44px;
135
136
  }
136
137
 
137
- .input-checkbox-decorator {
138
+ .input-checked-icon {
138
139
  grid-area: element-stack;
139
- color: var(--theme-form-radio-symbol);
140
+ color: var(--theme-form-checkbox-symbol);
140
141
  height: var(--_checkbox-size);
141
142
  width: var(--_checkbox-size);
142
143
  box-shadow: var(--_box-shadow);
@@ -149,13 +150,15 @@ const icon = computed(() => {
149
150
  overflow: hidden;
150
151
  opacity: 0;
151
152
 
153
+ height: var(--_checkbox-size);
154
+ width: var(--_checkbox-size);
155
+
152
156
  &:hover {
153
157
  cursor: pointer;
154
158
  }
155
159
 
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%);
160
+ &:focus-visible {
161
+ --_box-shadow: var(--theme-form-focus-box-shadow);
159
162
  }
160
163
  }
161
164
  }
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div class="input-checkbox-with-label" :class="[elementClasses, optionsLayout, { error: fieldHasError }]">
3
- <InputCheckboxCore :id :name :required v-model="modelValue" :size :trueValue :falseValue :stateIcon :fieldHasError :theme />
3
+ <InputCheckboxCore :id :name :required v-model="modelValue" :size :trueValue :falseValue :fieldHasError :theme>
4
+ <template #checkedIcon>
5
+ <slot name="checkedIcon"></slot>
6
+ </template>
7
+ </InputCheckboxCore>
4
8
  <label v-if="hasLabelContent" class="input-checkbox-label body-normal" :for="id">
5
9
  <slot name="labelContent"></slot>
6
10
  </label>
@@ -11,7 +15,7 @@
11
15
  <script setup lang="ts">
12
16
  import propValidators from '../c12/prop-validators';
13
17
 
14
- const { id, name, label, required, fieldHasError, trueValue, falseValue, size, stateIcon, optionsLayout, styleClassPassthrough, theme } = defineProps({
18
+ const { id, name, label, required, fieldHasError, trueValue, falseValue, size, optionsLayout, styleClassPassthrough, theme } = defineProps({
15
19
  id: {
16
20
  type: String,
17
21
  required: true,
@@ -47,13 +51,6 @@ const { id, name, label, required, fieldHasError, trueValue, falseValue, size, s
47
51
  return propValidators.size.includes(value);
48
52
  },
49
53
  },
50
- stateIcon: {
51
- type: Object as PropType<{ checked: string; unchecked: string }>,
52
- default: {
53
- checked: 'carbon:checkbox-checked',
54
- unchecked: 'carbon:checkbox',
55
- },
56
- },
57
54
  optionsLayout: {
58
55
  type: String as PropType<string>,
59
56
  default: 'equal-widths',
@@ -6,7 +6,11 @@
6
6
  </template>
7
7
  <div class="multiple-checkboxes-items" :class="[optionsLayout]">
8
8
  <template v-for="item in fieldData.data" :key="item.id">
9
- <InputCheckboxWithLabel :id="`${name}-${item.value}`" :name :required :label="item.label" :fieldHasError v-model="modelValue" :true-value="item.value" :size :stateIcon :optionsLayout :theme />
9
+ <InputCheckboxWithLabel :id="`${name}-${item.value}`" :name :required :label="item.label" :fieldHasError v-model="modelValue" :true-value="item.value" :size :optionsLayout :theme>
10
+ <template #checkedIcon>
11
+ <slot name="checkedIcon"></slot>
12
+ </template>
13
+ </InputCheckboxWithLabel>
10
14
  </template>
11
15
  </div>
12
16
  <InputError :errorMessage="errorMessage" :fieldHasError :id="name" :isDetached="true" />
@@ -19,7 +23,7 @@ import type { IOptionsConfig, IFormMultipleOptions } from '@/types/types.forms';
19
23
 
20
24
  import type { C12nMultipleCheckboxes, IFormFieldC12, IFormData } from '@/types/types.forms';
21
25
 
22
- const { id, name, legend, label, required, fieldHasError, placeholder, errorMessage, size, optionsLayout, equalCols, stateIcon, styleClassPassthrough, theme } = defineProps({
26
+ const { id, name, legend, label, required, fieldHasError, placeholder, errorMessage, size, optionsLayout, equalCols, styleClassPassthrough, theme } = defineProps({
23
27
  id: {
24
28
  type: String,
25
29
  required: true,
@@ -74,13 +78,6 @@ const { id, name, legend, label, required, fieldHasError, placeholder, errorMess
74
78
  type: Boolean,
75
79
  default: true,
76
80
  },
77
- stateIcon: {
78
- type: Object as PropType<{ checked: string; unchecked: string }>,
79
- default: {
80
- checked: 'carbon:checkbox-checked',
81
- unchecked: 'carbon:checkbox',
82
- },
83
- },
84
81
  styleClassPassthrough: {
85
82
  type: Array as PropType<string[]>,
86
83
  default: () => [],
@@ -5,7 +5,10 @@
5
5
  <slot name="description"></slot>
6
6
  </template>
7
7
  <div class="single-checkbox-items" :class="[optionsLayout]">
8
- <InputCheckboxWithLabel :id :name :required :label :fieldHasError v-model="modelValue" :trueValue :falseValue :size :stateIcon :theme>
8
+ <InputCheckboxWithLabel :id :name :required :label :fieldHasError v-model="modelValue" :trueValue :falseValue :size :theme>
9
+ <template #checkedIcon>
10
+ <slot name="checkedIcon"></slot>
11
+ </template>
9
12
  <template v-if="hasLabelContent" #labelContent>
10
13
  <slot name="labelContent"></slot>
11
14
  </template>
@@ -19,7 +22,7 @@
19
22
  import propValidators from '../../c12/prop-validators';
20
23
  import type { IFormMultipleOptions } from '@/types/types.forms';
21
24
 
22
- const { id, name, legend, label, required, fieldHasError, errorMessage, size, optionsLayout, equalCols, trueValue, falseValue, stateIcon, styleClassPassthrough, theme } = defineProps({
25
+ const { id, name, legend, label, required, fieldHasError, errorMessage, size, optionsLayout, equalCols, trueValue, falseValue, styleClassPassthrough, theme } = defineProps({
23
26
  id: {
24
27
  type: String,
25
28
  required: true,
@@ -79,13 +82,6 @@ const { id, name, legend, label, required, fieldHasError, errorMessage, size, op
79
82
  type: Boolean,
80
83
  default: true,
81
84
  },
82
- stateIcon: {
83
- type: Object as PropType<{ checked: string; unchecked: string }>,
84
- default: {
85
- checked: 'carbon:checkbox-checked',
86
- unchecked: 'carbon:checkbox',
87
- },
88
- },
89
85
  styleClassPassthrough: {
90
86
  type: Array as PropType<string[]>,
91
87
  default: () => [],
@@ -13,7 +13,7 @@
13
13
  :readonly="Number(modelValue) <= min"
14
14
  :is-pending="false"
15
15
  buttonText="Step down"
16
- theme="primary"
16
+ :theme
17
17
  size="x-small"
18
18
  >
19
19
  <template #iconOnly>
@@ -28,7 +28,7 @@
28
28
  :readonly="Number(modelValue) >= max"
29
29
  :is-pending="false"
30
30
  buttonText="Step up"
31
- theme="primary"
31
+ :theme
32
32
  size="x-small"
33
33
  >
34
34
  <template #iconOnly>
@@ -1,6 +1,8 @@
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
+ <slot name="checkedIcon" v-if="isChecked">
4
+ <Icon name="material-symbols:circle" class="input-checked-icon" />
5
+ </slot>
4
6
  <input
5
7
  type="radio"
6
8
  :true-value="trueValue"
@@ -19,7 +21,7 @@
19
21
 
20
22
  <script setup lang="ts">
21
23
  import propValidators from '../c12/prop-validators';
22
- const { id, name, required, trueValue, falseValue, multipleOptions, theme, styleClassPassthrough, size, stateIcon, fieldHasError } = defineProps({
24
+ const { id, name, required, trueValue, falseValue, multipleOptions, theme, styleClassPassthrough, size, fieldHasError } = defineProps({
23
25
  id: {
24
26
  type: String,
25
27
  required: true,
@@ -58,13 +60,6 @@ const { id, name, required, trueValue, falseValue, multipleOptions, theme, style
58
60
  return propValidators.size.includes(value);
59
61
  },
60
62
  },
61
- stateIcon: {
62
- type: Object as PropType<{ checked: string; unchecked: string }>,
63
- default: {
64
- checked: 'carbon:radio-button-checked',
65
- unchecked: 'carbon:radio-button',
66
- },
67
- },
68
63
  fieldHasError: {
69
64
  type: Boolean,
70
65
  default: false,
@@ -97,36 +92,29 @@ const isChecked = computed(() => {
97
92
  return modelValue.value === trueValue;
98
93
  }
99
94
  });
100
-
101
- const icon = computed(() => {
102
- return isChecked.value ? stateIcon.checked : stateIcon.unchecked;
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
- };
116
95
  </script>
117
96
 
118
- <style scoped lang="css">
97
+ <style lang="css">
119
98
  .input-radiobutton-wrapper {
120
99
  --_checkbox-size: initial;
121
100
  --_outline-width: var(--input-outline-width-thin);
122
101
  --_border-width: var(--input-border-width-default);
102
+ --_border-color: var(--theme-form-radio-border);
103
+ --_outline-color: var(--theme-form-radio-outline);
123
104
  --_box-shadow: none;
124
105
 
125
106
  display: grid;
126
107
  grid-template-areas: 'element-stack';
108
+ /* place-content: center; */
127
109
 
128
110
  background-color: var(--theme-form-radio-bg);
129
111
  border-radius: 50%;
112
+ border: var(--_border-width) solid var(--_border-color);
113
+ outline: 1px solid var(--_outline-color);
114
+ box-shadow: var(--_box-shadow);
115
+
116
+ height: var(--_checkbox-size);
117
+ width: var(--_checkbox-size);
130
118
 
131
119
  &:has(.input-radiobutton-core:focus-visible) {
132
120
  --_box-shadow: var(--theme-form-focus-box-shadow);
@@ -149,12 +137,15 @@ const useCustomizeIcon = (content: string, name: string, prefix: string, provide
149
137
  --_checkbox-size: 44px;
150
138
  }
151
139
 
152
- .input-radiobutton-decorator {
140
+ .input-checked-icon {
141
+ --_checked-size: calc(var(--_checkbox-size) * 0.65);
153
142
  grid-area: element-stack;
143
+ align-self: center;
144
+ justify-self: center;
154
145
  color: var(--theme-form-radio-symbol);
155
- height: var(--_checkbox-size);
156
- width: var(--_checkbox-size);
157
- box-shadow: var(--_box-shadow);
146
+ height: var(--_checked-size);
147
+ width: var(--_checked-size);
148
+ translate: -2px -2px;
158
149
  }
159
150
 
160
151
  .input-radiobutton-core {
@@ -164,13 +155,15 @@ const useCustomizeIcon = (content: string, name: string, prefix: string, provide
164
155
  overflow: hidden;
165
156
  opacity: 0;
166
157
 
158
+ height: var(--_checkbox-size);
159
+ width: var(--_checkbox-size);
160
+
167
161
  &:hover {
168
162
  cursor: pointer;
169
163
  }
170
164
 
171
- &:focus {
172
- border: var(--_border-width) solid var(--theme-form-input-border);
173
- outline: var(--_outline-width) solid hsl(from var(--theme-form-input-outline) h s 50%);
165
+ &:focus-visible {
166
+ --_box-shadow: var(--theme-form-focus-box-shadow);
174
167
  }
175
168
  }
176
169
  }
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div class="input-radiobutton-with-label" :class="[elementClasses, { error: fieldHasError }]">
3
- <InputRadiobuttonCore :id :name :required v-model="modelValue" :size :trueValue :falseValue :stateIcon :fieldHasError :theme />
3
+ <InputRadiobuttonCore :id :name :required v-model="modelValue" :size :trueValue :falseValue :fieldHasError :theme>
4
+ <template #checkedIcon>
5
+ <slot name="checkedIcon"></slot>
6
+ </template>
7
+ </InputRadiobuttonCore>
4
8
  <label v-if="hasLabelContent" class="input-radiobutton-label body-normal" :for="id">
5
9
  <slot name="labelContent"></slot>
6
10
  </label>
@@ -11,7 +15,7 @@
11
15
  <script setup lang="ts">
12
16
  import propValidators from '../c12/prop-validators';
13
17
 
14
- const { id, name, label, required, fieldHasError, trueValue, falseValue, size, stateIcon, styleClassPassthrough, theme } = defineProps({
18
+ const { id, name, label, required, fieldHasError, trueValue, falseValue, size, styleClassPassthrough, theme } = defineProps({
15
19
  id: {
16
20
  type: String,
17
21
  required: true,
@@ -47,13 +51,6 @@ const { id, name, label, required, fieldHasError, trueValue, falseValue, size, s
47
51
  return propValidators.size.includes(value);
48
52
  },
49
53
  },
50
- stateIcon: {
51
- type: Object as PropType<{ checked: string; unchecked: string }>,
52
- default: {
53
- checked: 'carbon:radio-button-checked',
54
- unchecked: 'carbon:radio-button',
55
- },
56
- },
57
54
  styleClassPassthrough: {
58
55
  type: Array as PropType<string[]>,
59
56
  default: () => [],
@@ -6,7 +6,11 @@
6
6
  </template>
7
7
  <div class="multiple-radiobuttons-items" :class="[optionsLayout]">
8
8
  <template v-for="item in fieldData.data" :key="item.id">
9
- <InputRadiobuttonWithLabel :id="`${name}-${item.value}`" :name="item.name" :required :label="item.label" :fieldHasError v-model="modelValue" :true-value="item.value" :size :stateIcon :theme />
9
+ <InputRadiobuttonWithLabel :id="`${name}-${item.value}`" :name="`${name}-${item.name}`" :required :label="item.label" :fieldHasError v-model="modelValue" :true-value="item.value" :size :theme>
10
+ <template #checkedIcon>
11
+ <slot name="checkedIcon"></slot>
12
+ </template>
13
+ </InputRadiobuttonWithLabel>
10
14
  </template>
11
15
  </div>
12
16
  <InputError :errorMessage="errorMessage" :fieldHasError :id="name" :isDetached="true" />
@@ -15,11 +19,9 @@
15
19
 
16
20
  <script setup lang="ts">
17
21
  import propValidators from '../../c12/prop-validators';
18
- import type { IOptionsConfig, IFormMultipleOptions } from '@/types/types.forms';
22
+ import type { IFormMultipleOptions } from '@/types/types.forms';
19
23
 
20
- import type { C12nMultipleCheckboxes, IFormFieldC12, IFormData } from '@/types/types.forms';
21
-
22
- const { id, name, legend, label, required, fieldHasError, placeholder, errorMessage, size, optionsLayout, equalCols, stateIcon, styleClassPassthrough, theme } = defineProps({
24
+ const { id, name, legend, label, required, fieldHasError, placeholder, errorMessage, size, optionsLayout, equalCols, styleClassPassthrough, theme } = defineProps({
23
25
  id: {
24
26
  type: String,
25
27
  required: true,
@@ -74,13 +76,6 @@ const { id, name, legend, label, required, fieldHasError, placeholder, errorMess
74
76
  type: Boolean,
75
77
  default: true,
76
78
  },
77
- stateIcon: {
78
- type: Object as PropType<{ checked: string; unchecked: string }>,
79
- default: {
80
- checked: 'carbon:radio-button-checked',
81
- unchecked: 'carbon:radio-button',
82
- },
83
- },
84
79
  styleClassPassthrough: {
85
80
  type: Array as PropType<string[]>,
86
81
  default: () => [],
@@ -16,7 +16,7 @@
16
16
  :list="hasDataList ? name + '-datalist' : ''"
17
17
  :class="['input-range-core', `input-range--${size}`, `input-range--${weight}`, styleClassPassthrough]"
18
18
  v-model="modelValue"
19
- ref="inputField"
19
+ ref="inputRange"
20
20
  />
21
21
 
22
22
  <template v-if="hasDataList">
@@ -102,6 +102,15 @@ const formTheme = computed(() => {
102
102
  });
103
103
 
104
104
  const modelValue = defineModel<number | readonly number[]>();
105
+
106
+ // @input="changeBackgroundColor"
107
+ const changeBackgroundColor = () => {
108
+ console.log('changeBackgroundColor()');
109
+ const inputRange = ref<HTMLInputElement | null>(null);
110
+ if (inputRange.value !== null) {
111
+ inputRange.value.style.accentColor = 'hsl(' + modelValue.value + ', 100%, 50%)';
112
+ }
113
+ };
105
114
  </script>
106
115
 
107
116
  <style lang="css">
@@ -126,11 +135,41 @@ const modelValue = defineModel<number | readonly number[]>();
126
135
  .input-range-container {
127
136
  flex-grow: 1;
128
137
  .input-range-core {
129
- color: var(--theme-form-input-text);
138
+ accent-color: var(--theme-form-range-accent-color);
130
139
  height: var(--_input-range-height);
131
140
  margin: 0;
132
141
  width: 100%;
133
142
 
143
+ /* For Chrome, Safari, Opera, and Edge */
144
+ /* &::-webkit-slider-runnable-track {
145
+ background: var(--theme-form-range-accent-color);
146
+ height: var(--_input-range-height);
147
+ } */
148
+
149
+ /* For Firefox */
150
+ /* &::-moz-range-track {
151
+ background: var(--theme-form-range-accent-color);
152
+ height: var(--_input-range-height);
153
+ } */
154
+
155
+ /* Stling the thumb */
156
+ /* &::-webkit-slider-thumb {
157
+ -webkit-appearance: none;
158
+ background: #5cd5eb;
159
+ height: 2rem;
160
+ width: 1rem;
161
+ border-radius: 10px;
162
+ } */
163
+
164
+ /* For Firefox */
165
+ /* &::-moz-range-thumb {
166
+ background: #5cd5eb;
167
+ height: 2rem;
168
+ width: 1rem;
169
+ border-radius: 10px;
170
+ border: none;
171
+ } */
172
+
134
173
  &:focus-visible {
135
174
  box-shadow: var(--theme-form-focus-box-shadow);
136
175
  }
@@ -16,7 +16,7 @@
16
16
  :readonly="Number(modelValue) === min"
17
17
  :is-pending="false"
18
18
  buttonText="Step down"
19
- theme="ghost"
19
+ :theme
20
20
  size="x-small"
21
21
  >
22
22
  <template #iconOnly>
@@ -31,7 +31,7 @@
31
31
  :readonly="Number(modelValue) === max"
32
32
  :is-pending="false"
33
33
  buttonText="Step up"
34
- theme="ghost"
34
+ :theme
35
35
  size="x-small"
36
36
  >
37
37
  <template #iconOnly>
@@ -6,7 +6,7 @@
6
6
  @click.stop.prevent="toggleDisplayPassword"
7
7
  :is-pending="false"
8
8
  :buttonText
9
- theme="ghost"
9
+ :theme
10
10
  size="x-small"
11
11
  @focusin="updateFocus(name, true)"
12
12
  @focusout="updateFocus(name, false)"
@@ -29,7 +29,7 @@
29
29
  :readonly="Number(modelValue) <= min"
30
30
  :is-pending="false"
31
31
  buttonText="Step down"
32
- theme="ghost"
32
+ :theme
33
33
  size="x-small"
34
34
  >
35
35
  <template #iconOnly>
@@ -44,7 +44,7 @@
44
44
  :readonly="Number(modelValue) >= max"
45
45
  :is-pending="false"
46
46
  buttonText="Step up"
47
- theme="ghost"
47
+ :theme
48
48
  size="x-small"
49
49
  >
50
50
  <template #iconOnly>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-forms",
3
3
  "type": "module",
4
- "version": "2.1.9",
4
+ "version": "2.1.11",
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",