@bamboocss/generator 1.60.1 → 1.60.3
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/index.cjs +872 -5
- package/dist/index.mjs +872 -5
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -160,7 +160,7 @@ function generateMergeCssFn(ctx) {
|
|
|
160
160
|
}).filter(Boolean).join(",");
|
|
161
161
|
return {
|
|
162
162
|
dts: outdent`
|
|
163
|
-
|
|
163
|
+
${ctx.file.importType("SystemStyleObject", "../types/index")}
|
|
164
164
|
|
|
165
165
|
/** Deep-merge style objects, resolving shorthands before merging. */
|
|
166
166
|
export declare function mergeCss(...styles: SystemStyleObject[]): SystemStyleObject;
|
|
@@ -374,7 +374,7 @@ function generateCx(ctx) {
|
|
|
374
374
|
}
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region src/artifacts/generated/helpers.mjs.json
|
|
377
|
-
var content$7 = "//#region src/assert.ts\nfunction isObject(value) {\n return typeof value === \"object\" && value != null && !Array.isArray(value);\n}\nconst isObjectOrArray = (obj) => typeof obj === \"object\" && obj !== null;\n//#endregion\n//#region src/error.ts\nvar BambooError = class extends Error {\n code;\n hint;\n constructor(code, message, opts) {\n super(message, { cause: opts?.cause });\n this.code = `ERR_BAMBOO_${code}`;\n this.hint = opts?.hint;\n }\n};\n//#endregion\n//#region src/memo.ts\n/**\n* Bounded argument memo used by the generated runtime (`css`, patterns, `cva`, recipes).\n*\n* Two regimes, picked per call:\n*\n* - Arguments that are flat (objects of primitives) take a cheap structural hash\n* and are confirmed with an exact comparison, so a hash collision can never\n* serve the wrong result. This is the shape `css({ ... })` has.\n* - Anything nested falls back to `JSON.stringify`, which V8 does faster than a\n* JS walk.\n*\n* The second point is the counter-intuitive one, and it has been measured rather\n* than assumed. Extending the structural hash to recurse — so nested styles could\n* take the fast path too — is *slower*, because it trades one native serialization\n* for two JS walks (hash, then the deep equality that confirms it). Over 10k\n* iterations per shape:\n*\n* shape stringify recursive hash + deep equal\n* flat 1.06ms 2.09ms\n* _hover 1.00ms 2.16ms\n* responsive 1.23ms 2.15ms\n* realistic 2.32ms 5.84ms\n* nested 3 deep 1.22ms 2.35ms\n*\n* So a nested `css()` call costing several times a flat one is not a defect here.\n* It is the floor for a value-keyed memo in JS, and the way to avoid it is to not\n* make the call — see the build-time fold in `@bamboocss/vite`.\n*\n* Both regimes key on *values*, never on object identity: mutating a style object\n* between calls changes its hash, so the next call misses and recomputes rather\n* than serving a stale class. Keying nested arguments on the identity of the inner\n* objects would skip serialization entirely, but it cannot detect a mutation, and\n* \"same object, different contents\" is exactly what a style object built per render\n* looks like.\n*\n* Both caches are bounded. An unbounded memo is a leak in any long-lived process\n* (SSR), where the set of distinct style objects grows without limit.\n*/\n/**\n* Distinct hashes held per memoized function before the cache rotates.\n*\n* This bounds *buckets*, not entries: a bucket keeps up to `MAX_BUCKET` colliding\n* argument lists, so the ceiling is `MAX_ENTRIES * MAX_BUCKET` live entries, and\n* twice that across both generations, since the previous one is retained until the\n* next rotation. Collisions are rare in practice, so the realistic figure is close\n* to `MAX_ENTRIES` — but the worst case is what matters when sizing a long-lived\n* process, so state it plainly.\n*\n* Rotation beats evicting the oldest key: single-key eviction is worst-case for a\n* working set that cycles, because it drops exactly the entry about to be needed.\n* Measured on a cycling set of 20k styles, one-at-a-time eviction cost ~719ns/op\n* against ~189ns unbounded, while rotation holds ~274ns. On realistic skewed\n* access rotation is at or below the unbounded cost.\n*/\nconst MAX_ENTRIES = 1e3;\n/** Entries kept per hash bucket, to bound the cost of a collision scan. */\nconst MAX_BUCKET = 8;\n/**\n* DJB2 over the arguments' own keys and primitive values.\n* Returns `null` for anything nested, which routes the call to the string key.\n*/\nconst flatHashOrNull = (args) => {\n let h = 5381;\n for (let a = 0; a < args.length; a++) {\n const obj = args[a];\n if (obj === null || typeof obj !== \"object\") {\n const t = typeof obj;\n if (t === \"string\") for (let i = 0; i < obj.length; i++) h = h * 33 ^ obj.charCodeAt(i);\n else if (t === \"number\") h = h * 33 ^ (obj | 0);\n else if (t === \"boolean\") h = h * 33 ^ (obj ? 991 : 997);\n else h = h * 33 ^ 3;\n continue;\n }\n if (Array.isArray(obj)) return null;\n const proto = Object.getPrototypeOf(obj);\n if (proto !== Object.prototype && proto !== null) return null;\n for (const k in obj) {\n const v = obj[k];\n const tv = typeof v;\n if (v !== null && tv === \"object\") return null;\n for (let i = 0; i < k.length; i++) h = h * 33 ^ k.charCodeAt(i);\n if (tv === \"string\") for (let i = 0; i < v.length; i++) h = h * 33 ^ v.charCodeAt(i);\n else if (tv === \"number\") h = h * 33 ^ (v | 0);\n else if (tv === \"boolean\") h = h * 33 ^ (v ? 991 : 997);\n else h = h * 33 ^ 2;\n }\n }\n return h >>> 0;\n};\n/**\n* Value snapshot of the arguments, taken once at insert.\n*\n* The cache must not hold the caller's objects: a style object can capture a much\n* larger graph, and keeping it alive until the cache rotates changes GC behaviour\n* for code that never asked to be cached. Only the flat path reaches here, so a\n* shallow copy contains primitives only and retains nothing.\n*\n* Comparing against a copy also removes the last way a mutation could be missed.\n* Were the caller's own object stored, `oa === ob` would short-circuit the value\n* comparison, and a mutation that happened to preserve the hash would return the\n* stale entry. Against a copy that check can only ever be true for equal\n* primitives.\n*/\nconst snapshotArgs = (args) => {\n const values = [];\n const counts = [];\n for (let i = 0; i < args.length; i++) {\n const o = args[i];\n if (o !== null && typeof o === \"object\") {\n const copy = Array.isArray(o) ? [] : {};\n let n = 0;\n for (const k in o) {\n copy[k] = o[k];\n n++;\n }\n values.push(copy);\n counts.push(n);\n } else {\n values.push(o);\n counts.push(0);\n }\n }\n return {\n values,\n counts\n };\n};\n/**\n* Exact match, so a `flatHashOrNull` collision is resolved rather than trusted.\n* `bCounts` is the cached side's key count; comparing against it avoids the\n* `Object.keys()` allocation this would otherwise make on every cache hit.\n*/\nconst flatArgsEqual = (a, b, bCounts) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n const oa = a[i];\n const ob = b[i];\n if (oa === ob) continue;\n if (oa === null || ob === null || typeof oa !== \"object\" || typeof ob !== \"object\") return false;\n if (Array.isArray(oa) !== Array.isArray(ob)) return false;\n let n = 0;\n for (const k in oa) {\n if (oa[k] !== ob[k]) return false;\n n++;\n }\n if (n !== bCounts[i]) return false;\n }\n return true;\n};\nconst memo = (fn) => {\n let buckets = /* @__PURE__ */ new Map();\n let priorBuckets = /* @__PURE__ */ new Map();\n let strings = /* @__PURE__ */ new Map();\n let priorStrings = /* @__PURE__ */ new Map();\n /**\n * One scalar argument, keyed directly.\n *\n * This is the shape of the hottest callers — `isCssProperty(prop)` runs per prop\n * per render — and a plain map lookup beats hashing, bucket scanning and\n * snapshotting for it. Distinct types stay distinct keys, so `1` and `'1'` do not\n * share an entry.\n */\n let scalars = /* @__PURE__ */ new Map();\n let priorScalars = /* @__PURE__ */ new Map();\n const scan = (bucket, args) => {\n if (bucket) for (let i = 0; i < bucket.length; i++) {\n const entry = bucket[i];\n if (flatArgsEqual(args, entry.values, entry.counts)) return entry;\n }\n };\n const get = (...args) => {\n if (args.length === 1) {\n const only = args[0];\n if (only === null || typeof only !== \"object\") {\n if (scalars.has(only)) return scalars.get(only);\n if (priorScalars.has(only)) {\n const promoted = priorScalars.get(only);\n scalars.set(only, promoted);\n return promoted;\n }\n const out = fn(only);\n scalars.set(only, out);\n if (scalars.size > MAX_ENTRIES) {\n priorScalars = scalars;\n scalars = /* @__PURE__ */ new Map();\n }\n return out;\n }\n }\n const hash = flatHashOrNull(args);\n if (hash !== null) {\n let bucket = buckets.get(hash);\n const hit = scan(bucket, args);\n if (hit) return hit.out;\n const priorHit = scan(priorBuckets.get(hash), args);\n if (priorHit) {\n if (!bucket) {\n bucket = [];\n buckets.set(hash, bucket);\n }\n bucket.push(priorHit);\n if (bucket.length > MAX_BUCKET) bucket.shift();\n return priorHit.out;\n }\n const snap = snapshotArgs(args);\n const out = fn(...args);\n if (!bucket) {\n bucket = [];\n buckets.set(hash, bucket);\n }\n bucket.push({\n values: snap.values,\n counts: snap.counts,\n out\n });\n if (bucket.length > MAX_BUCKET) bucket.shift();\n if (buckets.size > MAX_ENTRIES) {\n priorBuckets = buckets;\n buckets = /* @__PURE__ */ new Map();\n }\n return out;\n }\n const key = JSON.stringify(args);\n if (strings.has(key)) return strings.get(key);\n if (priorStrings.has(key)) {\n const promoted = priorStrings.get(key);\n strings.set(key, promoted);\n return promoted;\n }\n const out = fn(...args);\n strings.set(key, out);\n if (strings.size > MAX_ENTRIES) {\n priorStrings = strings;\n strings = /* @__PURE__ */ new Map();\n }\n return out;\n };\n return get;\n};\n//#endregion\n//#region src/merge-props.ts\nconst MERGE_OMIT = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\"\n]);\nfunction mergeProps(...sources) {\n return sources.reduce((prev, obj) => {\n if (!obj) return prev;\n Object.keys(obj).forEach((key) => {\n if (MERGE_OMIT.has(key)) return;\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) prev[key] = mergeProps(prevValue, value);\n else prev[key] = value;\n });\n return prev;\n }, {});\n}\n//#endregion\n//#region src/walk-object.ts\nconst isNotNullish = (element) => element != null;\nfunction walkObject(target, predicate, options = {}) {\n const { stop, getKey } = options;\n function inner(value, path = []) {\n if (isObjectOrArray(value)) {\n const result = {};\n for (const [prop, child] of Object.entries(value)) {\n const key = getKey?.(prop, child) ?? prop;\n const childPath = [...path, key];\n if (stop?.(value, childPath)) return predicate(value, path);\n const next = inner(child, childPath);\n if (isNotNullish(next)) result[key] = next;\n }\n return result;\n }\n return predicate(value, path);\n }\n return inner(target);\n}\nfunction mapObject(obj, fn) {\n if (Array.isArray(obj)) return obj.map((value) => fn(value));\n if (!isObject(obj)) return fn(obj);\n return walkObject(obj, (value) => fn(value));\n}\n//#endregion\n//#region src/normalize-style-object.ts\n/**\n* Whether walking the object would only rebuild it.\n*\n* Normalizing does two things: it renames a shorthand to its longhand and drops nullish\n* leaves. A flat object of plain values written in longhand needs neither, and that is most\n* of what `css()` is handed — but it still paid for a full rebuild plus a path array per key.\n*\n* Every clause has to be exact, since a false positive returns an object the walk would have\n* changed. Nullish is one of them: a leaf the walk removes must not survive, or a later merge\n* would see it override the value beneath it. The array check is another, and it is on the\n* container as well as the values — `stop` is handed the container, so an array arriving at\n* the top level has to reach the walk to be rejected rather than being returned as it came.\n*\n* `for...in` reads inherited keys the walk ignores, which is safe in the only direction it can\n* be wrong — an extra key can send this to the slow path, never past it.\n*\n* It does read every value, as `compactStyles` and the argument memo already do, so an\n* accessor prop is read once more than before. Style props are values by the time they get\n* here and reading one has no effect, but it is the reason this cannot be reordered to read\n* lazily.\n*/\nfunction needsNoNormalizing(styles, resolveShorthand) {\n if (Array.isArray(styles)) return false;\n for (const key in styles) {\n const value = styles[key];\n if (value == null || typeof value === \"object\") return false;\n if (resolveShorthand !== void 0 && resolveShorthand(key) !== key) return false;\n }\n return true;\n}\n/**\n* The result may be the argument itself rather than a fresh object, so callers have to treat\n* it as read-only. Every one of them does today: merging accumulates into its own object and\n* the two `raw()` helpers clone at the boundary.\n*\n* An array is not a style value. It used to be read as one value per breakpoint, which meant\n* a font stack written the way CSS writes one — `['Inter', 'sans-serif']` — silently became\n* `Inter` at base and `sans-serif` at `sm`. The type no longer admits an array, so reaching\n* this throw takes a cast or untyped javascript; it says which property, since the walk knows\n* the path and the caller usually does not.\n*/\nfunction normalizeStyleObject(styles, context, shorthand = true) {\n const { utility } = context;\n const { hasShorthand, resolveShorthand } = utility;\n if (needsNoNormalizing(styles, shorthand && hasShorthand ? resolveShorthand : void 0)) return styles;\n return walkObject(styles, (value, path) => {\n if (Array.isArray(value)) throw new BambooError(\"INVALID_STYLE_VALUE\", `An array is not a style value${path.length ? `: \"${path.join(\".\")}\"` : \"\"}.`, { hint: \"Write a responsive value as a condition object, e.g. { base: \\\"medium\\\", lg: \\\"bold\\\" }.\" });\n return value;\n }, {\n stop: (value) => Array.isArray(value),\n getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0\n });\n}\n//#endregion\n//#region src/classname.ts\n/**\n* Whether a style object carries anything `compact` would have kept.\n*\n* The question `compactStyles` asks is only ever \"is this empty once undefined values are\n* dropped\", but it used to answer it by building the compacted object and then a key array\n* for it, then throwing both away. `Object.keys` enumerates exactly what `compact`'s\n* `Object.entries` did — own, enumerable, string-keyed — so this is the same predicate\n* without the two allocations, and it stops at the first value that settles it.\n*/\nfunction hasDefinedValue(style) {\n const keys = Object.keys(style);\n for (let i = 0; i < keys.length; i++) if (style[keys[i]] !== void 0) return true;\n return false;\n}\n/**\n* An array is not a style argument.\n*\n* `css([a, b])` used to mean `css(a, b)`, flattened here one level. Two spellings of one\n* call is the redundancy; the array one also cost a `flat()` allocation on every merge to\n* serve a shape almost nothing wrote, and read as a responsive array everywhere that had\n* not been taught to flatten it first.\n*\n* It throws rather than being filtered out as a non-object, which is what dropping the\n* `flat()` alone would have done — silently returning no class at all.\n*/\nfunction compactStyles(...styles) {\n return styles.filter((style) => {\n if (Array.isArray(style)) throw new BambooError(\"INVALID_STYLE_ARGUMENT\", \"An array is not a style argument.\", { hint: \"Spread it instead, e.g. css(...styles) rather than css(styles).\" });\n return isObject(style) && hasDefinedValue(style);\n });\n}\nfunction createMergeCss(context) {\n function resolve(styles) {\n const allStyles = compactStyles(...styles);\n if (allStyles.length === 1) return allStyles;\n return allStyles.map((style) => normalizeStyleObject(style, context));\n }\n function mergeCss(...styles) {\n return mergeProps(...resolve(styles));\n }\n return {\n mergeCss: memo(mergeCss),\n mergeCssUncached: mergeCss\n };\n}\n//#endregion\n//#region src/clone-styles.ts\nconst OMIT = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\"\n]);\n/**\n* Independent copy of a style object, nested condition blocks included.\n*\n* Merged style objects are cached, so anything handed to user code has to be\n* copied first: a caller mutating what it received would otherwise change what\n* every later caller reads back. `css.raw()` and `cva.raw()` are those boundaries.\n*\n* Kept separate from `mergeProps` deliberately. Merging is on the hot path — it\n* runs on every `css()` cache miss and on every render of a pattern component\n* under `jsxStyleProps: 'minimal'` — and copying there charges every caller for a\n* guarantee only the two `raw()` helpers need. Measured on a realistic style\n* object (5 base properties, 4 condition blocks) that was roughly twice the cost\n* of merging alone.\n*/\nfunction cloneStyles(styles) {\n if (Array.isArray(styles)) return styles.map((value) => cloneStyles(value));\n if (!isObject(styles)) return styles;\n const out = {};\n for (const key of Object.keys(styles)) {\n if (OMIT.has(key)) continue;\n out[key] = cloneStyles(styles[key]);\n }\n return out;\n}\n//#endregion\n//#region src/compact.ts\nfunction compact(value) {\n return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value]) => value !== void 0));\n}\n//#endregion\n//#region src/is-css-function.ts\nconst fnRegExp = new RegExp(`^(${[\n \"min\",\n \"max\",\n \"clamp\",\n \"calc\"\n].join(\"|\")})\\\\(.*\\\\)`);\nconst isCssFunction = (v) => typeof v === \"string\" && fnRegExp.test(v);\n//#endregion\n//#region src/is-css-unit.ts\nconst lengthUnitsPattern = `(?:${\"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%\".split(\",\").join(\"|\")})`;\nconst lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nconst isCssUnit = (v) => typeof v === \"string\" && lengthRegExp.test(v);\n//#endregion\n//#region src/is-css-var.ts\nconst isCssVar = (v) => typeof v === \"string\" && /^var\\(--.+\\)$/.test(v);\n//#endregion\n//#region src/pattern-fns.ts\nconst createPatternFns = (token) => ({\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit,\n token\n});\nconst getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues) return styles;\n const defaults = typeof pattern.defaultValues === \"function\" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n//#endregion\n//#region src/split-props.ts\n/**\n* Move one key into a bucket, keeping whatever about it is observable.\n*\n* Shared by both paths below so there is one implementation of the descriptor rules rather\n* than two to keep in step. The rules themselves are documented on `splitProps`.\n*/\nconst copyKey = (props, target, key) => {\n const descriptor = Object.getOwnPropertyDescriptor(props, key);\n if (!descriptor) return false;\n if (\"get\" in descriptor || \"set\" in descriptor || !descriptor.enumerable || key === \"__proto__\") Object.defineProperty(target, key, descriptor);\n else target[key] = descriptor.value;\n return true;\n};\n/**\n* One array group, which is what every call site in this project passes — a recipe's\n* `variantKeys`.\n*\n* The general path below is built for several groups that may be predicates, and pays for\n* that shape on every call: a closure per group, a `map` and a `concat` to assemble the\n* result, and a branch per group to tell an array from a predicate. None of it is reachable\n* with one array group.\n*\n* What it does *not* skip is the part that looks skippable. `own` stays, because membership\n* has to be answered from `ownKeys` rather than by asking the object: on a proxy — which is\n* what Solid's `mergeProps` hands over — every question is a trap, and a recipe naming eight\n* variants would otherwise fire eight traps to learn what one `ownKeys` already said. And\n* the two passes stay separate, because the group bucket is in *group* order while the rest\n* bucket is in *props* order, and that ordering reaches the emitted CSS.\n*/\nconst splitOneGroup = (props, allKeys, group) => {\n const own = new Set(allKeys);\n const taken = /* @__PURE__ */ new Set();\n const picked = {};\n for (let i = 0; i < group.length; i++) {\n const key = group[i];\n if (taken.has(key) || !own.has(key)) continue;\n if (copyKey(props, picked, key)) taken.add(key);\n }\n const rest = {};\n for (let i = 0; i < allKeys.length; i++) {\n const key = allKeys[i];\n if (taken.has(key)) continue;\n copyKey(props, rest, key);\n }\n return [picked, rest];\n};\n/**\n* Deal a props object into one bucket per key group, plus a final bucket for the rest.\n* A key goes to the first group that claims it.\n*\n* ## Why the descriptor is read per key rather than in bulk\n*\n* This used to call `Object.getOwnPropertyDescriptors` for the whole object and\n* `defineProperty` for every key it moved. Copying plain values instead is 2.4–2.9x faster\n* on the shapes that allow it, but it is only correct where props are data — and they are\n* not always. Solid compiles props to accessors, so reading one eagerly runs whatever it\n* wraps: splitting a component's props would construct its children before the surrounding\n* provider exists.\n*\n* So the descriptor is fetched per key, and the value path is taken only when it changes\n* nothing observable. An accessor keeps its laziness, a non-enumerable key keeps its\n* invisibility, and `__proto__` is defined rather than assigned so it stays an own\n* property instead of reaching the prototype setter.\n*\n* The one thing the value path drops is `writable`/`configurable`, so a bucket key taken\n* from frozen props is writable where it used to be frozen. Nothing here relies on that,\n* and preserving it would mean `defineProperty` on the common path — the cost this exists\n* to avoid. Keys that take the descriptor path keep theirs, so a bucket can be\n* inconsistent in that one respect.\n*\n* Key order within a bucket is preserved exactly. It is not cosmetic: `cva` merges\n* variant props in iteration order, and the parser reads the rest bucket as the style\n* props it encodes, so order reaches the emitted CSS.\n*/\nfunction splitProps(props, ...keys) {\n const allKeys = Object.getOwnPropertyNames(props);\n if (keys.length === 1 && Array.isArray(keys[0])) return splitOneGroup(props, allKeys, keys[0]);\n const own = new Set(allKeys);\n const taken = /* @__PURE__ */ new Set();\n const split = (group) => {\n const clone = {};\n for (let i = 0; i < group.length; i++) {\n const key = group[i];\n if (taken.has(key) || !own.has(key)) continue;\n if (copyKey(props, clone, key)) taken.add(key);\n }\n return clone;\n };\n /**\n * The predicate is called with the key alone.\n *\n * Handing it to `filter` passes `(key, index, allKeys)`. A one-parameter predicate cannot\n * see the extras, but a memoized one reads its whole argument list — and the predicates\n * that arrive here are memoized, `isCssProperty` among them. So the memo hashed the entire\n * key array once per prop, and keyed its cache on it: two elements with different prop sets\n * shared no entry even for the same prop name.\n *\n * Worth ~9.7x on that path, and nothing at all on a plain predicate — which is why the\n * bench below it needs a memoized case to see this at all.\n *\n * A loop rather than `filter((k) => key(k))` because the wrapper allocates a closure per\n * group. The two measure the same to within noise; the loop just does not need one.\n */\n const matching = (predicate) => {\n const group = [];\n for (let i = 0; i < allKeys.length; i++) {\n const key = allKeys[i];\n if (predicate(key)) group.push(key);\n }\n return group;\n };\n return keys.map((key) => split(Array.isArray(key) ? key : matching(key))).concat(split(allKeys));\n}\n//#endregion\nexport { cloneStyles, createMergeCss, createPatternFns, getPatternStyles, splitProps };\n";
|
|
377
|
+
var content$7 = "//#region src/assert.ts\nfunction isObject(value) {\n return typeof value === \"object\" && value != null && !Array.isArray(value);\n}\nconst isObjectOrArray = (obj) => typeof obj === \"object\" && obj !== null;\n//#endregion\n//#region src/error.ts\nvar BambooError = class extends Error {\n code;\n hint;\n constructor(code, message, opts) {\n super(message, { cause: opts?.cause });\n this.code = `ERR_BAMBOO_${code}`;\n this.hint = opts?.hint;\n }\n};\n//#endregion\n//#region src/memo.ts\n/**\n* Bounded argument memo used by the generated runtime (`css`, patterns, `cva`, recipes).\n*\n* Two regimes, picked per call:\n*\n* - Arguments that are flat (objects of primitives) take a cheap structural hash\n* and are confirmed with an exact comparison, so a hash collision can never\n* serve the wrong result. This is the shape `css({ ... })` has.\n* - Anything nested falls back to `JSON.stringify`, which V8 does faster than a\n* JS walk.\n*\n* The second point is the counter-intuitive one, and it has been measured rather\n* than assumed. Extending the structural hash to recurse — so nested styles could\n* take the fast path too — is *slower*, because it trades one native serialization\n* for two JS walks (hash, then the deep equality that confirms it). Over 10k\n* iterations per shape:\n*\n* shape stringify recursive hash + deep equal\n* flat 1.06ms 2.09ms\n* _hover 1.00ms 2.16ms\n* responsive 1.23ms 2.15ms\n* realistic 2.32ms 5.84ms\n* nested 3 deep 1.22ms 2.35ms\n*\n* So a nested `css()` call costing several times a flat one is not a defect here.\n* It is the floor for a value-keyed memo in JS, and the way to avoid it is to not\n* make the call — see the build-time fold in `@bamboocss/vite`.\n*\n* Both regimes key on *values*, never on object identity: mutating a style object\n* between calls changes its hash, so the next call misses and recomputes rather\n* than serving a stale class. Keying nested arguments on the identity of the inner\n* objects would skip serialization entirely, but it cannot detect a mutation, and\n* \"same object, different contents\" is exactly what a style object built per render\n* looks like.\n*\n* Both caches are bounded. An unbounded memo is a leak in any long-lived process\n* (SSR), where the set of distinct style objects grows without limit.\n*/\n/**\n* Distinct hashes held per memoized function before the cache rotates.\n*\n* This bounds *buckets*, not entries: a bucket keeps up to `MAX_BUCKET` colliding\n* argument lists, so the ceiling is `MAX_ENTRIES * MAX_BUCKET` live entries, and\n* twice that across both generations, since the previous one is retained until the\n* next rotation. Collisions are rare in practice, so the realistic figure is close\n* to `MAX_ENTRIES` — but the worst case is what matters when sizing a long-lived\n* process, so state it plainly.\n*\n* Rotation beats evicting the oldest key: single-key eviction is worst-case for a\n* working set that cycles, because it drops exactly the entry about to be needed.\n* Measured on a cycling set of 20k styles, one-at-a-time eviction cost ~719ns/op\n* against ~189ns unbounded, while rotation holds ~274ns. On realistic skewed\n* access rotation is at or below the unbounded cost.\n*/\nconst MAX_ENTRIES = 1e3;\n/** Entries kept per hash bucket, to bound the cost of a collision scan. */\nconst MAX_BUCKET = 8;\n/**\n* DJB2 over the arguments' own keys and primitive values.\n* Returns `null` for anything nested, which routes the call to the string key.\n*/\nconst flatHashOrNull = (args) => {\n let h = 5381;\n for (let a = 0; a < args.length; a++) {\n const obj = args[a];\n if (obj === null || typeof obj !== \"object\") {\n const t = typeof obj;\n if (t === \"string\") for (let i = 0; i < obj.length; i++) h = h * 33 ^ obj.charCodeAt(i);\n else if (t === \"number\") h = h * 33 ^ (obj | 0);\n else if (t === \"boolean\") h = h * 33 ^ (obj ? 991 : 997);\n else h = h * 33 ^ 3;\n continue;\n }\n if (Array.isArray(obj)) return null;\n const proto = Object.getPrototypeOf(obj);\n if (proto !== Object.prototype && proto !== null) return null;\n for (const k in obj) {\n const v = obj[k];\n const tv = typeof v;\n if (v !== null && tv === \"object\") return null;\n for (let i = 0; i < k.length; i++) h = h * 33 ^ k.charCodeAt(i);\n if (tv === \"string\") for (let i = 0; i < v.length; i++) h = h * 33 ^ v.charCodeAt(i);\n else if (tv === \"number\") h = h * 33 ^ (v | 0);\n else if (tv === \"boolean\") h = h * 33 ^ (v ? 991 : 997);\n else h = h * 33 ^ 2;\n }\n }\n return h >>> 0;\n};\n/**\n* Value snapshot of the arguments, taken once at insert.\n*\n* The cache must not hold the caller's objects: a style object can capture a much\n* larger graph, and keeping it alive until the cache rotates changes GC behaviour\n* for code that never asked to be cached. Only the flat path reaches here, so a\n* shallow copy contains primitives only and retains nothing.\n*\n* Comparing against a copy also removes the last way a mutation could be missed.\n* Were the caller's own object stored, `oa === ob` would short-circuit the value\n* comparison, and a mutation that happened to preserve the hash would return the\n* stale entry. Against a copy that check can only ever be true for equal\n* primitives.\n*/\nconst snapshotArgs = (args) => {\n const values = [];\n const counts = [];\n for (let i = 0; i < args.length; i++) {\n const o = args[i];\n if (o !== null && typeof o === \"object\") {\n const copy = Array.isArray(o) ? [] : {};\n let n = 0;\n for (const k in o) {\n copy[k] = o[k];\n n++;\n }\n values.push(copy);\n counts.push(n);\n } else {\n values.push(o);\n counts.push(0);\n }\n }\n return {\n values,\n counts\n };\n};\n/**\n* Exact match, so a `flatHashOrNull` collision is resolved rather than trusted.\n* `bCounts` is the cached side's key count; comparing against it avoids the\n* `Object.keys()` allocation this would otherwise make on every cache hit.\n*/\nconst flatArgsEqual = (a, b, bCounts) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n const oa = a[i];\n const ob = b[i];\n if (oa === ob) continue;\n if (oa === null || ob === null || typeof oa !== \"object\" || typeof ob !== \"object\") return false;\n if (Array.isArray(oa) !== Array.isArray(ob)) return false;\n let n = 0;\n for (const k in oa) {\n if (oa[k] !== ob[k]) return false;\n n++;\n }\n if (n !== bCounts[i]) return false;\n }\n return true;\n};\nconst memo = (fn) => {\n let buckets = /* @__PURE__ */ new Map();\n let priorBuckets = /* @__PURE__ */ new Map();\n let strings = /* @__PURE__ */ new Map();\n let priorStrings = /* @__PURE__ */ new Map();\n /**\n * One scalar argument, keyed directly.\n *\n * This is the shape of the hottest callers — `isCssProperty(prop)` runs per prop\n * per render — and a plain map lookup beats hashing, bucket scanning and\n * snapshotting for it. Distinct types stay distinct keys, so `1` and `'1'` do not\n * share an entry.\n */\n let scalars = /* @__PURE__ */ new Map();\n let priorScalars = /* @__PURE__ */ new Map();\n const scan = (bucket, args) => {\n if (bucket) for (let i = 0; i < bucket.length; i++) {\n const entry = bucket[i];\n if (flatArgsEqual(args, entry.values, entry.counts)) return entry;\n }\n };\n const get = (...args) => {\n if (args.length === 1) {\n const only = args[0];\n if (only === null || typeof only !== \"object\") {\n if (scalars.has(only)) return scalars.get(only);\n if (priorScalars.has(only)) {\n const promoted = priorScalars.get(only);\n scalars.set(only, promoted);\n return promoted;\n }\n const out = fn(only);\n scalars.set(only, out);\n if (scalars.size > MAX_ENTRIES) {\n priorScalars = scalars;\n scalars = /* @__PURE__ */ new Map();\n }\n return out;\n }\n }\n const hash = flatHashOrNull(args);\n if (hash !== null) {\n let bucket = buckets.get(hash);\n const hit = scan(bucket, args);\n if (hit) return hit.out;\n const priorHit = scan(priorBuckets.get(hash), args);\n if (priorHit) {\n if (!bucket) {\n bucket = [];\n buckets.set(hash, bucket);\n }\n bucket.push(priorHit);\n if (bucket.length > MAX_BUCKET) bucket.shift();\n return priorHit.out;\n }\n const snap = snapshotArgs(args);\n const out = fn(...args);\n if (!bucket) {\n bucket = [];\n buckets.set(hash, bucket);\n }\n bucket.push({\n values: snap.values,\n counts: snap.counts,\n out\n });\n if (bucket.length > MAX_BUCKET) bucket.shift();\n if (buckets.size > MAX_ENTRIES) {\n priorBuckets = buckets;\n buckets = /* @__PURE__ */ new Map();\n }\n return out;\n }\n const key = JSON.stringify(args);\n if (strings.has(key)) return strings.get(key);\n if (priorStrings.has(key)) {\n const promoted = priorStrings.get(key);\n strings.set(key, promoted);\n return promoted;\n }\n const out = fn(...args);\n strings.set(key, out);\n if (strings.size > MAX_ENTRIES) {\n priorStrings = strings;\n strings = /* @__PURE__ */ new Map();\n }\n return out;\n };\n return get;\n};\n//#endregion\n//#region src/merge-props.ts\nconst MERGE_OMIT = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\"\n]);\nfunction mergeProps(...sources) {\n return sources.reduce((prev, obj) => {\n if (!obj) return prev;\n Object.keys(obj).forEach((key) => {\n if (MERGE_OMIT.has(key)) return;\n const prevValue = prev[key];\n const value = obj[key];\n if (isObject(prevValue) && isObject(value)) prev[key] = mergeProps(prevValue, value);\n else prev[key] = value;\n });\n return prev;\n }, {});\n}\n//#endregion\n//#region src/walk-object.ts\nconst isNotNullish = (element) => element != null;\nfunction walkObject(target, predicate, options = {}) {\n const { stop, getKey, merge } = options;\n function inner(value, path = []) {\n if (isObjectOrArray(value)) {\n const result = {};\n for (const [prop, child] of Object.entries(value)) {\n const key = getKey?.(prop, child) ?? prop;\n const childPath = [...path, key];\n if (stop?.(value, childPath)) return predicate(value, path);\n const next = inner(child, childPath);\n if (isNotNullish(next)) result[key] = merge && Object.prototype.hasOwnProperty.call(result, key) ? merge(result[key], next) : next;\n }\n return result;\n }\n return predicate(value, path);\n }\n return inner(target);\n}\nfunction mapObject(obj, fn) {\n if (Array.isArray(obj)) return obj.map((value) => fn(value));\n if (!isObject(obj)) return fn(obj);\n return walkObject(obj, (value) => fn(value));\n}\n//#endregion\n//#region src/normalize-style-object.ts\n/**\n* Whether walking the object would only rebuild it.\n*\n* Normalizing does two things: it renames a shorthand to its longhand and drops nullish\n* leaves. A flat object of plain values written in longhand needs neither, and that is most\n* of what `css()` is handed — but it still paid for a full rebuild plus a path array per key.\n*\n* Every clause has to be exact, since a false positive returns an object the walk would have\n* changed. Nullish is one of them: a leaf the walk removes must not survive, or a later merge\n* would see it override the value beneath it. The array check is another, and it is on the\n* container as well as the values — `stop` is handed the container, so an array arriving at\n* the top level has to reach the walk to be rejected rather than being returned as it came.\n*\n* `for...in` reads inherited keys the walk ignores, which is safe in the only direction it can\n* be wrong — an extra key can send this to the slow path, never past it.\n*\n* It does read every value, as `compactStyles` and the argument memo already do, so an\n* accessor prop is read once more than before. Style props are values by the time they get\n* here and reading one has no effect, but it is the reason this cannot be reordered to read\n* lazily.\n*/\nfunction needsNoNormalizing(styles, resolveShorthand) {\n if (Array.isArray(styles)) return false;\n for (const key in styles) {\n const value = styles[key];\n if (value == null || typeof value === \"object\") return false;\n if (resolveShorthand !== void 0 && resolveShorthand(key) !== key) return false;\n }\n return true;\n}\n/**\n* The result may be the argument itself rather than a fresh object, so callers have to treat\n* it as read-only. Every one of them does today: merging accumulates into its own object and\n* the two `raw()` helpers clone at the boundary.\n*\n* An array is not a style value. It used to be read as one value per breakpoint, which meant\n* a font stack written the way CSS writes one — `['Inter', 'sans-serif']` — silently became\n* `Inter` at base and `sans-serif` at `sm`. The type no longer admits an array, so reaching\n* this throw takes a cast or untyped javascript; it says which property, since the walk knows\n* the path and the caller usually does not.\n*/\nfunction normalizeStyleObject(styles, context, shorthand = true) {\n const { utility } = context;\n const { hasShorthand, resolveShorthand, mergeDeclarationValue } = utility;\n if (needsNoNormalizing(styles, shorthand && hasShorthand ? resolveShorthand : void 0)) return styles;\n return walkObject(styles, (value, path) => {\n if (Array.isArray(value)) throw new BambooError(\"INVALID_STYLE_VALUE\", `An array is not a style value${path.length ? `: \"${path.join(\".\")}\"` : \"\"}.`, { hint: \"Write a responsive value as a condition object, e.g. { base: \\\"medium\\\", lg: \\\"bold\\\" }.\" });\n return value;\n }, {\n stop: (value) => Array.isArray(value),\n getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0,\n merge: shorthand && hasShorthand ? mergeDeclarationValue : void 0\n });\n}\n//#endregion\n//#region src/classname.ts\n/**\n* Whether a style object carries anything `compact` would have kept.\n*\n* The question `compactStyles` asks is only ever \"is this empty once undefined values are\n* dropped\", but it used to answer it by building the compacted object and then a key array\n* for it, then throwing both away. `Object.keys` enumerates exactly what `compact`'s\n* `Object.entries` did — own, enumerable, string-keyed — so this is the same predicate\n* without the two allocations, and it stops at the first value that settles it.\n*/\nfunction hasDefinedValue(style) {\n const keys = Object.keys(style);\n for (let i = 0; i < keys.length; i++) if (style[keys[i]] !== void 0) return true;\n return false;\n}\n/**\n* An array is not a style argument.\n*\n* `css([a, b])` used to mean `css(a, b)`, flattened here one level. Two spellings of one\n* call is the redundancy; the array one also cost a `flat()` allocation on every merge to\n* serve a shape almost nothing wrote, and read as a responsive array everywhere that had\n* not been taught to flatten it first.\n*\n* It throws rather than being filtered out as a non-object, which is what dropping the\n* `flat()` alone would have done — silently returning no class at all.\n*/\nfunction compactStyles(...styles) {\n return styles.filter((style) => {\n if (Array.isArray(style)) throw new BambooError(\"INVALID_STYLE_ARGUMENT\", \"An array is not a style argument.\", { hint: \"Spread it instead, e.g. css(...styles) rather than css(styles).\" });\n return isObject(style) && hasDefinedValue(style);\n });\n}\nfunction createMergeCss(context) {\n function resolve(styles) {\n const allStyles = compactStyles(...styles);\n if (allStyles.length === 1) return allStyles;\n return allStyles.map((style) => normalizeStyleObject(style, context));\n }\n function mergeCss(...styles) {\n return mergeProps(...resolve(styles));\n }\n return {\n mergeCss: memo(mergeCss),\n mergeCssUncached: mergeCss\n };\n}\n//#endregion\n//#region src/clone-styles.ts\nconst OMIT = new Set([\n \"__proto__\",\n \"constructor\",\n \"prototype\"\n]);\n/**\n* Independent copy of a style object, nested condition blocks included.\n*\n* Merged style objects are cached, so anything handed to user code has to be\n* copied first: a caller mutating what it received would otherwise change what\n* every later caller reads back. `css.raw()` and `cva.raw()` are those boundaries.\n*\n* Kept separate from `mergeProps` deliberately. Merging is on the hot path — it\n* runs on every `css()` cache miss and on every render of a pattern component\n* under `jsxStyleProps: 'minimal'` — and copying there charges every caller for a\n* guarantee only the two `raw()` helpers need. Measured on a realistic style\n* object (5 base properties, 4 condition blocks) that was roughly twice the cost\n* of merging alone.\n*/\nfunction cloneStyles(styles) {\n if (Array.isArray(styles)) return styles.map((value) => cloneStyles(value));\n if (!isObject(styles)) return styles;\n const out = {};\n for (const key of Object.keys(styles)) {\n if (OMIT.has(key)) continue;\n out[key] = cloneStyles(styles[key]);\n }\n return out;\n}\n//#endregion\n//#region src/compact.ts\nfunction compact(value) {\n return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value]) => value !== void 0));\n}\n//#endregion\n//#region src/is-css-function.ts\nconst fnRegExp = new RegExp(`^(${[\n \"min\",\n \"max\",\n \"clamp\",\n \"calc\"\n].join(\"|\")})\\\\(.*\\\\)`);\nconst isCssFunction = (v) => typeof v === \"string\" && fnRegExp.test(v);\n//#endregion\n//#region src/is-css-unit.ts\nconst lengthUnitsPattern = `(?:${\"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%\".split(\",\").join(\"|\")})`;\nconst lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);\nconst isCssUnit = (v) => typeof v === \"string\" && lengthRegExp.test(v);\n//#endregion\n//#region src/is-css-var.ts\nconst isCssVar = (v) => typeof v === \"string\" && /^var\\(--.+\\)$/.test(v);\n//#endregion\n//#region src/pattern-fns.ts\nconst createPatternFns = (token) => ({\n map: mapObject,\n isCssFunction,\n isCssVar,\n isCssUnit,\n token\n});\nconst getPatternStyles = (pattern, styles) => {\n if (!pattern?.defaultValues) return styles;\n const defaults = typeof pattern.defaultValues === \"function\" ? pattern.defaultValues(styles) : pattern.defaultValues;\n return Object.assign({}, defaults, compact(styles));\n};\n//#endregion\n//#region src/split-props.ts\n/**\n* Move one key into a bucket, keeping whatever about it is observable.\n*\n* Shared by both paths below so there is one implementation of the descriptor rules rather\n* than two to keep in step. The rules themselves are documented on `splitProps`.\n*/\nconst copyKey = (props, target, key) => {\n const descriptor = Object.getOwnPropertyDescriptor(props, key);\n if (!descriptor) return false;\n if (\"get\" in descriptor || \"set\" in descriptor || !descriptor.enumerable || key === \"__proto__\") Object.defineProperty(target, key, descriptor);\n else target[key] = descriptor.value;\n return true;\n};\n/**\n* One array group, which is what every call site in this project passes — a recipe's\n* `variantKeys`.\n*\n* The general path below is built for several groups that may be predicates, and pays for\n* that shape on every call: a closure per group, a `map` and a `concat` to assemble the\n* result, and a branch per group to tell an array from a predicate. None of it is reachable\n* with one array group.\n*\n* What it does *not* skip is the part that looks skippable. `own` stays, because membership\n* has to be answered from `ownKeys` rather than by asking the object: on a proxy — which is\n* what Solid's `mergeProps` hands over — every question is a trap, and a recipe naming eight\n* variants would otherwise fire eight traps to learn what one `ownKeys` already said. And\n* the two passes stay separate, because the group bucket is in *group* order while the rest\n* bucket is in *props* order, and that ordering reaches the emitted CSS.\n*/\nconst splitOneGroup = (props, allKeys, group) => {\n const own = new Set(allKeys);\n const taken = /* @__PURE__ */ new Set();\n const picked = {};\n for (let i = 0; i < group.length; i++) {\n const key = group[i];\n if (taken.has(key) || !own.has(key)) continue;\n if (copyKey(props, picked, key)) taken.add(key);\n }\n const rest = {};\n for (let i = 0; i < allKeys.length; i++) {\n const key = allKeys[i];\n if (taken.has(key)) continue;\n copyKey(props, rest, key);\n }\n return [picked, rest];\n};\n/**\n* Deal a props object into one bucket per key group, plus a final bucket for the rest.\n* A key goes to the first group that claims it.\n*\n* ## Why the descriptor is read per key rather than in bulk\n*\n* This used to call `Object.getOwnPropertyDescriptors` for the whole object and\n* `defineProperty` for every key it moved. Copying plain values instead is 2.4–2.9x faster\n* on the shapes that allow it, but it is only correct where props are data — and they are\n* not always. Solid compiles props to accessors, so reading one eagerly runs whatever it\n* wraps: splitting a component's props would construct its children before the surrounding\n* provider exists.\n*\n* So the descriptor is fetched per key, and the value path is taken only when it changes\n* nothing observable. An accessor keeps its laziness, a non-enumerable key keeps its\n* invisibility, and `__proto__` is defined rather than assigned so it stays an own\n* property instead of reaching the prototype setter.\n*\n* The one thing the value path drops is `writable`/`configurable`, so a bucket key taken\n* from frozen props is writable where it used to be frozen. Nothing here relies on that,\n* and preserving it would mean `defineProperty` on the common path — the cost this exists\n* to avoid. Keys that take the descriptor path keep theirs, so a bucket can be\n* inconsistent in that one respect.\n*\n* Key order within a bucket is preserved exactly. It is not cosmetic: `cva` merges\n* variant props in iteration order, and the parser reads the rest bucket as the style\n* props it encodes, so order reaches the emitted CSS.\n*/\nfunction splitProps(props, ...keys) {\n const allKeys = Object.getOwnPropertyNames(props);\n if (keys.length === 1 && Array.isArray(keys[0])) return splitOneGroup(props, allKeys, keys[0]);\n const own = new Set(allKeys);\n const taken = /* @__PURE__ */ new Set();\n const split = (group) => {\n const clone = {};\n for (let i = 0; i < group.length; i++) {\n const key = group[i];\n if (taken.has(key) || !own.has(key)) continue;\n if (copyKey(props, clone, key)) taken.add(key);\n }\n return clone;\n };\n /**\n * The predicate is called with the key alone.\n *\n * Handing it to `filter` passes `(key, index, allKeys)`. A one-parameter predicate cannot\n * see the extras, but a memoized one reads its whole argument list — and the predicates\n * that arrive here are memoized, `isCssProperty` among them. So the memo hashed the entire\n * key array once per prop, and keyed its cache on it: two elements with different prop sets\n * shared no entry even for the same prop name.\n *\n * Worth ~9.7x on that path, and nothing at all on a plain predicate — which is why the\n * bench below it needs a memoized case to see this at all.\n *\n * A loop rather than `filter((k) => key(k))` because the wrapper allocates a closure per\n * group. The two measure the same to within noise; the loop just does not need one.\n */\n const matching = (predicate) => {\n const group = [];\n for (let i = 0; i < allKeys.length; i++) {\n const key = allKeys[i];\n if (predicate(key)) group.push(key);\n }\n return group;\n };\n return keys.map((key) => split(Array.isArray(key) ? key : matching(key))).concat(split(allKeys));\n}\n//#endregion\nexport { cloneStyles, createMergeCss, createPatternFns, getPatternStyles, splitProps };\n";
|
|
378
378
|
//#endregion
|
|
379
379
|
//#region src/artifacts/js/helpers.ts
|
|
380
380
|
function generateHelpers() {
|
|
@@ -1547,7 +1547,7 @@ var comments = {
|
|
|
1547
1547
|
var content$4 = "import type { CssProperty, SystemStyleObject } from './system-types'\nimport type { TokenCategory } from '../tokens'\n\ntype Primitive = string | number | boolean | null | undefined\ntype LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)\n\nexport type PatternProperty =\n | { type: 'property'; value: CssProperty; description?: string }\n | { type: 'enum'; value: string[]; description?: string }\n | { type: 'token'; value: TokenCategory; property?: CssProperty; description?: string }\n | { type: 'string' | 'boolean' | 'number'; description?: string }\n\nexport interface PatternHelpers {\n map: (value: any, fn: (value: string) => string | undefined) => any\n /**\n * The css variable reference for a token path, or `fallback` when the path names no token.\n *\n * `token('spacing.4', '4')` is `var(--spacing-4)` where that token exists and `'4'` where it\n * does not — so a pattern can accept either a token name or a raw css value without knowing\n * the theme.\n */\n token: (path: string, fallback?: string) => string | undefined\n isCssUnit: (value: any) => boolean\n isCssVar: (value: any) => boolean\n isCssFunction: (value: any) => boolean\n}\n\nexport interface PatternProperties {\n [key: string]: PatternProperty\n}\n\ntype InferProps<T> = Record<LiteralUnion<keyof T>, any>\n\nexport type PatternDefaultValue<T> = Partial<InferProps<T>>\n\nexport type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>\n\nexport interface PatternConfig<T extends PatternProperties = PatternProperties> {\n /**\n * The description of the pattern. This will be used in the JSDoc comment.\n */\n description?: string\n /**\n * The properties of the pattern.\n */\n properties?: T\n /**\n * The default values of the pattern.\n */\n defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>\n /**\n * The css object this pattern will generate.\n */\n transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject\n /**\n * Whether the pattern is deprecated.\n */\n deprecated?: boolean | string\n /**\n * Which css properties this pattern accepts alongside its own `properties`.\n *\n * - `all` accepts any css property.\n * - `none` accepts only the pattern's declared `properties`.\n * - `{ except }` accepts any css property but the ones listed.\n *\n * One option because these were two — `strict: true` for \"none\" and an `@experimental`\n * `blocklist` for \"all but these\" — and the pair had an unrepresentable combination that\n * silently did nothing: the blocklist is applied only to the type that lists css\n * properties, which `strict: true` does not emit, so setting both dropped the blocklist.\n *\n * Types only. Nothing strips a blocked property at runtime — one passed anyway reaches\n * `transform` and emits css.\n *\n * @default 'all'\n */\n cssProps?: 'all' | 'none' | { except: LiteralUnion<CssProperty>[] }\n}\n";
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region src/artifacts/generated/recipe.d.ts.json
|
|
1550
|
-
var content$3 = "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\n/**\n * What a compiled build lets you do with a recipe: call it, or split its variant props.\n *\n * Nothing else is declared, because nothing else compiles. The compiler rewrites a call into\n * the classes it selects and erases the recipe, so any other read of the binding — `raw`,\n * `variantMap`, `config`, `merge`, `getVariantProps` — would see a value that is no longer\n * there, and fails the build with `runtime-binding` or `raw-call`. Declaring them only let\n * that failure type-check.\n */\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject | undefined\n /**\n * Semantic recipe name used by extraction-only integrations.\n *\n * Required for a recipe declared in `theme.recipes`, where it is the key it is declared\n * under. Optional for an inline `cva`.\n *\n * The Vite compiler ignores this field when allocating declaration atoms: recipe identity\n * is not style identity, so identical declarations share one class across recipes.\n */\n className?: string | undefined\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string | undefined\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | undefined\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T> | undefined\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[] | undefined\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string | undefined\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp> | undefined\n /**\n * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[] | undefined\n}\n\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>, RecipeConfigMeta {\n /**\n * Required extraction metadata for a configured recipe: the key under which it is\n * declared in `theme.recipes`. The Vite compiler does not use it as style identity.\n */\n className: string\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\n// Not `Partial<Record<S, T>>`, which under `exactOptionalPropertyTypes` takes no `undefined` for a slot.\ntype SlotRecord<S extends string, T> = { [K in S]?: T | undefined }\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) =>
|
|
1550
|
+
var content$3 = "import type { RecipeRule } from './static-css'\nimport type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types'\n\ntype StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T\n\nexport type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>\n\nexport type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T\n ? {}\n : {\n [K in keyof T]?: StringToBoolean<keyof T[K]> | undefined\n }\n\nexport type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string\n\n/**\n * Extract the variant as optional props from a `cva` function.\n * Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.\n */\nexport type RecipeVariantProps<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Pretty<Parameters<T>[0]>\n\n/**\n * Extract the variants from a `cva` function.\n */\nexport type RecipeVariant<\n T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,\n> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>\n\n/* -----------------------------------------------------------------------------\n * Recipe / Standard\n * -----------------------------------------------------------------------------*/\n\n/**\n * What a compiled build lets you do with a recipe: call it, or split its variant props.\n *\n * Nothing else is declared, because nothing else compiles. The compiler rewrites a call into\n * the classes it selects and erases the recipe, so any other read of the binding — `raw`,\n * `variantMap`, `config`, `merge`, `getVariantProps` — would see a value that is no longer\n * there, and fails the build with `runtime-binding` or `raw-call`. Declaring them only let\n * that failure type-check.\n */\nexport interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {\n __type: RecipeSelection<T>\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\ntype OneOrMore<T> = T | Array<T>\n\nexport type RecipeCompoundSelection<T> = {\n [K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined\n}\n\nexport type RecipeCompoundVariant<T> = T & {\n css: SystemStyleObject\n}\n\nexport interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {\n /**\n * The base styles of the recipe.\n */\n base?: SystemStyleObject | undefined\n /**\n * Semantic recipe name used by extraction-only integrations.\n *\n * Required for a recipe declared in `theme.recipes`, where it is the key it is declared\n * under. Optional for an inline `cva`.\n *\n * The Vite compiler ignores this field when allocating declaration atoms: recipe identity\n * is not style identity, so identical declarations share one class across recipes.\n */\n className?: string | undefined\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string | undefined\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | undefined\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T> | undefined\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[] | undefined\n}\n\nexport type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>\n\ninterface RecipeConfigMeta {\n /**\n * The description of the recipe. This will be used in the JSDoc comment.\n */\n description?: string | undefined\n /**\n * The jsx elements to track for this recipe. Can be string or Regexp.\n *\n * @default capitalize(recipe.name)\n * @example ['Button', 'Link', /Button$/]\n */\n jsx?: Array<string | RegExp> | undefined\n /**\n * Variants to pre-generate, will be include in the final `config.staticCss`\n */\n staticCss?: RecipeRule[] | undefined\n}\n\nexport interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>\n extends RecipeDefinition<T>, RecipeConfigMeta {\n /**\n * Required extraction metadata for a configured recipe: the key under which it is\n * declared in `theme.recipes`. The Vite compiler does not use it as style identity.\n */\n className: string\n}\n\n/* -----------------------------------------------------------------------------\n * Recipe / Slot\n * -----------------------------------------------------------------------------*/\n\n// Not `Partial<Record<S, T>>`, which under `exactOptionalPropertyTypes` takes no `undefined` for a slot.\ntype SlotRecord<S extends string, T> = { [K in S]?: T | undefined }\n\nexport type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>\n\n/**\n * A class string for every slot: compiled, a slot recipe names each, an empty one for a slot with no\n * styles, as a config slot recipe's are typed. Typed as a slot's styles are, `string | undefined`,\n * every use of one took a `!` or a fallback for an `undefined` that never comes.\n */\nexport type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (\n props?: RecipeSelection<T>,\n) => Record<S, string>\n\n/**\n * A slot recipe as a compiled build allows it: call it, or split its variant props. See\n * `RecipeRuntimeFn` for why nothing else is declared.\n */\nexport interface SlotRecipeRuntimeFn<\n S extends string,\n T extends SlotRecipeVariantRecord<S>,\n> extends SlotRecipeVariantFn<S, T> {\n splitVariantProps<Props extends RecipeSelection<T>>(\n props: Props,\n ): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]\n}\n\nexport type SlotRecipeCompoundVariant<S extends string, T> = T & {\n css: SlotRecord<S, SystemStyleObject>\n}\n\nexport interface SlotRecipeDefinition<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> {\n /**\n * Semantic recipe name used by extraction-only integrations.\n *\n * Required for a recipe declared in `theme.slotRecipes`, where it is the key it is\n * declared under. Optional for an inline `sva`.\n *\n * The Vite compiler ignores this field when allocating declaration atoms: recipe and slot\n * identity do not enter generated class names.\n */\n className?: string | undefined\n /**\n * Whether the recipe is deprecated.\n */\n deprecated?: boolean | string | undefined\n /**\n * The parts/slots of the recipe.\n */\n slots: S[] | Readonly<S[]>\n /**\n * Accepted and ignored.\n *\n * Older extraction-only releases scoped a slot's variant styles with `@scope` rules anchored\n * at the slots named here. The Vite compiler returns complete atoms for every selected slot\n * and emits no `@scope`, so this has no effect on output; it is still accepted so existing\n * configs keep loading.\n *\n * @deprecated Has no effect on compiled output.\n */\n scopeRoots?: S[] | Readonly<S[]> | undefined\n /**\n * The base styles of the recipe.\n */\n base?: SlotRecord<S, SystemStyleObject> | undefined\n /**\n * The multi-variant styles of the recipe.\n */\n variants?: T | undefined\n /**\n * The default variants of the recipe.\n */\n defaultVariants?: RecipeSelection<T> | undefined\n /**\n * The styles to apply when a combination of variants is selected.\n */\n compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[] | undefined\n}\n\nexport type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(\n config: SlotRecipeDefinition<S, T>,\n) => SlotRecipeRuntimeFn<S, T>\n\nexport type SlotRecipeConfig<\n S extends string = string,\n T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,\n> = SlotRecipeDefinition<S, T> &\n RecipeConfigMeta & {\n /**\n * Required extraction metadata for a configured recipe: the key under which it is\n * declared in `theme.slotRecipes`. The Vite compiler does not use it as style identity.\n */\n className: string\n }\n";
|
|
1551
1551
|
//#endregion
|
|
1552
1552
|
//#region src/artifacts/generated/selectors.d.ts.json
|
|
1553
1553
|
var content$2 = "import type { Pseudos } from './csstype'\n\ntype AriaAttributes =\n | '[aria-disabled]'\n | '[aria-hidden]'\n | '[aria-invalid]'\n | '[aria-readonly]'\n | '[aria-required]'\n | '[aria-selected]'\n | '[aria-checked]'\n | '[aria-expanded]'\n | '[aria-pressed]'\n | `[aria-current=${'page' | 'step' | 'location' | 'date' | 'time'}]`\n | '[aria-invalid]'\n | `[aria-sort=${'ascending' | 'descending'}]`\n\ntype DataAttributes =\n | '[data-selected]'\n | '[data-highlighted]'\n | '[data-hover]'\n | '[data-active]'\n | '[data-checked]'\n | '[data-disabled]'\n | '[data-readonly]'\n | '[data-focus]'\n | '[data-focus-visible]'\n | '[data-focus-visible-added]'\n | '[data-invalid]'\n | '[data-pressed]'\n | '[data-expanded]'\n | '[data-grabbed]'\n | '[data-dragged]'\n | '[data-orientation=horizontal]'\n | '[data-orientation=vertical]'\n | '[data-in-range]'\n | '[data-out-of-range]'\n | '[data-placeholder-shown]'\n | `[data-part=${string}]`\n | `[data-attr=${string}]`\n | `[data-placement=${string}]`\n | `[data-theme=${string}]`\n | `[data-size=${string}]`\n | `[data-state=${string}]`\n | '[data-empty]'\n | '[data-loading]'\n | '[data-loaded]'\n | '[data-enter]'\n | '[data-entering]'\n | '[data-exited]'\n | '[data-exiting]'\n\ntype AttributeSelector = `&${Pseudos | DataAttributes | AriaAttributes}`\ntype ParentSelector = `${DataAttributes | AriaAttributes} &`\n\ntype AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page' | 'scope' | 'starting-style'\n\nexport type AnySelector = `${string}&` | `&${string}` | `@${AtRuleType}${string}`\nexport type Selectors = AttributeSelector | ParentSelector\n";
|
|
@@ -1557,6 +1557,871 @@ var content$1 = "interface ConditionOptions {\n /**\n * The conditions to gen
|
|
|
1557
1557
|
//#endregion
|
|
1558
1558
|
//#region src/artifacts/generated/system-types.d.ts.json
|
|
1559
1559
|
var content = "import type { ConditionalValue, Nested } from './conditions'\nimport type { AtRule, Globals, Properties } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\ntype CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`\n\nexport interface ModernCssProperties {\n /**\n * Controls whether the entire element should be draggable instead of its contents.\n */\n WebkitUserDrag?: Globals | 'auto' | 'element' | 'none' | undefined\n\n /**\n * Specifies whether an element can be used to drag the entire app window (Electron).\n */\n WebkitAppRegion?: Globals | 'drag' | 'no-drag' | undefined\n\n /**\n * Sets the horizontal spacing between table borders.\n */\n WebkitBorderHorizontalSpacing?: Globals | String | Number | undefined\n\n /**\n * Sets the vertical spacing between table borders.\n */\n WebkitBorderVerticalSpacing?: Globals | String | Number | undefined\n\n /**\n * Controls the display of text content for security purposes (e.g., password fields).\n */\n WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square' | undefined\n\n /**\n * Specifies the shape of a box's corners within the area defined by the border-radius property.\n * @experimental\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape\n */\n cornerShape?:\n | Globals\n | CornerShapeValue\n | `${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | String\n | undefined\n}\n\nexport type CssProperty = keyof Properties\n\nexport interface CssProperties extends Properties<String | Number>, CssVarProperties, ModernCssProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>\n\n/**\n * A style object with these properties alone, in every condition and selector too: what a component\n * takes when it lets its caller style part of it. `SystemStyleObjectWith<'width' | 'margin'>` takes\n * those two; a shorthand, `mt`, is a property of its own and listed as one. It is a\n * `SystemStyleObject`, so it goes into `css()` as one.\n */\nexport type SystemStyleObjectWith<K extends keyof SystemProperties> = Omit<Nested<Pick<SystemProperties, K>>, 'base'>\n\n/** A style object with every property but these, in every condition and selector too. @see SystemStyleObjectWith */\nexport type SystemStyleObjectWithout<K extends keyof SystemProperties> = Omit<Nested<Omit<SystemProperties, K>>, 'base'>\n\n/**\n * The four `::view-transition-*` pseudo-elements a `viewTransition()` bag can style.\n *\n * `imagePair` is camelCase here and emitted as `::view-transition-image-pair`, matching\n * how every other property in a style object is authored.\n */\nexport interface ViewTransitionStyleObject {\n group?: SystemStyleObject | undefined\n imagePair?: SystemStyleObject | undefined\n old?: SystemStyleObject | undefined\n new?: SystemStyleObject | undefined\n}\n\nexport type ViewTransitionFn = (options: ViewTransitionStyleObject) => string\n\n/**\n * The stops of one `@keyframes` block: `from`, `to` or a percentage, each the declarations at that\n * point, as a theme keyframe takes them.\n */\nexport interface KeyframeStops {\n [stop: string]: CssProperties\n}\n\nexport type KeyframesFn = (stops: KeyframeStops) => string\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Composition (text styles, layer styles)\n * -----------------------------------------------------------------------------*/\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: (K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown) | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Font face\n * -----------------------------------------------------------------------------*/\n\nexport type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>\n\nexport type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>\n\nexport interface GlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[]\n}\n\nexport interface ExtendableGlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined\n extend?: GlobalFontface | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[] | undefined\n}\n\nexport type JsxStyleProps = SystemStyleObject & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number | undefined\n htmlHeight?: string | number | undefined\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string | undefined\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n";
|
|
1560
|
+
var cssProperties = [
|
|
1561
|
+
"KhtmlBoxAlign",
|
|
1562
|
+
"KhtmlBoxDirection",
|
|
1563
|
+
"KhtmlBoxFlex",
|
|
1564
|
+
"KhtmlBoxFlexGroup",
|
|
1565
|
+
"KhtmlBoxLines",
|
|
1566
|
+
"KhtmlBoxOrdinalGroup",
|
|
1567
|
+
"KhtmlBoxOrient",
|
|
1568
|
+
"KhtmlBoxPack",
|
|
1569
|
+
"KhtmlLineBreak",
|
|
1570
|
+
"KhtmlOpacity",
|
|
1571
|
+
"KhtmlUserSelect",
|
|
1572
|
+
"MozAnimation",
|
|
1573
|
+
"MozAnimationDelay",
|
|
1574
|
+
"MozAnimationDirection",
|
|
1575
|
+
"MozAnimationDuration",
|
|
1576
|
+
"MozAnimationFillMode",
|
|
1577
|
+
"MozAnimationIterationCount",
|
|
1578
|
+
"MozAnimationName",
|
|
1579
|
+
"MozAnimationPlayState",
|
|
1580
|
+
"MozAnimationTimingFunction",
|
|
1581
|
+
"MozAppearance",
|
|
1582
|
+
"MozBackfaceVisibility",
|
|
1583
|
+
"MozBackgroundClip",
|
|
1584
|
+
"MozBackgroundOrigin",
|
|
1585
|
+
"MozBackgroundSize",
|
|
1586
|
+
"MozBinding",
|
|
1587
|
+
"MozBorderBottomColors",
|
|
1588
|
+
"MozBorderEndColor",
|
|
1589
|
+
"MozBorderEndStyle",
|
|
1590
|
+
"MozBorderEndWidth",
|
|
1591
|
+
"MozBorderImage",
|
|
1592
|
+
"MozBorderLeftColors",
|
|
1593
|
+
"MozBorderRadius",
|
|
1594
|
+
"MozBorderRadiusBottomleft",
|
|
1595
|
+
"MozBorderRadiusBottomright",
|
|
1596
|
+
"MozBorderRadiusTopleft",
|
|
1597
|
+
"MozBorderRadiusTopright",
|
|
1598
|
+
"MozBorderRightColors",
|
|
1599
|
+
"MozBorderStartColor",
|
|
1600
|
+
"MozBorderStartStyle",
|
|
1601
|
+
"MozBorderTopColors",
|
|
1602
|
+
"MozBoxAlign",
|
|
1603
|
+
"MozBoxDirection",
|
|
1604
|
+
"MozBoxFlex",
|
|
1605
|
+
"MozBoxOrdinalGroup",
|
|
1606
|
+
"MozBoxOrient",
|
|
1607
|
+
"MozBoxPack",
|
|
1608
|
+
"MozBoxShadow",
|
|
1609
|
+
"MozBoxSizing",
|
|
1610
|
+
"MozColumnCount",
|
|
1611
|
+
"MozColumnFill",
|
|
1612
|
+
"MozColumnRule",
|
|
1613
|
+
"MozColumnRuleColor",
|
|
1614
|
+
"MozColumnRuleStyle",
|
|
1615
|
+
"MozColumnRuleWidth",
|
|
1616
|
+
"MozColumnWidth",
|
|
1617
|
+
"MozColumns",
|
|
1618
|
+
"MozContextProperties",
|
|
1619
|
+
"MozFloatEdge",
|
|
1620
|
+
"MozFontFeatureSettings",
|
|
1621
|
+
"MozFontLanguageOverride",
|
|
1622
|
+
"MozForceBrokenImageIcon",
|
|
1623
|
+
"MozHyphens",
|
|
1624
|
+
"MozMarginEnd",
|
|
1625
|
+
"MozMarginStart",
|
|
1626
|
+
"MozOpacity",
|
|
1627
|
+
"MozOrient",
|
|
1628
|
+
"MozOsxFontSmoothing",
|
|
1629
|
+
"MozOutline",
|
|
1630
|
+
"MozOutlineColor",
|
|
1631
|
+
"MozOutlineRadius",
|
|
1632
|
+
"MozOutlineRadiusBottomleft",
|
|
1633
|
+
"MozOutlineRadiusBottomright",
|
|
1634
|
+
"MozOutlineRadiusTopleft",
|
|
1635
|
+
"MozOutlineRadiusTopright",
|
|
1636
|
+
"MozOutlineStyle",
|
|
1637
|
+
"MozOutlineWidth",
|
|
1638
|
+
"MozPaddingEnd",
|
|
1639
|
+
"MozPaddingStart",
|
|
1640
|
+
"MozPerspective",
|
|
1641
|
+
"MozPerspectiveOrigin",
|
|
1642
|
+
"MozStackSizing",
|
|
1643
|
+
"MozTabSize",
|
|
1644
|
+
"MozTextAlignLast",
|
|
1645
|
+
"MozTextBlink",
|
|
1646
|
+
"MozTextDecorationColor",
|
|
1647
|
+
"MozTextDecorationLine",
|
|
1648
|
+
"MozTextDecorationStyle",
|
|
1649
|
+
"MozTextSizeAdjust",
|
|
1650
|
+
"MozTransform",
|
|
1651
|
+
"MozTransformOrigin",
|
|
1652
|
+
"MozTransformStyle",
|
|
1653
|
+
"MozTransition",
|
|
1654
|
+
"MozTransitionDelay",
|
|
1655
|
+
"MozTransitionDuration",
|
|
1656
|
+
"MozTransitionProperty",
|
|
1657
|
+
"MozTransitionTimingFunction",
|
|
1658
|
+
"MozUserFocus",
|
|
1659
|
+
"MozUserInput",
|
|
1660
|
+
"MozUserModify",
|
|
1661
|
+
"MozUserSelect",
|
|
1662
|
+
"MozWindowDragging",
|
|
1663
|
+
"MozWindowShadow",
|
|
1664
|
+
"OAnimation",
|
|
1665
|
+
"OAnimationDelay",
|
|
1666
|
+
"OAnimationDirection",
|
|
1667
|
+
"OAnimationDuration",
|
|
1668
|
+
"OAnimationFillMode",
|
|
1669
|
+
"OAnimationIterationCount",
|
|
1670
|
+
"OAnimationName",
|
|
1671
|
+
"OAnimationPlayState",
|
|
1672
|
+
"OAnimationTimingFunction",
|
|
1673
|
+
"OBackgroundSize",
|
|
1674
|
+
"OBorderImage",
|
|
1675
|
+
"OObjectFit",
|
|
1676
|
+
"OObjectPosition",
|
|
1677
|
+
"OTabSize",
|
|
1678
|
+
"OTextOverflow",
|
|
1679
|
+
"OTransform",
|
|
1680
|
+
"OTransformOrigin",
|
|
1681
|
+
"OTransition",
|
|
1682
|
+
"OTransitionDelay",
|
|
1683
|
+
"OTransitionDuration",
|
|
1684
|
+
"OTransitionProperty",
|
|
1685
|
+
"OTransitionTimingFunction",
|
|
1686
|
+
"WebkitAlignContent",
|
|
1687
|
+
"WebkitAlignItems",
|
|
1688
|
+
"WebkitAlignSelf",
|
|
1689
|
+
"WebkitAnimation",
|
|
1690
|
+
"WebkitAnimationDelay",
|
|
1691
|
+
"WebkitAnimationDirection",
|
|
1692
|
+
"WebkitAnimationDuration",
|
|
1693
|
+
"WebkitAnimationFillMode",
|
|
1694
|
+
"WebkitAnimationIterationCount",
|
|
1695
|
+
"WebkitAnimationName",
|
|
1696
|
+
"WebkitAnimationPlayState",
|
|
1697
|
+
"WebkitAnimationTimingFunction",
|
|
1698
|
+
"WebkitAppRegion",
|
|
1699
|
+
"WebkitAppearance",
|
|
1700
|
+
"WebkitBackdropFilter",
|
|
1701
|
+
"WebkitBackfaceVisibility",
|
|
1702
|
+
"WebkitBackgroundClip",
|
|
1703
|
+
"WebkitBackgroundOrigin",
|
|
1704
|
+
"WebkitBackgroundSize",
|
|
1705
|
+
"WebkitBorderBefore",
|
|
1706
|
+
"WebkitBorderBeforeColor",
|
|
1707
|
+
"WebkitBorderBeforeStyle",
|
|
1708
|
+
"WebkitBorderBeforeWidth",
|
|
1709
|
+
"WebkitBorderBottomLeftRadius",
|
|
1710
|
+
"WebkitBorderBottomRightRadius",
|
|
1711
|
+
"WebkitBorderHorizontalSpacing",
|
|
1712
|
+
"WebkitBorderImage",
|
|
1713
|
+
"WebkitBorderImageSlice",
|
|
1714
|
+
"WebkitBorderRadius",
|
|
1715
|
+
"WebkitBorderTopLeftRadius",
|
|
1716
|
+
"WebkitBorderTopRightRadius",
|
|
1717
|
+
"WebkitBorderVerticalSpacing",
|
|
1718
|
+
"WebkitBoxAlign",
|
|
1719
|
+
"WebkitBoxDecorationBreak",
|
|
1720
|
+
"WebkitBoxDirection",
|
|
1721
|
+
"WebkitBoxFlex",
|
|
1722
|
+
"WebkitBoxFlexGroup",
|
|
1723
|
+
"WebkitBoxLines",
|
|
1724
|
+
"WebkitBoxOrdinalGroup",
|
|
1725
|
+
"WebkitBoxOrient",
|
|
1726
|
+
"WebkitBoxPack",
|
|
1727
|
+
"WebkitBoxReflect",
|
|
1728
|
+
"WebkitBoxShadow",
|
|
1729
|
+
"WebkitBoxSizing",
|
|
1730
|
+
"WebkitClipPath",
|
|
1731
|
+
"WebkitColumnCount",
|
|
1732
|
+
"WebkitColumnFill",
|
|
1733
|
+
"WebkitColumnRule",
|
|
1734
|
+
"WebkitColumnRuleColor",
|
|
1735
|
+
"WebkitColumnRuleStyle",
|
|
1736
|
+
"WebkitColumnRuleWidth",
|
|
1737
|
+
"WebkitColumnSpan",
|
|
1738
|
+
"WebkitColumnWidth",
|
|
1739
|
+
"WebkitColumns",
|
|
1740
|
+
"WebkitFilter",
|
|
1741
|
+
"WebkitFlex",
|
|
1742
|
+
"WebkitFlexBasis",
|
|
1743
|
+
"WebkitFlexDirection",
|
|
1744
|
+
"WebkitFlexFlow",
|
|
1745
|
+
"WebkitFlexGrow",
|
|
1746
|
+
"WebkitFlexShrink",
|
|
1747
|
+
"WebkitFlexWrap",
|
|
1748
|
+
"WebkitFontFeatureSettings",
|
|
1749
|
+
"WebkitFontKerning",
|
|
1750
|
+
"WebkitFontSmoothing",
|
|
1751
|
+
"WebkitFontVariantLigatures",
|
|
1752
|
+
"WebkitHyphenateCharacter",
|
|
1753
|
+
"WebkitHyphens",
|
|
1754
|
+
"WebkitInitialLetter",
|
|
1755
|
+
"WebkitJustifyContent",
|
|
1756
|
+
"WebkitLineBreak",
|
|
1757
|
+
"WebkitLineClamp",
|
|
1758
|
+
"WebkitLogicalHeight",
|
|
1759
|
+
"WebkitLogicalWidth",
|
|
1760
|
+
"WebkitMarginEnd",
|
|
1761
|
+
"WebkitMarginStart",
|
|
1762
|
+
"WebkitMask",
|
|
1763
|
+
"WebkitMaskAttachment",
|
|
1764
|
+
"WebkitMaskBoxImage",
|
|
1765
|
+
"WebkitMaskBoxImageOutset",
|
|
1766
|
+
"WebkitMaskBoxImageRepeat",
|
|
1767
|
+
"WebkitMaskBoxImageSlice",
|
|
1768
|
+
"WebkitMaskBoxImageSource",
|
|
1769
|
+
"WebkitMaskBoxImageWidth",
|
|
1770
|
+
"WebkitMaskClip",
|
|
1771
|
+
"WebkitMaskComposite",
|
|
1772
|
+
"WebkitMaskImage",
|
|
1773
|
+
"WebkitMaskOrigin",
|
|
1774
|
+
"WebkitMaskPosition",
|
|
1775
|
+
"WebkitMaskPositionX",
|
|
1776
|
+
"WebkitMaskPositionY",
|
|
1777
|
+
"WebkitMaskRepeat",
|
|
1778
|
+
"WebkitMaskRepeatX",
|
|
1779
|
+
"WebkitMaskRepeatY",
|
|
1780
|
+
"WebkitMaskSize",
|
|
1781
|
+
"WebkitMaxInlineSize",
|
|
1782
|
+
"WebkitOrder",
|
|
1783
|
+
"WebkitOverflowScrolling",
|
|
1784
|
+
"WebkitPaddingEnd",
|
|
1785
|
+
"WebkitPaddingStart",
|
|
1786
|
+
"WebkitPerspective",
|
|
1787
|
+
"WebkitPerspectiveOrigin",
|
|
1788
|
+
"WebkitPrintColorAdjust",
|
|
1789
|
+
"WebkitRubyPosition",
|
|
1790
|
+
"WebkitScrollSnapType",
|
|
1791
|
+
"WebkitShapeMargin",
|
|
1792
|
+
"WebkitTapHighlightColor",
|
|
1793
|
+
"WebkitTextCombine",
|
|
1794
|
+
"WebkitTextDecorationColor",
|
|
1795
|
+
"WebkitTextDecorationLine",
|
|
1796
|
+
"WebkitTextDecorationSkip",
|
|
1797
|
+
"WebkitTextDecorationStyle",
|
|
1798
|
+
"WebkitTextEmphasis",
|
|
1799
|
+
"WebkitTextEmphasisColor",
|
|
1800
|
+
"WebkitTextEmphasisPosition",
|
|
1801
|
+
"WebkitTextEmphasisStyle",
|
|
1802
|
+
"WebkitTextFillColor",
|
|
1803
|
+
"WebkitTextOrientation",
|
|
1804
|
+
"WebkitTextSecurity",
|
|
1805
|
+
"WebkitTextSizeAdjust",
|
|
1806
|
+
"WebkitTextStroke",
|
|
1807
|
+
"WebkitTextStrokeColor",
|
|
1808
|
+
"WebkitTextStrokeWidth",
|
|
1809
|
+
"WebkitTextUnderlinePosition",
|
|
1810
|
+
"WebkitTouchCallout",
|
|
1811
|
+
"WebkitTransform",
|
|
1812
|
+
"WebkitTransformOrigin",
|
|
1813
|
+
"WebkitTransformStyle",
|
|
1814
|
+
"WebkitTransition",
|
|
1815
|
+
"WebkitTransitionDelay",
|
|
1816
|
+
"WebkitTransitionDuration",
|
|
1817
|
+
"WebkitTransitionProperty",
|
|
1818
|
+
"WebkitTransitionTimingFunction",
|
|
1819
|
+
"WebkitUserDrag",
|
|
1820
|
+
"WebkitUserModify",
|
|
1821
|
+
"WebkitUserSelect",
|
|
1822
|
+
"WebkitWritingMode",
|
|
1823
|
+
"accentColor",
|
|
1824
|
+
"alignContent",
|
|
1825
|
+
"alignItems",
|
|
1826
|
+
"alignSelf",
|
|
1827
|
+
"alignTracks",
|
|
1828
|
+
"alignmentBaseline",
|
|
1829
|
+
"all",
|
|
1830
|
+
"anchorName",
|
|
1831
|
+
"anchorScope",
|
|
1832
|
+
"animation",
|
|
1833
|
+
"animationComposition",
|
|
1834
|
+
"animationDelay",
|
|
1835
|
+
"animationDirection",
|
|
1836
|
+
"animationDuration",
|
|
1837
|
+
"animationFillMode",
|
|
1838
|
+
"animationIterationCount",
|
|
1839
|
+
"animationName",
|
|
1840
|
+
"animationPlayState",
|
|
1841
|
+
"animationRange",
|
|
1842
|
+
"animationRangeEnd",
|
|
1843
|
+
"animationRangeStart",
|
|
1844
|
+
"animationTimeline",
|
|
1845
|
+
"animationTimingFunction",
|
|
1846
|
+
"appearance",
|
|
1847
|
+
"aspectRatio",
|
|
1848
|
+
"backdropFilter",
|
|
1849
|
+
"backfaceVisibility",
|
|
1850
|
+
"background",
|
|
1851
|
+
"backgroundAttachment",
|
|
1852
|
+
"backgroundBlendMode",
|
|
1853
|
+
"backgroundClip",
|
|
1854
|
+
"backgroundColor",
|
|
1855
|
+
"backgroundImage",
|
|
1856
|
+
"backgroundOrigin",
|
|
1857
|
+
"backgroundPosition",
|
|
1858
|
+
"backgroundPositionX",
|
|
1859
|
+
"backgroundPositionY",
|
|
1860
|
+
"backgroundRepeat",
|
|
1861
|
+
"backgroundSize",
|
|
1862
|
+
"baselineShift",
|
|
1863
|
+
"blockSize",
|
|
1864
|
+
"border",
|
|
1865
|
+
"borderBlock",
|
|
1866
|
+
"borderBlockColor",
|
|
1867
|
+
"borderBlockEnd",
|
|
1868
|
+
"borderBlockEndColor",
|
|
1869
|
+
"borderBlockEndStyle",
|
|
1870
|
+
"borderBlockEndWidth",
|
|
1871
|
+
"borderBlockStart",
|
|
1872
|
+
"borderBlockStartColor",
|
|
1873
|
+
"borderBlockStartStyle",
|
|
1874
|
+
"borderBlockStartWidth",
|
|
1875
|
+
"borderBlockStyle",
|
|
1876
|
+
"borderBlockWidth",
|
|
1877
|
+
"borderBottom",
|
|
1878
|
+
"borderBottomColor",
|
|
1879
|
+
"borderBottomLeftRadius",
|
|
1880
|
+
"borderBottomRightRadius",
|
|
1881
|
+
"borderBottomStyle",
|
|
1882
|
+
"borderBottomWidth",
|
|
1883
|
+
"borderCollapse",
|
|
1884
|
+
"borderColor",
|
|
1885
|
+
"borderEndEndRadius",
|
|
1886
|
+
"borderEndStartRadius",
|
|
1887
|
+
"borderImage",
|
|
1888
|
+
"borderImageOutset",
|
|
1889
|
+
"borderImageRepeat",
|
|
1890
|
+
"borderImageSlice",
|
|
1891
|
+
"borderImageSource",
|
|
1892
|
+
"borderImageWidth",
|
|
1893
|
+
"borderInline",
|
|
1894
|
+
"borderInlineColor",
|
|
1895
|
+
"borderInlineEnd",
|
|
1896
|
+
"borderInlineEndColor",
|
|
1897
|
+
"borderInlineEndStyle",
|
|
1898
|
+
"borderInlineEndWidth",
|
|
1899
|
+
"borderInlineStart",
|
|
1900
|
+
"borderInlineStartColor",
|
|
1901
|
+
"borderInlineStartStyle",
|
|
1902
|
+
"borderInlineStartWidth",
|
|
1903
|
+
"borderInlineStyle",
|
|
1904
|
+
"borderInlineWidth",
|
|
1905
|
+
"borderLeft",
|
|
1906
|
+
"borderLeftColor",
|
|
1907
|
+
"borderLeftStyle",
|
|
1908
|
+
"borderLeftWidth",
|
|
1909
|
+
"borderRadius",
|
|
1910
|
+
"borderRight",
|
|
1911
|
+
"borderRightColor",
|
|
1912
|
+
"borderRightStyle",
|
|
1913
|
+
"borderRightWidth",
|
|
1914
|
+
"borderSpacing",
|
|
1915
|
+
"borderStartEndRadius",
|
|
1916
|
+
"borderStartStartRadius",
|
|
1917
|
+
"borderStyle",
|
|
1918
|
+
"borderTop",
|
|
1919
|
+
"borderTopColor",
|
|
1920
|
+
"borderTopLeftRadius",
|
|
1921
|
+
"borderTopRightRadius",
|
|
1922
|
+
"borderTopStyle",
|
|
1923
|
+
"borderTopWidth",
|
|
1924
|
+
"borderWidth",
|
|
1925
|
+
"bottom",
|
|
1926
|
+
"boxAlign",
|
|
1927
|
+
"boxDecorationBreak",
|
|
1928
|
+
"boxDirection",
|
|
1929
|
+
"boxFlex",
|
|
1930
|
+
"boxFlexGroup",
|
|
1931
|
+
"boxLines",
|
|
1932
|
+
"boxOrdinalGroup",
|
|
1933
|
+
"boxOrient",
|
|
1934
|
+
"boxPack",
|
|
1935
|
+
"boxShadow",
|
|
1936
|
+
"boxSizing",
|
|
1937
|
+
"breakAfter",
|
|
1938
|
+
"breakBefore",
|
|
1939
|
+
"breakInside",
|
|
1940
|
+
"captionSide",
|
|
1941
|
+
"caret",
|
|
1942
|
+
"caretColor",
|
|
1943
|
+
"caretShape",
|
|
1944
|
+
"clear",
|
|
1945
|
+
"clip",
|
|
1946
|
+
"clipPath",
|
|
1947
|
+
"clipRule",
|
|
1948
|
+
"color",
|
|
1949
|
+
"colorAdjust",
|
|
1950
|
+
"colorInterpolation",
|
|
1951
|
+
"colorInterpolationFilters",
|
|
1952
|
+
"colorRendering",
|
|
1953
|
+
"colorScheme",
|
|
1954
|
+
"columnCount",
|
|
1955
|
+
"columnFill",
|
|
1956
|
+
"columnGap",
|
|
1957
|
+
"columnRule",
|
|
1958
|
+
"columnRuleColor",
|
|
1959
|
+
"columnRuleStyle",
|
|
1960
|
+
"columnRuleWidth",
|
|
1961
|
+
"columnSpan",
|
|
1962
|
+
"columnWidth",
|
|
1963
|
+
"columns",
|
|
1964
|
+
"contain",
|
|
1965
|
+
"containIntrinsicBlockSize",
|
|
1966
|
+
"containIntrinsicHeight",
|
|
1967
|
+
"containIntrinsicInlineSize",
|
|
1968
|
+
"containIntrinsicSize",
|
|
1969
|
+
"containIntrinsicWidth",
|
|
1970
|
+
"container",
|
|
1971
|
+
"containerName",
|
|
1972
|
+
"containerType",
|
|
1973
|
+
"content",
|
|
1974
|
+
"contentVisibility",
|
|
1975
|
+
"cornerShape",
|
|
1976
|
+
"counterIncrement",
|
|
1977
|
+
"counterReset",
|
|
1978
|
+
"counterSet",
|
|
1979
|
+
"cursor",
|
|
1980
|
+
"cx",
|
|
1981
|
+
"cy",
|
|
1982
|
+
"d",
|
|
1983
|
+
"direction",
|
|
1984
|
+
"display",
|
|
1985
|
+
"dominantBaseline",
|
|
1986
|
+
"emptyCells",
|
|
1987
|
+
"fieldSizing",
|
|
1988
|
+
"fill",
|
|
1989
|
+
"fillOpacity",
|
|
1990
|
+
"fillRule",
|
|
1991
|
+
"filter",
|
|
1992
|
+
"flex",
|
|
1993
|
+
"flexBasis",
|
|
1994
|
+
"flexDirection",
|
|
1995
|
+
"flexFlow",
|
|
1996
|
+
"flexGrow",
|
|
1997
|
+
"flexShrink",
|
|
1998
|
+
"flexWrap",
|
|
1999
|
+
"float",
|
|
2000
|
+
"floodColor",
|
|
2001
|
+
"floodOpacity",
|
|
2002
|
+
"font",
|
|
2003
|
+
"fontFamily",
|
|
2004
|
+
"fontFeatureSettings",
|
|
2005
|
+
"fontKerning",
|
|
2006
|
+
"fontLanguageOverride",
|
|
2007
|
+
"fontOpticalSizing",
|
|
2008
|
+
"fontPalette",
|
|
2009
|
+
"fontSize",
|
|
2010
|
+
"fontSizeAdjust",
|
|
2011
|
+
"fontSmooth",
|
|
2012
|
+
"fontStretch",
|
|
2013
|
+
"fontStyle",
|
|
2014
|
+
"fontSynthesis",
|
|
2015
|
+
"fontSynthesisPosition",
|
|
2016
|
+
"fontSynthesisSmallCaps",
|
|
2017
|
+
"fontSynthesisStyle",
|
|
2018
|
+
"fontSynthesisWeight",
|
|
2019
|
+
"fontVariant",
|
|
2020
|
+
"fontVariantAlternates",
|
|
2021
|
+
"fontVariantCaps",
|
|
2022
|
+
"fontVariantEastAsian",
|
|
2023
|
+
"fontVariantEmoji",
|
|
2024
|
+
"fontVariantLigatures",
|
|
2025
|
+
"fontVariantNumeric",
|
|
2026
|
+
"fontVariantPosition",
|
|
2027
|
+
"fontVariationSettings",
|
|
2028
|
+
"fontWeight",
|
|
2029
|
+
"fontWidth",
|
|
2030
|
+
"forcedColorAdjust",
|
|
2031
|
+
"gap",
|
|
2032
|
+
"glyphOrientationVertical",
|
|
2033
|
+
"grid",
|
|
2034
|
+
"gridArea",
|
|
2035
|
+
"gridAutoColumns",
|
|
2036
|
+
"gridAutoFlow",
|
|
2037
|
+
"gridAutoRows",
|
|
2038
|
+
"gridColumn",
|
|
2039
|
+
"gridColumnEnd",
|
|
2040
|
+
"gridColumnGap",
|
|
2041
|
+
"gridColumnStart",
|
|
2042
|
+
"gridGap",
|
|
2043
|
+
"gridRow",
|
|
2044
|
+
"gridRowEnd",
|
|
2045
|
+
"gridRowGap",
|
|
2046
|
+
"gridRowStart",
|
|
2047
|
+
"gridTemplate",
|
|
2048
|
+
"gridTemplateAreas",
|
|
2049
|
+
"gridTemplateColumns",
|
|
2050
|
+
"gridTemplateRows",
|
|
2051
|
+
"hangingPunctuation",
|
|
2052
|
+
"height",
|
|
2053
|
+
"hyphenateCharacter",
|
|
2054
|
+
"hyphenateLimitChars",
|
|
2055
|
+
"hyphens",
|
|
2056
|
+
"imageOrientation",
|
|
2057
|
+
"imageRendering",
|
|
2058
|
+
"imageResolution",
|
|
2059
|
+
"imeMode",
|
|
2060
|
+
"initialLetter",
|
|
2061
|
+
"initialLetterAlign",
|
|
2062
|
+
"inlineSize",
|
|
2063
|
+
"inset",
|
|
2064
|
+
"insetArea",
|
|
2065
|
+
"insetBlock",
|
|
2066
|
+
"insetBlockEnd",
|
|
2067
|
+
"insetBlockStart",
|
|
2068
|
+
"insetInline",
|
|
2069
|
+
"insetInlineEnd",
|
|
2070
|
+
"insetInlineStart",
|
|
2071
|
+
"interpolateSize",
|
|
2072
|
+
"isolation",
|
|
2073
|
+
"justifyContent",
|
|
2074
|
+
"justifyItems",
|
|
2075
|
+
"justifySelf",
|
|
2076
|
+
"justifyTracks",
|
|
2077
|
+
"left",
|
|
2078
|
+
"letterSpacing",
|
|
2079
|
+
"lightingColor",
|
|
2080
|
+
"lineBreak",
|
|
2081
|
+
"lineClamp",
|
|
2082
|
+
"lineHeight",
|
|
2083
|
+
"lineHeightStep",
|
|
2084
|
+
"listStyle",
|
|
2085
|
+
"listStyleImage",
|
|
2086
|
+
"listStylePosition",
|
|
2087
|
+
"listStyleType",
|
|
2088
|
+
"margin",
|
|
2089
|
+
"marginBlock",
|
|
2090
|
+
"marginBlockEnd",
|
|
2091
|
+
"marginBlockStart",
|
|
2092
|
+
"marginBottom",
|
|
2093
|
+
"marginInline",
|
|
2094
|
+
"marginInlineEnd",
|
|
2095
|
+
"marginInlineStart",
|
|
2096
|
+
"marginLeft",
|
|
2097
|
+
"marginRight",
|
|
2098
|
+
"marginTop",
|
|
2099
|
+
"marginTrim",
|
|
2100
|
+
"marker",
|
|
2101
|
+
"markerEnd",
|
|
2102
|
+
"markerMid",
|
|
2103
|
+
"markerStart",
|
|
2104
|
+
"mask",
|
|
2105
|
+
"maskBorder",
|
|
2106
|
+
"maskBorderMode",
|
|
2107
|
+
"maskBorderOutset",
|
|
2108
|
+
"maskBorderRepeat",
|
|
2109
|
+
"maskBorderSlice",
|
|
2110
|
+
"maskBorderSource",
|
|
2111
|
+
"maskBorderWidth",
|
|
2112
|
+
"maskClip",
|
|
2113
|
+
"maskComposite",
|
|
2114
|
+
"maskImage",
|
|
2115
|
+
"maskMode",
|
|
2116
|
+
"maskOrigin",
|
|
2117
|
+
"maskPosition",
|
|
2118
|
+
"maskRepeat",
|
|
2119
|
+
"maskSize",
|
|
2120
|
+
"maskType",
|
|
2121
|
+
"masonryAutoFlow",
|
|
2122
|
+
"mathDepth",
|
|
2123
|
+
"mathShift",
|
|
2124
|
+
"mathStyle",
|
|
2125
|
+
"maxBlockSize",
|
|
2126
|
+
"maxHeight",
|
|
2127
|
+
"maxInlineSize",
|
|
2128
|
+
"maxLines",
|
|
2129
|
+
"maxWidth",
|
|
2130
|
+
"minBlockSize",
|
|
2131
|
+
"minHeight",
|
|
2132
|
+
"minInlineSize",
|
|
2133
|
+
"minWidth",
|
|
2134
|
+
"mixBlendMode",
|
|
2135
|
+
"motion",
|
|
2136
|
+
"motionDistance",
|
|
2137
|
+
"motionPath",
|
|
2138
|
+
"motionRotation",
|
|
2139
|
+
"msAccelerator",
|
|
2140
|
+
"msBlockProgression",
|
|
2141
|
+
"msContentZoomChaining",
|
|
2142
|
+
"msContentZoomLimit",
|
|
2143
|
+
"msContentZoomLimitMax",
|
|
2144
|
+
"msContentZoomLimitMin",
|
|
2145
|
+
"msContentZoomSnap",
|
|
2146
|
+
"msContentZoomSnapPoints",
|
|
2147
|
+
"msContentZoomSnapType",
|
|
2148
|
+
"msContentZooming",
|
|
2149
|
+
"msFilter",
|
|
2150
|
+
"msFlex",
|
|
2151
|
+
"msFlexDirection",
|
|
2152
|
+
"msFlexPositive",
|
|
2153
|
+
"msFlowFrom",
|
|
2154
|
+
"msFlowInto",
|
|
2155
|
+
"msGridColumns",
|
|
2156
|
+
"msGridRows",
|
|
2157
|
+
"msHighContrastAdjust",
|
|
2158
|
+
"msHyphenateLimitChars",
|
|
2159
|
+
"msHyphenateLimitLines",
|
|
2160
|
+
"msHyphenateLimitZone",
|
|
2161
|
+
"msHyphens",
|
|
2162
|
+
"msImeAlign",
|
|
2163
|
+
"msImeMode",
|
|
2164
|
+
"msLineBreak",
|
|
2165
|
+
"msOrder",
|
|
2166
|
+
"msOverflowStyle",
|
|
2167
|
+
"msOverflowX",
|
|
2168
|
+
"msOverflowY",
|
|
2169
|
+
"msScrollChaining",
|
|
2170
|
+
"msScrollLimit",
|
|
2171
|
+
"msScrollLimitXMax",
|
|
2172
|
+
"msScrollLimitXMin",
|
|
2173
|
+
"msScrollLimitYMax",
|
|
2174
|
+
"msScrollLimitYMin",
|
|
2175
|
+
"msScrollRails",
|
|
2176
|
+
"msScrollSnapPointsX",
|
|
2177
|
+
"msScrollSnapPointsY",
|
|
2178
|
+
"msScrollSnapType",
|
|
2179
|
+
"msScrollSnapX",
|
|
2180
|
+
"msScrollSnapY",
|
|
2181
|
+
"msScrollTranslation",
|
|
2182
|
+
"msScrollbar3dlightColor",
|
|
2183
|
+
"msScrollbarArrowColor",
|
|
2184
|
+
"msScrollbarBaseColor",
|
|
2185
|
+
"msScrollbarDarkshadowColor",
|
|
2186
|
+
"msScrollbarFaceColor",
|
|
2187
|
+
"msScrollbarHighlightColor",
|
|
2188
|
+
"msScrollbarShadowColor",
|
|
2189
|
+
"msScrollbarTrackColor",
|
|
2190
|
+
"msTextAutospace",
|
|
2191
|
+
"msTextCombineHorizontal",
|
|
2192
|
+
"msTextOverflow",
|
|
2193
|
+
"msTouchAction",
|
|
2194
|
+
"msTouchSelect",
|
|
2195
|
+
"msTransform",
|
|
2196
|
+
"msTransformOrigin",
|
|
2197
|
+
"msTransition",
|
|
2198
|
+
"msTransitionDelay",
|
|
2199
|
+
"msTransitionDuration",
|
|
2200
|
+
"msTransitionProperty",
|
|
2201
|
+
"msTransitionTimingFunction",
|
|
2202
|
+
"msUserSelect",
|
|
2203
|
+
"msWordBreak",
|
|
2204
|
+
"msWrapFlow",
|
|
2205
|
+
"msWrapMargin",
|
|
2206
|
+
"msWrapThrough",
|
|
2207
|
+
"msWritingMode",
|
|
2208
|
+
"objectFit",
|
|
2209
|
+
"objectPosition",
|
|
2210
|
+
"objectViewBox",
|
|
2211
|
+
"offset",
|
|
2212
|
+
"offsetAnchor",
|
|
2213
|
+
"offsetBlock",
|
|
2214
|
+
"offsetBlockEnd",
|
|
2215
|
+
"offsetBlockStart",
|
|
2216
|
+
"offsetDistance",
|
|
2217
|
+
"offsetInline",
|
|
2218
|
+
"offsetInlineEnd",
|
|
2219
|
+
"offsetInlineStart",
|
|
2220
|
+
"offsetPath",
|
|
2221
|
+
"offsetPosition",
|
|
2222
|
+
"offsetRotate",
|
|
2223
|
+
"offsetRotation",
|
|
2224
|
+
"opacity",
|
|
2225
|
+
"order",
|
|
2226
|
+
"orphans",
|
|
2227
|
+
"outline",
|
|
2228
|
+
"outlineColor",
|
|
2229
|
+
"outlineOffset",
|
|
2230
|
+
"outlineStyle",
|
|
2231
|
+
"outlineWidth",
|
|
2232
|
+
"overflow",
|
|
2233
|
+
"overflowAnchor",
|
|
2234
|
+
"overflowBlock",
|
|
2235
|
+
"overflowClipBox",
|
|
2236
|
+
"overflowClipMargin",
|
|
2237
|
+
"overflowInline",
|
|
2238
|
+
"overflowWrap",
|
|
2239
|
+
"overflowX",
|
|
2240
|
+
"overflowY",
|
|
2241
|
+
"overlay",
|
|
2242
|
+
"overscrollBehavior",
|
|
2243
|
+
"overscrollBehaviorBlock",
|
|
2244
|
+
"overscrollBehaviorInline",
|
|
2245
|
+
"overscrollBehaviorX",
|
|
2246
|
+
"overscrollBehaviorY",
|
|
2247
|
+
"padding",
|
|
2248
|
+
"paddingBlock",
|
|
2249
|
+
"paddingBlockEnd",
|
|
2250
|
+
"paddingBlockStart",
|
|
2251
|
+
"paddingBottom",
|
|
2252
|
+
"paddingInline",
|
|
2253
|
+
"paddingInlineEnd",
|
|
2254
|
+
"paddingInlineStart",
|
|
2255
|
+
"paddingLeft",
|
|
2256
|
+
"paddingRight",
|
|
2257
|
+
"paddingTop",
|
|
2258
|
+
"page",
|
|
2259
|
+
"pageBreakAfter",
|
|
2260
|
+
"pageBreakBefore",
|
|
2261
|
+
"pageBreakInside",
|
|
2262
|
+
"paintOrder",
|
|
2263
|
+
"perspective",
|
|
2264
|
+
"perspectiveOrigin",
|
|
2265
|
+
"placeContent",
|
|
2266
|
+
"placeItems",
|
|
2267
|
+
"placeSelf",
|
|
2268
|
+
"pointerEvents",
|
|
2269
|
+
"position",
|
|
2270
|
+
"positionAnchor",
|
|
2271
|
+
"positionArea",
|
|
2272
|
+
"positionTry",
|
|
2273
|
+
"positionTryFallbacks",
|
|
2274
|
+
"positionTryOptions",
|
|
2275
|
+
"positionTryOrder",
|
|
2276
|
+
"positionVisibility",
|
|
2277
|
+
"printColorAdjust",
|
|
2278
|
+
"quotes",
|
|
2279
|
+
"r",
|
|
2280
|
+
"resize",
|
|
2281
|
+
"right",
|
|
2282
|
+
"rotate",
|
|
2283
|
+
"rowGap",
|
|
2284
|
+
"rubyAlign",
|
|
2285
|
+
"rubyMerge",
|
|
2286
|
+
"rubyOverhang",
|
|
2287
|
+
"rubyPosition",
|
|
2288
|
+
"rx",
|
|
2289
|
+
"ry",
|
|
2290
|
+
"scale",
|
|
2291
|
+
"scrollBehavior",
|
|
2292
|
+
"scrollInitialTarget",
|
|
2293
|
+
"scrollMargin",
|
|
2294
|
+
"scrollMarginBlock",
|
|
2295
|
+
"scrollMarginBlockEnd",
|
|
2296
|
+
"scrollMarginBlockStart",
|
|
2297
|
+
"scrollMarginBottom",
|
|
2298
|
+
"scrollMarginInline",
|
|
2299
|
+
"scrollMarginInlineEnd",
|
|
2300
|
+
"scrollMarginInlineStart",
|
|
2301
|
+
"scrollMarginLeft",
|
|
2302
|
+
"scrollMarginRight",
|
|
2303
|
+
"scrollMarginTop",
|
|
2304
|
+
"scrollPadding",
|
|
2305
|
+
"scrollPaddingBlock",
|
|
2306
|
+
"scrollPaddingBlockEnd",
|
|
2307
|
+
"scrollPaddingBlockStart",
|
|
2308
|
+
"scrollPaddingBottom",
|
|
2309
|
+
"scrollPaddingInline",
|
|
2310
|
+
"scrollPaddingInlineEnd",
|
|
2311
|
+
"scrollPaddingInlineStart",
|
|
2312
|
+
"scrollPaddingLeft",
|
|
2313
|
+
"scrollPaddingRight",
|
|
2314
|
+
"scrollPaddingTop",
|
|
2315
|
+
"scrollSnapAlign",
|
|
2316
|
+
"scrollSnapCoordinate",
|
|
2317
|
+
"scrollSnapDestination",
|
|
2318
|
+
"scrollSnapMargin",
|
|
2319
|
+
"scrollSnapMarginBottom",
|
|
2320
|
+
"scrollSnapMarginLeft",
|
|
2321
|
+
"scrollSnapMarginRight",
|
|
2322
|
+
"scrollSnapMarginTop",
|
|
2323
|
+
"scrollSnapPointsX",
|
|
2324
|
+
"scrollSnapPointsY",
|
|
2325
|
+
"scrollSnapStop",
|
|
2326
|
+
"scrollSnapType",
|
|
2327
|
+
"scrollSnapTypeX",
|
|
2328
|
+
"scrollSnapTypeY",
|
|
2329
|
+
"scrollTimeline",
|
|
2330
|
+
"scrollTimelineAxis",
|
|
2331
|
+
"scrollTimelineName",
|
|
2332
|
+
"scrollbarColor",
|
|
2333
|
+
"scrollbarGutter",
|
|
2334
|
+
"scrollbarWidth",
|
|
2335
|
+
"shapeImageThreshold",
|
|
2336
|
+
"shapeMargin",
|
|
2337
|
+
"shapeOutside",
|
|
2338
|
+
"shapeRendering",
|
|
2339
|
+
"speakAs",
|
|
2340
|
+
"stopColor",
|
|
2341
|
+
"stopOpacity",
|
|
2342
|
+
"stroke",
|
|
2343
|
+
"strokeColor",
|
|
2344
|
+
"strokeDasharray",
|
|
2345
|
+
"strokeDashoffset",
|
|
2346
|
+
"strokeLinecap",
|
|
2347
|
+
"strokeLinejoin",
|
|
2348
|
+
"strokeMiterlimit",
|
|
2349
|
+
"strokeOpacity",
|
|
2350
|
+
"strokeWidth",
|
|
2351
|
+
"tabSize",
|
|
2352
|
+
"tableLayout",
|
|
2353
|
+
"textAlign",
|
|
2354
|
+
"textAlignLast",
|
|
2355
|
+
"textAnchor",
|
|
2356
|
+
"textAutospace",
|
|
2357
|
+
"textBox",
|
|
2358
|
+
"textBoxEdge",
|
|
2359
|
+
"textBoxTrim",
|
|
2360
|
+
"textCombineUpright",
|
|
2361
|
+
"textDecoration",
|
|
2362
|
+
"textDecorationColor",
|
|
2363
|
+
"textDecorationLine",
|
|
2364
|
+
"textDecorationSkip",
|
|
2365
|
+
"textDecorationSkipInk",
|
|
2366
|
+
"textDecorationStyle",
|
|
2367
|
+
"textDecorationThickness",
|
|
2368
|
+
"textEmphasis",
|
|
2369
|
+
"textEmphasisColor",
|
|
2370
|
+
"textEmphasisPosition",
|
|
2371
|
+
"textEmphasisStyle",
|
|
2372
|
+
"textIndent",
|
|
2373
|
+
"textJustify",
|
|
2374
|
+
"textOrientation",
|
|
2375
|
+
"textOverflow",
|
|
2376
|
+
"textRendering",
|
|
2377
|
+
"textShadow",
|
|
2378
|
+
"textSizeAdjust",
|
|
2379
|
+
"textSpacingTrim",
|
|
2380
|
+
"textTransform",
|
|
2381
|
+
"textUnderlineOffset",
|
|
2382
|
+
"textUnderlinePosition",
|
|
2383
|
+
"textWrap",
|
|
2384
|
+
"textWrapMode",
|
|
2385
|
+
"textWrapStyle",
|
|
2386
|
+
"timelineScope",
|
|
2387
|
+
"top",
|
|
2388
|
+
"touchAction",
|
|
2389
|
+
"transform",
|
|
2390
|
+
"transformBox",
|
|
2391
|
+
"transformOrigin",
|
|
2392
|
+
"transformStyle",
|
|
2393
|
+
"transition",
|
|
2394
|
+
"transitionBehavior",
|
|
2395
|
+
"transitionDelay",
|
|
2396
|
+
"transitionDuration",
|
|
2397
|
+
"transitionProperty",
|
|
2398
|
+
"transitionTimingFunction",
|
|
2399
|
+
"translate",
|
|
2400
|
+
"unicodeBidi",
|
|
2401
|
+
"userSelect",
|
|
2402
|
+
"vectorEffect",
|
|
2403
|
+
"verticalAlign",
|
|
2404
|
+
"viewTimeline",
|
|
2405
|
+
"viewTimelineAxis",
|
|
2406
|
+
"viewTimelineInset",
|
|
2407
|
+
"viewTimelineName",
|
|
2408
|
+
"viewTransitionClass",
|
|
2409
|
+
"viewTransitionName",
|
|
2410
|
+
"visibility",
|
|
2411
|
+
"whiteSpace",
|
|
2412
|
+
"whiteSpaceCollapse",
|
|
2413
|
+
"widows",
|
|
2414
|
+
"width",
|
|
2415
|
+
"willChange",
|
|
2416
|
+
"wordBreak",
|
|
2417
|
+
"wordSpacing",
|
|
2418
|
+
"wordWrap",
|
|
2419
|
+
"writingMode",
|
|
2420
|
+
"x",
|
|
2421
|
+
"y",
|
|
2422
|
+
"zIndex",
|
|
2423
|
+
"zoom"
|
|
2424
|
+
];
|
|
1560
2425
|
//#endregion
|
|
1561
2426
|
//#region src/artifacts/types/generated.ts
|
|
1562
2427
|
function getGeneratedTypes(ctx) {
|
|
@@ -1713,6 +2578,8 @@ function generatePropTypes(ctx) {
|
|
|
1713
2578
|
}
|
|
1714
2579
|
//#endregion
|
|
1715
2580
|
//#region src/artifacts/types/style-props.ts
|
|
2581
|
+
/** The names `CssProperties["…"]` resolves for. See `packages/types/scripts/css-property-names.ts`. */
|
|
2582
|
+
const declaredCssProperties = new Set(cssProperties);
|
|
1716
2583
|
function generateStyleProps(ctx) {
|
|
1717
2584
|
const props = new Set(allCssProperties.concat(ctx.utility.keys()).filter(Boolean));
|
|
1718
2585
|
const propTypes = ctx.utility.getTypes();
|
|
@@ -1737,7 +2604,7 @@ function generateStyleProps(ctx) {
|
|
|
1737
2604
|
${Array.from(props).map((key) => {
|
|
1738
2605
|
const prop = ctx.utility.shorthands.get(key) ?? key;
|
|
1739
2606
|
const union = [];
|
|
1740
|
-
const cssFallback = allCssProperties.includes(prop) ? `CssProperties["${prop}"]` : "";
|
|
2607
|
+
const cssFallback = allCssProperties.includes(prop) && declaredCssProperties.has(prop) ? `CssProperties["${prop}"]` : "";
|
|
1741
2608
|
/**
|
|
1742
2609
|
* A utility's own values *extend* what the property accepts; they never replace it.
|
|
1743
2610
|
*
|
|
@@ -3336,7 +4203,7 @@ const generateSemanticTokensSpec = (ctx) => {
|
|
|
3336
4203
|
return {
|
|
3337
4204
|
type: "semantic-tokens",
|
|
3338
4205
|
data: Array.from(ctx.tokens.view.categoryMap.entries()).map(([category, tokenMap]) => {
|
|
3339
|
-
const typeTokens = Array.from(tokenMap.values()).filter((token) => (token.extensions.isSemantic || token.extensions.conditions) && !token.extensions.isVirtual);
|
|
4206
|
+
const typeTokens = Array.from(tokenMap.values()).filter((token) => (token.extensions.isSemantic || token.extensions.conditions) && !token.extensions.isVirtual && !token.extensions.isNegative);
|
|
3340
4207
|
if (!typeTokens.length) return null;
|
|
3341
4208
|
const firstToken = typeTokens[0];
|
|
3342
4209
|
const { functionExamples, tokenFunctionExamples } = generateTokenExamples(firstToken, ctx.tokens.view.get(firstToken.name));
|