@nxds/core 0.9.0 → 0.10.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.
- package/README.md +2 -2
- package/dist/runtime/catalogue.cjs +186 -35
- package/dist/runtime/catalogue.cjs.map +1 -1
- package/dist/runtime/catalogue.d.cts +6 -5
- package/dist/runtime/catalogue.d.ts +6 -5
- package/dist/runtime/catalogue.js +186 -35
- package/dist/runtime/catalogue.js.map +1 -1
- package/dist/runtime/index.cjs +30 -4
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.cts +8 -1
- package/dist/runtime/index.d.ts +8 -1
- package/dist/runtime/index.js +29 -4
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/palette.cjs +26 -3
- package/dist/runtime/palette.cjs.map +1 -1
- package/dist/runtime/palette.d.cts +3 -1402
- package/dist/runtime/palette.d.ts +3 -1402
- package/dist/runtime/palette.js +26 -3
- package/dist/runtime/palette.js.map +1 -1
- package/dist/runtime/token-scales.generated-CCNkHJ3I.d.cts +9 -0
- package/dist/runtime/token-scales.generated-CCNkHJ3I.d.ts +9 -0
- package/package.json +3 -2
package/dist/runtime/index.d.cts
CHANGED
|
@@ -2,6 +2,7 @@ import { T as Tier, P as PaletteKey, M as Mode } from './palette-BKTIQ0WC.cjs';
|
|
|
2
2
|
export { N as NxdsSurfaceTone, a as PALETTE_KEYS, b as TIER_THRESHOLDS } from './palette-BKTIQ0WC.cjs';
|
|
3
3
|
import { b as NxdsAppearanceState, d as DerivedTheme } from './surface-ladder-C8HTwT7z.cjs';
|
|
4
4
|
export { B as BASE_TONE_OPTIONS, e as BASE_TONE_SEEDS, C as CORNER_OPTIONS, f as DEFAULT_BRAND_COLOR, g as DEFAULT_NXDS_APPEARANCE, h as DENSITY_OPTIONS, E as ELEVATION_OPTIONS, i as NxdsAppearanceMode, a as NxdsAppearancePrefs, j as NxdsCorners, k as NxdsDensity, l as NxdsElevation, N as NxdsPresetField, m as NxdsStroke, n as NxdsThemeContract, o as STROKE_OPTIONS, p as SurfaceToken, T as ThemeDerivationInput, q as ThemeSeeds, r as TokenMap, s as appearancePrefsToCss, t as createNxdsThemeContract, u as deriveTheme, v as normalizeAppearanceModeIds, w as sanitizeNxdsAppearance, x as sanitizeNxdsAppearancePrefs, y as themeToCss } from './surface-ladder-C8HTwT7z.cjs';
|
|
5
|
+
export { S as SpacingStep } from './token-scales.generated-CCNkHJ3I.cjs';
|
|
5
6
|
|
|
6
7
|
type AdjustContrastTier = Tier;
|
|
7
8
|
type AdjustContrastPalette = PaletteKey;
|
|
@@ -145,6 +146,12 @@ declare function findBrandColorPreset(color: string): BrandColorPreset | undefin
|
|
|
145
146
|
/** Whether a string is a CSS color culori (and thus the engine) can parse. */
|
|
146
147
|
declare function isColor(value: string): boolean;
|
|
147
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The layer order nxds declares in every stylesheet that layers its CSS. It
|
|
151
|
+
* ranks `nx-runtime` after Tailwind's layers whichever stylesheet loads first.
|
|
152
|
+
*/
|
|
153
|
+
declare const RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
|
|
154
|
+
|
|
148
155
|
/** One registered foreground/background pair, measured in one mode. */
|
|
149
156
|
interface ThemeContrastCheck {
|
|
150
157
|
mode: Mode;
|
|
@@ -183,4 +190,4 @@ declare const ALPHA_TOKEN_NAMES: readonly ["background-hover-alpha", "border-def
|
|
|
183
190
|
type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
|
|
184
191
|
declare const SEMANTIC_TOKEN_REGISTRY: readonly SemanticTokenMeta[];
|
|
185
192
|
|
|
186
|
-
export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
|
|
193
|
+
export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, RUNTIME_LAYER_ORDER, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { T as Tier, P as PaletteKey, M as Mode } from './palette-BKTIQ0WC.js';
|
|
|
2
2
|
export { N as NxdsSurfaceTone, a as PALETTE_KEYS, b as TIER_THRESHOLDS } from './palette-BKTIQ0WC.js';
|
|
3
3
|
import { b as NxdsAppearanceState, d as DerivedTheme } from './surface-ladder-B950TU4_.js';
|
|
4
4
|
export { B as BASE_TONE_OPTIONS, e as BASE_TONE_SEEDS, C as CORNER_OPTIONS, f as DEFAULT_BRAND_COLOR, g as DEFAULT_NXDS_APPEARANCE, h as DENSITY_OPTIONS, E as ELEVATION_OPTIONS, i as NxdsAppearanceMode, a as NxdsAppearancePrefs, j as NxdsCorners, k as NxdsDensity, l as NxdsElevation, N as NxdsPresetField, m as NxdsStroke, n as NxdsThemeContract, o as STROKE_OPTIONS, p as SurfaceToken, T as ThemeDerivationInput, q as ThemeSeeds, r as TokenMap, s as appearancePrefsToCss, t as createNxdsThemeContract, u as deriveTheme, v as normalizeAppearanceModeIds, w as sanitizeNxdsAppearance, x as sanitizeNxdsAppearancePrefs, y as themeToCss } from './surface-ladder-B950TU4_.js';
|
|
5
|
+
export { S as SpacingStep } from './token-scales.generated-CCNkHJ3I.js';
|
|
5
6
|
|
|
6
7
|
type AdjustContrastTier = Tier;
|
|
7
8
|
type AdjustContrastPalette = PaletteKey;
|
|
@@ -145,6 +146,12 @@ declare function findBrandColorPreset(color: string): BrandColorPreset | undefin
|
|
|
145
146
|
/** Whether a string is a CSS color culori (and thus the engine) can parse. */
|
|
146
147
|
declare function isColor(value: string): boolean;
|
|
147
148
|
|
|
149
|
+
/**
|
|
150
|
+
* The layer order nxds declares in every stylesheet that layers its CSS. It
|
|
151
|
+
* ranks `nx-runtime` after Tailwind's layers whichever stylesheet loads first.
|
|
152
|
+
*/
|
|
153
|
+
declare const RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
|
|
154
|
+
|
|
148
155
|
/** One registered foreground/background pair, measured in one mode. */
|
|
149
156
|
interface ThemeContrastCheck {
|
|
150
157
|
mode: Mode;
|
|
@@ -183,4 +190,4 @@ declare const ALPHA_TOKEN_NAMES: readonly ["background-hover-alpha", "border-def
|
|
|
183
190
|
type SemanticColorName = (typeof SURFACE_TOKEN_NAMES)[number] | (typeof TEXT_TOKEN_NAMES)[number] | (typeof BORDER_TOKEN_NAMES)[number] | (typeof BRAND_TOKEN_NAMES)[number] | (typeof STATUS_TOKEN_NAMES)[number] | (typeof CHART_TOKEN_NAMES)[number] | (typeof FOCUS_TOKEN_NAMES)[number] | (typeof ALPHA_TOKEN_NAMES)[number];
|
|
184
191
|
declare const SEMANTIC_TOKEN_REGISTRY: readonly SemanticTokenMeta[];
|
|
185
192
|
|
|
186
|
-
export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
|
|
193
|
+
export { type AdjustContrastOptions, type AdjustContrastPalette, type AdjustContrastTier, BRAND_COLOR_PRESETS, type BrandColorPreset, DEFAULT_COOKIE_KEY, DEFAULT_STORAGE_KEY, DerivedTheme, Mode, NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS, NXDS_APPEARANCE_DATA_ATTRS, type NxdsAppearanceBootstrapScriptOptions, type NxdsAppearanceCookieOptions, type NxdsAppearanceCookieSameSite, type NxdsAppearanceDataAttr, type NxdsAppearancePersistOptions, type NxdsAppearanceSnapshot, NxdsAppearanceState, type NxdsAppearanceStateCookie, type NxdsFirstPaintResolution, type NxdsResolvedAppearanceMode, RUNTIME_LAYER_ORDER, SEMANTIC_TOKEN_REGISTRY, SNAPSHOT_VERSION, type SemanticColorName, type SemanticTokenMeta, type ThemeContrastCheck, Tier, type TokenCategory, adjustContrast, apcaLc, applyNxdsAppearance, createDefaultNxdsAppearanceSnapshot, createNxdsAppearanceBootstrapScript, createNxdsAppearanceSnapshot, createNxdsAppearanceSnapshotFromCookie, createNxdsAppearanceSnapshotFromState, createNxdsAppearanceStateCookie, findBrandColorPreset, isColor, measureThemeContrast, parseNxdsAppearanceStateCookie, persistNxdsAppearance, prefersDarkColorScheme, readStoredNxdsAppearance, removeNxdsAppearance, resolveFirstPaint, resolveNxdsAppearanceMode, sanitizeNxdsAppearanceSnapshot, serializeNxdsAppearanceStateCookie, watchColorScheme };
|
package/dist/runtime/index.js
CHANGED
|
@@ -2496,8 +2496,9 @@ function constrainColors(map, mode, contrast) {
|
|
|
2496
2496
|
}
|
|
2497
2497
|
|
|
2498
2498
|
// src/lib/runtime-layer.ts
|
|
2499
|
+
var RUNTIME_LAYER_ORDER = "@layer properties, theme, base, components, utilities, nx-runtime;";
|
|
2499
2500
|
function inRuntimeLayer(css) {
|
|
2500
|
-
return
|
|
2501
|
+
return `${RUNTIME_LAYER_ORDER}
|
|
2501
2502
|
@layer nx-runtime {
|
|
2502
2503
|
${css}
|
|
2503
2504
|
}
|
|
@@ -4108,10 +4109,33 @@ var color_default2 = {
|
|
|
4108
4109
|
}
|
|
4109
4110
|
};
|
|
4110
4111
|
|
|
4112
|
+
// src/lib/token-scales.generated.ts
|
|
4113
|
+
var PRIMITIVE_PALETTE_NAMES = [
|
|
4114
|
+
"green",
|
|
4115
|
+
"emerald",
|
|
4116
|
+
"teal",
|
|
4117
|
+
"cyan",
|
|
4118
|
+
"sky",
|
|
4119
|
+
"indigo",
|
|
4120
|
+
"violet",
|
|
4121
|
+
"purple",
|
|
4122
|
+
"fuchsia",
|
|
4123
|
+
"pink",
|
|
4124
|
+
"slate",
|
|
4125
|
+
"rose",
|
|
4126
|
+
"lime",
|
|
4127
|
+
"yellow",
|
|
4128
|
+
"blue",
|
|
4129
|
+
"gray",
|
|
4130
|
+
"zinc",
|
|
4131
|
+
"neutral",
|
|
4132
|
+
"stone",
|
|
4133
|
+
"red",
|
|
4134
|
+
"orange",
|
|
4135
|
+
"amber"
|
|
4136
|
+
];
|
|
4137
|
+
|
|
4111
4138
|
// src/lib/primitive-palette.ts
|
|
4112
|
-
var PRIMITIVE_PALETTE_NAMES = Object.keys(color_default2).filter(
|
|
4113
|
-
(name) => name !== "white" && name !== "black"
|
|
4114
|
-
);
|
|
4115
4139
|
var rampCache = /* @__PURE__ */ new Map();
|
|
4116
4140
|
function getPaletteRamp(palette) {
|
|
4117
4141
|
if (!PRIMITIVE_PALETTE_NAMES.includes(palette)) {
|
|
@@ -4947,6 +4971,7 @@ export {
|
|
|
4947
4971
|
NXDS_APPEARANCE_COOKIE_MAX_AGE_SECONDS,
|
|
4948
4972
|
NXDS_APPEARANCE_DATA_ATTRS,
|
|
4949
4973
|
PALETTE_KEYS,
|
|
4974
|
+
RUNTIME_LAYER_ORDER,
|
|
4950
4975
|
SEMANTIC_TOKEN_REGISTRY,
|
|
4951
4976
|
SNAPSHOT_VERSION,
|
|
4952
4977
|
STROKE_OPTIONS,
|