@odx/foundation 1.0.0-rc.5 → 1.0.0-rc.7
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 +22 -1
- package/README.md +3 -1
- package/dist/lib/breakpoints.d.ts +0 -3
- package/dist/lib/breakpoints.js +0 -2
- package/dist/lib/format.d.ts +0 -3
- package/dist/lib/format.js +0 -2
- package/dist/lib/localization.d.ts +0 -3
- package/dist/lib/localization.js +0 -2
- package/dist/lib/models.d.ts +0 -2
- package/dist/lib/scroll-lock.d.ts +7 -0
- package/dist/lib/scroll-lock.js +27 -0
- package/dist/lib/signals.d.ts +0 -3
- package/dist/lib/signals.js +0 -2
- package/dist/lib/theming.d.ts +0 -3
- package/dist/lib/theming.js +0 -2
- package/dist/lib/utils/shared-media-observer.js +0 -2
- package/dist/main.d.ts +2 -1
- package/dist/main.js +2 -1
- package/dist/styles.css +194 -181
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 1.0.0-rc.7
|
|
2
|
+
|
|
3
|
+
### Minor Changes
|
|
4
|
+
|
|
5
|
+
- Add `applyScrollLock` and `removeScrollLock` utilities to enable/disable scroll lock on the document
|
|
6
|
+
|
|
7
|
+
## 1.0.0-rc.6
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Rename CSS layers to remove dot notation:
|
|
12
|
+
- `odx.reset` to `odx-reset`
|
|
13
|
+
- `odx.base` to `odx-base`
|
|
14
|
+
- `odx.overrides` to `odx-overrides`
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- Remove debug info from rolldown build output
|
|
19
|
+
- Fix `.odx-cloak` if applied to `:root` element not working correctly
|
|
20
|
+
|
|
1
21
|
## 1.0.0-rc.5
|
|
2
22
|
|
|
3
23
|
### Major Changes
|
|
@@ -6,8 +26,9 @@
|
|
|
6
26
|
|
|
7
27
|
### Minor Changes
|
|
8
28
|
|
|
9
|
-
- 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
|
|
29
|
+
- 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
|
|
10
30
|
- Support `:visited` state for native links and anchors with `odx-link` class for better user experience
|
|
31
|
+
- Improve tabbable element detection
|
|
11
32
|
|
|
12
33
|
## 1.0.0-rc.4
|
|
13
34
|
|
package/README.md
CHANGED
|
@@ -96,6 +96,8 @@ This class will temporarily hide the content of the `.odx-root` element until cu
|
|
|
96
96
|
</html>
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
+
> The timeout can be set via the `--odx-cloak-timeout` custom property on the `:root` element, which defaults to `2s`.
|
|
100
|
+
|
|
99
101
|
### Documentation
|
|
100
102
|
|
|
101
|
-
For detailed documentation on how to use the `@odx/foundation` package,
|
|
103
|
+
For detailed documentation on how to use the `@odx/foundation` package, please visit our <a href="https://ca-odx-storybook-dev.yellowisland-7b13f2d7.westeurope.azurecontainerapps.io/" target="_blank" rel="noopener">storybook documentation</a>.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Signal } from "./signals.js";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/breakpoints.d.ts
|
|
4
2
|
declare global {
|
|
5
3
|
namespace ODX.Breakpoints {
|
|
6
4
|
interface Config {
|
|
@@ -57,5 +55,4 @@ declare function setupBreakpoints(breakpointsConfig?: BreakpointConfig[]): () =>
|
|
|
57
55
|
declare function createBreakpointUpdater(breakpoints: Breakpoint[], update?: (target: HTMLElement, change: Breakpoint & {
|
|
58
56
|
matches: boolean;
|
|
59
57
|
}) => void): () => void;
|
|
60
|
-
//#endregion
|
|
61
58
|
export { Breakpoint, BreakpointConfig, BreakpointOperator, breakpointAttribute, buildBreakpoint, createBreakpointUpdater, defaultBreakpoints, expandBreakpoints, observeBreakpoint, registeredBreakpoints, setupBreakpoints };
|
package/dist/lib/breakpoints.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { effect, signal } from "./signals.js";
|
|
2
2
|
import { observeMedia } from "./utils/shared-media-observer.js";
|
|
3
|
-
//#region src/lib/breakpoints.ts
|
|
4
3
|
const operators = [
|
|
5
4
|
"<",
|
|
6
5
|
"<=",
|
|
@@ -154,5 +153,4 @@ function createBreakpointUpdater(breakpoints, update) {
|
|
|
154
153
|
}
|
|
155
154
|
};
|
|
156
155
|
}
|
|
157
|
-
//#endregion
|
|
158
156
|
export { breakpointAttribute, buildBreakpoint, createBreakpointUpdater, defaultBreakpoints, expandBreakpoints, observeBreakpoint, registeredBreakpoints, setupBreakpoints };
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { UnitIdentifier } from "./models.js";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/format.d.ts
|
|
4
2
|
interface FormatOptions {
|
|
5
3
|
dateTimeFormatOptions?: DateTimeFormatOptions;
|
|
6
4
|
numberFormatOptions?: NumberFormatOptions;
|
|
@@ -56,5 +54,4 @@ interface RelativeTimeFormatOptions extends Intl.RelativeTimeFormatOptions, Base
|
|
|
56
54
|
start?: number | string | Date;
|
|
57
55
|
}
|
|
58
56
|
declare function formatRelativeTime(input: number | string | Date, options?: RelativeTimeFormatOptions): string;
|
|
59
|
-
//#endregion
|
|
60
57
|
export { DateTimeFormatOptions, FormatOptions, ListFormatOptions, NumberFormatOptions, RelativeTimeFormatOptions, formatDate, formatList, formatNumber, formatRelativeTime, parseDate };
|
package/dist/lib/format.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lib/format.ts
|
|
2
1
|
function parseDate(value) {
|
|
3
2
|
const createDate = (value) => Number.isNaN(value) ? null : new Date(value);
|
|
4
3
|
if (value instanceof Date) return createDate(value.getTime());
|
|
@@ -62,5 +61,4 @@ function formatRelativeTime(input, options) {
|
|
|
62
61
|
const [unit, unitConfig] = Object.entries(TIME_UNIT_MAP).find(([_, { value, max }]) => Math.abs(relativeTime) < max && minUnit.value <= value);
|
|
63
62
|
return new Intl.RelativeTimeFormat(options?.locale, options).format(Math.round(relativeTime / unitConfig.value), unit);
|
|
64
63
|
}
|
|
65
|
-
//#endregion
|
|
66
64
|
export { formatDate, formatList, formatNumber, formatRelativeTime, parseDate };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { FormatOptions } from "./format.js";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/localization.d.ts
|
|
4
2
|
interface LocalizationOptions extends FormatOptions {
|
|
5
3
|
defaultLocale: () => Intl.Locale | Intl.UnicodeBCP47LocaleIdentifier;
|
|
6
4
|
fallbackLanguage: () => Intl.UnicodeBCP47LocaleIdentifier;
|
|
@@ -11,5 +9,4 @@ declare function setLocalizationOptions(options?: Partial<LocalizationOptions> |
|
|
|
11
9
|
declare function getLocalizationOptions(options?: Partial<LocalizationOptions> | null): LocalizationOptions;
|
|
12
10
|
declare function getLocale(localeInput?: Intl.Locale | Intl.UnicodeBCP47LocaleIdentifier | null): Intl.Locale;
|
|
13
11
|
declare function setLocale(localeInput?: Intl.Locale | Intl.UnicodeBCP47LocaleIdentifier | null): void;
|
|
14
|
-
//#endregion
|
|
15
12
|
export { LocalizationOptions, getLocale, getLocalizationOptions, setLocale, setLocalizationOptions };
|
package/dist/lib/localization.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { sharedSignal } from "./signals.js";
|
|
2
|
-
//#region src/lib/localization.ts
|
|
3
2
|
const locale = sharedSignal("locale", null);
|
|
4
3
|
const localizationOptions = sharedSignal("localizationOptions", null);
|
|
5
4
|
const LocalizationOptions = (config) => ({
|
|
@@ -24,5 +23,4 @@ function getLocale(localeInput) {
|
|
|
24
23
|
function setLocale(localeInput) {
|
|
25
24
|
locale.set(localeInput ? getLocale(localeInput) : null);
|
|
26
25
|
}
|
|
27
|
-
//#endregion
|
|
28
26
|
export { LocalizationOptions, getLocale, getLocalizationOptions, setLocale, setLocalizationOptions };
|
package/dist/lib/models.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#region src/lib/models.d.ts
|
|
2
1
|
type UnitIdentifier = SingleUnitIdentifier | `${SingleUnitIdentifier}-per-${SingleUnitIdentifier}` | (string & {});
|
|
3
2
|
type SingleUnitIdentifier = 'acre' | 'bit' | 'byte' | 'celsius' | 'centimeter' | 'day' | 'degree' | 'fahrenheit' | 'fluid-ounce' | 'foot' | 'gallon' | 'gigabit' | 'gigabyte' | 'gram' | 'hectare' | 'hour' | 'inch' | 'kilobit' | 'kilobyte' | 'kilogram' | 'kilometer' | 'liter' | 'megabit' | 'megabyte' | 'meter' | 'microsecond' | 'mile' | 'mile-scandinavian' | 'milliliter' | 'millimeter' | 'millisecond' | 'minute' | 'month' | 'nanosecond' | 'ounce' | 'percent' | 'petabyte' | 'pound' | 'second' | 'stone' | 'terabit' | 'terabyte' | 'week' | 'yard' | 'year';
|
|
4
|
-
//#endregion
|
|
5
3
|
export { UnitIdentifier };
|
|
@@ -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/lib/signals.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/signals.d.ts
|
|
4
2
|
type Signal$1<T> = Signal.State<T> & {
|
|
5
3
|
update: (updateFn: (value: T) => T) => void;
|
|
6
4
|
};
|
|
@@ -19,5 +17,4 @@ declare function effect(callback: (() => void) | (() => () => void)): () => void
|
|
|
19
17
|
declare global {
|
|
20
18
|
var __ODX_SHARED_SIGNALS__: Record<string, unknown>;
|
|
21
19
|
}
|
|
22
|
-
//#endregion
|
|
23
20
|
export { ReadonlySignal, Signal$1 as Signal, SignalOptions, computed, effect, sharedSignal, signal };
|
package/dist/lib/signals.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Signal } from "signal-polyfill";
|
|
2
|
-
//#region src/lib/signals.ts
|
|
3
2
|
function transformOptions(options) {
|
|
4
3
|
if (!options) return;
|
|
5
4
|
return {
|
|
@@ -48,5 +47,4 @@ function effect(callback) {
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
globalThis.__ODX_SHARED_SIGNALS__ ||= {};
|
|
51
|
-
//#endregion
|
|
52
50
|
export { computed, effect, sharedSignal, signal };
|
package/dist/lib/theming.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ThemeConfig } from "@odx/design-tokens";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/theming.d.ts
|
|
4
2
|
declare global {
|
|
5
3
|
var __ODX_THEME_ROOT__: HTMLElement;
|
|
6
4
|
}
|
|
@@ -15,5 +13,4 @@ interface AttachDarkModeToggleOptions<T extends HTMLElement> {
|
|
|
15
13
|
root?: HTMLElement;
|
|
16
14
|
}
|
|
17
15
|
declare function attachDarkModeToggle<T extends HTMLElement>(host: T, options?: AttachDarkModeToggleOptions<T>): () => void;
|
|
18
|
-
//#endregion
|
|
19
16
|
export { AttachDarkModeToggleOptions, attachDarkModeToggle, darkModeIcon, isDarkModeEnabled, lightModeIcon, setTheme$1 as setTheme, toggleDarkMode, userPrefersDarkMode };
|
package/dist/lib/theming.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { effect, sharedSignal } from "./signals.js";
|
|
2
2
|
import { darkModeClass, lightModeClass, setTheme } from "@odx/design-tokens";
|
|
3
|
-
//#region src/lib/theming.ts
|
|
4
3
|
const { matches: userPrefersDarkMode = false } = globalThis.matchMedia?.("(prefers-color-scheme: dark)") ?? {};
|
|
5
4
|
const darkModeIcon = "core::night-mode";
|
|
6
5
|
const lightModeIcon = "core::brightness";
|
|
@@ -30,5 +29,4 @@ function attachDarkModeToggle(host, options = {}) {
|
|
|
30
29
|
options.update?.(host, darkModeEnabled, icon);
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
//#endregion
|
|
34
32
|
export { attachDarkModeToggle, darkModeIcon, isDarkModeEnabled, lightModeIcon, setTheme$1 as setTheme, toggleDarkMode, userPrefersDarkMode };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lib/utils/shared-media-observer.ts
|
|
2
1
|
const mediaQueryRegistry = /* @__PURE__ */ new Map();
|
|
3
2
|
const eventListenerRegistry = /* @__PURE__ */ new Map();
|
|
4
3
|
function handleMediaChange(event) {
|
|
@@ -37,5 +36,4 @@ function unobserveMedia(query, listener) {
|
|
|
37
36
|
mediaQueryList.removeEventListener("change", handleMediaChange);
|
|
38
37
|
mediaQueryRegistry.delete(query);
|
|
39
38
|
}
|
|
40
|
-
//#endregion
|
|
41
39
|
export { observeMedia };
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@layer odx-
|
|
1
|
+
@layer odx-reset {
|
|
2
2
|
.odx-root {
|
|
3
3
|
&, & *, & :before, & :after {
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -60,7 +60,9 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
}
|
|
63
64
|
|
|
65
|
+
@layer odx-base {
|
|
64
66
|
.odx-link, .odx-root a {
|
|
65
67
|
transition: var(--odx-motion-transition-reduced);
|
|
66
68
|
overflow: inherit;
|
|
@@ -141,179 +143,12 @@
|
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
|
|
145
|
-
--
|
|
146
|
-
border-collapse: collapse;
|
|
147
|
-
background-color: #0000;
|
|
148
|
-
width: 100%;
|
|
149
|
-
max-width: 100%;
|
|
150
|
-
|
|
151
|
-
& caption {
|
|
152
|
-
line-height: var(--odx-typography-line-height-text-sm);
|
|
153
|
-
font-size: var(--odx-typography-font-size-text-sm);
|
|
154
|
-
font-weight: var(--odx-typography-font-weight-semibold);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
& thead {
|
|
158
|
-
background-color: inherit;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
& tr {
|
|
162
|
-
transition: var(--odx-motion-transition-reduced);
|
|
163
|
-
background-color: var(--odx-color-background-transparent);
|
|
164
|
-
transition-property: background-color, color;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
& tr:has(td):hover {
|
|
168
|
-
background-color: var(--odx-color-background-transparent-hover);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
& th, & td {
|
|
172
|
-
padding: var(--odx-control-spacing-md) var(--odx-control-spacing-inline-md);
|
|
173
|
-
min-height: var(--odx-size-250);
|
|
174
|
-
text-align: start;
|
|
175
|
-
font-size: inherit;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
& th {
|
|
179
|
-
border-bottom: var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);
|
|
180
|
-
vertical-align: top;
|
|
181
|
-
font-weight: var(--odx-typography-font-weight-medium);
|
|
182
|
-
cursor: default;
|
|
183
|
-
user-select: none;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
& td {
|
|
187
|
-
height: var(--cell-size);
|
|
188
|
-
vertical-align: middle;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
& tr:not(:last-child) td {
|
|
192
|
-
border-bottom: var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
& th :is(odx-input, odx-select) {
|
|
196
|
-
margin-inline: var(--odx-spacing-negative-50);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.odx-content {
|
|
201
|
-
--_content-spacing-sm: var(--odx-spacing-layout-sm);
|
|
202
|
-
--_content-spacing-md: var(--odx-spacing-layout-md);
|
|
203
|
-
--_content-spacing-lg: var(--odx-spacing-layout-lg);
|
|
204
|
-
line-height: var(--odx-typography-line-height-text-md);
|
|
205
|
-
|
|
206
|
-
& table, & ul, & ol, & dl, & blockquote, & pre, & figure, & video, & embed, & iframe {
|
|
207
|
-
margin: var(--_content-spacing-md) 0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
& :is(odx-key-value-list, odx-list) {
|
|
211
|
-
margin-block: var(--_content-spacing-md);
|
|
212
|
-
|
|
213
|
-
& :is(odx-key-value-list, odx-list) {
|
|
214
|
-
margin-block: 0;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
& > :is(odx-text, .odx-text), & li > :is(ul, ol, dl), & p, & li {
|
|
219
|
-
margin: var(--_content-spacing-sm) 0;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
& :is(odx-text, .odx-text), & p {
|
|
223
|
-
&:first-child {
|
|
224
|
-
margin-block-start: 0;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
& > :is(odx-title, [class*="odx-title"]), & h1, & h2, & h3, & h4, & h5, & h6 {
|
|
229
|
-
margin-block: var(--_content-spacing-lg) var(--_content-spacing-sm);
|
|
230
|
-
|
|
231
|
-
&:first-child {
|
|
232
|
-
margin-block-start: var(--_content-spacing-sm);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
& table, & ul, & ol, & dl, & blockquote {
|
|
237
|
-
padding-inline-start: var(--odx-spacing-150);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
& code, & pre, & mark {
|
|
241
|
-
border-radius: var(--odx-border-radius-sm);
|
|
242
|
-
padding: 0 var(--odx-spacing-12);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
& code, & pre {
|
|
246
|
-
background-color: var(--odx-color-background-control-rest);
|
|
247
|
-
font-size: var(--odx-typography-font-size-text-sm);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
& blockquote {
|
|
251
|
-
padding-inline-end: var(--odx-spacing-150);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
& dt {
|
|
255
|
-
font-weight: var(--odx-typography-font-weight-medium);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
& a {
|
|
259
|
-
text-decoration: underline;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
& del {
|
|
263
|
-
color: var(--odx-color-foreground-danger-rest);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
& figure {
|
|
267
|
-
flex-direction: column;
|
|
268
|
-
display: flex;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
& figcaption {
|
|
272
|
-
padding: var(--_content-spacing-sm);
|
|
273
|
-
line-height: var(--odx-typography-line-height-text-sm);
|
|
274
|
-
font-size: var(--odx-typography-font-size-text-sm);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
& ins {
|
|
278
|
-
color: var(--odx-color-foreground-success-rest);
|
|
279
|
-
text-decoration: none;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
& mark {
|
|
283
|
-
background-color: var(--odx-color-background-selection);
|
|
284
|
-
color: var(--odx-color-foreground-rest);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
& pre {
|
|
288
|
-
padding: var(--odx-control-spacing-md) calc(2 * var(--odx-control-spacing-inline-md));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
& small {
|
|
292
|
-
font-size: var(--odx-typography-font-size-text-sm);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
& var {
|
|
296
|
-
font-weight: var(--odx-typography-font-weight-medium);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.odx-content-sm {
|
|
301
|
-
--_content-spacing-md: var(--odx-spacing-layout-sm);
|
|
302
|
-
--_content-spacing-lg: var(--odx-spacing-layout-md);
|
|
303
|
-
line-height: var(--odx-typography-line-height-text-sm);
|
|
304
|
-
font-size: var(--odx-typography-font-size-text-sm);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.odx-content-box {
|
|
308
|
-
background-color: var(--odx-color-background-level-1);
|
|
309
|
-
padding: var(--odx-spacing-layout-lg);
|
|
310
|
-
border-radius: 0;
|
|
146
|
+
:root {
|
|
147
|
+
--odx-cloak-timeout: 2s;
|
|
311
148
|
}
|
|
312
|
-
}
|
|
313
149
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
animation: 2s step-end odx-cloak-hide;
|
|
150
|
+
.odx-cloak:has(:not(:defined)) > * {
|
|
151
|
+
animation: var(--odx-cloak-timeout) step-end odx-cloak-hide;
|
|
317
152
|
}
|
|
318
153
|
|
|
319
154
|
@keyframes odx-cloak-hide {
|
|
@@ -326,14 +161,11 @@
|
|
|
326
161
|
}
|
|
327
162
|
}
|
|
328
163
|
|
|
329
|
-
.odx-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
height: 1px !important;
|
|
335
|
-
padding: 0 !important;
|
|
336
|
-
position: absolute !important;
|
|
164
|
+
.odx-scroll-lock {
|
|
165
|
+
scrollbar-gutter: var(--odx-scroll-lock-gutter, stable) !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.odx-scroll-lock body {
|
|
337
169
|
overflow: hidden !important;
|
|
338
170
|
}
|
|
339
171
|
|
|
@@ -1015,9 +847,189 @@
|
|
|
1015
847
|
.odx-w-full-static {
|
|
1016
848
|
width: 100%;
|
|
1017
849
|
}
|
|
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
|
+
|
|
862
|
+
.odx-content :where(table), .odx-table {
|
|
863
|
+
--cell-size: var(--odx-size-300);
|
|
864
|
+
border-collapse: collapse;
|
|
865
|
+
background-color: #0000;
|
|
866
|
+
width: 100%;
|
|
867
|
+
max-width: 100%;
|
|
868
|
+
|
|
869
|
+
& caption {
|
|
870
|
+
line-height: var(--odx-typography-line-height-text-sm);
|
|
871
|
+
font-size: var(--odx-typography-font-size-text-sm);
|
|
872
|
+
font-weight: var(--odx-typography-font-weight-semibold);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
& thead {
|
|
876
|
+
background-color: inherit;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
& tr {
|
|
880
|
+
transition: var(--odx-motion-transition-reduced);
|
|
881
|
+
background-color: var(--odx-color-background-transparent);
|
|
882
|
+
transition-property: background-color, color;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
& tr:has(td):hover {
|
|
886
|
+
background-color: var(--odx-color-background-transparent-hover);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
& th, & td {
|
|
890
|
+
padding: var(--odx-control-spacing-md) var(--odx-control-spacing-inline-md);
|
|
891
|
+
min-height: var(--odx-size-250);
|
|
892
|
+
text-align: start;
|
|
893
|
+
font-size: inherit;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
& th {
|
|
897
|
+
border-bottom: var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);
|
|
898
|
+
vertical-align: top;
|
|
899
|
+
font-weight: var(--odx-typography-font-weight-medium);
|
|
900
|
+
cursor: default;
|
|
901
|
+
user-select: none;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
& td {
|
|
905
|
+
height: var(--cell-size);
|
|
906
|
+
vertical-align: middle;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
& tr:not(:last-child) td {
|
|
910
|
+
border-bottom: var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
& th :is(odx-input, odx-select) {
|
|
914
|
+
margin-inline: var(--odx-spacing-negative-50);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
.odx-content {
|
|
919
|
+
--_content-spacing-sm: var(--odx-spacing-layout-sm);
|
|
920
|
+
--_content-spacing-md: var(--odx-spacing-layout-md);
|
|
921
|
+
--_content-spacing-lg: var(--odx-spacing-layout-lg);
|
|
922
|
+
line-height: var(--odx-typography-line-height-text-md);
|
|
923
|
+
|
|
924
|
+
& table, & ul, & ol, & dl, & blockquote, & pre, & figure, & video, & embed, & iframe {
|
|
925
|
+
margin: var(--_content-spacing-md) 0;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
& :is(odx-key-value-list, odx-list) {
|
|
929
|
+
margin-block: var(--_content-spacing-md);
|
|
930
|
+
|
|
931
|
+
& :is(odx-key-value-list, odx-list) {
|
|
932
|
+
margin-block: 0;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
& > :is(odx-text, .odx-text), & li > :is(ul, ol, dl), & p, & li {
|
|
937
|
+
margin: var(--_content-spacing-sm) 0;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
& :is(odx-text, .odx-text), & p {
|
|
941
|
+
&:first-child {
|
|
942
|
+
margin-block-start: 0;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
& > :is(odx-title, [class*="odx-title"]), & h1, & h2, & h3, & h4, & h5, & h6 {
|
|
947
|
+
margin-block: var(--_content-spacing-lg) var(--_content-spacing-sm);
|
|
948
|
+
|
|
949
|
+
&:first-child {
|
|
950
|
+
margin-block-start: var(--_content-spacing-sm);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
& table, & ul, & ol, & dl, & blockquote {
|
|
955
|
+
padding-inline-start: var(--odx-spacing-150);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
& code, & pre, & mark {
|
|
959
|
+
border-radius: var(--odx-border-radius-sm);
|
|
960
|
+
padding: 0 var(--odx-spacing-12);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
& code, & pre {
|
|
964
|
+
background-color: var(--odx-color-background-control-rest);
|
|
965
|
+
font-size: var(--odx-typography-font-size-text-sm);
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
& blockquote {
|
|
969
|
+
padding-inline-end: var(--odx-spacing-150);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
& dt {
|
|
973
|
+
font-weight: var(--odx-typography-font-weight-medium);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
& a {
|
|
977
|
+
text-decoration: underline;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
& del {
|
|
981
|
+
color: var(--odx-color-foreground-danger-rest);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
& figure {
|
|
985
|
+
flex-direction: column;
|
|
986
|
+
display: flex;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
& figcaption {
|
|
990
|
+
padding: var(--_content-spacing-sm);
|
|
991
|
+
line-height: var(--odx-typography-line-height-text-sm);
|
|
992
|
+
font-size: var(--odx-typography-font-size-text-sm);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
& ins {
|
|
996
|
+
color: var(--odx-color-foreground-success-rest);
|
|
997
|
+
text-decoration: none;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
& mark {
|
|
1001
|
+
background-color: var(--odx-color-background-selection);
|
|
1002
|
+
color: var(--odx-color-foreground-rest);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
& pre {
|
|
1006
|
+
padding: var(--odx-control-spacing-md) calc(2 * var(--odx-control-spacing-inline-md));
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
& small {
|
|
1010
|
+
font-size: var(--odx-typography-font-size-text-sm);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
& var {
|
|
1014
|
+
font-weight: var(--odx-typography-font-weight-medium);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.odx-content-sm {
|
|
1019
|
+
--_content-spacing-md: var(--odx-spacing-layout-sm);
|
|
1020
|
+
--_content-spacing-lg: var(--odx-spacing-layout-md);
|
|
1021
|
+
line-height: var(--odx-typography-line-height-text-sm);
|
|
1022
|
+
font-size: var(--odx-typography-font-size-text-sm);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.odx-content-box {
|
|
1026
|
+
background-color: var(--odx-color-background-level-1);
|
|
1027
|
+
padding: var(--odx-spacing-layout-lg);
|
|
1028
|
+
border-radius: 0;
|
|
1029
|
+
}
|
|
1018
1030
|
}
|
|
1019
1031
|
|
|
1020
|
-
@layer odx-
|
|
1032
|
+
@layer odx-overrides;
|
|
1021
1033
|
|
|
1022
1034
|
.odx-slot-placeholder-sm, .odx-slot-placeholder {
|
|
1023
1035
|
background-color: var(--odx-color-background-accent-subtle);
|
|
@@ -1066,4 +1078,5 @@
|
|
|
1066
1078
|
--odx-layout-width-page-default: 1440px;
|
|
1067
1079
|
--odx-layout-width-page-narrow: 1200px;
|
|
1068
1080
|
--odx-layout-width-page-wide: 1800px;
|
|
1081
|
+
--odx-motion-transition-instant: 50ms 0s var(--odx-motion-easing-reduced);
|
|
1069
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.7",
|
|
6
6
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"homepage": "https://odx.draeger.com",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"dist",
|
|
11
11
|
"types",
|
|
12
12
|
"CHANGELOG.md",
|
|
13
|
-
"LICENSE",
|
|
14
13
|
"!dist/**/*.map"
|
|
15
14
|
],
|
|
16
15
|
"type": "module",
|
|
@@ -23,10 +22,10 @@
|
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"@tsdown/css": "0.22.0",
|
|
25
24
|
"lit": "3.3.3",
|
|
26
|
-
"stylelint": "17.
|
|
25
|
+
"stylelint": "17.12.0",
|
|
27
26
|
"tsdown": "0.22.0",
|
|
28
|
-
"@odx-internal/
|
|
29
|
-
"@odx-internal/
|
|
27
|
+
"@odx-internal/utils-storybook": "0.0.0",
|
|
28
|
+
"@odx-internal/config-stylelint": "0.0.0"
|
|
30
29
|
},
|
|
31
30
|
"style": "./dist/styles.css",
|
|
32
31
|
"sideEffects": [
|
|
@@ -54,7 +53,8 @@
|
|
|
54
53
|
},
|
|
55
54
|
"scripts": {
|
|
56
55
|
"build": "tsdown",
|
|
57
|
-
"dev": "tsdown
|
|
56
|
+
"dev": "tsdown --log-level error --no-clean --watch",
|
|
57
|
+
"dev:tsc": "tsc --build tsconfig.lib.json --noEmit --watch",
|
|
58
58
|
"lint": "biome lint src",
|
|
59
59
|
"lint:styles": "stylelint '**/*.css'"
|
|
60
60
|
}
|