@kerkhoff-ict/solora 2.4.3 → 2.5.1

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
@@ -175,42 +175,6 @@
175
175
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
176
176
  }
177
177
  }
178
- flux\\:button {
179
- all: unset;
180
- display: inline-flex;
181
- align-items: center;
182
- justify-content: center;
183
- font-weight: 600;
184
- border-radius: 9999px;
185
- padding: 0.5rem 1rem;
186
- cursor: pointer;
187
- transition: all 0.2s ease;
188
- background: var(--color-primary, #0071e3);
189
- color: var(--color-text-light, #fff);
190
- }
191
- flux\\:button:hover {
192
- filter: brightness(0.85);
193
- }
194
- flux\\:button.btn-secondary {
195
- background: var(--color-secondary, #f5f5f5);
196
- color: var(--color-text-dark, #000);
197
- border: 2px solid rgba(0, 0, 0, 0.1);
198
- }
199
- flux\\:input {
200
- all: unset;
201
- width: 100%;
202
- padding: 0.3rem 0.4rem;
203
- border-radius: 12px;
204
- border: 1px solid rgba(0, 0, 0, 0.1);
205
- background: var(--color-bg, #fefefe);
206
- color: var(--color-text-dark, #000);
207
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.05);
208
- transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
209
- }
210
- flux\\:input:focus {
211
- border-color: var(--color-primary, #0071e3);
212
- box-shadow: 0 0 0 4px var(--color-focus-glow, rgba(0, 113, 227, 0.15));
213
- }
214
178
 
215
179
  /* src/components/codeblock.css */
216
180
  .codeblock {
@@ -837,13 +801,12 @@ flux\\:input:focus {
837
801
  top: 100%;
838
802
  left: 0;
839
803
  min-width: 10rem;
840
- max-width: 20rem;
841
804
  border-radius: 12px;
842
805
  margin-top: 0.5rem;
843
806
  overflow: hidden;
844
807
  overflow-y: auto;
845
808
  background: transparent;
846
- border: 1px solid rgba(255, 255, 255, 0.3);
809
+ border: 1px solid rgba(200, 200, 200, 0.81);
847
810
  backdrop-filter: blur(12px);
848
811
  -webkit-backdrop-filter: blur(12px);
849
812
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
@@ -854,7 +817,6 @@ flux\\:input:focus {
854
817
  z-index: 1000;
855
818
  padding: 0.5rem;
856
819
  color: var(--color-text-dark, #000);
857
- background: var(--color-bg, #fefefe);
858
820
  }
859
821
  .popover.sol-pop-w-16 {
860
822
  width: 4rem;
package/dist/index.js CHANGED
@@ -1918,6 +1918,44 @@ function initDropdowns() {
1918
1918
  });
1919
1919
  }
1920
1920
 
1921
+ // src/components/input.js
1922
+ function initInput(inputElement) {
1923
+ if (!inputElement) return;
1924
+ let errorDisplay = inputElement.parentNode.querySelector(".sol-error-message");
1925
+ if (!errorDisplay) {
1926
+ errorDisplay = document.createElement("span");
1927
+ errorDisplay.className = "sol-error-message";
1928
+ inputElement.parentNode.appendChild(errorDisplay);
1929
+ }
1930
+ inputElement.addEventListener("invalid", (e) => {
1931
+ e.preventDefault();
1932
+ showError();
1933
+ });
1934
+ inputElement.addEventListener("input", () => {
1935
+ if (inputElement.validity.valid) {
1936
+ hideError();
1937
+ }
1938
+ });
1939
+ function showError() {
1940
+ let message = "Ongeldige invoer";
1941
+ if (inputElement.validity.valueMissing) {
1942
+ message = "Dit veld is verplicht";
1943
+ } else if (inputElement.validity.typeMismatch) {
1944
+ if (inputElement.type === "email") message = "Voer een geldig e-mailadres in";
1945
+ if (inputElement.type === "url") message = "Voer een geldige link in";
1946
+ } else if (inputElement.validity.rangeUnderflow) {
1947
+ message = `Minimum is ${inputElement.min}`;
1948
+ }
1949
+ errorDisplay.textContent = message;
1950
+ errorDisplay.style.display = "block";
1951
+ inputElement.classList.add("is-invalid");
1952
+ }
1953
+ function hideError() {
1954
+ errorDisplay.style.display = "none";
1955
+ inputElement.classList.remove("is-invalid");
1956
+ }
1957
+ }
1958
+
1921
1959
  // src/components/contextMenu.js
1922
1960
  function initContextMenu() {
1923
1961
  let menu = document.querySelector(".sol-context-menu");
@@ -2296,6 +2334,7 @@ function safeInitAll() {
2296
2334
  try {
2297
2335
  initCodeblocks();
2298
2336
  initDropdowns();
2337
+ initInput();
2299
2338
  initContextMenu();
2300
2339
  initThemeToggle();
2301
2340
  initPopovers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerkhoff-ict/solora",
3
- "version": "2.4.3",
3
+ "version": "2.5.1",
4
4
  "description": "Simple CSS component library",
5
5
  "main": "dist/index.js",
6
6
  "style": "dist/index.css",