@yahoo/uds-v5-wip 1.61.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/dist/AssetGroup.d.ts +75 -0
- package/dist/config/dist/AssetGroup.js +114 -0
- package/dist/config/dist/Component.d.ts +309 -0
- package/dist/config/dist/Component.js +897 -0
- package/dist/config/dist/ComponentGroup.d.ts +21 -0
- package/dist/config/dist/ComponentGroup.js +46 -0
- package/dist/config/dist/CompositeStyle.d.ts +28 -0
- package/dist/config/dist/CompositeStyle.js +52 -0
- package/dist/config/dist/Config.d.ts +422 -0
- package/dist/config/dist/Config.js +1426 -0
- package/dist/config/dist/Mode.d.ts +42 -0
- package/dist/config/dist/Mode.js +81 -0
- package/dist/config/dist/Modifier.d.ts +52 -0
- package/dist/config/dist/Modifier.js +97 -0
- package/dist/config/dist/MotionDef.d.ts +50 -0
- package/dist/config/dist/MotionDef.js +97 -0
- package/dist/config/dist/Props.d.ts +235 -126
- package/dist/config/dist/Provider.d.ts +21 -0
- package/dist/config/dist/Provider.js +14 -0
- package/dist/config/dist/StyleProp.d.ts +113 -0
- package/dist/config/dist/StyleProp.js +197 -0
- package/dist/config/dist/Token.d.ts +56 -0
- package/dist/config/dist/Token.js +112 -0
- package/dist/config/dist/TokenGroup.d.ts +33 -0
- package/dist/config/dist/TokenGroup.js +68 -0
- package/dist/config/dist/asset-kind.d.ts +56 -0
- package/dist/config/dist/asset-kind.js +29 -0
- package/dist/config/dist/brands.d.ts +31 -0
- package/dist/config/dist/brands.js +20 -0
- package/dist/config/dist/captureCallerPath.d.ts +49 -0
- package/dist/config/dist/captureCallerPath.js +95 -0
- package/dist/config/dist/colorExpressions.d.ts +132 -0
- package/dist/config/dist/colorExpressions.js +148 -0
- package/dist/config/dist/defineAssetGroup.d.ts +158 -0
- package/dist/config/dist/defineAssetGroup.js +263 -0
- package/dist/config/dist/defineProvider.d.ts +30 -0
- package/dist/config/dist/defineProvider.js +60 -0
- package/dist/config/dist/element-marker.d.ts +55 -0
- package/dist/config/dist/element-marker.js +113 -0
- package/dist/config/dist/entity-utils.d.ts +27 -0
- package/dist/config/dist/entity-utils.js +105 -0
- package/dist/config/dist/factories.d.ts +707 -0
- package/dist/config/dist/factories.js +393 -0
- package/dist/config/dist/foreign-component-name.js +42 -0
- package/dist/config/dist/index.d.ts +30 -21
- package/dist/config/dist/index.js +26 -14
- package/dist/config/dist/interpolate.d.ts +21 -0
- package/dist/config/dist/interpolate.js +10 -0
- package/dist/config/dist/markers.d.ts +218 -0
- package/dist/config/dist/markers.js +67 -0
- package/dist/config/dist/refs.d.ts +143 -69
- package/dist/config/dist/refs.js +95 -113
- package/dist/config/dist/token-override-rows.d.ts +67 -0
- package/dist/config/dist/token-override-rows.js +223 -0
- package/dist/config/dist/tokenValueType.js +138 -0
- package/dist/config/dist/types/css-properties.d.ts +132 -122
- package/dist/config/dist/types/css-property-keywords.d.ts +157 -0
- package/dist/config/dist/types/css-property-keywords.js +616 -0
- package/dist/config/dist/types/css-values.d.ts +18 -16
- package/dist/config/dist/types.d.ts +688 -66
- package/dist/config/dist/units.d.ts +15 -0
- package/dist/config/dist/units.js +16 -0
- package/dist/config.d.ts +31 -22
- package/dist/config.js +28 -16
- package/dist/loader/dist/loader/artifacts.js +26 -9
- package/dist/loader/dist/loader.d.ts +11 -23
- package/dist/loader/dist/loader.js +54 -99
- package/dist/loader/dist/next.js +3 -3
- package/dist/loader/dist/transform-runner.js +1 -8
- package/dist/loader/dist/unplugin.d.ts +2 -2
- package/dist/loader/dist/unplugin.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/dist/index.js +1 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.d.ts +35 -0
- package/dist/utils/dist/motion-utils/resolveMotionState.js +33 -0
- package/dist/utils/dist/string-utils/componentClassName.d.ts +41 -8
- package/dist/utils/dist/string-utils/componentClassName.js +48 -11
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +3 -2
- package/package.json +3 -3
- package/dist/codegen/dist/loader/getLoaderArtifacts.js +0 -2
- package/dist/config/dist/bindRender.d.ts +0 -16
- package/dist/config/dist/bindRender.js +0 -310
- package/dist/config/dist/className.d.ts +0 -54
- package/dist/config/dist/className.js +0 -77
- package/dist/config/dist/component-config.d.ts +0 -862
- package/dist/config/dist/component-config.js +0 -163
- package/dist/config/dist/component-refs.d.ts +0 -121
- package/dist/config/dist/createConfig.d.ts +0 -456
- package/dist/config/dist/createConfig.js +0 -503
- package/dist/config/dist/createStyler.d.ts +0 -35
- package/dist/config/dist/createStyler.js +0 -93
- package/dist/config/dist/defineComponent.d.ts +0 -317
- package/dist/config/dist/defineComponent.js +0 -264
- package/dist/config/dist/defineCompositeStyle.d.ts +0 -93
- package/dist/config/dist/defineCompositeStyle.js +0 -18
- package/dist/config/dist/defineMotionConfig.d.ts +0 -152
- package/dist/config/dist/definePreview.d.ts +0 -45
- package/dist/config/dist/definePreview.js +0 -35
- package/dist/config/dist/defineStyleProp.d.ts +0 -289
- package/dist/config/dist/defineStyleProp.js +0 -61
- package/dist/config/dist/merge-utils.js +0 -51
- package/dist/config/dist/propertyAcceptedTypes.d.ts +0 -19
- package/dist/config/dist/propertyAcceptedTypes.js +0 -220
- package/dist/config/dist/resolveCompoundProps.d.ts +0 -65
- package/dist/config/dist/resolveCompoundProps.js +0 -120
- package/dist/config/dist/resolveStyleProp.d.ts +0 -157
- package/dist/config/dist/resolveStyleProp.js +0 -260
- package/dist/config/dist/runtime-registry.js +0 -37
- package/dist/config/dist/serialize.d.ts +0 -47
- package/dist/config/dist/serialize.js +0 -111
- package/dist/config/dist/sniffTokenType.d.ts +0 -7
- package/dist/config/dist/sniffTokenType.js +0 -67
- package/dist/config/dist/style-prop-runtime.d.ts +0 -75
- package/dist/config/dist/style-prop-runtime.js +0 -390
- package/dist/loader/dist/loader/internal-meta.js +0 -59
- package/dist/loader/dist/loader/lower-new-api-primitive.js +0 -252
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//#region ../config/dist/className.d.ts
|
|
2
|
-
//#region src/className.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* **NEW-API ONLY** — shared utility-class derivation for
|
|
5
|
-
* `defineComponent`-authored components.
|
|
6
|
-
*
|
|
7
|
-
* Single source of truth for `(prop, value, styleProp) → class`.
|
|
8
|
-
* Consumed by:
|
|
9
|
-
*
|
|
10
|
-
* - `bindRender.ts` (runtime) — emits the per-layer className
|
|
11
|
-
* bundle as JSX renders.
|
|
12
|
-
* - `getStylesForConfig.ts` (build-time) — derives the same
|
|
13
|
-
* className list for the CSS scanner's safelist so the purger
|
|
14
|
-
* keeps every class the runtime can produce.
|
|
15
|
-
*
|
|
16
|
-
* Both paths MUST agree on the className shape. Centralising the
|
|
17
|
-
* derivation here is the contract: any change to the convention
|
|
18
|
-
* (e.g. boolean-alias handling) updates one place and both paths
|
|
19
|
-
* stay in lockstep.
|
|
20
|
-
*
|
|
21
|
-
* Does NOT touch the legacy `@uds/core`'s `getStyles` /
|
|
22
|
-
* `propMappings` — that's the legacy `createComponent` factory's
|
|
23
|
-
* world and lives in a different package.
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Build the utility-class name a style prop emits for a given
|
|
27
|
-
* JSX-level value. Mirrors the codegen convention in
|
|
28
|
-
* `prepareCss.ts`'s @utility emission:
|
|
29
|
-
*
|
|
30
|
-
* - `classPrefix === ''` — the value IS the class (e.g.
|
|
31
|
-
* `<Box display="block">` → `.block`).
|
|
32
|
-
* - Boolean `true` — the class IS the bare `classPrefix`
|
|
33
|
-
* (`<Box border>` / `<Box border={true}>` → `.border`, never
|
|
34
|
-
* `.border-true`). Falsy (`undefined` / `null` / `false`) →
|
|
35
|
-
* `undefined`, so the caller omits the class entirely. The "no
|
|
36
|
-
* border" state is the default; adding a class to undo one that
|
|
37
|
-
* was never applied is pointless.
|
|
38
|
-
* - Bracketed arbitrary values (`'[#abc]'`, `'[100px]'`) keep
|
|
39
|
-
* their brackets verbatim: `bg-[#abc]`, `w-[100px]`.
|
|
40
|
-
* - Otherwise: `${classPrefix}-${safeTokenName(value)}`. Authors
|
|
41
|
-
* write the original token name (`'1.5'`); the @utility block
|
|
42
|
-
* is keyed by the class-name-safe form (`'1_5'`), so apply the
|
|
43
|
-
* conversion at emit time. Bracketed arbitrary values are left
|
|
44
|
-
* alone — Tailwind's wildcard utility expansion expects them
|
|
45
|
-
* verbatim.
|
|
46
|
-
*
|
|
47
|
-
* Returns `undefined` when no class should be emitted — callers
|
|
48
|
-
* skip the contribution rather than push a malformed token.
|
|
49
|
-
*/
|
|
50
|
-
declare function buildStylePropClassName(styleProp: {
|
|
51
|
-
classPrefix: string;
|
|
52
|
-
}, value: unknown): string | undefined; //#endregion
|
|
53
|
-
//#endregion
|
|
54
|
-
export { buildStylePropClassName };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
//#region ../config/dist/className.js
|
|
2
|
-
/**
|
|
3
|
-
* **NEW-API ONLY** — shared utility-class derivation for
|
|
4
|
-
* `defineComponent`-authored components.
|
|
5
|
-
*
|
|
6
|
-
* Single source of truth for `(prop, value, styleProp) → class`.
|
|
7
|
-
* Consumed by:
|
|
8
|
-
*
|
|
9
|
-
* - `bindRender.ts` (runtime) — emits the per-layer className
|
|
10
|
-
* bundle as JSX renders.
|
|
11
|
-
* - `getStylesForConfig.ts` (build-time) — derives the same
|
|
12
|
-
* className list for the CSS scanner's safelist so the purger
|
|
13
|
-
* keeps every class the runtime can produce.
|
|
14
|
-
*
|
|
15
|
-
* Both paths MUST agree on the className shape. Centralising the
|
|
16
|
-
* derivation here is the contract: any change to the convention
|
|
17
|
-
* (e.g. boolean-alias handling) updates one place and both paths
|
|
18
|
-
* stay in lockstep.
|
|
19
|
-
*
|
|
20
|
-
* Does NOT touch the legacy `@uds/core`'s `getStyles` /
|
|
21
|
-
* `propMappings` — that's the legacy `createComponent` factory's
|
|
22
|
-
* world and lives in a different package.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Convert a token name to its class-name-safe form. Mirrors
|
|
26
|
-
* `safeTokenName` from `@uds/utils`: `.` → `_`, `/` → `-`. Inlined
|
|
27
|
-
* to keep `@uds/config` free of a cross-package import for a one-line
|
|
28
|
-
* transform.
|
|
29
|
-
*
|
|
30
|
-
* toSafeTokenName('1.5') // → '1_5'
|
|
31
|
-
* toSafeTokenName('always/black') // → 'always-black'
|
|
32
|
-
* toSafeTokenName('brand') // → 'brand'
|
|
33
|
-
*/
|
|
34
|
-
function toSafeTokenName(value) {
|
|
35
|
-
return value.replace(/\./g, "_").replace(/\//g, "-");
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Build the utility-class name a style prop emits for a given
|
|
39
|
-
* JSX-level value. Mirrors the codegen convention in
|
|
40
|
-
* `prepareCss.ts`'s @utility emission:
|
|
41
|
-
*
|
|
42
|
-
* - `classPrefix === ''` — the value IS the class (e.g.
|
|
43
|
-
* `<Box display="block">` → `.block`).
|
|
44
|
-
* - Boolean `true` — the class IS the bare `classPrefix`
|
|
45
|
-
* (`<Box border>` / `<Box border={true}>` → `.border`, never
|
|
46
|
-
* `.border-true`). Falsy (`undefined` / `null` / `false`) →
|
|
47
|
-
* `undefined`, so the caller omits the class entirely. The "no
|
|
48
|
-
* border" state is the default; adding a class to undo one that
|
|
49
|
-
* was never applied is pointless.
|
|
50
|
-
* - Bracketed arbitrary values (`'[#abc]'`, `'[100px]'`) keep
|
|
51
|
-
* their brackets verbatim: `bg-[#abc]`, `w-[100px]`.
|
|
52
|
-
* - Otherwise: `${classPrefix}-${safeTokenName(value)}`. Authors
|
|
53
|
-
* write the original token name (`'1.5'`); the @utility block
|
|
54
|
-
* is keyed by the class-name-safe form (`'1_5'`), so apply the
|
|
55
|
-
* conversion at emit time. Bracketed arbitrary values are left
|
|
56
|
-
* alone — Tailwind's wildcard utility expansion expects them
|
|
57
|
-
* verbatim.
|
|
58
|
-
*
|
|
59
|
-
* Returns `undefined` when no class should be emitted — callers
|
|
60
|
-
* skip the contribution rather than push a malformed token.
|
|
61
|
-
*/
|
|
62
|
-
function buildStylePropClassName(styleProp, value) {
|
|
63
|
-
if (value === void 0 || value === null || value === false) return void 0;
|
|
64
|
-
if (value === true) return styleProp.classPrefix || void 0;
|
|
65
|
-
let stringValue = String(value);
|
|
66
|
-
if (stringValue.startsWith("{") && stringValue.endsWith("}")) {
|
|
67
|
-
const inner = stringValue.slice(1, -1);
|
|
68
|
-
const slash = inner.lastIndexOf("/");
|
|
69
|
-
stringValue = slash >= 0 ? inner.slice(slash + 1) : inner;
|
|
70
|
-
}
|
|
71
|
-
const isNoPrefix = styleProp.classPrefix === "";
|
|
72
|
-
const safeValue = stringValue.startsWith("[") && stringValue.endsWith("]") ? stringValue : toSafeTokenName(stringValue);
|
|
73
|
-
if (isNoPrefix) return safeValue;
|
|
74
|
-
return `${styleProp.classPrefix}-${safeValue}`;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { buildStylePropClassName };
|