@marianmeres/stuic 2.1.27 → 2.1.29

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,7 +8,7 @@
8
8
  border-button-border dark:border-button-border-dark
9
9
  rounded-md
10
10
  inline-flex items-center justify-center gap-x-2
11
- px-3 py-2
11
+ px-3 py-2.5
12
12
  select-none
13
13
 
14
14
  hover:brightness-105
@@ -24,7 +24,7 @@
24
24
 
25
25
  export const BUTTON_STUIC_PRESET_CLASSES: any = {
26
26
  size: {
27
- sm: `text-xs rounded-sm px-2 py-0.5`,
27
+ sm: `text-sm rounded-sm px-2 py-1`,
28
28
  lg: `text-base rounded-md`,
29
29
  },
30
30
  variant: {
@@ -1,4 +1,4 @@
1
- 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-md\n\t\tinline-flex items-center justify-center gap-x-2\n\t\tpx-3 py-2\n\t\tselect-none\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";
1
+ 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-md\n\t\tinline-flex items-center justify-center gap-x-2\n\t\tpx-3 py-2.5\n\t\tselect-none\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";
2
2
  export declare const BUTTON_STUIC_PRESET_CLASSES: any;
3
3
  import type { Snippet } from "svelte";
4
4
  import type { HTMLButtonAttributes } from "svelte/elements";
@@ -30,6 +30,7 @@
30
30
  //
31
31
  onOutside?: () => void;
32
32
  // onOutsideEnabled?: boolean;
33
+ noBackdropScrollLock?: boolean;
33
34
  }
34
35
 
35
36
  let {
@@ -48,6 +49,7 @@
48
49
  animOffset = "75vw",
49
50
  onEscape,
50
51
  onOutside,
52
+ noBackdropScrollLock,
51
53
  // onOutsideEnabled = true,
52
54
  }: Props = $props();
53
55
 
@@ -136,6 +138,7 @@
136
138
  fadeOutDuration={transitionDuration}
137
139
  {onEscape}
138
140
  onmousedown={() => onOutside?.()}
141
+ noScrollLock={noBackdropScrollLock}
139
142
  >
140
143
  <!-- svelte-ignore a11y_interactive_supports_focus -->
141
144
  <!-- svelte-ignore a11y_click_events_have_key_events -->
@@ -15,6 +15,7 @@ interface Props {
15
15
  animOffset?: string | number;
16
16
  onEscape?: () => void;
17
17
  onOutside?: () => void;
18
+ noBackdropScrollLock?: boolean;
18
19
  }
19
20
  declare const Drawer: import("svelte").Component<Props, {
20
21
  close: () => void;
@@ -1,10 +1,14 @@
1
1
  import { createClog } from "@marianmeres/clog";
2
+ import { isBrowser } from "./is-browser.js";
2
3
  const clog = createClog("BodyScroll").debug;
4
+ const document = globalThis.document ?? {};
3
5
  /**
4
6
  * Helper for "locking" and "unlocking" body scroll (window.scrollY) position
5
7
  */
6
8
  export class BodyScroll {
7
9
  static lock() {
10
+ if (!isBrowser())
11
+ return;
8
12
  const data = document.body.dataset;
9
13
  // Only save the scroll position if it hasn't been saved already
10
14
  if (data.originalScrollY === undefined) {
@@ -27,6 +31,8 @@ export class BodyScroll {
27
31
  }
28
32
  }
29
33
  static unlock() {
34
+ if (!isBrowser())
35
+ return;
30
36
  const data = document.body.dataset;
31
37
  // Only proceed if scroll is currently locked
32
38
  if (data.scrollLockCount !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "2.1.27",
3
+ "version": "2.1.29",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -41,22 +41,22 @@
41
41
  "@marianmeres/icons-fns": "^4.4.0",
42
42
  "@marianmeres/random-human-readable": "^1.6.1",
43
43
  "@sveltejs/adapter-auto": "^4.0.0",
44
- "@sveltejs/kit": "^2.43.5",
44
+ "@sveltejs/kit": "^2.48.4",
45
45
  "@sveltejs/package": "^2.5.4",
46
46
  "@sveltejs/vite-plugin-svelte": "^5.1.1",
47
- "@tailwindcss/cli": "^4.1.13",
47
+ "@tailwindcss/cli": "^4.1.16",
48
48
  "@tailwindcss/forms": "^0.5.10",
49
49
  "@tailwindcss/typography": "^0.5.19",
50
- "@tailwindcss/vite": "^4.1.13",
50
+ "@tailwindcss/vite": "^4.1.16",
51
51
  "dotenv": "^16.6.1",
52
52
  "prettier": "^3.6.2",
53
53
  "prettier-plugin-svelte": "^3.4.0",
54
- "publint": "^0.3.13",
55
- "svelte": "^5.39.6",
56
- "svelte-check": "^4.3.2",
57
- "tailwindcss": "^4.1.13",
58
- "typescript": "^5.9.2",
59
- "vite": "^6.3.6",
54
+ "publint": "^0.3.15",
55
+ "svelte": "^5.43.2",
56
+ "svelte-check": "^4.3.3",
57
+ "tailwindcss": "^4.1.16",
58
+ "typescript": "^5.9.3",
59
+ "vite": "^6.4.1",
60
60
  "vitest": "^3.2.4"
61
61
  },
62
62
  "dependencies": {