@kerkhoff-ict/solora 2.6.2 → 2.7.0

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/dist/index.css CHANGED
@@ -1099,6 +1099,124 @@
1099
1099
  background: rgba(255, 255, 255, 0.2);
1100
1100
  }
1101
1101
 
1102
+ /* src/components/check.css */
1103
+ .apple-input-group {
1104
+ margin-bottom: 1.5rem;
1105
+ font-family:
1106
+ -apple-system,
1107
+ BlinkMacSystemFont,
1108
+ "Segoe UI",
1109
+ Roboto,
1110
+ Helvetica,
1111
+ Arial,
1112
+ sans-serif;
1113
+ }
1114
+ .apple-input-group-title {
1115
+ font-weight: 600;
1116
+ margin-bottom: 0.5rem;
1117
+ display: block;
1118
+ color: var(--color-text-dark, #000);
1119
+ }
1120
+ .apple-input-wrapper {
1121
+ display: flex;
1122
+ align-items: center;
1123
+ gap: 0.6rem;
1124
+ margin-bottom: 0.6rem;
1125
+ cursor: pointer;
1126
+ user-select: none;
1127
+ color: var(--color-text-dark, #000);
1128
+ }
1129
+ .apple-input-wrapper input {
1130
+ position: absolute;
1131
+ opacity: 0;
1132
+ cursor: pointer;
1133
+ height: 0;
1134
+ width: 0;
1135
+ }
1136
+ .apple-control {
1137
+ position: relative;
1138
+ display: inline-block;
1139
+ width: 1.25rem;
1140
+ height: 1.25rem;
1141
+ background: #fff;
1142
+ border: 1.5px solid rgba(0, 0, 0, 0.2);
1143
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
1144
+ }
1145
+ .apple-checkbox .apple-control {
1146
+ border-radius: 4px;
1147
+ }
1148
+ .apple-radio .apple-control {
1149
+ border-radius: 50%;
1150
+ }
1151
+ .apple-input-wrapper:hover input:not(:disabled) ~ .apple-control {
1152
+ border-color: rgba(0, 0, 0, 0.4);
1153
+ }
1154
+ .apple-input-wrapper input:checked ~ .apple-control {
1155
+ background-color: #007aff;
1156
+ border-color: #007aff;
1157
+ }
1158
+ .apple-checkbox .apple-control:after {
1159
+ content: "";
1160
+ position: absolute;
1161
+ display: none;
1162
+ left: 6px;
1163
+ top: 2px;
1164
+ width: 5px;
1165
+ height: 10px;
1166
+ border: solid white;
1167
+ border-width: 0 2px 2px 0;
1168
+ transform: rotate(45deg);
1169
+ }
1170
+ .apple-checkbox input:checked ~ .apple-control:after {
1171
+ display: block;
1172
+ }
1173
+ .apple-radio .apple-control:after {
1174
+ content: "";
1175
+ position: absolute;
1176
+ display: none;
1177
+ top: 50%;
1178
+ left: 50%;
1179
+ transform: translate(-50%, -50%);
1180
+ width: 0.5rem;
1181
+ height: 0.5rem;
1182
+ border-radius: 50%;
1183
+ background: white;
1184
+ }
1185
+ .apple-radio input:checked ~ .apple-control:after {
1186
+ display: block;
1187
+ }
1188
+ .apple-input-wrapper input:disabled ~ .apple-control {
1189
+ background-color: rgba(0, 0, 0, 0.05);
1190
+ border-color: rgba(0, 0, 0, 0.1);
1191
+ cursor: not-allowed;
1192
+ }
1193
+ .apple-input-wrapper input:disabled ~ .apple-label {
1194
+ color: rgba(0, 0, 0, 0.4);
1195
+ cursor: not-allowed;
1196
+ }
1197
+ :root.dark .apple-input-group-title,
1198
+ :root.dark .apple-input-wrapper {
1199
+ color: #f0f0f0;
1200
+ }
1201
+ :root.dark .apple-control {
1202
+ background: #1c1c1e;
1203
+ border-color: rgba(255, 255, 255, 0.3);
1204
+ }
1205
+ :root.dark .apple-input-wrapper:hover input:not(:disabled) ~ .apple-control {
1206
+ border-color: rgba(255, 255, 255, 0.5);
1207
+ }
1208
+ :root.dark .apple-input-wrapper input:checked ~ .apple-control {
1209
+ background-color: #0a84ff;
1210
+ border-color: #0a84ff;
1211
+ }
1212
+ :root.dark .apple-input-wrapper input:disabled ~ .apple-control {
1213
+ background-color: rgba(255, 255, 255, 0.08);
1214
+ border-color: rgba(255, 255, 255, 0.15);
1215
+ }
1216
+ :root.dark .apple-input-wrapper input:disabled ~ .apple-label {
1217
+ color: rgba(255, 255, 255, 0.3);
1218
+ }
1219
+
1102
1220
  /* src/index.css */
1103
1221
  :root {
1104
1222
  --font-body:
package/dist/index.js CHANGED
@@ -2359,6 +2359,31 @@ function initPopovers() {
2359
2359
  });
2360
2360
  }
2361
2361
 
2362
+ // src/components/check.js
2363
+ function initCheck() {
2364
+ const limitedGroups = document.querySelectorAll(".apple-input-group[data-max]");
2365
+ limitedGroups.forEach((group) => {
2366
+ const maxAllowed = parseInt(group.getAttribute("data-max"), 10);
2367
+ const checkboxes = group.querySelectorAll('input[type="checkbox"]');
2368
+ checkboxes.forEach((checkbox) => {
2369
+ checkbox.addEventListener("change", () => {
2370
+ const checkedCount = group.querySelectorAll('input[type="checkbox"]:checked').length;
2371
+ if (checkedCount >= maxAllowed) {
2372
+ checkboxes.forEach((cb) => {
2373
+ if (!cb.checked) {
2374
+ cb.disabled = true;
2375
+ }
2376
+ });
2377
+ } else {
2378
+ checkboxes.forEach((cb) => {
2379
+ cb.disabled = false;
2380
+ });
2381
+ }
2382
+ });
2383
+ });
2384
+ });
2385
+ }
2386
+
2362
2387
  // src/index.js
2363
2388
  function safeInitAll() {
2364
2389
  try {
@@ -2368,6 +2393,7 @@ function safeInitAll() {
2368
2393
  initContextMenu();
2369
2394
  initThemeToggle();
2370
2395
  initPopovers();
2396
+ initCheck();
2371
2397
  } catch (err) {
2372
2398
  console.warn("[Solora] initAll error:", err);
2373
2399
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerkhoff-ict/solora",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "description": "Simple CSS component library",
5
5
  "main": "dist/index.js",
6
6
  "style": "dist/index.css",