@yahoo/uds-v5-wip 1.48.0 → 1.49.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/createConfig.js +19 -1
- package/dist/config/dist/defineStyleProp.d.ts +18 -0
- package/dist/config/dist/defineStyleProp.js +19 -7
- package/dist/config/dist/resolveStyleProp.d.ts +14 -0
- package/dist/config/dist/resolveStyleProp.js +11 -5
- package/dist/core/dist/createComponent.js +1 -1
- package/dist/core/dist/getStyles.js +1 -1
- package/dist/core/dist/index.d.ts +0 -1
- package/dist/core/dist/index.js +0 -1
- package/dist/core.d.ts +1 -2
- package/dist/core.js +1 -2
- package/dist/foundational-presets/dist/style-props.js +60 -0
- package/dist/loader/dist/loader/style-transform.js +3 -4
- package/dist/loader/dist/packages/core/dist/getStyles.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/core/dist/color-opacity-map.d.ts +0 -13
|
@@ -421,9 +421,27 @@ function createConfigBuilder(data, extensions) {
|
|
|
421
421
|
}, extensions);
|
|
422
422
|
},
|
|
423
423
|
registerStyleProps(props) {
|
|
424
|
+
const expanded = {};
|
|
425
|
+
for (const [propName, prop] of Object.entries(props)) {
|
|
426
|
+
expanded[propName] = prop;
|
|
427
|
+
if (prop.opacityPair) {
|
|
428
|
+
const sibling = {
|
|
429
|
+
kind: "styleProp",
|
|
430
|
+
cssProperty: prop.cssProperty,
|
|
431
|
+
classPrefix: "",
|
|
432
|
+
values: prop.opacityPair.values,
|
|
433
|
+
arbitrary: void 0,
|
|
434
|
+
cssType: prop.cssType,
|
|
435
|
+
metadata: { label: prop.metadata?.label ? `${prop.metadata.label} opacity` : void 0 },
|
|
436
|
+
_pairedWith: propName,
|
|
437
|
+
_separator: prop.opacityPair.separator
|
|
438
|
+
};
|
|
439
|
+
expanded[prop.opacityPair.as] = sibling;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
424
442
|
const mergedStyleProps = {
|
|
425
443
|
...data.styleProps ?? {},
|
|
426
|
-
...
|
|
444
|
+
...expanded
|
|
427
445
|
};
|
|
428
446
|
const updates = { styleProps: mergedStyleProps };
|
|
429
447
|
if (data.vars) updates.atomic = mergeAtomic([], synthesizeAtomicFromVarsAndStyleProps(data.vars, mergedStyleProps, data.modes ?? []), "override");
|
|
@@ -47,6 +47,23 @@ type StylePropMetadata = {
|
|
|
47
47
|
* (`Array.isArray(p) ? p : [p]`); readers that only need the primary
|
|
48
48
|
* use the string directly or `Array.isArray(p) ? p[0] : p`.
|
|
49
49
|
*/
|
|
50
|
+
/**
|
|
51
|
+
* Internal shape attached to a {@link StyleProp} by `.withOpacity()`.
|
|
52
|
+
* The resolver inspects this at `resolveConfig` time to synthesize a
|
|
53
|
+
* second {@link ResolvedStyleProp} for the opacity sibling.
|
|
54
|
+
*/
|
|
55
|
+
interface OpacityPairSpec {
|
|
56
|
+
/** JSX-prop name for the opacity sibling, e.g. `'bgOpacity'`. */
|
|
57
|
+
readonly as: string;
|
|
58
|
+
/** Token-group refs the opacity sibling accepts as values. */
|
|
59
|
+
readonly values: readonly unknown[];
|
|
60
|
+
/**
|
|
61
|
+
* Separator between the parent's value-token suffix and the opacity
|
|
62
|
+
* value in the emitted class name (`bg-primary_75` vs.
|
|
63
|
+
* `bg-primary/75`). Defaults to `_`.
|
|
64
|
+
*/
|
|
65
|
+
readonly separator: string;
|
|
66
|
+
}
|
|
50
67
|
/**
|
|
51
68
|
* Structurally-loose form of {@link StyleProp}. Any concrete `StyleProp<P>`
|
|
52
69
|
* is assignable to this. Used at registration / resolution boundaries where
|
|
@@ -61,6 +78,7 @@ interface AnyStyleProp {
|
|
|
61
78
|
readonly arbitrary?: ArbitrarySpec;
|
|
62
79
|
readonly cssType?: CssValueTypeName;
|
|
63
80
|
readonly metadata: StylePropMetadata;
|
|
81
|
+
readonly opacityPair?: OpacityPairSpec;
|
|
64
82
|
}
|
|
65
83
|
/**
|
|
66
84
|
* Return shape of {@link defineStyleProp}. The `metadata` field doubles as
|
|
@@ -35,14 +35,26 @@ function defineStyleProp(spec) {
|
|
|
35
35
|
arbitrary,
|
|
36
36
|
cssType
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
const buildChainable = (fields) => {
|
|
39
|
+
const metadata = (meta = {}) => ({
|
|
40
|
+
...fields,
|
|
41
|
+
metadata: meta
|
|
42
|
+
});
|
|
43
|
+
const withOpacity = (spec) => buildChainable({
|
|
44
|
+
...fields,
|
|
45
|
+
opacityPair: {
|
|
46
|
+
as: spec.as,
|
|
47
|
+
values: spec.values,
|
|
48
|
+
separator: spec.separator ?? "_"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
...fields,
|
|
53
|
+
metadata,
|
|
54
|
+
withOpacity
|
|
55
|
+
};
|
|
45
56
|
};
|
|
57
|
+
return buildChainable(baseFields);
|
|
46
58
|
}
|
|
47
59
|
//#endregion
|
|
48
60
|
export { defineStyleProp };
|
|
@@ -52,6 +52,20 @@ interface ResolvedStyleProp {
|
|
|
52
52
|
* (`Array.isArray(p) ? p : [p]`) when iteration matters. */
|
|
53
53
|
readonly cssProperty: string | readonly string[];
|
|
54
54
|
readonly classPrefix: string;
|
|
55
|
+
/**
|
|
56
|
+
* Set on opacity-sibling entries to the JSX-prop name of the parent
|
|
57
|
+
* color prop they compose with (`bg` for `bgOpacity`). Authored via
|
|
58
|
+
* `.withOpacity({ as })` on the parent's `defineStyleProp`. Consumers
|
|
59
|
+
* use this to merge `bg="primary"` + `bgOpacity="75"` into a single
|
|
60
|
+
* `bg-primary_75` class.
|
|
61
|
+
*/
|
|
62
|
+
readonly pairedWith?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Class-name separator between the parent's token suffix and the
|
|
65
|
+
* opacity value (`bg-primary_75` vs. `bg-primary/75`). Only set when
|
|
66
|
+
* `pairedWith` is set. Defaults to `'_'` at the authoring layer.
|
|
67
|
+
*/
|
|
68
|
+
readonly separator?: string;
|
|
55
69
|
readonly tokens: readonly ResolvedToken[];
|
|
56
70
|
readonly literals: readonly (string | number | boolean)[];
|
|
57
71
|
/** Alias → CSS-value map for `{ alias, value }` entries in `values`.
|
|
@@ -124,13 +124,13 @@ function isNamespacedRef(entry) {
|
|
|
124
124
|
function buildCssVar(configPrefix, varPrefix, safeName) {
|
|
125
125
|
return configPrefix ? `--${configPrefix}-${varPrefix}-${safeName}` : `--${varPrefix}-${safeName}`;
|
|
126
126
|
}
|
|
127
|
-
function resolveGroupTokens(group, cssProperty, configPrefix, namespace) {
|
|
127
|
+
function resolveGroupTokens(group, cssProperty, configPrefix, namespace, skipPropertyFilter = false) {
|
|
128
128
|
const groupName = group.namespace ?? group.cssPrefix ?? "";
|
|
129
129
|
const varPrefix = group.cssPrefix ?? group.namespace ?? "";
|
|
130
130
|
const out = [];
|
|
131
131
|
for (const token of group.tokens) {
|
|
132
132
|
const valueType = detectTokenValueType(token, group);
|
|
133
|
-
if (!isTokenAcceptedByProperty(cssProperty, valueType, token.value)) continue;
|
|
133
|
+
if (!skipPropertyFilter && !isTokenAcceptedByProperty(cssProperty, valueType, token.value)) continue;
|
|
134
134
|
const safeName = safeTokenName(token.name);
|
|
135
135
|
out.push({
|
|
136
136
|
name: token.name,
|
|
@@ -156,6 +156,8 @@ function resolveGroupTokens(group, cssProperty, configPrefix, namespace) {
|
|
|
156
156
|
*/
|
|
157
157
|
function resolveStyleProp(propName, styleProp, config) {
|
|
158
158
|
const { cssProperty, classPrefix, values, arbitrary, metadata } = styleProp;
|
|
159
|
+
const pairedWith = styleProp._pairedWith;
|
|
160
|
+
const separator = styleProp._separator;
|
|
159
161
|
const primaryCssProperty = Array.isArray(cssProperty) ? cssProperty[0] : cssProperty;
|
|
160
162
|
const configPrefix = config.prefix;
|
|
161
163
|
const tokens = [];
|
|
@@ -179,7 +181,7 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
179
181
|
const token = group.tokens.find((t) => t.name === parsed.key);
|
|
180
182
|
if (!token) continue;
|
|
181
183
|
const valueType = detectTokenValueType(token, group);
|
|
182
|
-
if (!isTokenAcceptedByProperty(primaryCssProperty, valueType, token.value)) continue;
|
|
184
|
+
if (!pairedWith && !isTokenAcceptedByProperty(primaryCssProperty, valueType, token.value)) continue;
|
|
183
185
|
const safeName = safeTokenName(token.name);
|
|
184
186
|
const varPrefix = group.cssPrefix ?? group.namespace ?? parsed.group;
|
|
185
187
|
tokens.push({
|
|
@@ -192,7 +194,7 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
192
194
|
cssVar: buildCssVar(configPrefix, varPrefix, safeName),
|
|
193
195
|
modifiers: token.modifiers
|
|
194
196
|
});
|
|
195
|
-
} else tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix));
|
|
197
|
+
} else tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, void 0, pairedWith !== void 0));
|
|
196
198
|
continue;
|
|
197
199
|
}
|
|
198
200
|
if (isNamespacedRef(entry)) {
|
|
@@ -200,7 +202,7 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
200
202
|
if (!parsed || parsed.key !== void 0) continue;
|
|
201
203
|
const group = findGroup(config.atomic, parsed.group);
|
|
202
204
|
if (!group) continue;
|
|
203
|
-
tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, entry.namespace));
|
|
205
|
+
tokens.push(...resolveGroupTokens(group, primaryCssProperty, configPrefix, entry.namespace, pairedWith !== void 0));
|
|
204
206
|
continue;
|
|
205
207
|
}
|
|
206
208
|
if (typeof entry === "object" && entry !== null && "alias" in entry && "value" in entry) {
|
|
@@ -218,6 +220,10 @@ function resolveStyleProp(propName, styleProp, config) {
|
|
|
218
220
|
propName,
|
|
219
221
|
cssProperty,
|
|
220
222
|
classPrefix,
|
|
223
|
+
...pairedWith !== void 0 ? {
|
|
224
|
+
pairedWith,
|
|
225
|
+
separator
|
|
226
|
+
} : {},
|
|
221
227
|
tokens,
|
|
222
228
|
literals,
|
|
223
229
|
...Object.keys(literalAliases).length > 0 ? { literalAliases } : {},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { applySlotOverrides, assertTransformedConfig, buildSlotProps, buildUntransformedSlotProps, inferComponentNameFromRenderFn, mergeMotionConfig, mergeRootClassName, mergeSlotMotionProps, partitionMergedProps } from "./createComponent.boundaries.js";
|
|
1
2
|
import { processStyleProps } from "./getStyles.js";
|
|
2
3
|
import { createComponentStyler } from "./getComponentStyles.js";
|
|
3
|
-
import { applySlotOverrides, assertTransformedConfig, buildSlotProps, buildUntransformedSlotProps, inferComponentNameFromRenderFn, mergeMotionConfig, mergeRootClassName, mergeSlotMotionProps, partitionMergedProps } from "./createComponent.boundaries.js";
|
|
4
4
|
import { createElement } from "react";
|
|
5
5
|
//#region ../core/dist/createComponent.js
|
|
6
6
|
function createPrimitiveRenderFn(tag) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { colorPropToOpacityProp } from "./color-opacity-map.js";
|
|
2
1
|
import { componentSlotClass } from "../../utils/dist/string-utils/componentClassName.js";
|
|
3
2
|
import "../../utils/dist/index.js";
|
|
4
3
|
import { expandCompositeStyles, getCompositeStylesConfig } from "./compositeStyles.js";
|
|
5
4
|
import { propMappings } from "./style-prop-data.js";
|
|
6
5
|
import { stylePropsTwMap } from "./generated/stylePropsTwMap.js";
|
|
6
|
+
import { colorPropToOpacityProp } from "./color-opacity-map.js";
|
|
7
7
|
import { modifierMappings } from "./modifier-mappings.js";
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
9
|
//#region ../core/dist/getStyles.js
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { colorPropToOpacityProp } from "./color-opacity-map.js";
|
|
2
1
|
import { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig } from "./compositeStyles.js";
|
|
3
2
|
import { PropMapping, propMappings } from "./style-prop-data.js";
|
|
4
3
|
import { ConfigurablePropertyEntry, CssVariablePrefixEntry, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes } from "./configurable-prop-helpers.js";
|
package/dist/core/dist/index.js
CHANGED
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { colorPropToOpacityProp } from "./core/dist/color-opacity-map.js";
|
|
2
1
|
import { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig } from "./core/dist/compositeStyles.js";
|
|
3
2
|
import { PropMapping, propMappings } from "./core/dist/style-prop-data.js";
|
|
4
3
|
import { ConfigurablePropertyEntry, CssVariablePrefixEntry, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes } from "./core/dist/configurable-prop-helpers.js";
|
|
@@ -12,4 +11,4 @@ import { ModifierEntry, modifierMappings } from "./core/dist/modifier-mappings.j
|
|
|
12
11
|
import { resolveMotionState } from "./core/dist/resolveMotionState.js";
|
|
13
12
|
import { TransformedMotionProps, transformPreset } from "./core/dist/transformPreset.js";
|
|
14
13
|
import { withDefaultStyleProps } from "./core/dist/withDefaultStyleProps.js";
|
|
15
|
-
export { ComponentExample, ConfigurablePropertyEntry, CssVariablePrefixEntry, ModifierEntry, PropMapping, TransformedMotionProps,
|
|
14
|
+
export { ComponentExample, ConfigurablePropertyEntry, CssVariablePrefixEntry, ModifierEntry, PropMapping, TransformedMotionProps, createComponent, createComponentExample, createComponentStyler, createProvider, createVariants, cx, expandCompositeStyles, getCompositeStylesConfig, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes, getStyles, getVariantClassName, modifierMappings, processStyleProps, propMappings, resolveMotionState, setCompositeStylesConfig, stylePropsTwMap, toCamelCase, transformPreset, withDefaultStyleProps };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { colorPropToOpacityProp } from "./core/dist/color-opacity-map.js";
|
|
2
1
|
import { expandCompositeStyles, getCompositeStylesConfig, setCompositeStylesConfig } from "./core/dist/compositeStyles.js";
|
|
3
2
|
import { propMappings } from "./core/dist/style-prop-data.js";
|
|
4
3
|
import { getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes } from "./core/dist/configurable-prop-helpers.js";
|
|
@@ -13,4 +12,4 @@ import { resolveMotionState } from "./core/dist/resolveMotionState.js";
|
|
|
13
12
|
import { transformPreset } from "./core/dist/transformPreset.js";
|
|
14
13
|
import { withDefaultStyleProps } from "./core/dist/withDefaultStyleProps.js";
|
|
15
14
|
import "./core/dist/index.js";
|
|
16
|
-
export {
|
|
15
|
+
export { createComponent, createComponentExample, createComponentStyler, createProvider, createVariants, cx, expandCompositeStyles, getCompositeStylesConfig, getConfigurablePropMapping, getConfigurableProperties, getCssVariablePrefixes, getStyles, getVariantClassName, modifierMappings, processStyleProps, propMappings, resolveMotionState, setCompositeStylesConfig, stylePropsTwMap, toCamelCase, transformPreset, withDefaultStyleProps };
|
|
@@ -239,6 +239,9 @@ const bg = defineStyleProp({
|
|
|
239
239
|
classPrefix: "bg",
|
|
240
240
|
values: ["{color}", "{bg}"],
|
|
241
241
|
arbitrary: "color"
|
|
242
|
+
}).withOpacity({
|
|
243
|
+
as: "bgOpacity",
|
|
244
|
+
values: ["{opacity}"]
|
|
242
245
|
}).metadata({ label: "Background" });
|
|
243
246
|
const borderRadius = defineStyleProp({
|
|
244
247
|
cssProperty: "border-radius",
|
|
@@ -299,54 +302,81 @@ const borderColor = defineStyleProp({
|
|
|
299
302
|
classPrefix: "border-color",
|
|
300
303
|
values: ["{color}", "{borderColor}"],
|
|
301
304
|
arbitrary: "color"
|
|
305
|
+
}).withOpacity({
|
|
306
|
+
as: "borderColorOpacity",
|
|
307
|
+
values: ["{opacity}"]
|
|
302
308
|
}).metadata({ label: "Border color" });
|
|
303
309
|
const borderYColor = defineStyleProp({
|
|
304
310
|
cssProperty: "border-block-color",
|
|
305
311
|
classPrefix: "border-y-color",
|
|
306
312
|
values: ["{color}", "{borderColor}"],
|
|
307
313
|
arbitrary: "color"
|
|
314
|
+
}).withOpacity({
|
|
315
|
+
as: "borderYColorOpacity",
|
|
316
|
+
values: ["{opacity}"]
|
|
308
317
|
}).metadata({ label: "Border Y color" });
|
|
309
318
|
const borderXColor = defineStyleProp({
|
|
310
319
|
cssProperty: "border-inline-color",
|
|
311
320
|
classPrefix: "border-x-color",
|
|
312
321
|
values: ["{color}", "{borderColor}"],
|
|
313
322
|
arbitrary: "color"
|
|
323
|
+
}).withOpacity({
|
|
324
|
+
as: "borderXColorOpacity",
|
|
325
|
+
values: ["{opacity}"]
|
|
314
326
|
}).metadata({ label: "Border X color" });
|
|
315
327
|
const borderStartColor = defineStyleProp({
|
|
316
328
|
cssProperty: "border-inline-start-color",
|
|
317
329
|
classPrefix: "border-s-color",
|
|
318
330
|
values: ["{color}", "{borderColor}"],
|
|
319
331
|
arbitrary: "color"
|
|
332
|
+
}).withOpacity({
|
|
333
|
+
as: "borderStartColorOpacity",
|
|
334
|
+
values: ["{opacity}"]
|
|
320
335
|
}).metadata({ label: "Border start color" });
|
|
321
336
|
const borderLeftColor = defineStyleProp({
|
|
322
337
|
cssProperty: "border-left-color",
|
|
323
338
|
classPrefix: "border-l-color",
|
|
324
339
|
values: ["{color}", "{borderColor}"],
|
|
325
340
|
arbitrary: "color"
|
|
341
|
+
}).withOpacity({
|
|
342
|
+
as: "borderLeftColorOpacity",
|
|
343
|
+
values: ["{opacity}"]
|
|
326
344
|
}).metadata({ label: "Border left color" });
|
|
327
345
|
const borderEndColor = defineStyleProp({
|
|
328
346
|
cssProperty: "border-inline-end-color",
|
|
329
347
|
classPrefix: "border-e-color",
|
|
330
348
|
values: ["{color}", "{borderColor}"],
|
|
331
349
|
arbitrary: "color"
|
|
350
|
+
}).withOpacity({
|
|
351
|
+
as: "borderEndColorOpacity",
|
|
352
|
+
values: ["{opacity}"]
|
|
332
353
|
}).metadata({ label: "Border end color" });
|
|
333
354
|
const borderRightColor = defineStyleProp({
|
|
334
355
|
cssProperty: "border-right-color",
|
|
335
356
|
classPrefix: "border-r-color",
|
|
336
357
|
values: ["{color}", "{borderColor}"],
|
|
337
358
|
arbitrary: "color"
|
|
359
|
+
}).withOpacity({
|
|
360
|
+
as: "borderRightColorOpacity",
|
|
361
|
+
values: ["{opacity}"]
|
|
338
362
|
}).metadata({ label: "Border right color" });
|
|
339
363
|
const borderTopColor = defineStyleProp({
|
|
340
364
|
cssProperty: "border-top-color",
|
|
341
365
|
classPrefix: "border-t-color",
|
|
342
366
|
values: ["{color}", "{borderColor}"],
|
|
343
367
|
arbitrary: "color"
|
|
368
|
+
}).withOpacity({
|
|
369
|
+
as: "borderTopColorOpacity",
|
|
370
|
+
values: ["{opacity}"]
|
|
344
371
|
}).metadata({ label: "Border top color" });
|
|
345
372
|
const borderBottomColor = defineStyleProp({
|
|
346
373
|
cssProperty: "border-bottom-color",
|
|
347
374
|
classPrefix: "border-b-color",
|
|
348
375
|
values: ["{color}", "{borderColor}"],
|
|
349
376
|
arbitrary: "color"
|
|
377
|
+
}).withOpacity({
|
|
378
|
+
as: "borderBottomColorOpacity",
|
|
379
|
+
values: ["{opacity}"]
|
|
350
380
|
}).metadata({ label: "Border bottom color" });
|
|
351
381
|
const border = defineStyleProp({
|
|
352
382
|
cssProperty: "border-width",
|
|
@@ -435,6 +465,9 @@ const color = defineStyleProp({
|
|
|
435
465
|
classPrefix: "color",
|
|
436
466
|
values: ["{color}"],
|
|
437
467
|
arbitrary: "color"
|
|
468
|
+
}).withOpacity({
|
|
469
|
+
as: "colorOpacity",
|
|
470
|
+
values: ["{opacity}"]
|
|
438
471
|
}).metadata({ label: "Color" });
|
|
439
472
|
const divideWidth = defineStyleProp({
|
|
440
473
|
cssProperty: "border-width",
|
|
@@ -446,6 +479,9 @@ const divideColor = defineStyleProp({
|
|
|
446
479
|
classPrefix: "divide-color",
|
|
447
480
|
values: ["{color}", "{borderColor}"],
|
|
448
481
|
arbitrary: "color"
|
|
482
|
+
}).withOpacity({
|
|
483
|
+
as: "divideColorOpacity",
|
|
484
|
+
values: ["{opacity}"]
|
|
449
485
|
}).metadata({ label: "Divide color" });
|
|
450
486
|
const divideStyle = defineStyleProp({
|
|
451
487
|
cssProperty: "border-style",
|
|
@@ -578,6 +614,9 @@ const caretColor = defineStyleProp({
|
|
|
578
614
|
classPrefix: "caret-color",
|
|
579
615
|
values: ["{color}"],
|
|
580
616
|
arbitrary: "color"
|
|
617
|
+
}).withOpacity({
|
|
618
|
+
as: "caretColorOpacity",
|
|
619
|
+
values: ["{opacity}"]
|
|
581
620
|
}).metadata({ label: "Caret color" });
|
|
582
621
|
const pointerEvents = defineStyleProp({
|
|
583
622
|
cssProperty: "pointer-events",
|
|
@@ -832,6 +871,9 @@ const outlineColor = defineStyleProp({
|
|
|
832
871
|
classPrefix: "outline-color",
|
|
833
872
|
values: ["{color}"],
|
|
834
873
|
arbitrary: "color"
|
|
874
|
+
}).withOpacity({
|
|
875
|
+
as: "outlineColorOpacity",
|
|
876
|
+
values: ["{opacity}"]
|
|
835
877
|
}).metadata({ label: "Outline color" });
|
|
836
878
|
const outlineStyle = defineStyleProp({
|
|
837
879
|
cssProperty: "outline-style",
|
|
@@ -854,6 +896,9 @@ const ringColor = defineStyleProp({
|
|
|
854
896
|
classPrefix: "ring-color",
|
|
855
897
|
values: ["{color}"],
|
|
856
898
|
arbitrary: "color"
|
|
899
|
+
}).withOpacity({
|
|
900
|
+
as: "ringColorOpacity",
|
|
901
|
+
values: ["{opacity}"]
|
|
857
902
|
}).metadata({ label: "Ring color" });
|
|
858
903
|
const ringOffsetWidth = defineStyleProp({
|
|
859
904
|
cssProperty: "--tw-ring-offset-width",
|
|
@@ -867,6 +912,9 @@ const ringOffsetColor = defineStyleProp({
|
|
|
867
912
|
classPrefix: "ring-offset-color",
|
|
868
913
|
values: ["{color}"],
|
|
869
914
|
arbitrary: "color"
|
|
915
|
+
}).withOpacity({
|
|
916
|
+
as: "ringOffsetColorOpacity",
|
|
917
|
+
values: ["{opacity}"]
|
|
870
918
|
}).metadata({ label: "Ring offset color" });
|
|
871
919
|
const ringInset = defineStyleProp({
|
|
872
920
|
cssProperty: "--tw-ring-inset",
|
|
@@ -885,6 +933,9 @@ const shadowColor = defineStyleProp({
|
|
|
885
933
|
classPrefix: "shadow-color",
|
|
886
934
|
values: ["{color}"],
|
|
887
935
|
arbitrary: "color"
|
|
936
|
+
}).withOpacity({
|
|
937
|
+
as: "shadowColorOpacity",
|
|
938
|
+
values: ["{opacity}"]
|
|
888
939
|
}).metadata({ label: "Shadow color" });
|
|
889
940
|
const height = defineStyleProp({
|
|
890
941
|
cssProperty: "height",
|
|
@@ -1131,12 +1182,18 @@ const fillColor = defineStyleProp({
|
|
|
1131
1182
|
classPrefix: "fill",
|
|
1132
1183
|
values: ["{color}"],
|
|
1133
1184
|
arbitrary: "color"
|
|
1185
|
+
}).withOpacity({
|
|
1186
|
+
as: "fillColorOpacity",
|
|
1187
|
+
values: ["{opacity}"]
|
|
1134
1188
|
}).metadata({ label: "Fill color" });
|
|
1135
1189
|
const strokeColor = defineStyleProp({
|
|
1136
1190
|
cssProperty: "stroke",
|
|
1137
1191
|
classPrefix: "stroke-color",
|
|
1138
1192
|
values: ["{color}"],
|
|
1139
1193
|
arbitrary: "color"
|
|
1194
|
+
}).withOpacity({
|
|
1195
|
+
as: "strokeColorOpacity",
|
|
1196
|
+
values: ["{opacity}"]
|
|
1140
1197
|
}).metadata({ label: "Stroke color" });
|
|
1141
1198
|
const strokeWidth = defineStyleProp({
|
|
1142
1199
|
cssProperty: "stroke-width",
|
|
@@ -1321,6 +1378,9 @@ const textDecorationColor = defineStyleProp({
|
|
|
1321
1378
|
classPrefix: "decoration-color",
|
|
1322
1379
|
values: ["{color}"],
|
|
1323
1380
|
arbitrary: "color"
|
|
1381
|
+
}).withOpacity({
|
|
1382
|
+
as: "textDecorationColorOpacity",
|
|
1383
|
+
values: ["{opacity}"]
|
|
1324
1384
|
}).metadata({ label: "Text decoration color" });
|
|
1325
1385
|
const textDecorationStyle = defineStyleProp({
|
|
1326
1386
|
cssProperty: "text-decoration-style",
|
|
@@ -2,7 +2,6 @@ import { applyComponentStyleDefaults } from "../../../utils/dist/component-style
|
|
|
2
2
|
import { kebabCase } from "../../../utils/dist/string-utils/kebabCase.js";
|
|
3
3
|
import { componentVariantClass } from "../../../utils/dist/string-utils/componentClassName.js";
|
|
4
4
|
import "../../../utils/dist/index.js";
|
|
5
|
-
import { colorPropToOpacityProp } from "../packages/core/dist/color-opacity-map.js";
|
|
6
5
|
import { expandCompositeStyles } from "../packages/core/dist/compositeStyles.js";
|
|
7
6
|
import { propMappings } from "../packages/core/dist/style-prop-data.js";
|
|
8
7
|
import { toCamelCase } from "../packages/core/dist/getStyles.js";
|
|
@@ -163,9 +162,9 @@ function createStyleTransformRuntime(transformData, manifest) {
|
|
|
163
162
|
effectiveProps = expanded;
|
|
164
163
|
if (markerClasses.length > 0) effectiveProps.__compositeStyleMarkers = markerClasses;
|
|
165
164
|
}
|
|
166
|
-
for (const
|
|
167
|
-
effectiveProps[colorProp] = `${effectiveProps[colorProp]}
|
|
168
|
-
delete effectiveProps[
|
|
165
|
+
for (const { colorProp, opacityProp, separator } of transformData?.colorOpacityPairs ?? []) if (effectiveProps[opacityProp] !== void 0 && effectiveProps[colorProp] !== void 0) {
|
|
166
|
+
effectiveProps[colorProp] = `${effectiveProps[colorProp]}${separator}${effectiveProps[opacityProp]}`;
|
|
167
|
+
delete effectiveProps[opacityProp];
|
|
169
168
|
}
|
|
170
169
|
const classParts = [];
|
|
171
170
|
if (Array.isArray(effectiveProps.__compositeStyleMarkers)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../../../../utils/dist/index.js";
|
|
2
|
-
import { colorPropToOpacityProp } from "./color-opacity-map.js";
|
|
3
2
|
import "./compositeStyles.js";
|
|
4
3
|
import { propMappings } from "./style-prop-data.js";
|
|
5
4
|
import { stylePropsTwMap } from "./generated/stylePropsTwMap.js";
|
|
5
|
+
import { colorPropToOpacityProp } from "./color-opacity-map.js";
|
|
6
6
|
import { modifierMappings } from "./modifier-mappings.js";
|
|
7
7
|
//#region ../loader/dist/packages/core/dist/getStyles.js
|
|
8
8
|
/** Convert kebab-case CSS property to camelCase for React inline styles.
|