@ui0/theme 0.1.4 → 0.1.6
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/dist/config.default.mjs +10 -1
- package/dist/config.default.mjs.map +1 -1
- package/dist/display.scss +0 -3
- package/dist/duration.scss +0 -10
- package/dist/{generate-Dey8zJEZ.mjs → generate-1VaquCh8.mjs} +34 -6
- package/dist/generate-1VaquCh8.mjs.map +1 -0
- package/dist/generator/cli.mjs +1 -1
- package/dist/generator/vite.d.mts.map +1 -1
- package/dist/generator/vite.mjs +13 -3
- package/dist/generator/vite.mjs.map +1 -1
- package/dist/index.d.mts +14 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +25 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/contracts/backdrop/backdrop.generator.ts +0 -2
- package/src/contracts/backdrop/index.ts +1 -1
- package/src/contracts/color/color.generator.ts +7 -0
- package/src/contracts/color/index.ts +1 -1
- package/src/contracts/contract.ts +5 -1
- package/src/contracts/disabled/index.ts +1 -1
- package/src/contracts/display/display.contract.ts +11 -22
- package/src/contracts/display/display.scss +0 -3
- package/src/contracts/display/index.ts +1 -1
- package/src/contracts/duration/duration.generator.spec.ts +15 -0
- package/src/contracts/duration/duration.generator.ts +40 -0
- package/src/contracts/duration/duration.keys.ts +4 -0
- package/src/{styles → contracts/duration}/duration.scss +0 -10
- package/src/contracts/duration/duration.types.ts +16 -0
- package/src/contracts/duration/duration.util.ts +12 -0
- package/src/contracts/duration/index.ts +13 -0
- package/src/contracts/elevation/index.ts +1 -1
- package/src/contracts/index.ts +3 -1
- package/src/contracts/round/index.ts +1 -1
- package/src/contracts/round/round.types.ts +1 -1
- package/src/contracts/size/index.ts +1 -1
- package/src/contracts/typography/index.ts +4 -5
- package/src/contracts/typography/typography.generator.spec.ts +7 -5
- package/src/contracts/typography/typography.module.css +1 -1
- package/src/contracts/typography/typography.types.ts +1 -27
- package/src/generator/theme.default.css +12 -48
- package/dist/generate-Dey8zJEZ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as buildPool, a as deepMerge, b as ensureThemeBaseStyle, c as contractGenerators, d as round_module_css_default, f as elevation_module_css_default, g as parseRef, h as parseColorProp, i as withDefaults, l as typography_module_css_default, m as color_module_css_default, n as generateThemeCss, o as resolvePreset, p as disabled_module_css_default, r as generateThemeTypes, s as hashClassName, t as generateThemeArtifacts, u as size_module_css_default, v as resolvePool, x as schemesOf, y as backdrop_module_css_default } from "./generate-1VaquCh8.mjs";
|
|
2
2
|
import config from "./config.default.mjs";
|
|
3
3
|
import { RecordContainer, arrayPickNext, arrayPickPrev, getClientHeight, getClientWidth, isArray, isBrowser, isString, mergeCssModulesStyles, newFrameworkError, objectMerge, parseUnits, propsToCssModuleClassNext, toCamelCase } from "@ui0/util";
|
|
4
4
|
import { AT_SIGN } from "@ui0/shared";
|
|
5
|
-
import {
|
|
5
|
+
import { hasInjectionContext, inject, isReactive, onMounted, onUnmounted, provide, reactive, ref, toRefs, useCssModule, watch } from "vue";
|
|
6
6
|
import { ThemeProvider } from "./components/index.js";
|
|
7
7
|
// src/constants.ts
|
|
8
8
|
const THEME_SCHEMES = [
|
|
@@ -216,22 +216,10 @@ const disabled = {
|
|
|
216
216
|
props: DisabledPropsKeys
|
|
217
217
|
};
|
|
218
218
|
// src/contracts/display/display.contract.ts
|
|
219
|
-
function displayClasses(props, styles) {
|
|
220
|
-
const $ = mergeCssModulesStyles(display_module_css_default, styles);
|
|
221
|
-
const out = [];
|
|
222
|
-
if (props.display && $.displayed) out.push($.displayed);
|
|
223
|
-
return out;
|
|
224
|
-
}
|
|
225
219
|
function displayDeal(instance) {
|
|
226
|
-
const props = instance.props;
|
|
227
220
|
return {
|
|
228
221
|
classes: () => {
|
|
229
|
-
|
|
230
|
-
if (props.display === "inherit") {
|
|
231
|
-
const ctx = instance.context;
|
|
232
|
-
if (ctx?.display) return instance.inject(displayClasses({ display: ctx.display.value }, instance.$styles));
|
|
233
|
-
}
|
|
234
|
-
return instance.inject(displayClasses(props, instance.$styles));
|
|
222
|
+
return [];
|
|
235
223
|
},
|
|
236
224
|
styles: () => instance.inject(EMPTY_OBJ)
|
|
237
225
|
};
|
|
@@ -249,6 +237,12 @@ const display = {
|
|
|
249
237
|
flag: 1,
|
|
250
238
|
props: []
|
|
251
239
|
};
|
|
240
|
+
// src/contracts/duration/index.ts
|
|
241
|
+
const duration = {
|
|
242
|
+
key: Symbol("DurationContractKey"),
|
|
243
|
+
name: "duration",
|
|
244
|
+
flag: 1
|
|
245
|
+
};
|
|
252
246
|
// src/contracts/elevation/elevation.contract.ts
|
|
253
247
|
function elevationClasses(p, s) {
|
|
254
248
|
const { elevation } = p;
|
|
@@ -462,6 +456,7 @@ const contracts = {
|
|
|
462
456
|
backdrop,
|
|
463
457
|
round,
|
|
464
458
|
elevation,
|
|
459
|
+
duration,
|
|
465
460
|
style,
|
|
466
461
|
disabled,
|
|
467
462
|
display,
|
|
@@ -709,14 +704,17 @@ const Ui0ThemeKey = Symbol("ui0-theme");
|
|
|
709
704
|
function createUi0Theme(config) {
|
|
710
705
|
return { install(instance) {
|
|
711
706
|
const theme = createThemeInstance(config);
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
instance.vue
|
|
719
|
-
|
|
707
|
+
if (theme) {
|
|
708
|
+
Object.keys(contracts).forEach((c) => {
|
|
709
|
+
if (contracts[c].flag & 2) theme.addContract(contracts[c]);
|
|
710
|
+
});
|
|
711
|
+
const display = new Display(config.contracts.display);
|
|
712
|
+
if (typeof document !== "undefined") ensureThemeBaseStyle(document);
|
|
713
|
+
if (instance.vue) {
|
|
714
|
+
if (theme) instance.vue.provide(Ui0ThemeKey, theme);
|
|
715
|
+
if (display) instance.vue.provide(DisplayKey, display);
|
|
716
|
+
}
|
|
717
|
+
instance.theme = theme;
|
|
720
718
|
}
|
|
721
719
|
return theme;
|
|
722
720
|
} };
|
|
@@ -727,16 +725,12 @@ function useTheme() {
|
|
|
727
725
|
const provided = inject(Ui0ThemeKey, void 0);
|
|
728
726
|
if (provided) return provided;
|
|
729
727
|
}
|
|
730
|
-
const vm = getCurrentInstance();
|
|
731
|
-
if (!vm) return void 0;
|
|
732
|
-
return vm.appContext.config.globalProperties.$ui0?.theme;
|
|
733
728
|
}
|
|
734
729
|
// src/useDisplay.ts
|
|
735
730
|
function useDisplay(onUpdate) {
|
|
736
731
|
if (hasInjectionContext()) {
|
|
737
732
|
const display = inject(DisplayKey);
|
|
738
733
|
if (display) {
|
|
739
|
-
console.log("if display", display);
|
|
740
734
|
if (onUpdate) onMounted(() => {
|
|
741
735
|
const id = display.addUpdateListener(onUpdate);
|
|
742
736
|
onUnmounted(() => {
|
|
@@ -775,7 +769,9 @@ var ThemeContractInstance = class {
|
|
|
775
769
|
const instance = this;
|
|
776
770
|
for (const contract of Object.values(this.contracts)) {
|
|
777
771
|
if (isArray(name)) name.forEach((n) => {
|
|
778
|
-
if (contract.props?.includes(n))
|
|
772
|
+
if (contract.props?.includes(n)) {
|
|
773
|
+
if (contract.flag & 2) jobs[contract.name] = contract.deal;
|
|
774
|
+
}
|
|
779
775
|
});
|
|
780
776
|
else if (isString(name)) {
|
|
781
777
|
if (contract.props?.includes(name)) jobs[contract.name] = contract;
|
|
@@ -848,7 +844,6 @@ var ThemeContractInstance = class {
|
|
|
848
844
|
};
|
|
849
845
|
// src/useThemeContext.ts
|
|
850
846
|
function useThemeContext(props, $styles, _allowContracts) {
|
|
851
|
-
const vm = getCurrentInstance();
|
|
852
847
|
if (hasInjectionContext()) {
|
|
853
848
|
const $style = $styles ?? useCssModule();
|
|
854
849
|
const theme = useTheme();
|
|
@@ -897,9 +892,7 @@ function useThemeContext(props, $styles, _allowContracts) {
|
|
|
897
892
|
return [theme, provider];
|
|
898
893
|
}
|
|
899
894
|
}
|
|
900
|
-
|
|
901
|
-
if (!vm) return [void 0, void 0];
|
|
902
|
-
return [vm.appContext.config.globalProperties.$ui0?.theme, void 0];
|
|
895
|
+
return [void 0, void 0];
|
|
903
896
|
}
|
|
904
897
|
export { props as ThemeContractPropsKeys, ThemeProvider, contractGenerators, createThemeInstance, createUi0Theme, generateThemeArtifacts, generateThemeCss, generateThemeTypes, useDisplay, useTheme, useThemeContext, withDefaults };
|
|
905
898
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["$backdrop","$color","$disabled","$display","$elevation","$round","$size","$typography","cfg","config"],"sources":["../src/constants.ts","../src/contracts/backdrop/backdrop.contract.ts","../src/contracts/backdrop/backdrop.keys.ts","../src/contracts/backdrop/index.ts","../src/contracts/color/color.gradient.ts","../src/contracts/color/color.serialize.ts","../src/contracts/color/color.contract.ts","../src/contracts/color/color.keys.ts","../src/contracts/color/index.ts","../src/contracts/disabled/disabled.contract.ts","../src/contracts/disabled/disabled.keys.ts","../src/contracts/disabled/index.ts","../src/contracts/display/display.contract.ts","../src/contracts/display/display.keys.ts","../src/contracts/display/index.ts","../src/contracts/elevation/elevation.contract.ts","../src/contracts/elevation/elevation.keys.ts","../src/contracts/elevation/index.ts","../src/contracts/round/round.contract.ts","../src/contracts/round/round.keys.ts","../src/contracts/round/index.ts","../src/contracts/size/size.types.ts","../src/contracts/size/size.contract.ts","../src/contracts/size/size.keys.ts","../src/contracts/size/index.ts","../src/contracts/style/style.key.ts","../src/contracts/style/index.ts","../src/contracts/typography/typography.contract.ts","../src/contracts/typography/typography.keys.ts","../src/contracts/typography/index.ts","../src/contracts/index.ts","../src/contracts/display/display.instance.ts","../src/persist.ts","../src/instance.ts","../src/keys.ts","../src/plugin.ts","../src/useTheme.ts","../src/useDisplay.ts","../src/contracts/contract.ts","../src/useThemeContext.ts"],"sourcesContent":["export const CONTRACT_GENERATOR = 0\nexport const THEME_SCHEMES = ['dark', 'light', 'default']\n// from @vue/shared\n\nexport const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__\n ? Object.freeze({})\n : {}\nexport enum ThemeContractFlags {\n /**\n * can generate css\n * @type {ContractFlags.generator}\n */\n\n generator = 1 << 0,\n /**\n * can resolve classes\n * @type {ContractFlags.dealer}\n */\n dealer = 1 << 1\n}\n","import { AT_SIGN } from '@ui0/shared'\n// The backdrop contract's processing endpoint: the backdrop prop selects a\n// backdrop-filter function; the deal resolves the prop value to the hashed\n// setter class from the module map (merged with the component's own $style).\nimport type { ClassList, CSSModuleClassList, StyleList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { isArray, isString, mergeCssModulesStyles } from '@ui0/util'\n\nimport type { BackdropProps } from './backdrop.types'\n\nimport $backdrop from './backdrop.module.css'\n\nfunction backdropClasses(p: BackdropProps, s?: CSSModuleClassList): ClassList {\n const $ = mergeCssModulesStyles($backdrop, s)\n // console.log('$', $)\n\n if (p.backdrop) return [$['backdrop']]\n return []\n}\n\nexport function backdropDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => instance.inject(backdropClasses(props, instance.$styles)),\n styles() {\n const out: StyleList = {}\n const val = props.backdrop\n if (val) {\n if (isArray(val)) {\n } else if (isString(val)) {\n const split = val.split(AT_SIGN)\n if (split[1]) {\n out['--0-backdrop-' + split[0]] = split[1]\n out['--0-backdrop'] = `${split[0]}(var(--0-backdrop-${split[0]}))`\n } else {\n out['--0-backdrop'] = `${props.backdrop}(var(--0-backdrop-${props.backdrop}))`\n }\n }\n }\n return instance.inject(out)\n }\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { BackdropProps } from './backdrop.types'\n\nexport const BackdropRefKey = Symbol('BackdropRefKey') as InjectionKey<Ref<BackdropProps['backdrop']>>\nexport const BackdropContractKey = Symbol('BackdropContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { backdropDeal } from './backdrop.contract'\nimport { BackdropContractKey, BackdropRefKey } from './backdrop.keys'\nimport type { BackdropProps } from './backdrop.types'\n\nexport { default as $style } from './backdrop.module.css'\nexport type * from './backdrop.types'\nexport * from './backdrop.keys'\n\nexport const BackdropPropsKeys: ReadonlyArray<keyof BackdropProps> = ['backdrop']\n\nexport const backdrop: ThemeContract = {\n name: 'backdrop',\n key: BackdropContractKey,\n ref: BackdropRefKey,\n deal: backdropDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: BackdropPropsKeys\n}\n","// the `gradient` prop -> the `--0-g-cur` value (a linear-gradient()\n// composed of live var() references to pool channels). Delivered as an\n// element inline style, NOT a class: a gradient is a composition of values,\n// and class-per-combination would explode combinatorially. The references\n// stay live - a scheme block revalues the underlying --0-c-* channels and\n// the gradient re-paints without any gradient-specific rule.\n//\n// gradient=\"error->success\"\n// gradient=\"to-br error->success@80->highlight\"\nimport { isString } from '@ui0/util'\n\nimport { parseRef } from './color.token'\n\nconst DIRECTIONS: Record<string, string> = {\n right: 'to right',\n left: 'to left',\n top: 'to top',\n bottom: 'to bottom',\n tr: 'to top right',\n tl: 'to top left',\n br: 'to bottom right',\n bl: 'to bottom left'\n}\n\n/** compile a gradient prop value into a `linear-gradient(...)` string */\nexport function gradientStyle(value: string | undefined | null): string | undefined {\n if (!isString(value) || !value.trim()) return undefined\n const parts = value.trim().split(/\\s+/)\n\n let direction = DIRECTIONS.bottom\n if (parts[0]?.startsWith('to-')) {\n const css = DIRECTIONS[parts[0].slice(3)]\n if (!css)\n throw new Error(\n `ui0 gradient: unknown direction \"${parts[0]}\" (expected to-right|to-left|to-top|to-bottom|to-tr|to-tl|to-br|to-bl)`\n )\n direction = css\n parts.shift()\n }\n\n // rejoin so spaced arrows (`error -> success`) compile too\n const stops = parts\n .join('')\n .split('->')\n .map((s) => parseRef(s))\n .filter((s) => s.ref)\n\n if (stops.length < 2) throw new Error(`ui0 gradient: \"${value}\" needs at least two stops (ref[->ref...])`)\n\n const paint = stops.map((s) => `rgb(var(--0-c-${s.ref}-v) / ${s.opacity ?? 1})`).join(', ')\n return `linear-gradient(${direction}, ${paint})`\n}\n","// tokens -> paint. A token's color selection always compiles to a hashed\n// swatch setter class (`[scheme-][pseudo-]{c|f}-<ref>`) - selections are\n// conditional by nature. Opacity VALUES always ride element inline styles as\n// context source vars (`--0-{slot}-src[-{l|d}][-{pseudo}]`); the conditional\n// pick happens in the component's color.use() scss bridges, so the generated\n// theme css carries no opacity rules at all.\nimport type { ClassList, CSSModuleClassList, StyleList } from '@ui0/types'\n\nimport { hashClassName } from '../../generator/hash'\nimport type { ColorToken } from './color.types'\n\nexport function resolveClass(full: string, $?: CSSModuleClassList): string {\n return ($ && $[full]) || hashClassName(full)\n}\n\nexport function serializeTokens(\n tokens: ColorToken[],\n slot: 'c' | 'f',\n $?: CSSModuleClassList\n): { classes: ClassList; styles: StyleList } {\n const classes: ClassList = []\n const styles: StyleList = {}\n const ns = slot === 'c' ? '--0-c' : '--0-f'\n\n for (const t of tokens) {\n const pre = `${t.scheme ? t.scheme + '-' : ''}${t.pseudo ? t.pseudo + '-' : ''}${slot}`\n classes.push(resolveClass(`${pre}-${t.ref}`, $))\n\n if (t.opacity !== undefined && t.opacity < 1) {\n const ctx = `${t.scheme === 'light' ? '-l' : t.scheme === 'dark' ? '-d' : ''}${t.pseudo ? `-${t.pseudo}` : ''}`\n styles[`${ns}-src${ctx}`] = `${t.opacity}`\n }\n }\n return { classes, styles }\n}\n","// The color contract's processing endpoint (v2): resolves the color/fill\n// props onto hashed setter classes (via the token parser + serializer) and\n// the gradient prop onto the `--0-g-cur` inline style. One parse pass per\n// prop change, shared by classes() and styles().\nimport type { ClassList, StyleList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { isString, mergeCssModulesStyles } from '@ui0/util'\n\nimport { gradientStyle } from './color.gradient'\nimport { serializeTokens } from './color.serialize'\nimport { parseColorProp } from './color.token'\nimport type { ColorProps, FillProps, GradientProps } from './color.types'\n\nimport $color from './color.module.css'\n\ntype Painted = ColorProps & FillProps & GradientProps\n\nexport function colorDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n // one parse pass per prop change, shared by classes() and styles() -\n // either may be called first; the key also carries the inherited context\n // values so an `inherit` prop follows a context change\n let cache: { key: string; value: { classes: ClassList; styles: StyleList } } | undefined\n\n const norm = (v: unknown) => (isString(v) ? v : Array.isArray(v) ? v.join(' ') : '')\n\n const ensure = () => {\n const key = [\n norm(props.color),\n norm(props.fill),\n norm(props.gradient),\n norm(instance.context?.color?.value),\n norm(instance.context?.fill?.value)\n ].join('|')\n if (cache && cache.key === key) return cache.value\n const value = paint(resolveProps())\n cache = { key, value }\n return value\n }\n\n // the `inherit` passthrough: an `inherit` prop re-reads the provided\n // context ref (a parent's prop), everything else resolves its own value\n const resolveProps = (): Painted => {\n const out: Record<string, any> = {}\n const color = props.color\n const fill = props.fill\n\n if (isString(color) && color.split(' ')[0] === 'inherit') {\n const v = instance.context?.color?.value\n if (v) out['color'] = v\n } else if (color) {\n out['color'] = color\n }\n if (isString(fill) && fill.split(' ')[0] === 'inherit') {\n const v = instance.context?.fill?.value\n if (v) out['fill'] = v\n } else if (fill) {\n out['fill'] = fill\n }\n if (props.gradient) out['gradient'] = props.gradient\n return out as Painted\n }\n\n const paint = (p: Painted): { classes: ClassList; styles: StyleList } => {\n const classes: ClassList = []\n const styles: StyleList = {}\n const $ = mergeCssModulesStyles($color, instance.$styles)\n\n if (p.color) {\n const out = serializeTokens(parseColorProp(p.color), 'c', $)\n classes.push(...out.classes)\n Object.assign(styles, out.styles)\n classes.push($.colored)\n }\n if (p.fill) {\n const out = serializeTokens(parseColorProp(p.fill), 'f', $)\n classes.push(...out.classes)\n Object.assign(styles, out.styles)\n classes.push($.filled)\n }\n if (p.gradient) {\n const g = gradientStyle(p.gradient)\n if (g) {\n styles['--0-g-cur'] = g\n classes.push($.gradiented)\n }\n }\n return { classes, styles }\n }\n\n return {\n classes: () =>\n props.color || props.fill || props.gradient ? instance.inject(ensure().classes) : instance.inject([]),\n styles: () => instance.inject(ensure().styles)\n }\n}\n","import type { ComponentColor } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const ColorContractKey = Symbol('ColorContractKey') as InjectionKey<ThemeContractDeal>\nexport const ColorRefKey = Symbol('ColorRefKey') as InjectionKey<Ref<ComponentColor>>\nexport const FillRefKey = Symbol('FillRefKey') as InjectionKey<Ref<ComponentColor>>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { colorDeal } from './color.contract'\nimport { ColorContractKey, ColorRefKey } from './color.keys'\nimport type { ColorProps, GradientProps, FillProps } from './color.types'\n\nexport { default as $style } from './color.module.css'\nexport type * from './color.types'\nexport * from './color.keys'\n\nexport const ColorPropsKeys: ReadonlyArray<keyof (GradientProps & ColorProps & FillProps)> = [\n 'color',\n 'fill',\n 'gradient'\n]\n\nexport const color: ThemeContract = {\n name: 'color',\n key: ColorContractKey,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n ref: ColorRefKey,\n deal: colorDeal,\n props: ColorPropsKeys\n}\n","// The disabled contract's processing endpoint: the `disabled` prop maps to\n// the hashed `.disabled` setter class; `inherit` reads the provided ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { DisabledProps } from './disabled.types'\n\nimport $disabled from './disabled.module.css'\n\nfunction disabledClasses(p: DisabledProps, s?: CSSModuleClassList): ClassList {\n const $ = mergeCssModulesStyles($disabled, s)\n if (p.disabled) return [$.disabled]\n return []\n}\n\nexport function disabledDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (instance.context) {\n if (props.disabled === 'inherit' && instance.context.disabled) {\n return instance.inject(disabledClasses({ disabled: instance.context.disabled.value }, instance.$styles))\n }\n }\n return instance.inject(disabledClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const DisabledRefKey = Symbol('DisabledRefKey') as InjectionKey<Ref<boolean>>\n\nexport const DisabledContractKey = Symbol('DisabledContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { disabledDeal } from './disabled.contract'\nimport { DisabledContractKey, DisabledRefKey } from './disabled.keys'\nimport type { DisabledProps } from './disabled.types'\n\nexport { default as $style } from './disabled.module.css'\nexport type * from './disabled.types'\nexport * from './disabled.keys'\n\nexport const DisabledPropsKeys: ReadonlyArray<keyof DisabledProps> = ['disabled']\n\nexport const disabled: ThemeContract = {\n key: DisabledContractKey,\n name: 'disabled',\n ref: DisabledRefKey,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n deal: disabledDeal,\n props: DisabledPropsKeys\n}\n","// The display contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `display` prop onto classes/styles at\n// runtime, resolving `inherit` against the provided context ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\nimport type { Ref } from 'vue'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { DisplayProps } from './display.types'\n\nimport $display from './display.module.css'\n\n// the prop -> class wiring: resolves the prop value to the hashed class from\n// the module map (merged with the component's own $style)\nfunction displayClasses(props: DisplayProps, styles?: CSSModuleClassList): ClassList {\n const $ = mergeCssModulesStyles($display, styles)\n const out: ClassList = []\n if (props.display && $.displayed) out.push($.displayed)\n return out\n}\n\nexport function displayDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (!props.display) return instance.inject([])\n\n if (props.display === 'inherit') {\n const ctx = instance.context as Record<string, Ref<any> | undefined> | null\n if (ctx?.display) {\n return instance.inject(displayClasses({ display: ctx.display.value }, instance.$styles))\n }\n }\n\n return instance.inject(displayClasses(props as DisplayProps, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContract } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { DisplayImpl, DisplayProp, DisplayReturn } from './display.types'\n\n/** context key the deal resolves `inherit` against (see useThemeContract) */\nexport const DisplayRefKey = Symbol('DisplayRefKey') as InjectionKey<Ref<DisplayProp | undefined>>\nexport const DisplayContractKey = Symbol('DisplayContractKey') as InjectionKey<ThemeContract>\nexport const DisplayKey = Symbol('DisplayContractKey') as InjectionKey<DisplayImpl>\n","import type { ThemeContract } from '@ui0/types'\n\n// The display contract's registry entry, generated from\n// packages/templates/contract. Wiring left (see the generator output):\n// 1. add `display` to src/contracts/index.ts (next to round/size/...)\n// 2. add displayGenerator to src/generator.ts (contractGenerators)\nimport { ThemeContractFlags } from '../../constants'\nimport { displayDeal } from './display.contract'\nimport { DisplayContractKey, DisplayRefKey } from './display.keys'\nimport type { DisplayProps } from './display.types'\n\nexport { default as $style } from './display.module.css'\nexport type * from './display.types'\nexport * from './display.keys'\n\nexport const DisplayPropsKeys: ReadonlyArray<keyof DisplayProps> = [\n // 'display'\n]\n\nexport const display: ThemeContract = {\n key: DisplayContractKey,\n name: 'display',\n ref: DisplayRefKey,\n deal: displayDeal,\n flag: ThemeContractFlags.generator,\n props: DisplayPropsKeys\n}\n","// The elevation contract's processing endpoint: the `elevation` prop picks a\n// step of the shadow scale; the deal resolves it to the hashed step class\n// (`elv1..steps`, `n` suffix for inset), `inherit` reading the provided ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { ElevationProps } from './elevation.types'\n\nimport $elevation from './elevation.module.css'\n\nfunction elevationClasses(p: ElevationProps, s?: CSSModuleClassList): ClassList {\n const { elevation } = p\n if (elevation === undefined) return []\n const $ = mergeCssModulesStyles($elevation, s)\n\n const value = Number(elevation)\n\n return Number.isNaN(value) ? [] : [$['elv' + Math.abs(value) + (value < 0 ? 'n' : '')], $.elv]\n}\n\nexport function elevationDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (instance.context) {\n if (props.elevation === 'inherit' && instance.context.elevation) {\n return instance.inject(elevationClasses({ elevation: instance.context.elevation.value }, instance.$styles))\n }\n }\n return instance.inject(elevationClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ComponentElevation } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const ElevationRefKey = Symbol('ElevationRefKey') as InjectionKey<Ref<ComponentElevation>>\nexport const ElevationContractKey = Symbol('ElevationContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { elevationDeal } from './elevation.contract'\nimport { ElevationContractKey, ElevationRefKey } from './elevation.keys'\nimport type { ElevationProps } from './elevation.types'\n\nexport { default as $style } from './elevation.module.css'\nexport type * from './elevation.types'\nexport * from './elevation.keys'\nexport const ElevationPropsKeys: ReadonlyArray<keyof ElevationProps> = ['elevation']\n\nexport const elevation: ThemeContract = {\n key: ElevationContractKey,\n name: 'elevation',\n ref: ElevationRefKey,\n deal: elevationDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: ElevationPropsKeys\n}\n","// The round contract's processing endpoint. The runtime wiring is minimal\n// for now: radius values are computed in the component namespace\n// (round.scss) and no round settings land on the theme block yet - the deal\n// returns no classes until a rounding setting arrives in the config.\nimport type { CSSModuleClassList, Indexed } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles, propsToCssModuleClassNext } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { RoundProps } from './round.types'\n\nimport $round from './round.module.css'\nexport type PropClassImpl<T = Record<string, unknown>> = keyof T | [keyof T, Indexed]\n\nexport function roundDeal(instance: ContractProvider): ThemeContractDeal {\n return {\n classes() {\n const { props, $styles } = instance\n const $ = mergeCssModulesStyles($round, $styles)\n // console.log('props', instance.props)\n\n // console.log(\n // 'propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)',\n // propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)\n // )\n\n return propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n\nfunction getRoundTargetPropClasses(style: CSSModuleClassList = $round): PropClassImpl<RoundProps> {\n return [\n 'roundTarget',\n {\n 'top-left-none': style.tln,\n 'bottom-left-none': style.bln,\n 'top-right-none': style.trn,\n 'bottom-right-none': style.brn,\n\n 'top-none': style.tn,\n 'bottom-none': style.bn,\n 'right-none': style.rn,\n 'left-none': style.ln,\n\n 'bottom-left': style.bl,\n 'bottom-right': style.br,\n 'top-right': style.tr,\n 'top-left': style.tl\n }\n ]\n}\nfunction getRoundPropClasses(style: CSSModuleClassList = $round): PropClassImpl<RoundProps> {\n return [\n 'round',\n {\n true: style.rFull,\n none: style.rNone,\n full: style.rFull,\n\n basic: style.rBasic,\n smooth: style.rSmooth,\n hard: style.rHard,\n\n round: style.round,\n\n left: [style.tl, style.bl],\n\n right: [style.tr, style.br],\n bottom: [style.br, style.bl],\n top: [style.tl, style.tr]\n }\n ]\n}\n","import type { ComponentRound, ComponentRoundTarget } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const RoundRefKey = Symbol('RoundRefKey') as InjectionKey<Ref<ComponentRound>>\nexport const RoundTargetRefKey = Symbol('RoundTargetRefKey') as InjectionKey<Ref<ComponentRoundTarget>>\nexport const RoundContractKey = Symbol('RoundContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { roundDeal } from './round.contract'\nimport { RoundContractKey, RoundRefKey } from './round.keys'\nimport type { RoundProps } from './round.types'\n\nexport { default as $style } from './round.module.css'\nexport type * from './round.types'\nexport * from './round.keys'\n\nexport const RoundPropsKeys: ReadonlyArray<keyof RoundProps> = ['round', 'round-target']\n\nexport const round: ThemeContract = {\n key: RoundContractKey,\n name: 'round',\n ref: RoundRefKey,\n deal: roundDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: RoundPropsKeys\n}\n","import type { MaybeUnits, InheritValue, LiteralUnion } from '@ui0/types'\n\n/* -------------------------------------------------------------------------- */\n/* Size */\n/* -------------------------------------------------------------------------- */\n\nexport type SizeXXXS = 'xxx-small' | 'xxxs'\nexport type SizeXXS = 'xx-small' | 'xxs'\nexport type SizeXS = 'x-small' | 'xs'\nexport type SizeS = 'small' | 's'\nexport type SizeM = 'medium' | 'm'\nexport type SizeL = 'large' | 'l'\nexport type SizeXL = 'x-large' | 'xl'\nexport type SizeXXL = 'xx-large' | 'xxl'\nexport type SizeXXXL = 'xxx-large' | 'xxxl'\n\nexport type Size =\n | SizeXXXS\n | SizeXXS\n | SizeXS\n | SizeS\n | SizeM\n | SizeL\n | SizeXL\n | SizeXXL\n | SizeXXXL\n | 'custom'\n | 'smaller'\n | 'larger'\n | InheritValue\n\nexport type SizeDensity = LiteralUnion<'normal' | 'compact' | 'child'>\n\nexport interface SizeProps {\n size?: Size\n}\n\nexport interface DensityProps {\n density?: SizeDensity\n}\n\n/** the size contract's settings inside a theme preset (appearance config) */\nexport interface SizeThemeAppearanceConfig {\n /** the control's base height -> expands into the --0-s-* scale */\n control?: MaybeUnits\n /** a control's child (icon etc.) base height -> the --0-sc-* scale */\n child?: MaybeUnits\n}\n\n/** the absolute scale steps a `size` prop can pick (long and short spellings) */\nexport const SizeValuesAbsolute: Size[] = ['xxxs', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl']\n\n// registration: the contract announces itself to the package registries\n// (interface merging - no central import of the contracts anywhere)\ndeclare module '@ui0/types/theme' {\n interface Ui0ThemePresetAppearanceConfig {\n size?: SizeThemeAppearanceConfig\n }\n interface Ui0ThemeContractSettings {\n size?: boolean\n }\n interface Ui0ThemeContracts extends SizeProps, DensityProps {}\n}\n","// The size contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `size`/`density` props onto classes,\n// resolving `inherit`/`smaller`/`larger` against the provided context refs.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { arrayPickNext, arrayPickPrev, isArray, mergeCssModulesStyles, toCamelCase } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { DensityProps, Size, SizeProps } from './size.types'\nimport { SizeValuesAbsolute } from './size.types'\n\nimport $size from './size.module.css'\n\ntype Sizers = SizeProps & DensityProps\n\nfunction sizeClasses(props: Sizers, styles?: CSSModuleClassList): ClassList {\n const out: ClassList = []\n const { size, density } = props\n const normalizedSizing = (isArray(density) ? density : [toCamelCase(density)]) as string[]\n\n const $ = mergeCssModulesStyles($size, styles)\n if (size) {\n out.push($.sized)\n const cls = getSizePropClasses($)[size]\n if (cls) out.push(cls)\n }\n\n if (normalizedSizing) {\n normalizedSizing.forEach((d) => {\n if ($ && $[d]) out.push($[d])\n })\n }\n return out\n}\n\nfunction getSizePropClasses(styles: CSSModuleClassList): Record<Size | 'inherit', string> {\n return {\n 'xxx-large': styles.sizeXxxl,\n 'xx-large': styles.sizeXxl,\n 'x-large': styles.sizeXl,\n large: styles.sizeL,\n 'x-small': styles.sizeXs,\n 'xx-small': styles.sizeXxs,\n 'xxx-small': styles.sizeXxxs,\n small: styles.sizeS,\n medium: styles.sizeM,\n\n xxxl: styles.sizeXxxl,\n xxl: styles.sizeXxl,\n xl: styles.sizeXl,\n l: styles.sizeL,\n xs: styles.sizeXs,\n xxs: styles.sizeXxs,\n xxxs: styles.sizeXxxs,\n s: styles.sizeS,\n m: styles.sizeM,\n\n larger: '',\n inherit: '',\n smaller: '',\n custom: styles.sizeCustom\n }\n}\n\nexport function sizeDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n const { size, density } = props\n if (!size && !density) return instance.inject([])\n\n if (instance.context) {\n const out: Record<string, any> = {}\n const ctxSize = instance.context.size\n\n if (ctxSize) {\n if (size === 'inherit') out['size'] = ctxSize.value\n if (size === 'smaller' || size === 'larger') {\n out['size'] = (size === 'smaller' ? arrayPickPrev : arrayPickNext)(SizeValuesAbsolute, ctxSize.value)\n }\n }\n const ctxDensity = instance.context.density\n if (ctxDensity && density === 'inherit') {\n out['density'] = ctxDensity.value\n }\n\n if (!('density' in out) && props.density) out['density'] = props.density\n if (!('size' in out) && props.size) out['size'] = props.size\n\n return instance.inject(sizeClasses(out, instance.$styles))\n }\n\n return instance.inject(sizeClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { Size, SizeDensity } from './size.types'\n\nexport const SizeRefKey = Symbol('SizeRefKey') as InjectionKey<Ref<Size>>\nexport const SizeDensityRefKey = Symbol('DensityRefKey') as InjectionKey<Ref<SizeDensity>>\nexport const SizeContractKey = Symbol('SizeContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { sizeDeal } from './size.contract'\nimport { SizeContractKey, SizeRefKey } from './size.keys'\nimport type { DensityProps, SizeProps } from './size.types'\n\nexport { default as $style } from './size.module.css'\nexport type * from './size.types'\nexport * from './size.keys'\nexport { default as sizeGenerator } from './size.generator'\n\nexport const SizePropsKeys: ReadonlyArray<keyof (SizeProps & DensityProps)> = ['size', 'density']\n\nexport const size: ThemeContract = {\n ref: SizeRefKey,\n name: 'size',\n props: SizePropsKeys,\n deal: sizeDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n key: SizeContractKey\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey } from 'vue'\n\nexport const StyleContractKey = Symbol('StyleContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { StyleContractKey } from './style.key'\n\nexport type * from './style.types'\nexport const style: ThemeContract = {\n key: StyleContractKey,\n name: 'style',\n flag: ThemeContractFlags.generator\n}\n","// The typography contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `typography` prop onto classes/styles at\n// runtime, resolving `inherit` against the provided context ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { Ref } from 'vue'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { ContractProvider, ThemeContractDeal } from '../../types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport type { TypographyProps } from './typography.types'\nimport $typography from './typography.module.css'\n\n// the prop -> class wiring: the prop value IS the logical class name from the\n// registry (e.g. `typography=\"fw700\"`), resolved to its hashed form from the\n// module map (merged with the component's own $style)\nfunction typographyClasses(\n props: TypographyProps,\n styles?: CSSModuleClassList\n): ClassList {\n const $ = mergeCssModulesStyles($typography, styles)\n const out: ClassList = []\n if (props.typography && $[props.typography]) out.push($[props.typography])\n return out\n}\n\nexport function typographyDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (!props.typography) return instance.inject([])\n\n if (props.typography === 'inherit') {\n const ctx = instance.context as Record<\n string,\n Ref<any> | undefined\n > | null\n if (ctx?.typography) {\n return instance.inject(\n typographyClasses({ typography: ctx.typography.value }, instance.$styles)\n )\n }\n }\n\n return instance.inject(\n typographyClasses(props as TypographyProps, instance.$styles)\n )\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { InjectionKey, Ref } from 'vue'\n\nimport type { ThemeContract } from '../../types'\nimport type { TypographyProp } from './typography.types'\n\n/** context key the deal resolves `inherit` against (see useThemeContract) */\nexport const TypographyRefKey = Symbol('TypographyRefKey') as InjectionKey<\n Ref<TypographyProp | undefined>\n>\nexport const TypographyContractKey = Symbol(\n 'TypographyContractKey'\n) as InjectionKey<ThemeContract>\n","// The typography contract's registry entry, generated from\n// packages/templates/contract. Wiring left (see the generator output):\n// 1. add `typography` to src/contracts/index.ts (next to round/size/...)\n// 2. add typographyGenerator to src/generator.ts (contractGenerators)\nimport { ThemeContractFlags } from '../../constants'\nimport type { ThemeContract } from '../../types'\nimport { typographyDeal } from './typography.contract'\nimport { TypographyContractKey, TypographyRefKey } from './typography.keys'\nimport type { TypographyProps } from './typography.types'\n\nexport { default as $style } from './typography.module.css'\nexport type * from './typography.types'\nexport * from './typography.keys'\n\nexport const TypographyPropsKeys: ReadonlyArray<keyof TypographyProps> = [\n 'typography'\n]\n\nexport const typography: ThemeContract = {\n key: TypographyContractKey,\n name: 'typography',\n ref: TypographyRefKey,\n deal: typographyDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: TypographyPropsKeys\n}\n","import type { ThemeContract, ThemeContractName } from '@ui0/types'\n\nimport { backdrop, BackdropPropsKeys } from './backdrop'\nimport { color, ColorPropsKeys } from './color'\nimport { disabled, DisabledPropsKeys } from './disabled'\nimport { display } from './display'\nimport { elevation, ElevationPropsKeys } from './elevation'\nimport { round, RoundPropsKeys } from './round'\nimport { size, SizePropsKeys } from './size'\nimport { style } from './style'\nimport { typography } from './typography'\nexport type * from './backdrop'\nexport type * from './color'\nexport type * from './disabled'\nexport type * from './elevation'\nexport type * from './round'\nexport type * from './size'\n\nexport const contracts: Record<ThemeContractName, ThemeContract> = {\n color,\n backdrop,\n round,\n elevation,\n style,\n disabled,\n display,\n typography,\n size\n}\nexport const props = [\n ColorPropsKeys,\n RoundPropsKeys,\n SizePropsKeys,\n ElevationPropsKeys,\n BackdropPropsKeys,\n DisabledPropsKeys\n].flat()\n","import type { Ui0ThemeContractSettings, EventHandler } from '@ui0/types'\nimport {\n getClientHeight,\n getClientWidth,\n isBrowser,\n objectMerge,\n parseUnits,\n RecordContainer,\n type RecordContainerImpl\n} from '@ui0/util'\nimport { ref, type Ref, type WatchHandle } from 'vue'\n\nimport cfg from '../../config.default'\nimport type {\n DisplayBreakpoint,\n DisplayBreakpoints,\n DisplayImpl,\n DisplayMeasure,\n DisplayOperation,\n DisplayWatcher\n} from './display.types'\n\nexport class Display implements DisplayImpl {\n breakpoints: DisplayBreakpoints\n _watchers: DisplayWatcher[]\n _watcher: WatchHandle | null\n _activated: boolean\n _listeners: RecordContainerImpl<any>\n _width: Ref<number> | null\n _height: Ref<number> | null\n _resizeHandler: EventHandler\n\n constructor(config: Ui0ThemeContractSettings['display']) {\n this.breakpoints = objectMerge(cfg.contracts.display?.breakpoints, config?.breakpoints ?? {})\n\n this._watchers = []\n this._watcher = null\n this._width = null\n this._height = null\n this._activated = false\n this._resizeHandler = () => this.update()\n this._listeners = new RecordContainer()\n }\n\n public update() {\n if (this._width && this._height) {\n this._width.value = getClientWidth()\n this._height.value = getClientHeight()\n }\n let wasChanged = false\n\n this._watchers.forEach((watcher) => {\n const measure = watcher.measure === 'width' ? this._width : this._height\n const oldValue = watcher.value.value\n\n if (watcher.operation === 'between') {\n const breakpoint1 = this.getBreakpointValue(String(watcher.points[0]))\n const breakpoint2 = this.getBreakpointValue(String(watcher.points[1]))\n\n if (measure && breakpoint1 && breakpoint2) {\n const b1 = parseUnits(String(breakpoint1)).value\n const b2 = parseUnits(String(breakpoint2)).value\n // console.log('we', b1, b2)\n if (b1 > b2) watcher.value.value = measure.value > b2 && measure.value < b1\n if (b1 < b2) watcher.value.value = measure.value > b1 && measure.value < b2\n\n if (watcher.value.value !== oldValue) {\n wasChanged = true\n }\n }\n }\n if (watcher.operation === 'less' || watcher.operation === 'greater') {\n const breakpoint1 = this.getBreakpointValue(String(watcher.points[0]))\n if (breakpoint1 && measure) {\n const b1 = parseUnits(String(breakpoint1)).value\n watcher.value.value = watcher.operation === 'less' ? measure.value < b1 : measure.value > b1\n\n if (watcher.value.value !== oldValue) {\n wasChanged = true\n }\n }\n }\n })\n\n if (wasChanged) {\n this._listeners.items.forEach((item) => item())\n }\n }\n\n public addUpdateListener(fn: AnyFn): number {\n return this._listeners.add(fn)\n }\n\n public removeUpdateListener(index: number) {\n this._listeners.remove(index)\n }\n\n public less(point: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('less', [point], measure)\n this.activate()\n return out\n }\n\n public between(point1: DisplayBreakpoint, point2: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('between', [point1, point2], measure)\n this.activate()\n this.update()\n return out\n }\n\n public greater(point: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('greater', [point], measure)\n this.activate()\n return out\n }\n\n public activate() {\n // if (this._activated) return\n\n if (!this._width) this._width = ref(0)\n if (!this._height) this._height = ref(0)\n\n if (isBrowser && !this._activated) window.addEventListener('resize', this._resizeHandler, { passive: true })\n\n this.update()\n this._activated = true\n }\n\n public deactivate() {\n this._activated = false\n if (isBrowser) window.removeEventListener('resize', this._resizeHandler)\n }\n\n private getBreakpointValue(name: string): number {\n // console.log('breaks', Object.keys(_breakpoints).length)\n return +this.breakpoints[name]\n }\n\n private addWatcher(\n operation: DisplayOperation,\n points: DisplayBreakpoint[],\n measure: DisplayMeasure = 'width'\n ): Ref<boolean> {\n let outRef: Ref<boolean> | undefined = undefined\n\n this._watchers.forEach((watcher) => {\n const isMultiValued = watcher.points.length > 1\n if (watcher.operation === operation) {\n if (isMultiValued) {\n if (watcher.points[0] === points[0] && watcher.points[1] === points[1]) {\n console.log('setting existing ', watcher.value)\n outRef = watcher.value\n }\n } else {\n if (watcher.points[0] === points[0]) {\n outRef = watcher.value\n }\n }\n }\n })\n if (!outRef) {\n outRef = ref(false)\n this._watchers.push({\n measure,\n points,\n operation,\n value: outRef\n })\n }\n\n return outRef\n }\n}\n","// localStorage persistence for the theme instance's selection (preset +\n// appearance). SSR-safe: a no-op wherever localStorage is unavailable or\n// throws (private mode, blocked storage).\n\n/** the storage slot holding the selection */\nconst STORAGE_KEY = 'ui0:theme'\n\n/** the persisted shape; both fields optional so a partial write still reads */\nexport interface StoredThemeSelection {\n preset?: string\n appearance?: string\n}\n\n/**\n * Reads the stored selection.\n * @returns the parsed selection, or undefined when absent or unreadable\n */\nexport function readStoredSelection(): StoredThemeSelection | undefined {\n if (typeof localStorage === 'undefined') return undefined\n try {\n const raw = localStorage.getItem(STORAGE_KEY)\n if (!raw) return undefined\n const parsed = JSON.parse(raw)\n if (typeof parsed !== 'object' || parsed === null) return undefined\n return parsed as StoredThemeSelection\n } catch {\n return undefined\n }\n}\n\n/**\n * Writes the selection, swallowing storage errors.\n * @param preset - the active preset name\n * @param appearance - the active appearance\n */\nexport function writeStoredSelection(preset: string, appearance: string): void {\n if (typeof localStorage === 'undefined') return\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify({ preset, appearance }))\n } catch {\n // storage full or blocked - the selection just won't persist\n }\n}\n","import type {\n ThemeAppearance,\n ThemePluginConfig,\n ThemeInstance,\n ThemeInstanceOptions,\n ThemePreset,\n ThemePresetName,\n ThemePresets,\n Ui0ThemePresetAppearanceConfig,\n ThemeContracts,\n Ui0ThemeContracts\n} from '@ui0/types'\nimport { isArray } from '@ui0/util'\n// The live theme instance - the runtime counterpart of the theme config\n// (ThemeConfig). Holds the registered presets plus the current\n// name/appearance, and answers the questions the UI asks at runtime:\n// which presets exist, what colors a scheme resolves to, ...\n// Plain data + vue refs only (reactive by itself - reading `.name` /\n// `.appearance` inside an effect tracks them).\nimport { ref, watch, type Ref } from 'vue'\n\nimport { THEME_SCHEMES } from './constants'\nimport { withDefaults } from './generator/generate'\nimport { buildPool, resolvePool } from './generator/pool'\nimport { deepMerge, resolvePreset } from './generator/theme-def'\nimport { readStoredSelection, writeStoredSelection } from './persist'\nimport { schemesOf } from './types'\n\nexport function createThemeInstance(config: ThemePluginConfig, options: ThemeInstanceOptions = {}): ThemeInstance {\n // merge the built-in default preset UNDER the consumer's (same rule the\n // generator uses) so the runtime instance sees exactly what the generated\n // css carries - e.g. colorList() includes the system colors a consumer\n // preset never redeclared\n const resolved = withDefaults(config)\n const contracts: ThemeContracts = {}\n\n const props: Array<keyof Ui0ThemeContracts> = []\n //collect list symbols and supply symbols as keys\n // for (const i in builtinContracts.contracts) {\n // const ix: ThemeContractName = i\n // const k = builtinContracts.contracts[ix].key\n // contracts[k] = builtinContracts.contracts[ix]\n // if (contracts[k].props) props.push(...contracts[k].props)\n // }\n const presets: ThemePresets = { ...resolved.presets }\n\n const cache: ThemePresets = {}\n\n const names = () => Object.keys(presets)\n\n // a previous session's selection wins over the config defaults (explicit\n // options win over both); entries the config can't honor are dropped\n const stored = readStoredSelection()\n const storedPreset = stored?.preset && stored.preset in presets ? (stored.preset as ThemePresetName) : undefined\n const storedAppearance =\n stored?.appearance && THEME_SCHEMES.includes(stored.appearance) ? (stored.appearance as ThemeAppearance) : undefined\n\n const name: Ref<ThemePresetName> = ref(\n options.theme && options.theme in presets\n ? options.theme\n : (storedPreset ?? (resolved.default in presets ? resolved.default : (names()[0] ?? '')))\n )\n\n const appearance: Ref<ThemeAppearance> = ref(options.appearance ?? storedAppearance ?? 'light')\n\n // keep the user's selection across reloads (no-op where storage is\n // unavailable); sync so a change is durable even if the page unloads right\n // after the mutation\n watch([name, appearance], ([preset, appr]) => writeStoredSelection(preset, appr), {\n flush: 'sync'\n })\n\n /** the resolved appearance config (base merged under the scheme) */\n const configFor = (n: ThemePresetName, appr: ThemeAppearance): Ui0ThemePresetAppearanceConfig => {\n const preset = resolvePreset(presets, n, cache)\n const scheme = appr === 'default' ? schemesOf(preset).default : schemesOf(preset)[appr]\n return scheme\n ? (deepMerge(\n schemesOf(preset).default as Record<string, unknown>,\n scheme as Record<string, unknown>\n ) as Ui0ThemePresetAppearanceConfig)\n : schemesOf(preset).default\n }\n\n // presets whose `extends` chain reaches `base` (transitively)\n function descendants(base: ThemePresetName): ThemePresetName[] {\n const out = new Set<ThemePresetName>()\n let frontier: ThemePresetName[] = [base]\n while (frontier.length) {\n const next: ThemePresetName[] = []\n for (const b of frontier) {\n for (const n of names()) {\n if (!out.has(n) && n !== base && presets[n]?.extends === b) {\n out.add(n)\n next.push(n)\n }\n }\n }\n frontier = next\n }\n return [...out]\n }\n\n return {\n contracts,\n get preset() {\n return name.value\n },\n presets() {\n return presets\n },\n set preset(v: ThemePresetName) {\n if (v in presets) name.value = v\n },\n get appearance() {\n return appearance.value\n },\n set appearance(v: ThemeAppearance) {\n appearance.value = v\n },\n toggle: () => {\n appearance.value = appearance.value === 'dark' ? 'light' : 'dark'\n },\n presetList: () => names(),\n // registered presets extending the current one (transitively via their\n // `extends` field); pass `exact` to ask about another base preset\n extends: (exact?: string) => descendants(exact ?? name.value),\n\n addPreset(n: ThemePresetName, preset: ThemePreset) {\n presets[n] = preset\n delete cache[n]\n },\n addContract(contract) {\n contracts[contract.key] = contract\n\n if (contract.props && isArray(contract.props)) props.push(...contract.props)\n },\n removeContract(key) {\n delete contracts[key]\n },\n contractList: () => Object.getOwnPropertySymbols(contracts),\n contractProps: () => props,\n // component-level knobs that are not part of the generated token set\n\n colorList(theme?: ThemePresetName, appr?: ThemeAppearance): string[] {\n const cfg = configFor(theme ?? name.value, appr ?? appearance.value)\n const { base } = resolvePool(buildPool(cfg.color, undefined))\n return Object.keys(base)\n }\n }\n}\n","import type { ContractProvider } from '@ui0/types'\nimport type { ThemeInstance } from '@ui0/types'\nimport type { InjectionKey } from 'vue'\n\nexport const Ui0ThemeKey: InjectionKey<ThemeInstance> = Symbol('ui0-theme')\nexport const Ui0ThemeContractProvider: InjectionKey<ContractProvider> = Symbol('ui0-theme-contract')\n","// The theme as a core plugin: app-agnostic install into the core's public\n// instance - exposes the live theme at instance.theme (typed via the\n// augmentation in ./types) AND provides it on the Vue app, so a host can use\n// the theme with or without the theme-provider component.\nimport type { Ui0CoreInstallablePlugin, Ui0CorePublicInstance } from '@ui0/types'\nimport type { ThemePluginConfig, ThemeInstance, ThemeContractName } from '@ui0/types'\n\nimport { contracts } from './contracts'\nimport { Display } from './contracts/display/display.instance'\nimport { DisplayContractKey, DisplayKey } from './contracts/display/display.keys'\nimport { ensureThemeBaseStyle } from './generator/base'\nimport { createThemeInstance } from './instance'\nimport { Ui0ThemeKey } from './keys'\n\nexport function createUi0Theme(config: ThemePluginConfig): Ui0CoreInstallablePlugin {\n return {\n install(instance: Ui0CorePublicInstance) {\n const theme: ThemeInstance = createThemeInstance(config)\n\n Object.keys(contracts).forEach((c) => {\n theme.addContract(contracts[c as ThemeContractName])\n })\n const display = new Display(config.contracts.display)\n\n // the body reset ships with the install - no separate css import needed\n if (typeof document !== 'undefined') ensureThemeBaseStyle(document)\n if (instance.vue) {\n instance.vue.provide(Ui0ThemeKey, theme)\n instance.vue.provide(DisplayKey, display)\n }\n return theme\n }\n }\n}\n","import type { Ui0CorePublicInstance } from '@ui0/types'\nimport type { ThemeInstance } from '@ui0/types'\nimport { getCurrentInstance, hasInjectionContext, inject } from 'vue'\n\nimport { Ui0ThemeKey } from './keys'\n\nexport function useTheme(): ThemeInstance | undefined {\n if (hasInjectionContext()) {\n const provided = inject(Ui0ThemeKey, undefined)\n if (provided) {\n return provided\n }\n }\n\n const vm = getCurrentInstance()\n if (!vm) return undefined\n return (vm.appContext.config.globalProperties.$ui0 as Ui0CorePublicInstance | undefined)?.theme\n}\n","import type { UpdateFn } from '@ui0/types'\nimport { newFrameworkError } from '@ui0/util'\nimport { hasInjectionContext, inject, onMounted, onUnmounted } from 'vue'\n\nimport { DisplayKey, type DisplayReturn } from './contracts/display'\n\nexport function useDisplay(onUpdate?: UpdateFn): DisplayReturn {\n if (hasInjectionContext()) {\n const display = inject(DisplayKey)\n if (display) {\n console.log('if display', display)\n\n if (onUpdate)\n onMounted(() => {\n const id = display.addUpdateListener(onUpdate)\n onUnmounted(() => {\n display.removeUpdateListener(id)\n })\n })\n return display\n }\n }\n throw newFrameworkError('display context not exists')\n}\n","import type { AnyProps, ClassList, CSSModuleClassList, Indexed, StyleList } from '@ui0/types'\nimport type { ContractProvider, ContractRefs, ThemeContract, ThemeContractName, Ui0ThemeContracts } from '@ui0/types'\nimport { isArray, isString } from '@ui0/util'\nfunction createProviderInstance(name: string, props?: Ui0ThemeContracts, styles?: CSSModuleClassList) {\n const provider = {}\n}\nexport class ThemeContractInstance implements ContractProvider {\n props: AnyProps\n /**\n * context have any provided props from styler's\n */\n context: ContractRefs | null\n $styles: CSSModuleClassList\n name: string\n classList: ClassList = []\n styleList: StyleList = {}\n contracts: Partial<Record<ThemeContractName, ThemeContract>>\n\n constructor(name: string, props?: Ui0ThemeContracts, styles?: CSSModuleClassList) {\n this.$styles = styles ?? {}\n this.props = props ?? {}\n this.name = name\n this.context = null\n this.contracts = {}\n }\n\n public add(contract: ThemeContract) {\n this.contracts[contract.name] = contract\n }\n public prop(name: keyof Ui0ThemeContracts | Array<keyof Ui0ThemeContracts>) {\n const jobs: Indexed<ThemeContract> = {}\n const instance = this\n\n for (const contract of Object.values(this.contracts)) {\n if (isArray(name)) {\n name.forEach((n) => {\n if (contract.props?.includes(n)) {\n jobs[contract.name] = contract.deal\n }\n })\n } else if (isString(name)) {\n if (contract.props?.includes(name)) {\n jobs[contract.name] = contract\n }\n }\n contract?.props?.includes(name)\n }\n return {\n styles() {\n let out: StyleList = {}\n for (const contract of Object.values(jobs)) {\n const deal = contract?.deal?.(instance)\n if (deal) out = { ...out, ...deal.styles() }\n // if (deal && CONTRACT_PROPS[contract].some((p) => props[p])) {\n // out = { ...out, ...deal.styles(props) }\n // }\n }\n return out\n },\n classes() {\n const out: ClassList = []\n for (const contract of Object.values(jobs)) {\n const deal = contract?.deal?.(instance)\n if (deal) out.push(...deal.classes())\n }\n return out\n }\n }\n }\n\n public remove(name: ThemeContractName) {\n delete this.contracts[name]\n }\n\n public setContext(p: ContractRefs) {\n this.context = p\n }\n\n public classes(props_?: AnyProps, $styles = this.$styles) {\n const props = props_ ?? this.props\n const out: ClassList = []\n for (const contract of Object.values(this.contracts)) {\n const deal = contract?.deal?.(this)\n if (deal) out.push(...deal.classes(props as Ui0ThemeContracts, $styles))\n }\n return out\n }\n\n public styles(props_?: AnyProps) {\n const props = props_ ?? this.props\n let out: StyleList = {}\n for (const contract of Object.keys(this.contracts) as ThemeContractName[]) {\n const deal = this.contracts[contract]?.deal?.(this)\n if (deal) out = { ...out, ...deal.styles(props) }\n // if (deal && CONTRACT_PROPS[contract].some((p) => props[p])) {\n // out = { ...out, ...deal.styles(props) }\n // }\n }\n return out\n }\n\n /**\n * Virtual's classes and styles injector\n * @param data\n * @private\n */\n public inject(data?: any) {\n if (isArray(data)) {\n // dirty hack to compute it faster\n // in reality we need to check-mark every item of array1 in array2\n if (data.indexOf(this.classList[0]) === -1) return [...this.classList, ...data]\n else return data\n } else return { ...this.styleList, ...data }\n }\n}\n","import type {\n ContractRefs,\n CSSModuleClassList,\n ThemeContractKey,\n ThemeContractName,\n ThemeInstance,\n Ui0CorePublicInstance,\n Ui0ThemeContracts\n} from '@ui0/types'\nimport { isArray, isString, newFrameworkError } from '@ui0/util'\nimport {\n getCurrentInstance,\n hasInjectionContext,\n isReactive,\n provide,\n inject,\n reactive,\n toRefs,\n type InjectionKey,\n type Ref,\n useCssModule\n} from 'vue'\n\nimport { ThemeContractInstance } from './contracts/contract'\nimport { useTheme } from './useTheme'\n\nexport function useThemeContext(\n props: Ui0ThemeContracts,\n $styles?: CSSModuleClassList,\n _allowContracts?: Array<keyof Ui0ThemeContracts>\n): [ThemeInstance | undefined, ThemeContractInstance | undefined] {\n const vm = getCurrentInstance()\n\n if (hasInjectionContext()) {\n const $style = $styles ?? useCssModule()\n const theme = useTheme()\n\n if (theme) {\n const refs = isReactive(props) ? toRefs(props) : toRefs(reactive(props))\n\n function providePropRef(name: ThemeContractName, key: InjectionKey<Ref | undefined>) {\n const injected = inject(key, null)\n const keys = ['smaller', 'larger', 'inherit']\n\n if (refs) {\n const ref = refs[name as keyof Ui0ThemeContracts]\n if (ref) {\n if (ref.value !== undefined) {\n const v = ref.value\n\n if (isArray(v) && v.length) {\n if (v[0] && isString(v[0]) && !keys.includes(v[0])) {\n provide(key, ref)\n return ref\n } else {\n if (injected) {\n provide(key, injected)\n return injected\n }\n }\n } else if ((v && isString(v) && !keys.includes(v)) || typeof v === 'number') {\n provide(key, ref)\n return ref\n } else {\n if (injected) {\n provide(key, injected)\n return injected\n }\n }\n }\n }\n }\n }\n\n const provider = new ThemeContractInstance('test', props, $style)\n\n const ctx: ContractRefs = {}\n\n for (const c of theme.contractList()) {\n const currentContract = theme.contracts[c as ThemeContractKey]\n const r = currentContract.ref\n if (r) {\n ctx[currentContract.name as keyof Ui0ThemeContracts] = providePropRef(currentContract.name, r)\n }\n provider.add(currentContract)\n }\n provider.setContext(ctx)\n\n return [theme, provider]\n }\n }\n if (!vm) throw newFrameworkError('ThemeWithContext')\n\n if (!vm) return [undefined, undefined]\n return [(vm.appContext.config.globalProperties.$ui0 as Ui0CorePublicInstance | undefined)?.theme, undefined]\n}\n"],"mappings":";;;;;;;AACA,MAAa,gBAAgB;CAAC;CAAQ;CAAS;AAAS;AAGxD,MAAa,YACT,OAAO,OAAO,CAAC,CAAC;;ACOpB,SAAS,gBAAgB,GAAkB,GAAmC;CAC5E,MAAM,IAAI,sBAAsBA,6BAAW,CAAC;CAG5C,IAAI,EAAE,UAAU,OAAO,CAAC,EAAE,WAAW;CACrC,OAAO,CAAC;AACV;AAEA,SAAgB,aAAa,UAA+C;CAC1E,MAAM,QAAQ,SAAS;CAEvB,OAAO;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IAAS;IAE5C,IAAI,MAAM;KACR,MAAM,MAAM,KAAK;KACjB,IAAI,KACE;UAAA,IAAI,UAAU,KAAA,GAAW;OAC3B,MAAM,IAAI,IAAI;OAEd,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ;QAC1B,IAAI,EAAE,MAAM,SAAS,EAAE,EAAE,KAAK,CAAC,KAAK,SAAS,EAAE,EAAE,GAAG;SAClD,QAAQ,KAAK,GAAG;SAChB,OAAO;QACT,OACE,IAAI,UAAU;SACZ,QAAQ,KAAK,QAAQ;SACrB,OAAO;QACT;OAEJ,OAAO,IAAK,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,KAAM,OAAO,MAAM,UAAU;QAC3E,QAAQ,KAAK,GAAG;QAChB,OAAO;OACT,OACE,IAAI,UAAU;QACZ,QAAQ,KAAK,QAAQ;QACrB,OAAO;OACT;MAEJ;;IAEJ;GACF;GAEA,MAAM,WAAW,IAAI,sBAAsB,QAAQ,OAAO,MAAM;GAEhE,MAAM,MAAoB,CAAC;GAE3B,KAAK,MAAM,KAAK,MAAM,aAAa,GAAG;IACpC,MAAM,kBAAkB,MAAM,UAAU;IACxC,MAAM,IAAI,gBAAgB;IAC1B,IAAI,GACF,IAAI,gBAAgB,QAAmC,eAAe,gBAAgB,MAAM,CAAC;IAE/F,SAAS,IAAI,eAAe;GAC9B;GACA,SAAS,WAAW,GAAG;GAEvB,OAAO,CAAC,OAAO,QAAQ;EACzB;CACF;CACA,IAAI,CAAC,IAAI,MAAM,kBAAkB,kBAAkB;CAEnD,IAAI,CAAC,IAAI,OAAO,CAAC,KAAA,GAAW,KAAA,CAAS;CACrC,OAAO,CAAE,GAAG,WAAW,OAAO,iBAAiB,MAA4C,OAAO,KAAA,CAAS;AAC7G"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["$backdrop","$color","$disabled","$elevation","$round","$size","$typography","config","cfg"],"sources":["../src/constants.ts","../src/contracts/backdrop/backdrop.contract.ts","../src/contracts/backdrop/backdrop.keys.ts","../src/contracts/backdrop/index.ts","../src/contracts/color/color.gradient.ts","../src/contracts/color/color.serialize.ts","../src/contracts/color/color.contract.ts","../src/contracts/color/color.keys.ts","../src/contracts/color/index.ts","../src/contracts/disabled/disabled.contract.ts","../src/contracts/disabled/disabled.keys.ts","../src/contracts/disabled/index.ts","../src/contracts/display/display.contract.ts","../src/contracts/display/display.keys.ts","../src/contracts/display/index.ts","../src/contracts/duration/duration.keys.ts","../src/contracts/duration/index.ts","../src/contracts/elevation/elevation.contract.ts","../src/contracts/elevation/elevation.keys.ts","../src/contracts/elevation/index.ts","../src/contracts/round/round.contract.ts","../src/contracts/round/round.keys.ts","../src/contracts/round/index.ts","../src/contracts/size/size.types.ts","../src/contracts/size/size.contract.ts","../src/contracts/size/size.keys.ts","../src/contracts/size/index.ts","../src/contracts/style/style.key.ts","../src/contracts/style/index.ts","../src/contracts/typography/typography.contract.ts","../src/contracts/typography/typography.keys.ts","../src/contracts/typography/index.ts","../src/contracts/index.ts","../src/contracts/display/display.instance.ts","../src/persist.ts","../src/instance.ts","../src/keys.ts","../src/plugin.ts","../src/useTheme.ts","../src/useDisplay.ts","../src/contracts/contract.ts","../src/useThemeContext.ts"],"sourcesContent":["export const CONTRACT_GENERATOR = 0\nexport const THEME_SCHEMES = ['dark', 'light', 'default']\n// from @vue/shared\n\nexport const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__\n ? Object.freeze({})\n : {}\nexport enum ThemeContractFlags {\n /**\n * can generate css\n * @type {ContractFlags.generator}\n */\n\n generator = 1 << 0,\n /**\n * can resolve classes\n * @type {ContractFlags.dealer}\n */\n dealer = 1 << 1\n}\n","import { AT_SIGN } from '@ui0/shared'\n// The backdrop contract's processing endpoint: the backdrop prop selects a\n// backdrop-filter function; the deal resolves the prop value to the hashed\n// setter class from the module map (merged with the component's own $style).\nimport type { ClassList, CSSModuleClassList, StyleList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { isArray, isString, mergeCssModulesStyles } from '@ui0/util'\n\nimport type { BackdropProps } from './backdrop.types'\n\nimport $backdrop from './backdrop.module.css'\n\nfunction backdropClasses(p: BackdropProps, s?: CSSModuleClassList): ClassList {\n const $ = mergeCssModulesStyles($backdrop, s)\n // console.log('$', $)\n\n if (p.backdrop) return [$['backdrop']]\n return []\n}\n\nexport function backdropDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => instance.inject(backdropClasses(props, instance.$styles)),\n styles() {\n const out: StyleList = {}\n const val = props.backdrop\n if (val) {\n if (isArray(val)) {\n } else if (isString(val)) {\n const split = val.split(AT_SIGN)\n if (split[1]) {\n out['--0-backdrop-' + split[0]] = split[1]\n out['--0-backdrop'] = `${split[0]}(var(--0-backdrop-${split[0]}))`\n } else {\n out['--0-backdrop'] = `${props.backdrop}(var(--0-backdrop-${props.backdrop}))`\n }\n }\n }\n return instance.inject(out)\n }\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { BackdropProps } from './backdrop.types'\n\nexport const BackdropRefKey = Symbol('BackdropRefKey') as InjectionKey<Ref<BackdropProps['backdrop']>>\nexport const BackdropContractKey = Symbol('BackdropContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { backdropDeal } from './backdrop.contract'\nimport { BackdropContractKey, BackdropRefKey } from './backdrop.keys'\nimport type { BackdropProps } from './backdrop.types'\n\nexport { default as $backdrop } from './backdrop.module.css'\nexport type * from './backdrop.types'\nexport * from './backdrop.keys'\n\nexport const BackdropPropsKeys: ReadonlyArray<keyof BackdropProps> = ['backdrop']\n\nexport const backdrop: ThemeContract = {\n name: 'backdrop',\n key: BackdropContractKey,\n ref: BackdropRefKey,\n deal: backdropDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: BackdropPropsKeys\n}\n","// the `gradient` prop -> the `--0-g-cur` value (a linear-gradient()\n// composed of live var() references to pool channels). Delivered as an\n// element inline style, NOT a class: a gradient is a composition of values,\n// and class-per-combination would explode combinatorially. The references\n// stay live - a scheme block revalues the underlying --0-c-* channels and\n// the gradient re-paints without any gradient-specific rule.\n//\n// gradient=\"error->success\"\n// gradient=\"to-br error->success@80->highlight\"\nimport { isString } from '@ui0/util'\n\nimport { parseRef } from './color.token'\n\nconst DIRECTIONS: Record<string, string> = {\n right: 'to right',\n left: 'to left',\n top: 'to top',\n bottom: 'to bottom',\n tr: 'to top right',\n tl: 'to top left',\n br: 'to bottom right',\n bl: 'to bottom left'\n}\n\n/** compile a gradient prop value into a `linear-gradient(...)` string */\nexport function gradientStyle(value: string | undefined | null): string | undefined {\n if (!isString(value) || !value.trim()) return undefined\n const parts = value.trim().split(/\\s+/)\n\n let direction = DIRECTIONS.bottom\n if (parts[0]?.startsWith('to-')) {\n const css = DIRECTIONS[parts[0].slice(3)]\n if (!css)\n throw new Error(\n `ui0 gradient: unknown direction \"${parts[0]}\" (expected to-right|to-left|to-top|to-bottom|to-tr|to-tl|to-br|to-bl)`\n )\n direction = css\n parts.shift()\n }\n\n // rejoin so spaced arrows (`error -> success`) compile too\n const stops = parts\n .join('')\n .split('->')\n .map((s) => parseRef(s))\n .filter((s) => s.ref)\n\n if (stops.length < 2) throw new Error(`ui0 gradient: \"${value}\" needs at least two stops (ref[->ref...])`)\n\n const paint = stops.map((s) => `rgb(var(--0-c-${s.ref}-v) / ${s.opacity ?? 1})`).join(', ')\n return `linear-gradient(${direction}, ${paint})`\n}\n","// tokens -> paint. A token's color selection always compiles to a hashed\n// swatch setter class (`[scheme-][pseudo-]{c|f}-<ref>`) - selections are\n// conditional by nature. Opacity VALUES always ride element inline styles as\n// context source vars (`--0-{slot}-src[-{l|d}][-{pseudo}]`); the conditional\n// pick happens in the component's color.use() scss bridges, so the generated\n// theme css carries no opacity rules at all.\nimport type { ClassList, CSSModuleClassList, StyleList } from '@ui0/types'\n\nimport { hashClassName } from '../../generator/hash'\nimport type { ColorToken } from './color.types'\n\nexport function resolveClass(full: string, $?: CSSModuleClassList): string {\n return ($ && $[full]) || hashClassName(full)\n}\n\nexport function serializeTokens(\n tokens: ColorToken[],\n slot: 'c' | 'f',\n $?: CSSModuleClassList\n): { classes: ClassList; styles: StyleList } {\n const classes: ClassList = []\n const styles: StyleList = {}\n const ns = slot === 'c' ? '--0-c' : '--0-f'\n\n for (const t of tokens) {\n const pre = `${t.scheme ? t.scheme + '-' : ''}${t.pseudo ? t.pseudo + '-' : ''}${slot}`\n classes.push(resolveClass(`${pre}-${t.ref}`, $))\n\n if (t.opacity !== undefined && t.opacity < 1) {\n const ctx = `${t.scheme === 'light' ? '-l' : t.scheme === 'dark' ? '-d' : ''}${t.pseudo ? `-${t.pseudo}` : ''}`\n styles[`${ns}-src${ctx}`] = `${t.opacity}`\n }\n }\n return { classes, styles }\n}\n","// The color contract's processing endpoint (v2): resolves the color/fill\n// props onto hashed setter classes (via the token parser + serializer) and\n// the gradient prop onto the `--0-g-cur` inline style. One parse pass per\n// prop change, shared by classes() and styles().\nimport type { ClassList, StyleList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { isString, mergeCssModulesStyles } from '@ui0/util'\n\nimport { gradientStyle } from './color.gradient'\nimport { serializeTokens } from './color.serialize'\nimport { parseColorProp } from './color.token'\nimport type { ColorProps, FillProps, GradientProps } from './color.types'\n\nimport $color from './color.module.css'\n\ntype Painted = ColorProps & FillProps & GradientProps\n\nexport function colorDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n // one parse pass per prop change, shared by classes() and styles() -\n // either may be called first; the key also carries the inherited context\n // values so an `inherit` prop follows a context change\n let cache: { key: string; value: { classes: ClassList; styles: StyleList } } | undefined\n\n const norm = (v: unknown) => (isString(v) ? v : Array.isArray(v) ? v.join(' ') : '')\n\n const ensure = () => {\n const key = [\n norm(props.color),\n norm(props.fill),\n norm(props.gradient),\n norm(instance.context?.color?.value),\n norm(instance.context?.fill?.value)\n ].join('|')\n if (cache && cache.key === key) return cache.value\n const value = paint(resolveProps())\n cache = { key, value }\n return value\n }\n\n // the `inherit` passthrough: an `inherit` prop re-reads the provided\n // context ref (a parent's prop), everything else resolves its own value\n const resolveProps = (): Painted => {\n const out: Record<string, any> = {}\n const color = props.color\n const fill = props.fill\n\n if (isString(color) && color.split(' ')[0] === 'inherit') {\n const v = instance.context?.color?.value\n if (v) out['color'] = v\n } else if (color) {\n out['color'] = color\n }\n if (isString(fill) && fill.split(' ')[0] === 'inherit') {\n const v = instance.context?.fill?.value\n if (v) out['fill'] = v\n } else if (fill) {\n out['fill'] = fill\n }\n if (props.gradient) out['gradient'] = props.gradient\n return out as Painted\n }\n\n const paint = (p: Painted): { classes: ClassList; styles: StyleList } => {\n const classes: ClassList = []\n const styles: StyleList = {}\n const $ = mergeCssModulesStyles($color, instance.$styles)\n\n if (p.color) {\n const out = serializeTokens(parseColorProp(p.color), 'c', $)\n classes.push(...out.classes)\n Object.assign(styles, out.styles)\n classes.push($.colored)\n }\n if (p.fill) {\n const out = serializeTokens(parseColorProp(p.fill), 'f', $)\n classes.push(...out.classes)\n Object.assign(styles, out.styles)\n classes.push($.filled)\n }\n if (p.gradient) {\n const g = gradientStyle(p.gradient)\n if (g) {\n styles['--0-g-cur'] = g\n classes.push($.gradiented)\n }\n }\n return { classes, styles }\n }\n\n return {\n classes: () =>\n props.color || props.fill || props.gradient ? instance.inject(ensure().classes) : instance.inject([]),\n styles: () => instance.inject(ensure().styles)\n }\n}\n","import type { ComponentColor } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const ColorContractKey = Symbol('ColorContractKey') as InjectionKey<ThemeContractDeal>\nexport const ColorRefKey = Symbol('ColorRefKey') as InjectionKey<Ref<ComponentColor>>\nexport const FillRefKey = Symbol('FillRefKey') as InjectionKey<Ref<ComponentColor>>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { colorDeal } from './color.contract'\nimport { ColorContractKey, ColorRefKey } from './color.keys'\nimport type { ColorProps, GradientProps, FillProps } from './color.types'\n\nexport { default as $color } from './color.module.css'\nexport type * from './color.types'\nexport * from './color.keys'\n\nexport const ColorPropsKeys: ReadonlyArray<keyof (GradientProps & ColorProps & FillProps)> = [\n 'color',\n 'fill',\n 'gradient'\n]\n\nexport const color: ThemeContract = {\n name: 'color',\n key: ColorContractKey,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n ref: ColorRefKey,\n deal: colorDeal,\n props: ColorPropsKeys\n}\n","// The disabled contract's processing endpoint: the `disabled` prop maps to\n// the hashed `.disabled` setter class; `inherit` reads the provided ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { DisabledProps } from './disabled.types'\n\nimport $disabled from './disabled.module.css'\n\nfunction disabledClasses(p: DisabledProps, s?: CSSModuleClassList): ClassList {\n const $ = mergeCssModulesStyles($disabled, s)\n if (p.disabled) return [$.disabled]\n return []\n}\n\nexport function disabledDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (instance.context) {\n if (props.disabled === 'inherit' && instance.context.disabled) {\n return instance.inject(disabledClasses({ disabled: instance.context.disabled.value }, instance.$styles))\n }\n }\n return instance.inject(disabledClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const DisabledRefKey = Symbol('DisabledRefKey') as InjectionKey<Ref<boolean>>\n\nexport const DisabledContractKey = Symbol('DisabledContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { disabledDeal } from './disabled.contract'\nimport { DisabledContractKey, DisabledRefKey } from './disabled.keys'\nimport type { DisabledProps } from './disabled.types'\n\nexport { default as $disabled } from './disabled.module.css'\nexport type * from './disabled.types'\nexport * from './disabled.keys'\n\nexport const DisabledPropsKeys: ReadonlyArray<keyof DisabledProps> = ['disabled']\n\nexport const disabled: ThemeContract = {\n key: DisabledContractKey,\n name: 'disabled',\n ref: DisabledRefKey,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n deal: disabledDeal,\n props: DisabledPropsKeys\n}\n","// The display contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `display` prop onto classes/styles at\n// runtime, resolving `inherit` against the provided context ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\nimport type { Ref } from 'vue'\n\nimport { EMPTY_OBJ } from '../../constants'\n\nimport $display from './display.module.css'\n\nexport function displayDeal(instance: ContractProvider): ThemeContractDeal {\n return {\n classes: () => {\n return []\n // if (!props.display) return instance.inject([])\n //\n // if (props.display === 'inherit') {\n // const ctx = instance.context as Record<string, Ref<any> | undefined> | null\n // if (ctx?.display) {\n // return instance.inject(displayClasses({ display: ctx.display.value }, instance.$styles))\n // }\n // }\n //\n // return instance.inject(displayClasses(props as DisplayProps, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContract } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { DisplayImpl, DisplayProp, DisplayReturn } from './display.types'\n\n/** context key the deal resolves `inherit` against (see useThemeContract) */\nexport const DisplayRefKey = Symbol('DisplayRefKey') as InjectionKey<Ref<DisplayProp | undefined>>\nexport const DisplayContractKey = Symbol('DisplayContractKey') as InjectionKey<ThemeContract>\nexport const DisplayKey = Symbol('DisplayContractKey') as InjectionKey<DisplayImpl>\n","import type { ThemeContract } from '@ui0/types'\n\n// The display contract's registry entry, generated from\n// packages/templates/contract. Wiring left (see the generator output):\n// 1. add `display` to src/contracts/index.ts (next to round/size/...)\n// 2. add displayGenerator to src/generator.ts (contractGenerators)\nimport { ThemeContractFlags } from '../../constants'\nimport { displayDeal } from './display.contract'\nimport { DisplayContractKey, DisplayRefKey } from './display.keys'\nimport type { DisplayProps } from './display.types'\n\nexport { default as $duration } from './display.module.css'\nexport type * from './display.types'\nexport * from './display.keys'\n\nexport const DisplayPropsKeys: ReadonlyArray<keyof DisplayProps> = [\n // 'display'\n]\n\nexport const display: ThemeContract = {\n key: DisplayContractKey,\n name: 'display',\n ref: DisplayRefKey,\n deal: displayDeal,\n flag: ThemeContractFlags.generator,\n props: DisplayPropsKeys\n}\n","import type { ThemeContract } from '@ui0/types'\nimport type { InjectionKey } from 'vue'\n\nexport const DurationContractKey = Symbol('DurationContractKey') as InjectionKey<ThemeContract>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { DurationContractKey } from './duration.keys'\n\nexport type * from './duration.types'\nexport * from './duration.keys'\n\nexport const duration: ThemeContract = {\n key: DurationContractKey,\n name: 'duration',\n flag: ThemeContractFlags.generator\n}\n","// The elevation contract's processing endpoint: the `elevation` prop picks a\n// step of the shadow scale; the deal resolves it to the hashed step class\n// (`elv1..steps`, `n` suffix for inset), `inherit` reading the provided ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { ElevationProps } from './elevation.types'\n\nimport $elevation from './elevation.module.css'\n\nfunction elevationClasses(p: ElevationProps, s?: CSSModuleClassList): ClassList {\n const { elevation } = p\n if (elevation === undefined) return []\n const $ = mergeCssModulesStyles($elevation, s)\n\n const value = Number(elevation)\n\n return Number.isNaN(value) ? [] : [$['elv' + Math.abs(value) + (value < 0 ? 'n' : '')], $.elv]\n}\n\nexport function elevationDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (instance.context) {\n if (props.elevation === 'inherit' && instance.context.elevation) {\n return instance.inject(elevationClasses({ elevation: instance.context.elevation.value }, instance.$styles))\n }\n }\n return instance.inject(elevationClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ComponentElevation } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const ElevationRefKey = Symbol('ElevationRefKey') as InjectionKey<Ref<ComponentElevation>>\nexport const ElevationContractKey = Symbol('ElevationContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { elevationDeal } from './elevation.contract'\nimport { ElevationContractKey, ElevationRefKey } from './elevation.keys'\nimport type { ElevationProps } from './elevation.types'\n\nexport { default as $elevation } from './elevation.module.css'\nexport type * from './elevation.types'\nexport * from './elevation.keys'\nexport const ElevationPropsKeys: ReadonlyArray<keyof ElevationProps> = ['elevation']\n\nexport const elevation: ThemeContract = {\n key: ElevationContractKey,\n name: 'elevation',\n ref: ElevationRefKey,\n deal: elevationDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: ElevationPropsKeys\n}\n","// The round contract's processing endpoint. The runtime wiring is minimal\n// for now: radius values are computed in the component namespace\n// (round.scss) and no round settings land on the theme block yet - the deal\n// returns no classes until a rounding setting arrives in the config.\nimport type { CSSModuleClassList, Indexed } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { mergeCssModulesStyles, propsToCssModuleClassNext } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { RoundProps } from './round.types'\n\nimport $round from './round.module.css'\nexport type PropClassImpl<T = Record<string, unknown>> = keyof T | [keyof T, Indexed]\n\nexport function roundDeal(instance: ContractProvider): ThemeContractDeal {\n return {\n classes() {\n const { props, $styles } = instance\n const $ = mergeCssModulesStyles($round, $styles)\n // console.log('props', instance.props)\n\n // console.log(\n // 'propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)',\n // propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)\n // )\n\n return propsToCssModuleClassNext(props, [getRoundPropClasses($), getRoundTargetPropClasses($)], $)\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n\nfunction getRoundTargetPropClasses(style: CSSModuleClassList = $round): PropClassImpl<RoundProps> {\n return [\n 'roundTarget',\n {\n 'top-left-none': style.tln,\n 'bottom-left-none': style.bln,\n 'top-right-none': style.trn,\n 'bottom-right-none': style.brn,\n\n 'top-none': style.tn,\n 'bottom-none': style.bn,\n 'right-none': style.rn,\n 'left-none': style.ln,\n\n 'bottom-left': style.bl,\n 'bottom-right': style.br,\n 'top-right': style.tr,\n 'top-left': style.tl\n }\n ]\n}\nfunction getRoundPropClasses(style: CSSModuleClassList = $round): PropClassImpl<RoundProps> {\n return [\n 'round',\n {\n true: style.rFull,\n none: style.rNone,\n full: style.rFull,\n\n basic: style.rBasic,\n smooth: style.rSmooth,\n hard: style.rHard,\n\n round: style.round,\n\n left: [style.tl, style.bl],\n\n right: [style.tr, style.br],\n bottom: [style.br, style.bl],\n top: [style.tl, style.tr]\n }\n ]\n}\n","import type { ComponentRound, ComponentRoundTarget } from '@ui0/types'\nimport type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const RoundRefKey = Symbol('RoundRefKey') as InjectionKey<Ref<ComponentRound>>\nexport const RoundTargetRefKey = Symbol('RoundTargetRefKey') as InjectionKey<Ref<ComponentRoundTarget>>\nexport const RoundContractKey = Symbol('RoundContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { roundDeal } from './round.contract'\nimport { RoundContractKey, RoundRefKey } from './round.keys'\nimport type { RoundProps } from './round.types'\n\nexport { default as $round } from './round.module.css'\nexport type * from './round.types'\nexport * from './round.keys'\n\nexport const RoundPropsKeys: ReadonlyArray<keyof RoundProps> = ['round', 'round-target']\n\nexport const round: ThemeContract = {\n key: RoundContractKey,\n name: 'round',\n ref: RoundRefKey,\n deal: roundDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: RoundPropsKeys\n}\n","import type { MaybeUnits, InheritValue, LiteralUnion } from '@ui0/types'\n\n/* -------------------------------------------------------------------------- */\n/* Size */\n/* -------------------------------------------------------------------------- */\n\nexport type SizeXXXS = 'xxx-small' | 'xxxs'\nexport type SizeXXS = 'xx-small' | 'xxs'\nexport type SizeXS = 'x-small' | 'xs'\nexport type SizeS = 'small' | 's'\nexport type SizeM = 'medium' | 'm'\nexport type SizeL = 'large' | 'l'\nexport type SizeXL = 'x-large' | 'xl'\nexport type SizeXXL = 'xx-large' | 'xxl'\nexport type SizeXXXL = 'xxx-large' | 'xxxl'\n\nexport type Size =\n | SizeXXXS\n | SizeXXS\n | SizeXS\n | SizeS\n | SizeM\n | SizeL\n | SizeXL\n | SizeXXL\n | SizeXXXL\n | 'custom'\n | 'smaller'\n | 'larger'\n | InheritValue\n\nexport type SizeDensity = LiteralUnion<'normal' | 'compact' | 'child'>\n\nexport interface SizeProps {\n size?: Size\n}\n\nexport interface DensityProps {\n density?: SizeDensity\n}\n\n/** the size contract's settings inside a theme preset (appearance config) */\nexport interface SizeThemeAppearanceConfig {\n /** the control's base height -> expands into the --0-s-* scale */\n control?: MaybeUnits\n /** a control's child (icon etc.) base height -> the --0-sc-* scale */\n child?: MaybeUnits\n}\n\n/** the absolute scale steps a `size` prop can pick (long and short spellings) */\nexport const SizeValuesAbsolute: Size[] = ['xxxs', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl']\n\n// registration: the contract announces itself to the package registries\n// (interface merging - no central import of the contracts anywhere)\ndeclare module '@ui0/types/theme' {\n interface Ui0ThemePresetAppearanceConfig {\n size?: SizeThemeAppearanceConfig\n }\n interface Ui0ThemeContractSettings {\n size?: boolean\n }\n interface Ui0ThemeContracts extends SizeProps, DensityProps {}\n}\n","// The size contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `size`/`density` props onto classes,\n// resolving `inherit`/`smaller`/`larger` against the provided context refs.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { ContractProvider, ThemeContractDeal } from '@ui0/types'\nimport { arrayPickNext, arrayPickPrev, isArray, mergeCssModulesStyles, toCamelCase } from '@ui0/util'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { DensityProps, Size, SizeProps } from './size.types'\nimport { SizeValuesAbsolute } from './size.types'\n\nimport $size from './size.module.css'\n\ntype Sizers = SizeProps & DensityProps\n\nfunction sizeClasses(props: Sizers, styles?: CSSModuleClassList): ClassList {\n const out: ClassList = []\n const { size, density } = props\n const normalizedSizing = (isArray(density) ? density : [toCamelCase(density)]) as string[]\n\n const $ = mergeCssModulesStyles($size, styles)\n if (size) {\n out.push($.sized)\n const cls = getSizePropClasses($)[size]\n if (cls) out.push(cls)\n }\n\n if (normalizedSizing) {\n normalizedSizing.forEach((d) => {\n if ($ && $[d]) out.push($[d])\n })\n }\n return out\n}\n\nfunction getSizePropClasses(styles: CSSModuleClassList): Record<Size | 'inherit', string> {\n return {\n 'xxx-large': styles.sizeXxxl,\n 'xx-large': styles.sizeXxl,\n 'x-large': styles.sizeXl,\n large: styles.sizeL,\n 'x-small': styles.sizeXs,\n 'xx-small': styles.sizeXxs,\n 'xxx-small': styles.sizeXxxs,\n small: styles.sizeS,\n medium: styles.sizeM,\n\n xxxl: styles.sizeXxxl,\n xxl: styles.sizeXxl,\n xl: styles.sizeXl,\n l: styles.sizeL,\n xs: styles.sizeXs,\n xxs: styles.sizeXxs,\n xxxs: styles.sizeXxxs,\n s: styles.sizeS,\n m: styles.sizeM,\n\n larger: '',\n inherit: '',\n smaller: '',\n custom: styles.sizeCustom\n }\n}\n\nexport function sizeDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n const { size, density } = props\n if (!size && !density) return instance.inject([])\n\n if (instance.context) {\n const out: Record<string, any> = {}\n const ctxSize = instance.context.size\n\n if (ctxSize) {\n if (size === 'inherit') out['size'] = ctxSize.value\n if (size === 'smaller' || size === 'larger') {\n out['size'] = (size === 'smaller' ? arrayPickPrev : arrayPickNext)(SizeValuesAbsolute, ctxSize.value)\n }\n }\n const ctxDensity = instance.context.density\n if (ctxDensity && density === 'inherit') {\n out['density'] = ctxDensity.value\n }\n\n if (!('density' in out) && props.density) out['density'] = props.density\n if (!('size' in out) && props.size) out['size'] = props.size\n\n return instance.inject(sizeClasses(out, instance.$styles))\n }\n\n return instance.inject(sizeClasses(props, instance.$styles))\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { Size, SizeDensity } from './size.types'\n\nexport const SizeRefKey = Symbol('SizeRefKey') as InjectionKey<Ref<Size>>\nexport const SizeDensityRefKey = Symbol('DensityRefKey') as InjectionKey<Ref<SizeDensity>>\nexport const SizeContractKey = Symbol('SizeContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { sizeDeal } from './size.contract'\nimport { SizeContractKey, SizeRefKey } from './size.keys'\nimport type { DensityProps, SizeProps } from './size.types'\n\nexport { default as $size } from './size.module.css'\nexport type * from './size.types'\nexport * from './size.keys'\nexport { default as sizeGenerator } from './size.generator'\n\nexport const SizePropsKeys: ReadonlyArray<keyof (SizeProps & DensityProps)> = ['size', 'density']\n\nexport const size: ThemeContract = {\n ref: SizeRefKey,\n name: 'size',\n props: SizePropsKeys,\n deal: sizeDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n key: SizeContractKey\n}\n","import type { ThemeContractDeal } from '@ui0/types'\nimport type { InjectionKey } from 'vue'\n\nexport const StyleContractKey = Symbol('StyleContractKey') as InjectionKey<ThemeContractDeal>\n","import type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { StyleContractKey } from './style.key'\n\nexport type * from './style.types'\nexport const style: ThemeContract = {\n key: StyleContractKey,\n name: 'style',\n flag: ThemeContractFlags.generator\n}\n","// The typography contract's processing endpoint: closes over the provider and\n// returns the deal that maps the `typography` prop onto classes/styles at\n// runtime, resolving `inherit` against the provided context ref.\nimport type { ClassList, CSSModuleClassList } from '@ui0/types'\nimport type { Ref } from 'vue'\n\nimport { EMPTY_OBJ } from '../../constants'\nimport type { ContractProvider, ThemeContractDeal } from '../../types'\nimport { mergeCssModulesStyles } from '@ui0/util'\n\nimport type { TypographyProps } from './typography.types'\nimport $typography from './typography.module.css'\n\n// the prop -> class wiring: the prop value IS the logical class name from the\n// registry (e.g. `typography=\"fw700\"`), resolved to its hashed form from the\n// module map (merged with the component's own $style)\nfunction typographyClasses(\n props: TypographyProps,\n styles?: CSSModuleClassList\n): ClassList {\n const $ = mergeCssModulesStyles($typography, styles)\n const out: ClassList = []\n if (props.typography && $[props.typography]) out.push($[props.typography])\n return out\n}\n\nexport function typographyDeal(instance: ContractProvider): ThemeContractDeal {\n const props = instance.props\n\n return {\n classes: () => {\n if (!props.typography) return instance.inject([])\n\n if (props.typography === 'inherit') {\n const ctx = instance.context as Record<\n string,\n Ref<any> | undefined\n > | null\n if (ctx?.typography) {\n return instance.inject(\n typographyClasses({ typography: ctx.typography.value }, instance.$styles)\n )\n }\n }\n\n return instance.inject(\n typographyClasses(props as TypographyProps, instance.$styles)\n )\n },\n styles: () => instance.inject(EMPTY_OBJ)\n }\n}\n","import type { InjectionKey, Ref } from 'vue'\n\nimport type { ThemeContract } from '../../types'\nimport type { TypographyProp } from './typography.types'\n\n/** context key the deal resolves `inherit` against (see useThemeContract) */\nexport const TypographyRefKey = Symbol('TypographyRefKey') as InjectionKey<\n Ref<TypographyProp | undefined>\n>\nexport const TypographyContractKey = Symbol(\n 'TypographyContractKey'\n) as InjectionKey<ThemeContract>\n","// The typography contract's registry entry, generated from\n// packages/templates/contract. Wiring left (see the generator output):\n// 1. add `typography` to src/contracts/index.ts (next to round/size/...)\n// 2. add typographyGenerator to src/generator.ts (contractGenerators)\nimport type { ThemeContract } from '@ui0/types'\n\nimport { ThemeContractFlags } from '../../constants'\nimport { typographyDeal } from './typography.contract'\nimport { TypographyContractKey, TypographyRefKey } from './typography.keys'\nimport type { TypographyProps } from './typography.types'\n\nexport { default as $typography } from './typography.module.css'\nexport type * from './typography.types'\nexport * from './typography.keys'\n\nexport const TypographyPropsKeys: ReadonlyArray<keyof TypographyProps> = ['typography']\n\nexport const typography: ThemeContract = {\n key: TypographyContractKey,\n name: 'typography',\n ref: TypographyRefKey,\n deal: typographyDeal,\n flag: ThemeContractFlags.dealer + ThemeContractFlags.generator,\n props: TypographyPropsKeys\n}\n","import type { ThemeContract, ThemeContractName } from '@ui0/types'\n\nimport { backdrop, BackdropPropsKeys } from './backdrop'\nimport { color, ColorPropsKeys } from './color'\nimport { disabled, DisabledPropsKeys } from './disabled'\nimport { display } from './display'\nimport { duration } from './duration'\nimport { elevation, ElevationPropsKeys } from './elevation'\nimport { round, RoundPropsKeys } from './round'\nimport { size, SizePropsKeys } from './size'\nimport { style } from './style'\nimport { typography } from './typography'\nexport type * from './backdrop'\nexport type * from './color'\nexport type * from './disabled'\nexport type * from './elevation'\nexport type * from './round'\nexport type * from './size'\n\nexport const contracts: Record<ThemeContractName, ThemeContract> = {\n color,\n backdrop,\n round,\n elevation,\n duration,\n style,\n disabled,\n display,\n typography,\n size\n}\nexport const props: Array<string> = [\n ColorPropsKeys,\n RoundPropsKeys,\n SizePropsKeys,\n ElevationPropsKeys,\n BackdropPropsKeys,\n DisabledPropsKeys\n].flat()\n","import type { Ui0ThemeContractSettings, EventHandler } from '@ui0/types'\nimport {\n getClientHeight,\n getClientWidth,\n isBrowser,\n objectMerge,\n parseUnits,\n RecordContainer,\n type RecordContainerImpl\n} from '@ui0/util'\nimport { ref, type Ref, type WatchHandle } from 'vue'\n\nimport cfg from '../../config.default'\nimport type {\n DisplayBreakpoint,\n DisplayBreakpoints,\n DisplayImpl,\n DisplayMeasure,\n DisplayOperation,\n DisplayWatcher\n} from './display.types'\n\nexport class Display implements DisplayImpl {\n breakpoints: DisplayBreakpoints\n _watchers: DisplayWatcher[]\n _watcher: WatchHandle | null\n _activated: boolean\n _listeners: RecordContainerImpl<any>\n _width: Ref<number> | null\n _height: Ref<number> | null\n _resizeHandler: EventHandler\n\n constructor(config: Ui0ThemeContractSettings['display']) {\n this.breakpoints = objectMerge(cfg.contracts.display?.breakpoints, config?.breakpoints ?? {})\n\n this._watchers = []\n this._watcher = null\n this._width = null\n this._height = null\n this._activated = false\n this._resizeHandler = () => this.update()\n this._listeners = new RecordContainer()\n }\n\n public update() {\n if (this._width && this._height) {\n this._width.value = getClientWidth()\n this._height.value = getClientHeight()\n }\n let wasChanged = false\n\n this._watchers.forEach((watcher) => {\n const measure = watcher.measure === 'width' ? this._width : this._height\n const oldValue = watcher.value.value\n\n if (watcher.operation === 'between') {\n const breakpoint1 = this.getBreakpointValue(String(watcher.points[0]))\n const breakpoint2 = this.getBreakpointValue(String(watcher.points[1]))\n\n if (measure && breakpoint1 && breakpoint2) {\n const b1 = parseUnits(String(breakpoint1)).value\n const b2 = parseUnits(String(breakpoint2)).value\n // console.log('we', b1, b2)\n if (b1 > b2) watcher.value.value = measure.value > b2 && measure.value < b1\n if (b1 < b2) watcher.value.value = measure.value > b1 && measure.value < b2\n\n if (watcher.value.value !== oldValue) {\n wasChanged = true\n }\n }\n }\n if (watcher.operation === 'less' || watcher.operation === 'greater') {\n const breakpoint1 = this.getBreakpointValue(String(watcher.points[0]))\n if (breakpoint1 && measure) {\n const b1 = parseUnits(String(breakpoint1)).value\n watcher.value.value = watcher.operation === 'less' ? measure.value < b1 : measure.value > b1\n\n if (watcher.value.value !== oldValue) {\n wasChanged = true\n }\n }\n }\n })\n\n if (wasChanged) {\n this._listeners.items.forEach((item) => item())\n }\n }\n\n public addUpdateListener(fn: AnyFn): number {\n return this._listeners.add(fn)\n }\n\n public removeUpdateListener(index: number) {\n this._listeners.remove(index)\n }\n\n public less(point: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('less', [point], measure)\n this.activate()\n return out\n }\n\n public between(point1: DisplayBreakpoint, point2: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('between', [point1, point2], measure)\n this.activate()\n this.update()\n return out\n }\n\n public greater(point: DisplayBreakpoint, measure: DisplayMeasure = 'width') {\n const out = this.addWatcher('greater', [point], measure)\n this.activate()\n return out\n }\n\n public activate() {\n // if (this._activated) return\n\n if (!this._width) this._width = ref(0)\n if (!this._height) this._height = ref(0)\n\n if (isBrowser && !this._activated) window.addEventListener('resize', this._resizeHandler, { passive: true })\n\n this.update()\n this._activated = true\n }\n\n public deactivate() {\n this._activated = false\n if (isBrowser) window.removeEventListener('resize', this._resizeHandler)\n }\n\n private getBreakpointValue(name: string): number {\n // console.log('breaks', Object.keys(_breakpoints).length)\n return +this.breakpoints[name]\n }\n\n private addWatcher(\n operation: DisplayOperation,\n points: DisplayBreakpoint[],\n measure: DisplayMeasure = 'width'\n ): Ref<boolean> {\n let outRef: Ref<boolean> | undefined = undefined\n\n this._watchers.forEach((watcher) => {\n const isMultiValued = watcher.points.length > 1\n if (watcher.operation === operation) {\n if (isMultiValued) {\n if (watcher.points[0] === points[0] && watcher.points[1] === points[1]) {\n console.log('setting existing ', watcher.value)\n outRef = watcher.value\n }\n } else {\n if (watcher.points[0] === points[0]) {\n outRef = watcher.value\n }\n }\n }\n })\n if (!outRef) {\n outRef = ref(false)\n this._watchers.push({\n measure,\n points,\n operation,\n value: outRef\n })\n }\n\n return outRef\n }\n}\n","// localStorage persistence for the theme instance's selection (preset +\n// appearance). SSR-safe: a no-op wherever localStorage is unavailable or\n// throws (private mode, blocked storage).\n\n/** the storage slot holding the selection */\nconst STORAGE_KEY = 'ui0:theme'\n\n/** the persisted shape; both fields optional so a partial write still reads */\nexport interface StoredThemeSelection {\n preset?: string\n appearance?: string\n}\n\n/**\n * Reads the stored selection.\n * @returns the parsed selection, or undefined when absent or unreadable\n */\nexport function readStoredSelection(): StoredThemeSelection | undefined {\n if (typeof localStorage === 'undefined') return undefined\n try {\n const raw = localStorage.getItem(STORAGE_KEY)\n if (!raw) return undefined\n const parsed = JSON.parse(raw)\n if (typeof parsed !== 'object' || parsed === null) return undefined\n return parsed as StoredThemeSelection\n } catch {\n return undefined\n }\n}\n\n/**\n * Writes the selection, swallowing storage errors.\n * @param preset - the active preset name\n * @param appearance - the active appearance\n */\nexport function writeStoredSelection(preset: string, appearance: string): void {\n if (typeof localStorage === 'undefined') return\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify({ preset, appearance }))\n } catch {\n // storage full or blocked - the selection just won't persist\n }\n}\n","import type {\n ThemeAppearance,\n ThemePluginConfig,\n ThemeInstance,\n ThemeInstanceOptions,\n ThemePreset,\n ThemePresetName,\n ThemePresets,\n Ui0ThemePresetAppearanceConfig,\n ThemeContracts,\n Ui0ThemeContracts\n} from '@ui0/types'\nimport { isArray } from '@ui0/util'\n// The live theme instance - the runtime counterpart of the theme config\n// (ThemeConfig). Holds the registered presets plus the current\n// name/appearance, and answers the questions the UI asks at runtime:\n// which presets exist, what colors a scheme resolves to, ...\n// Plain data + vue refs only (reactive by itself - reading `.name` /\n// `.appearance` inside an effect tracks them).\nimport { ref, watch, type Ref } from 'vue'\n\nimport { THEME_SCHEMES } from './constants'\nimport { withDefaults } from './generator/generate'\nimport { buildPool, resolvePool } from './generator/pool'\nimport { deepMerge, resolvePreset } from './generator/theme-def'\nimport { readStoredSelection, writeStoredSelection } from './persist'\nimport { schemesOf } from './preset'\n\nexport function createThemeInstance(config: ThemePluginConfig, options: ThemeInstanceOptions = {}): ThemeInstance {\n // merge the built-in default preset UNDER the consumer's (same rule the\n // generator uses) so the runtime instance sees exactly what the generated\n // css carries - e.g. colorList() includes the system colors a consumer\n // preset never redeclared\n const resolved = withDefaults(config)\n const contracts: ThemeContracts = {}\n\n const props: Array<keyof Ui0ThemeContracts> = []\n //collect list symbols and supply symbols as keys\n // for (const i in builtinContracts.contracts) {\n // const ix: ThemeContractName = i\n // const k = builtinContracts.contracts[ix].key\n // contracts[k] = builtinContracts.contracts[ix]\n // if (contracts[k].props) props.push(...contracts[k].props)\n // }\n const presets: ThemePresets = { ...resolved.presets }\n\n const cache: ThemePresets = {}\n\n const names = () => Object.keys(presets)\n\n // a previous session's selection wins over the config defaults (explicit\n // options win over both); entries the config can't honor are dropped\n const stored = readStoredSelection()\n const storedPreset = stored?.preset && stored.preset in presets ? (stored.preset as ThemePresetName) : undefined\n const storedAppearance =\n stored?.appearance && THEME_SCHEMES.includes(stored.appearance) ? (stored.appearance as ThemeAppearance) : undefined\n\n const name: Ref<ThemePresetName> = ref(\n options.theme && options.theme in presets\n ? options.theme\n : (storedPreset ?? (resolved.default in presets ? resolved.default : (names()[0] ?? '')))\n )\n\n const appearance: Ref<ThemeAppearance> = ref(options.appearance ?? storedAppearance ?? 'light')\n\n // keep the user's selection across reloads (no-op where storage is\n // unavailable); sync so a change is durable even if the page unloads right\n // after the mutation\n watch([name, appearance], ([preset, appr]) => writeStoredSelection(preset, appr), {\n flush: 'sync'\n })\n\n /** the resolved appearance config (base merged under the scheme) */\n const configFor = (n: ThemePresetName, appr: ThemeAppearance): Ui0ThemePresetAppearanceConfig => {\n const preset = resolvePreset(presets, n, cache)\n const scheme = appr === 'default' ? schemesOf(preset).default : schemesOf(preset)[appr]\n return scheme\n ? (deepMerge(\n schemesOf(preset).default as Record<string, unknown>,\n scheme as Record<string, unknown>\n ) as Ui0ThemePresetAppearanceConfig)\n : schemesOf(preset).default\n }\n\n // presets whose `extends` chain reaches `base` (transitively)\n function descendants(base: ThemePresetName): ThemePresetName[] {\n const out = new Set<ThemePresetName>()\n let frontier: ThemePresetName[] = [base]\n while (frontier.length) {\n const next: ThemePresetName[] = []\n for (const b of frontier) {\n for (const n of names()) {\n if (!out.has(n) && n !== base && presets[n]?.extends === b) {\n out.add(n)\n next.push(n)\n }\n }\n }\n frontier = next\n }\n return [...out]\n }\n\n return {\n contracts,\n get preset() {\n return name.value\n },\n presets() {\n return presets\n },\n set preset(v: ThemePresetName) {\n if (v in presets) name.value = v\n },\n get appearance() {\n return appearance.value\n },\n set appearance(v: ThemeAppearance) {\n appearance.value = v\n },\n toggle: () => {\n appearance.value = appearance.value === 'dark' ? 'light' : 'dark'\n },\n presetList: () => names(),\n // registered presets extending the current one (transitively via their\n // `extends` field); pass `exact` to ask about another base preset\n extends: (exact?: string) => descendants(exact ?? name.value),\n\n addPreset(n: ThemePresetName, preset: ThemePreset) {\n presets[n] = preset\n delete cache[n]\n },\n addContract(contract) {\n contracts[contract.key] = contract\n\n if (contract.props && isArray(contract.props)) props.push(...contract.props)\n },\n removeContract(key) {\n delete contracts[key]\n },\n contractList: () => Object.getOwnPropertySymbols(contracts),\n contractProps: () => props,\n // component-level knobs that are not part of the generated token set\n\n colorList(theme?: ThemePresetName, appr?: ThemeAppearance): string[] {\n const cfg = configFor(theme ?? name.value, appr ?? appearance.value)\n const { base } = resolvePool(buildPool(cfg.color, undefined))\n return Object.keys(base)\n }\n }\n}\n","import type { ContractProvider } from '@ui0/types'\nimport type { ThemeInstance } from '@ui0/types'\nimport type { InjectionKey } from 'vue'\n\nexport const Ui0ThemeKey: InjectionKey<ThemeInstance> = Symbol('ui0-theme')\nexport const Ui0ThemeContractProvider: InjectionKey<ContractProvider> = Symbol('ui0-theme-contract')\n","// The theme as a core plugin: app-agnostic install into the core's public\n// instance - exposes the live theme at instance.theme (typed via the\n// augmentation in ./types) AND provides it on the Vue app, so a host can use\n// the theme with or without the theme-provider component.\nimport type { Ui0CoreInstallablePlugin, Ui0CorePublicInstance } from '@ui0/types'\nimport type { ThemePluginConfig, ThemeInstance, ThemeContractName } from '@ui0/types'\n\nimport { ThemeContractFlags } from './constants'\nimport { contracts } from './contracts'\nimport { Display } from './contracts/display/display.instance'\nimport { DisplayKey } from './contracts/display/display.keys'\nimport { ensureThemeBaseStyle } from './generator/base'\nimport { createThemeInstance } from './instance'\nimport { Ui0ThemeKey } from './keys'\n\nexport function createUi0Theme(config: ThemePluginConfig): Ui0CoreInstallablePlugin {\n return {\n install(instance: Ui0CorePublicInstance) {\n const theme: ThemeInstance = createThemeInstance(config)\n\n if (theme) {\n Object.keys(contracts).forEach((c) => {\n const cur = contracts[c as ThemeContractName]\n if (cur.flag & ThemeContractFlags.dealer) theme.addContract(contracts[c as ThemeContractName])\n })\n const display = new Display(config.contracts.display)\n\n // the body reset ships with the install - no separate css import needed\n if (typeof document !== 'undefined') ensureThemeBaseStyle(document)\n if (instance.vue) {\n if (theme) instance.vue.provide(Ui0ThemeKey, theme)\n if (display) instance.vue.provide(DisplayKey, display)\n }\n // the public surface the type promises (Ui0CorePublicInstance.theme)\n instance.theme = theme\n }\n\n return theme\n }\n }\n}\n","import type { ThemeInstance } from '@ui0/types'\nimport { hasInjectionContext, inject } from 'vue'\n\nimport { Ui0ThemeKey } from './keys'\n\nexport function useTheme(): ThemeInstance | undefined {\n if (hasInjectionContext()) {\n const provided = inject(Ui0ThemeKey, undefined)\n if (provided) {\n return provided\n }\n }\n return undefined\n}\n","import type { UpdateFn } from '@ui0/types'\nimport { newFrameworkError } from '@ui0/util'\nimport { hasInjectionContext, inject, onMounted, onUnmounted } from 'vue'\n\nimport { DisplayKey, type DisplayReturn } from './contracts/display'\n\nexport function useDisplay(onUpdate?: UpdateFn): DisplayReturn {\n if (hasInjectionContext()) {\n const display = inject(DisplayKey)\n if (display) {\n\n\n if (onUpdate)\n onMounted(() => {\n const id = display.addUpdateListener(onUpdate)\n onUnmounted(() => {\n display.removeUpdateListener(id)\n })\n })\n return display\n }\n }\n throw newFrameworkError('display context not exists')\n}\n","import { RegistryFlags } from '@ui0/shared'\nimport type { AnyProps, ClassList, CSSModuleClassList, Indexed, StyleList } from '@ui0/types'\nimport type { ContractProvider, ContractRefs, ThemeContract, ThemeContractName, Ui0ThemeContracts } from '@ui0/types'\nimport { isArray, isString } from '@ui0/util'\nimport { ThemeContractFlags } from '../constants'\nfunction createProviderInstance(name: string, props?: Ui0ThemeContracts, styles?: CSSModuleClassList) {\n const provider = {}\n}\nexport class ThemeContractInstance implements ContractProvider {\n props: AnyProps\n /**\n * context have any provided props from styler's\n */\n context: ContractRefs | null\n $styles: CSSModuleClassList\n name: string\n classList: ClassList = []\n styleList: StyleList = {}\n contracts: Partial<Record<ThemeContractName, ThemeContract>>\n\n constructor(name: string, props?: Ui0ThemeContracts, styles?: CSSModuleClassList) {\n this.$styles = styles ?? {}\n this.props = props ?? {}\n this.name = name\n this.context = null\n this.contracts = {}\n }\n\n public add(contract: ThemeContract) {\n this.contracts[contract.name] = contract\n }\n public prop(name: keyof Ui0ThemeContracts | Array<keyof Ui0ThemeContracts>) {\n const jobs: Indexed<ThemeContract> = {}\n const instance = this\n\n for (const contract of Object.values(this.contracts)) {\n if (isArray(name)) {\n name.forEach((n) => {\n if (contract.props?.includes(n)) {\n if (contract.flag & ThemeContractFlags.dealer) {\n jobs[contract.name] = contract.deal\n }\n }\n })\n } else if (isString(name)) {\n if (contract.props?.includes(name)) {\n jobs[contract.name] = contract\n }\n }\n contract?.props?.includes(name)\n }\n return {\n styles() {\n let out: StyleList = {}\n for (const contract of Object.values(jobs)) {\n const deal = contract?.deal?.(instance)\n if (deal) out = { ...out, ...deal.styles() }\n // if (deal && CONTRACT_PROPS[contract].some((p) => props[p])) {\n // out = { ...out, ...deal.styles(props) }\n // }\n }\n return out\n },\n classes() {\n const out: ClassList = []\n for (const contract of Object.values(jobs)) {\n const deal = contract?.deal?.(instance)\n if (deal) out.push(...deal.classes())\n }\n return out\n }\n }\n }\n\n public remove(name: ThemeContractName) {\n delete this.contracts[name]\n }\n\n public setContext(p: ContractRefs) {\n this.context = p\n }\n\n public classes(props_?: AnyProps, $styles = this.$styles) {\n const props = props_ ?? this.props\n const out: ClassList = []\n for (const contract of Object.values(this.contracts)) {\n const deal = contract?.deal?.(this)\n if (deal) out.push(...deal.classes(props as Ui0ThemeContracts, $styles))\n }\n return out\n }\n\n public styles(props_?: AnyProps) {\n const props = props_ ?? this.props\n let out: StyleList = {}\n for (const contract of Object.keys(this.contracts) as ThemeContractName[]) {\n const deal = this.contracts[contract]?.deal?.(this)\n if (deal) out = { ...out, ...deal.styles(props) }\n // if (deal && CONTRACT_PROPS[contract].some((p) => props[p])) {\n // out = { ...out, ...deal.styles(props) }\n // }\n }\n return out\n }\n\n /**\n * Virtual's classes and styles injector\n * @param data\n * @private\n */\n public inject(data?: any) {\n if (isArray(data)) {\n // dirty hack to compute it faster\n // in reality we need to check-mark every item of array1 in array2\n if (data.indexOf(this.classList[0]) === -1) return [...this.classList, ...data]\n else return data\n } else return { ...this.styleList, ...data }\n }\n}\n","import type {\n ContractRefs,\n CSSModuleClassList,\n ThemeContractKey,\n ThemeContractName,\n ThemeInstance,\n Ui0ThemeContracts\n} from '@ui0/types'\nimport { isArray, isString } from '@ui0/util'\nimport {\n hasInjectionContext,\n isReactive,\n provide,\n inject,\n reactive,\n toRefs,\n type InjectionKey,\n type Ref,\n useCssModule\n} from 'vue'\n\nimport { ThemeContractInstance } from './contracts/contract'\nimport { useTheme } from './useTheme'\n\nexport function useThemeContext(\n props: Ui0ThemeContracts,\n $styles?: CSSModuleClassList,\n _allowContracts?: Array<keyof Ui0ThemeContracts>\n): [ThemeInstance | undefined, ThemeContractInstance | undefined] {\n if (hasInjectionContext()) {\n const $style = $styles ?? useCssModule()\n const theme = useTheme()\n\n if (theme) {\n const refs = isReactive(props) ? toRefs(props) : toRefs(reactive(props))\n\n function providePropRef(name: ThemeContractName, key: InjectionKey<Ref | undefined>) {\n const injected = inject(key, null)\n const keys = ['smaller', 'larger', 'inherit']\n\n if (refs) {\n const ref = refs[name as keyof Ui0ThemeContracts]\n if (ref) {\n if (ref.value !== undefined) {\n const v = ref.value\n\n if (isArray(v) && v.length) {\n if (v[0] && isString(v[0]) && !keys.includes(v[0])) {\n provide(key, ref)\n return ref\n } else {\n if (injected) {\n provide(key, injected)\n return injected\n }\n }\n } else if ((v && isString(v) && !keys.includes(v)) || typeof v === 'number') {\n provide(key, ref)\n return ref\n } else {\n if (injected) {\n provide(key, injected)\n return injected\n }\n }\n }\n }\n }\n }\n\n const provider = new ThemeContractInstance('test', props, $style)\n\n const ctx: ContractRefs = {}\n\n for (const c of theme.contractList()) {\n const currentContract = theme.contracts[c as ThemeContractKey]\n const r = currentContract.ref\n if (r) {\n ctx[currentContract.name as keyof Ui0ThemeContracts] = providePropRef(currentContract.name, r)\n }\n provider.add(currentContract)\n }\n provider.setContext(ctx)\n\n return [theme, provider]\n }\n }\n return [undefined, undefined]\n}\n"],"mappings":";;;;;;;AACA,MAAa,gBAAgB;CAAC;CAAQ;CAAS;AAAS;AAGxD,MAAa,YACT,OAAO,OAAO,CAAC,CAAC;;ACOpB,SAAS,gBAAgB,GAAkB,GAAmC;CAC5E,MAAM,IAAI,sBAAsBA,6BAAW,CAAC;CAG5C,IAAI,EAAE,UAAU,OAAO,CAAC,EAAE,WAAW;CACrC,OAAO,CAAC;AACV;AAEA,SAAgB,aAAa,UAA+C;CAC1E,MAAM,QAAQ,SAAS;CAEvB,OAAO;EACL,eAAe,SAAS,OAAO,gBAAgB,OAAO,SAAS,OAAO,CAAC;EACvE,SAAS;GACP,MAAM,MAAiB,CAAC;GACxB,MAAM,MAAM,MAAM;GAClB,IAAI,KAAK;IACP,IAAI,QAAQ,GAAG,GAAG,CAClB,OAAO,IAAI,SAAS,GAAG,GAAG;KACxB,MAAM,QAAQ,IAAI,MAAM,OAAO;KAC/B,IAAI,MAAM,IAAI;MACZ,IAAI,kBAAkB,MAAM,MAAM,MAAM;MACxC,IAAI,kBAAkB,GAAG,MAAM,GAAG,oBAAoB,MAAM,GAAG;K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QAAmC,eAAe,gBAAgB,MAAM,CAAC;IAE/F,SAAS,IAAI,eAAe;GAC9B;GACA,SAAS,WAAW,GAAG;GAEvB,OAAO,CAAC,OAAO,QAAQ;EACzB;CACF;CACA,OAAO,CAAC,KAAA,GAAW,KAAA,CAAS;AAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui0/theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Generates themeable CSS custom properties from a theme config (library + Vite plugin + CLI)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css-variables",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"./round/classes": "./dist/round.module.css",
|
|
45
45
|
"./size": "./dist/size.scss",
|
|
46
46
|
"./size/classes": "./dist/size.module.css",
|
|
47
|
+
"./duration": "./dist/duration.scss",
|
|
47
48
|
"./styles": "./dist/size.module.css",
|
|
48
49
|
"./elevation": "./dist/elevation.scss",
|
|
49
50
|
"./elevation/classes": "./dist/elevation.module.css",
|
|
@@ -57,7 +58,6 @@
|
|
|
57
58
|
"import": "./dist/config.default.mjs"
|
|
58
59
|
},
|
|
59
60
|
"./is": "./dist/is.scss",
|
|
60
|
-
"./duration": "./dist/duration.scss",
|
|
61
61
|
"./theme": "./dist/theme.scss",
|
|
62
62
|
"./package.json": "./package.json",
|
|
63
63
|
"./theme-provider": {
|
|
@@ -76,22 +76,22 @@
|
|
|
76
76
|
"theme:test": "vitest run"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@ui0/composable": "^0.1.
|
|
80
|
-
"@ui0/types": "^0.1.
|
|
81
|
-
"@ui0/util": "^0.0.
|
|
79
|
+
"@ui0/composable": "^0.1.6",
|
|
80
|
+
"@ui0/types": "^0.1.7",
|
|
81
|
+
"@ui0/util": "^0.0.8",
|
|
82
82
|
"esbuild": "^0.27.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "^22.0.0",
|
|
86
|
-
"@ui0/vite": "^0.1.
|
|
86
|
+
"@ui0/vite": "^0.1.6",
|
|
87
87
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
88
88
|
"sass-embedded": "^1.80.0",
|
|
89
89
|
"vite-plugin-dts": "^5.1.2",
|
|
90
90
|
"vue": "^3.5.45"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@ui0/core": "^0.1.
|
|
94
|
-
"@ui0/shared": "^0.0.
|
|
93
|
+
"@ui0/core": "^0.1.6",
|
|
94
|
+
"@ui0/shared": "^0.0.606",
|
|
95
95
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
96
96
|
"vue": "^3.5.45"
|
|
97
97
|
}
|
|
@@ -39,7 +39,6 @@ const DEFAULTS: Record<BackdropFunction, string> = {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const backdropGenerator: ContractFactory = (ctx): ThemeContractGenerator => {
|
|
42
|
-
const { hash } = ctx
|
|
43
42
|
const config = ctx.config.backdrop
|
|
44
43
|
// which functions ship: the appearance config's keys by default, plus any
|
|
45
44
|
// function the settings turn on; a `false` in the settings always wins.
|
|
@@ -60,7 +59,6 @@ const backdropGenerator: ContractFactory = (ctx): ThemeContractGenerator => {
|
|
|
60
59
|
}
|
|
61
60
|
return { backdrop }
|
|
62
61
|
}
|
|
63
|
-
console.log('hash', $backdrop.backdrop)
|
|
64
62
|
|
|
65
63
|
return {
|
|
66
64
|
namespace: 'bd',
|
|
@@ -5,7 +5,7 @@ import { backdropDeal } from './backdrop.contract'
|
|
|
5
5
|
import { BackdropContractKey, BackdropRefKey } from './backdrop.keys'
|
|
6
6
|
import type { BackdropProps } from './backdrop.types'
|
|
7
7
|
|
|
8
|
-
export { default as $
|
|
8
|
+
export { default as $backdrop } from './backdrop.module.css'
|
|
9
9
|
export type * from './backdrop.types'
|
|
10
10
|
export * from './backdrop.keys'
|
|
11
11
|
|