@massimo-cassandro/minimo 1.19.10 → 1.19.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.19.10",
3
+ "version": "1.19.11",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -112,7 +112,7 @@ select.form-control {
112
112
 
113
113
  input[type='checkbox'] {
114
114
  color: var(--form-control-text-color);
115
- accent-color: var(--accent-color);
115
+ accent-color: var(--accent);
116
116
  transform-origin: center;
117
117
  scale: 1.3;
118
118
  }
@@ -8,7 +8,7 @@ html, body {
8
8
  font-style: var(--font-style-base);
9
9
  line-height: var(--line-height-base);
10
10
  color: var(--text-color);
11
- accent-color: var(--accent-color);
11
+ accent-color: var(--accent);
12
12
  background-color: var(--body-background-color);
13
13
 
14
14
  }
@@ -44,7 +44,7 @@ export function buildInputTag({
44
44
  * @param {Object} args
45
45
  * @param {string} args.label - checkbox label.
46
46
  * @param {string | null} args.name - checkbox `name` attribute.
47
- * @param {string | number | null} args.value - checkbox `value` attribute.
47
+ * @param {string | number | null} [args.value=1] - checkbox `value` attribute.
48
48
  * @param {boolean} [args.checked=false] - checkbox `checked` attribute.
49
49
  * @param {string | null} [args.wrapperClass=null] - optional class to be added to the `.form-group` wrapper (used only when `addFormGroup` is true).
50
50
  * @param {boolean} [args.addFormGroup=true] - When true, wraps the checkbox in a `.form-group` element.
@@ -54,7 +54,7 @@ export function buildInputTag({
54
54
  export function buildCheckboxTag({
55
55
  label,
56
56
  name,
57
- value,
57
+ value = 1,
58
58
  checked = false,
59
59
  wrapperClass = null,
60
60
  addFormGroup = true,
@@ -65,15 +65,22 @@ export function buildCheckboxTag({
65
65
  return null;
66
66
  }
67
67
 
68
+ /*
69
+ <div class="form-group">
70
+ <div class="form-check">
71
+ <input type="checkbox" id="..." name="..." class="form-check-input" value="1">
72
+ <label for="..." class="form-label">...</label>
73
+ </div>
74
+ </div>
75
+ */
68
76
  const id = randomId();
69
77
 
70
78
  const tag = {
71
79
  className: classnames('form-check', !addFormGroup && wrapperClass),
72
80
  children: [
73
- `label.form-label[for:${id}] ${label}`,
74
81
  {
75
82
  tag: 'input',
76
- className: 'form-control',
83
+ className: 'form-check-input',
77
84
  id: id,
78
85
  attrs: {
79
86
  type: 'checkbox',
@@ -81,7 +88,8 @@ export function buildCheckboxTag({
81
88
  name: name,
82
89
  checked: checked
83
90
  }
84
- }
91
+ },
92
+ `label.form-label[for:${id}] ${label}`,
85
93
  ]
86
94
  };
87
95