@odx/foundation 1.0.0-rc.6 → 1.0.0-rc.8
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/CHANGELOG.md +13 -1
- package/dist/lib/scroll-lock.d.ts +7 -0
- package/dist/lib/scroll-lock.js +27 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +2 -1
- package/dist/styles.css +17 -8
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 1.0.0-rc.8
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Remove scroll lock gutter when scrollbar is not present to prevent unnecessary layout shift
|
|
6
|
+
|
|
7
|
+
## 1.0.0-rc.7
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Add `applyScrollLock` and `removeScrollLock` utilities to enable/disable scroll lock on the document
|
|
12
|
+
|
|
1
13
|
## 1.0.0-rc.6
|
|
2
14
|
|
|
3
15
|
### Minor Changes
|
|
@@ -20,7 +32,7 @@
|
|
|
20
32
|
|
|
21
33
|
### Minor Changes
|
|
22
34
|
|
|
23
|
-
- Add `.odx-cloak` class to prevent FOUC (Flash of Unstyled Content) during initial load, use `odx-cloak` class on the root element of your application to enable it
|
|
35
|
+
- Add `.odx-cloak` class to prevent FOUC (Flash of Unstyled Content) during initial load, use `odx-cloak` class on the root element of your application to enable it
|
|
24
36
|
- Support `:visited` state for native links and anchors with `odx-link` class for better user experience
|
|
25
37
|
- Improve tabbable element detection
|
|
26
38
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
declare function applyScrollLock(source: HTMLElement): void;
|
|
3
|
+
/** @internal */
|
|
4
|
+
declare function removeScrollLock(source: HTMLElement): void;
|
|
5
|
+
/** @internal */
|
|
6
|
+
declare function removeAllScrollLocks(): void;
|
|
7
|
+
export { applyScrollLock, removeAllScrollLocks, removeScrollLock };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const scrollLockClass = "odx-scroll-lock";
|
|
2
|
+
const scrollLocks = /* @__PURE__ */ new Set();
|
|
3
|
+
/** @internal */
|
|
4
|
+
function applyScrollLock(source) {
|
|
5
|
+
const root = document.documentElement;
|
|
6
|
+
scrollLocks.add(source);
|
|
7
|
+
if (root.classList.contains(scrollLockClass)) return;
|
|
8
|
+
const bodyPadding = Number(getComputedStyle(document.body).paddingRight.replace("px", ""));
|
|
9
|
+
let scrollbarWidth = Math.abs(window.innerWidth - root.clientWidth);
|
|
10
|
+
if (!Number.isNaN(bodyPadding) && bodyPadding > 0) scrollbarWidth += bodyPadding;
|
|
11
|
+
let { scrollbarGutter } = getComputedStyle(root);
|
|
12
|
+
if (!scrollbarGutter || scrollbarGutter === "auto") scrollbarGutter = "stable";
|
|
13
|
+
document.documentElement.classList.add(scrollLockClass);
|
|
14
|
+
root.style.setProperty("--odx-scroll-lock-gutter", scrollbarWidth > 1 ? scrollbarGutter : "");
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
function removeScrollLock(source) {
|
|
18
|
+
scrollLocks.delete(source);
|
|
19
|
+
if (scrollLocks.size > 0) return;
|
|
20
|
+
document.documentElement.classList.remove(scrollLockClass);
|
|
21
|
+
}
|
|
22
|
+
/** @internal */
|
|
23
|
+
function removeAllScrollLocks() {
|
|
24
|
+
scrollLocks.clear();
|
|
25
|
+
document.documentElement.classList.remove(scrollLockClass);
|
|
26
|
+
}
|
|
27
|
+
export { applyScrollLock, removeAllScrollLocks, removeScrollLock };
|
package/dist/main.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ import { Breakpoint, BreakpointConfig, BreakpointOperator, breakpointAttribute,
|
|
|
3
3
|
import { UnitIdentifier } from "./lib/models.js";
|
|
4
4
|
import { DateTimeFormatOptions, FormatOptions, ListFormatOptions, NumberFormatOptions, RelativeTimeFormatOptions, formatDate, formatList, formatNumber, formatRelativeTime, parseDate } from "./lib/format.js";
|
|
5
5
|
import { LocalizationOptions, getLocale, getLocalizationOptions, setLocale, setLocalizationOptions } from "./lib/localization.js";
|
|
6
|
+
import { applyScrollLock, removeAllScrollLocks, removeScrollLock } from "./lib/scroll-lock.js";
|
|
6
7
|
import { AttachDarkModeToggleOptions, attachDarkModeToggle, darkModeIcon, isDarkModeEnabled, lightModeIcon, setTheme, toggleDarkMode, userPrefersDarkMode } from "./lib/theming.js";
|
|
7
|
-
export { AttachDarkModeToggleOptions, Breakpoint, BreakpointConfig, BreakpointOperator, DateTimeFormatOptions, FormatOptions, ListFormatOptions, LocalizationOptions, NumberFormatOptions, ReadonlySignal, RelativeTimeFormatOptions, Signal, SignalOptions, type UnitIdentifier, attachDarkModeToggle, breakpointAttribute, buildBreakpoint, computed, createBreakpointUpdater, darkModeIcon, defaultBreakpoints, effect, expandBreakpoints, formatDate, formatList, formatNumber, formatRelativeTime, getLocale, getLocalizationOptions, isDarkModeEnabled, lightModeIcon, observeBreakpoint, parseDate, registeredBreakpoints, setLocale, setLocalizationOptions, setTheme, setupBreakpoints, sharedSignal, signal, toggleDarkMode, userPrefersDarkMode };
|
|
8
|
+
export { AttachDarkModeToggleOptions, Breakpoint, BreakpointConfig, BreakpointOperator, DateTimeFormatOptions, FormatOptions, ListFormatOptions, LocalizationOptions, NumberFormatOptions, ReadonlySignal, RelativeTimeFormatOptions, Signal, SignalOptions, type UnitIdentifier, applyScrollLock, attachDarkModeToggle, breakpointAttribute, buildBreakpoint, computed, createBreakpointUpdater, darkModeIcon, defaultBreakpoints, effect, expandBreakpoints, formatDate, formatList, formatNumber, formatRelativeTime, getLocale, getLocalizationOptions, isDarkModeEnabled, lightModeIcon, observeBreakpoint, parseDate, registeredBreakpoints, removeAllScrollLocks, removeScrollLock, setLocale, setLocalizationOptions, setTheme, setupBreakpoints, sharedSignal, signal, toggleDarkMode, userPrefersDarkMode };
|
package/dist/main.js
CHANGED
|
@@ -2,5 +2,6 @@ import { computed, effect, sharedSignal, signal } from "./lib/signals.js";
|
|
|
2
2
|
import { breakpointAttribute, buildBreakpoint, createBreakpointUpdater, defaultBreakpoints, expandBreakpoints, observeBreakpoint, registeredBreakpoints, setupBreakpoints } from "./lib/breakpoints.js";
|
|
3
3
|
import { formatDate, formatList, formatNumber, formatRelativeTime, parseDate } from "./lib/format.js";
|
|
4
4
|
import { LocalizationOptions, getLocale, getLocalizationOptions, setLocale, setLocalizationOptions } from "./lib/localization.js";
|
|
5
|
+
import { applyScrollLock, removeAllScrollLocks, removeScrollLock } from "./lib/scroll-lock.js";
|
|
5
6
|
import { attachDarkModeToggle, darkModeIcon, isDarkModeEnabled, lightModeIcon, setTheme, toggleDarkMode, userPrefersDarkMode } from "./lib/theming.js";
|
|
6
|
-
export { LocalizationOptions, attachDarkModeToggle, breakpointAttribute, buildBreakpoint, computed, createBreakpointUpdater, darkModeIcon, defaultBreakpoints, effect, expandBreakpoints, formatDate, formatList, formatNumber, formatRelativeTime, getLocale, getLocalizationOptions, isDarkModeEnabled, lightModeIcon, observeBreakpoint, parseDate, registeredBreakpoints, setLocale, setLocalizationOptions, setTheme, setupBreakpoints, sharedSignal, signal, toggleDarkMode, userPrefersDarkMode };
|
|
7
|
+
export { LocalizationOptions, applyScrollLock, attachDarkModeToggle, breakpointAttribute, buildBreakpoint, computed, createBreakpointUpdater, darkModeIcon, defaultBreakpoints, effect, expandBreakpoints, formatDate, formatList, formatNumber, formatRelativeTime, getLocale, getLocalizationOptions, isDarkModeEnabled, lightModeIcon, observeBreakpoint, parseDate, registeredBreakpoints, removeAllScrollLocks, removeScrollLock, setLocale, setLocalizationOptions, setTheme, setupBreakpoints, sharedSignal, signal, toggleDarkMode, userPrefersDarkMode };
|
package/dist/styles.css
CHANGED
|
@@ -161,14 +161,11 @@
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.odx-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
height: 1px !important;
|
|
170
|
-
padding: 0 !important;
|
|
171
|
-
position: absolute !important;
|
|
164
|
+
.odx-scroll-lock {
|
|
165
|
+
scrollbar-gutter: var(--odx-scroll-lock-gutter) !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.odx-scroll-lock body {
|
|
172
169
|
overflow: hidden !important;
|
|
173
170
|
}
|
|
174
171
|
|
|
@@ -851,6 +848,17 @@
|
|
|
851
848
|
width: 100%;
|
|
852
849
|
}
|
|
853
850
|
|
|
851
|
+
.odx-visually-hidden:not(:focus-within), .odx-visually-hidden-force {
|
|
852
|
+
clip-path: rect(0 0 0 0) !important;
|
|
853
|
+
white-space: nowrap !important;
|
|
854
|
+
border: none !important;
|
|
855
|
+
width: 1px !important;
|
|
856
|
+
height: 1px !important;
|
|
857
|
+
padding: 0 !important;
|
|
858
|
+
position: absolute !important;
|
|
859
|
+
overflow: hidden !important;
|
|
860
|
+
}
|
|
861
|
+
|
|
854
862
|
.odx-content :where(table), .odx-table {
|
|
855
863
|
--cell-size: var(--odx-size-300);
|
|
856
864
|
border-collapse: collapse;
|
|
@@ -1070,4 +1078,5 @@
|
|
|
1070
1078
|
--odx-layout-width-page-default: 1440px;
|
|
1071
1079
|
--odx-layout-width-page-narrow: 1200px;
|
|
1072
1080
|
--odx-layout-width-page-wide: 1800px;
|
|
1081
|
+
--odx-motion-transition-instant: 50ms 0s var(--odx-motion-easing-reduced);
|
|
1073
1082
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@odx/foundation",
|
|
3
3
|
"displayName": "ODX Design System Foundation",
|
|
4
4
|
"description": "The design foundation of the ODX Design System, providing base styles and utilities",
|
|
5
|
-
"version": "1.0.0-rc.
|
|
5
|
+
"version": "1.0.0-rc.8",
|
|
6
6
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"homepage": "https://odx.draeger.com",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"@odx/design-tokens": "^4.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@tsdown/css": "0.22.
|
|
23
|
+
"@tsdown/css": "0.22.1",
|
|
24
24
|
"lit": "3.3.3",
|
|
25
|
-
"stylelint": "17.
|
|
26
|
-
"tsdown": "0.22.
|
|
25
|
+
"stylelint": "17.12.0",
|
|
26
|
+
"tsdown": "0.22.1",
|
|
27
27
|
"@odx-internal/config-stylelint": "0.0.0",
|
|
28
28
|
"@odx-internal/utils-storybook": "0.0.0"
|
|
29
29
|
},
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsdown",
|
|
56
|
-
"dev": "tsdown
|
|
56
|
+
"dev": "tsdown --log-level error --no-clean --watch",
|
|
57
|
+
"dev:tsc": "tsc --build tsconfig.lib.json --noEmit --watch",
|
|
57
58
|
"lint": "biome lint src",
|
|
58
59
|
"lint:styles": "stylelint '**/*.css'"
|
|
59
60
|
}
|