@marianmeres/stuic 2.29.0 → 2.31.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.
|
@@ -392,6 +392,28 @@ export function popover(anchorEl, fn) {
|
|
|
392
392
|
}
|
|
393
393
|
// Render content
|
|
394
394
|
renderContent();
|
|
395
|
+
// Add close button for fallback mode (after content so it's not cleared)
|
|
396
|
+
if (!useAnchorPositioning && popoverEl) {
|
|
397
|
+
const closeBtn = document.createElement("button");
|
|
398
|
+
closeBtn.setAttribute("type", "button");
|
|
399
|
+
closeBtn.setAttribute("aria-label", "Close");
|
|
400
|
+
closeBtn.innerHTML = `<svg fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" style="width:1.25rem;height:1.25rem"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /></svg>`;
|
|
401
|
+
closeBtn.style.cssText = `
|
|
402
|
+
position: absolute;
|
|
403
|
+
top: 0;
|
|
404
|
+
right: 0;
|
|
405
|
+
background: black;
|
|
406
|
+
color: white;
|
|
407
|
+
border: none;
|
|
408
|
+
border-bottom-left-radius: 0.5rem;
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
opacity: 0.8;
|
|
411
|
+
padding: 0.33rem;
|
|
412
|
+
line-height: 1;
|
|
413
|
+
`;
|
|
414
|
+
closeBtn.addEventListener("click", hide);
|
|
415
|
+
popoverEl.appendChild(closeBtn);
|
|
416
|
+
}
|
|
395
417
|
// Transition in
|
|
396
418
|
popoverEl.classList.add("pop-block");
|
|
397
419
|
requestAnimationFrame(() => {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
leading-none
|
|
42
42
|
border-1
|
|
43
43
|
border-button-border dark:border-button-border-dark
|
|
44
|
-
rounded-
|
|
44
|
+
rounded-lg
|
|
45
45
|
inline-flex items-center justify-center gap-x-2
|
|
46
46
|
px-4 py-3
|
|
47
47
|
select-none
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
|
|
61
61
|
export const BUTTON_STUIC_PRESET_CLASSES: ButtonPresetClasses = {
|
|
62
62
|
size: {
|
|
63
|
-
sm: `text-sm rounded-
|
|
64
|
-
lg: `text-base rounded-
|
|
63
|
+
sm: `text-sm rounded-md px-3 py-2 min-h-none min-w-none`,
|
|
64
|
+
lg: `text-base rounded-xl`,
|
|
65
65
|
},
|
|
66
66
|
variant: {
|
|
67
67
|
primary: `font-medium`,
|
|
@@ -31,7 +31,7 @@ export interface ButtonPresetClasses {
|
|
|
31
31
|
shadow: string;
|
|
32
32
|
inverse: string;
|
|
33
33
|
}
|
|
34
|
-
export declare const BUTTON_STUIC_BASE_CLASSES = "\n\t\tbg-button-bg text-button-text\n\t\tdark:bg-button-bg-dark dark:text-button-text-dark\n\t\tfont-mono text-sm text-center\n\t\tleading-none\n\t\tborder-1\n\t\tborder-button-border dark:border-button-border-dark\n\t\trounded-
|
|
34
|
+
export declare const BUTTON_STUIC_BASE_CLASSES = "\n\t\tbg-button-bg text-button-text\n\t\tdark:bg-button-bg-dark dark:text-button-text-dark\n\t\tfont-mono text-sm text-center\n\t\tleading-none\n\t\tborder-1\n\t\tborder-button-border dark:border-button-border-dark\n\t\trounded-lg\n\t\tinline-flex items-center justify-center gap-x-2\n\t\tpx-4 py-3\n\t\tselect-none\n\t\tmin-h-[44px] min-w-[44px]\n\n\t\thover:brightness-105\n\t\tactive:brightness-95\n\t\tdisabled:hover:brightness-100 disabled:opacity-50\n\n\t\tfocus:brightness-105\n\t\tfocus:border-button-border-focus focus:dark:border-button-border-focus-dark\n\n\t\t focus:outline-4 focus:outline-black/10 focus:dark:outline-white/20\n\t\tfocus-visible:outline-4 focus-visible:outline-black/10 focus-visible:dark:outline-white/20\n\t";
|
|
35
35
|
export declare const BUTTON_STUIC_PRESET_CLASSES: ButtonPresetClasses;
|
|
36
36
|
import "./index.css";
|
|
37
37
|
import { type TooltipConfig } from "../../actions/index.js";
|
|
@@ -156,8 +156,8 @@
|
|
|
156
156
|
<button
|
|
157
157
|
type="button"
|
|
158
158
|
class={twMerge(
|
|
159
|
-
"no-focus-visible",
|
|
160
|
-
"w-full text-left py-2 px-3 border-0 bg-transparent",
|
|
159
|
+
"no-focus-visible form-field",
|
|
160
|
+
"w-full text-left py-2.5 px-3 border-0 bg-transparent",
|
|
161
161
|
"focus:outline-0 focus-visible:outline-0",
|
|
162
162
|
renderSize,
|
|
163
163
|
classInput
|