zyzz 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -19
- package/dist/Config.d.ts +16 -167
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +7 -246
- package/dist/Config.js.map +1 -1
- package/dist/Style.d.ts +15 -12
- package/dist/Style.d.ts.map +1 -1
- package/dist/Style.js +51 -26
- package/dist/Style.js.map +1 -1
- package/dist/Vars.d.ts +114 -0
- package/dist/Vars.d.ts.map +1 -0
- package/dist/Vars.js +42 -0
- package/dist/Vars.js.map +1 -0
- package/dist/compiler/Graph.js +11 -8
- package/dist/compiler/Graph.js.map +1 -1
- package/dist/compiler/Native.d.ts +5 -5
- package/dist/compiler/Native.d.ts.map +1 -1
- package/dist/compiler/Native.js +21 -21
- package/dist/compiler/Native.js.map +1 -1
- package/dist/compiler/Source.d.ts +8 -6
- package/dist/compiler/Source.d.ts.map +1 -1
- package/dist/compiler/Source.js +47 -14
- package/dist/compiler/Source.js.map +1 -1
- package/dist/compiler/Transform.d.ts +1 -1
- package/dist/compiler/Transform.d.ts.map +1 -1
- package/dist/compiler/Transform.js +58 -22
- package/dist/compiler/Transform.js.map +1 -1
- package/dist/compiler/internal/Compositions.d.ts +5 -0
- package/dist/compiler/internal/Compositions.d.ts.map +1 -1
- package/dist/compiler/internal/Compositions.js +22 -3
- package/dist/compiler/internal/Compositions.js.map +1 -1
- package/dist/compiler/internal/Configurations.d.ts.map +1 -1
- package/dist/compiler/internal/Configurations.js +73 -12
- package/dist/compiler/internal/Configurations.js.map +1 -1
- package/dist/compiler/internal/Contract.d.ts +1 -1
- package/dist/compiler/internal/Contract.d.ts.map +1 -1
- package/dist/compiler/internal/Contract.js +155 -13
- package/dist/compiler/internal/Contract.js.map +1 -1
- package/dist/compiler/internal/Contributions.js +1 -1
- package/dist/compiler/internal/Contributions.js.map +1 -1
- package/dist/compiler/internal/Dynamic.js +1 -1
- package/dist/compiler/internal/Dynamic.js.map +1 -1
- package/dist/compiler/internal/Expression.d.ts +3 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -1
- package/dist/compiler/internal/Expression.js +21 -0
- package/dist/compiler/internal/Expression.js.map +1 -1
- package/dist/compiler/internal/Identifiers.d.ts +1 -1
- package/dist/compiler/internal/Identifiers.d.ts.map +1 -1
- package/dist/compiler/internal/Identifiers.js +2 -2
- package/dist/compiler/internal/Identifiers.js.map +1 -1
- package/dist/compiler/internal/NativeBindings.d.ts +1 -1
- package/dist/compiler/internal/NativeBindings.d.ts.map +1 -1
- package/dist/compiler/internal/NativeBindings.js +3 -3
- package/dist/compiler/internal/NativeBindings.js.map +1 -1
- package/dist/compiler/internal/PackedStyles.d.ts +1 -1
- package/dist/compiler/internal/PackedStyles.d.ts.map +1 -1
- package/dist/compiler/internal/PackedStyles.js +15 -25
- package/dist/compiler/internal/PackedStyles.js.map +1 -1
- package/dist/compiler/internal/Recipes.js +1 -1
- package/dist/compiler/internal/Recipes.js.map +1 -1
- package/dist/compiler/internal/Selectors.js +1 -1
- package/dist/compiler/internal/Selectors.js.map +1 -1
- package/dist/compiler/internal/Themes.d.ts +12 -3
- package/dist/compiler/internal/Themes.d.ts.map +1 -1
- package/dist/compiler/internal/Themes.js +192 -52
- package/dist/compiler/internal/Themes.js.map +1 -1
- package/dist/compiler/internal/{Variables.d.ts → Vars.d.ts} +1 -1
- package/dist/compiler/internal/Vars.d.ts.map +1 -0
- package/dist/compiler/internal/{Variables.js → Vars.js} +3 -3
- package/dist/compiler/internal/Vars.js.map +1 -0
- package/dist/default.d.ts +147 -2562
- package/dist/default.d.ts.map +1 -1
- package/dist/default.js +85 -80
- package/dist/default.js.map +2 -2
- package/dist/default.js.zyzz.json +1 -1
- package/dist/esbuild/index.d.ts +3 -0
- package/dist/esbuild/index.d.ts.map +1 -0
- package/dist/esbuild/index.js +5 -0
- package/dist/esbuild/index.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/Authoring.d.ts +1 -1
- package/dist/internal/Authoring.d.ts.map +1 -1
- package/dist/internal/Authoring.js +4 -4
- package/dist/internal/Authoring.js.map +1 -1
- package/dist/internal/Binding.d.ts +1 -1
- package/dist/internal/Binding.d.ts.map +1 -1
- package/dist/internal/Completion.d.ts +19 -0
- package/dist/internal/Completion.d.ts.map +1 -0
- package/dist/internal/Completion.js +2 -0
- package/dist/internal/Completion.js.map +1 -0
- package/dist/internal/Condition.d.ts +3 -1
- package/dist/internal/Condition.d.ts.map +1 -1
- package/dist/internal/Condition.js.map +1 -1
- package/dist/internal/Configuration.d.ts +248 -0
- package/dist/internal/Configuration.d.ts.map +1 -0
- package/dist/internal/Configuration.js +343 -0
- package/dist/internal/Configuration.js.map +1 -0
- package/dist/{Theme.d.ts → internal/Theme.d.ts} +15 -13
- package/dist/internal/Theme.d.ts.map +1 -0
- package/dist/{Theme.js → internal/Theme.js} +39 -12
- package/dist/internal/Theme.js.map +1 -0
- package/dist/internal/Token.d.ts +46 -16
- package/dist/internal/Token.d.ts.map +1 -1
- package/dist/internal/Token.js +89 -5
- package/dist/internal/Token.js.map +1 -1
- package/dist/internal/Typography.d.ts +13 -5
- package/dist/internal/Typography.d.ts.map +1 -1
- package/dist/internal/Typography.js +42 -6
- package/dist/internal/Typography.js.map +1 -1
- package/dist/internal/Value.d.ts +6 -1
- package/dist/internal/Value.d.ts.map +1 -1
- package/dist/internal/Value.js.map +1 -1
- package/dist/internal/VariableSets.d.ts +20 -0
- package/dist/internal/VariableSets.d.ts.map +1 -0
- package/dist/internal/VariableSets.js +317 -0
- package/dist/internal/VariableSets.js.map +1 -0
- package/dist/next/loader.js +15 -5
- package/dist/next/loader.js.map +1 -1
- package/dist/node/Host.d.ts.map +1 -1
- package/dist/node/Host.js +1 -1
- package/dist/node/Host.js.map +1 -1
- package/dist/react-native/Host.d.ts +2 -2
- package/dist/react-native/Host.d.ts.map +1 -1
- package/dist/react-native/Host.js +4 -4
- package/dist/react-native/Host.js.map +1 -1
- package/dist/react-native/StyleSheet.d.ts +9 -8
- package/dist/react-native/StyleSheet.d.ts.map +1 -1
- package/dist/react-native/StyleSheet.js +29 -23
- package/dist/react-native/StyleSheet.js.map +1 -1
- package/dist/react-native/Variants.d.ts +3 -3
- package/dist/react-native/Variants.d.ts.map +1 -1
- package/dist/react-native/Variants.js +2 -2
- package/dist/react-native/react.d.ts +1 -1
- package/dist/react-native/react.d.ts.map +1 -1
- package/dist/react-native/react.js +5 -5
- package/dist/react-native/react.js.map +1 -1
- package/dist/rollup/index.d.ts +3 -0
- package/dist/rollup/index.d.ts.map +1 -0
- package/dist/rollup/index.js +5 -0
- package/dist/rollup/index.js.map +1 -0
- package/dist/runtime/Appearance.d.ts +7 -7
- package/dist/runtime/Appearance.d.ts.map +1 -1
- package/dist/runtime/Appearance.js +15 -15
- package/dist/runtime/Appearance.js.map +1 -1
- package/dist/runtime/Dynamic.d.ts.map +1 -1
- package/dist/runtime/Dynamic.js +4 -1
- package/dist/runtime/Dynamic.js.map +1 -1
- package/dist/runtime/NativeContext.d.ts +4 -4
- package/dist/runtime/NativeContext.d.ts.map +1 -1
- package/dist/runtime/NativeContext.js +5 -5
- package/dist/runtime/NativeContext.js.map +1 -1
- package/dist/runtime/NativeDynamic.d.ts +1 -1
- package/dist/runtime/NativeDynamic.d.ts.map +1 -1
- package/dist/runtime/NativeDynamic.js.map +1 -1
- package/dist/runtime/Props.d.ts +1 -1
- package/dist/runtime/Props.js +3 -3
- package/dist/runtime/Props.js.map +1 -1
- package/dist/runtime/Selection.d.ts +14 -10
- package/dist/runtime/Selection.d.ts.map +1 -1
- package/dist/runtime/Selection.js +19 -18
- package/dist/runtime/Selection.js.map +1 -1
- package/dist/styleFunction.d.ts +14 -14
- package/dist/styleFunction.d.ts.map +1 -1
- package/dist/styleFunction.js.map +1 -1
- package/dist/unplugin/index.d.ts +20 -0
- package/dist/unplugin/index.d.ts.map +1 -0
- package/dist/unplugin/index.js +498 -0
- package/dist/unplugin/index.js.map +1 -0
- package/dist/variants.d.ts +3 -3
- package/dist/variants.d.ts.map +1 -1
- package/dist/variants.js.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +6 -3
- package/dist/vite/index.js.map +1 -1
- package/dist/web/Css.d.ts +4 -3
- package/dist/web/Css.d.ts.map +1 -1
- package/dist/web/Css.js +4 -4
- package/dist/web/Css.js.map +1 -1
- package/dist/web/internal/Themes.d.ts +3 -2
- package/dist/web/internal/Themes.d.ts.map +1 -1
- package/dist/web/internal/Themes.js +42 -6
- package/dist/web/internal/Themes.js.map +1 -1
- package/dist/webpack/index.d.ts +3 -0
- package/dist/webpack/index.d.ts.map +1 -0
- package/dist/webpack/index.js +5 -0
- package/dist/webpack/index.js.map +1 -0
- package/package.json +23 -2
- package/src/Config.ts +43 -685
- package/src/Style.ts +97 -34
- package/src/Vars.ts +299 -0
- package/src/compiler/Graph.ts +14 -9
- package/src/compiler/Native.ts +29 -32
- package/src/compiler/Source.ts +59 -21
- package/src/compiler/Transform.ts +73 -23
- package/src/compiler/internal/Compositions.ts +36 -3
- package/src/compiler/internal/Configurations.ts +83 -11
- package/src/compiler/internal/Contract.ts +207 -15
- package/src/compiler/internal/Contributions.ts +1 -1
- package/src/compiler/internal/Dynamic.ts +1 -1
- package/src/compiler/internal/Expression.ts +26 -0
- package/src/compiler/internal/Identifiers.ts +2 -1
- package/src/compiler/internal/NativeBindings.ts +3 -3
- package/src/compiler/internal/PackedStyles.ts +22 -26
- package/src/compiler/internal/Recipes.ts +1 -1
- package/src/compiler/internal/Selectors.ts +1 -1
- package/src/compiler/internal/Themes.ts +266 -57
- package/src/compiler/internal/{Variables.ts → Vars.ts} +2 -2
- package/src/default.ts +173 -154
- package/src/esbuild/index.ts +5 -0
- package/src/index.ts +4 -4
- package/src/internal/Authoring.ts +5 -7
- package/src/internal/Binding.ts +1 -1
- package/src/internal/Completion.ts +42 -0
- package/src/internal/Condition.ts +31 -1
- package/src/internal/Configuration.ts +970 -0
- package/src/{Theme.ts → internal/Theme.ts} +75 -20
- package/src/internal/Token.ts +258 -85
- package/src/internal/Typography.ts +71 -16
- package/src/internal/Value.ts +45 -26
- package/src/internal/VariableSets.ts +458 -0
- package/src/next/loader.ts +19 -5
- package/src/node/Host.ts +1 -2
- package/src/react-native/Host.ts +6 -6
- package/src/react-native/StyleSheet.ts +49 -42
- package/src/react-native/Variants.ts +3 -3
- package/src/react-native/react.ts +6 -6
- package/src/rollup/index.ts +5 -0
- package/src/runtime/Appearance.ts +20 -20
- package/src/runtime/Dynamic.ts +4 -1
- package/src/runtime/NativeContext.ts +8 -8
- package/src/runtime/NativeDynamic.ts +2 -4
- package/src/runtime/Props.ts +3 -3
- package/src/runtime/Selection.ts +44 -33
- package/src/styleFunction.ts +22 -19
- package/src/unplugin/index.ts +600 -0
- package/src/variants.ts +7 -5
- package/src/vite/index.ts +5 -4
- package/src/web/Css.ts +10 -7
- package/src/web/internal/Themes.ts +52 -9
- package/src/webpack/index.ts +5 -0
- package/dist/Theme.d.ts.map +0 -1
- package/dist/Theme.js.map +0 -1
- package/dist/compiler/internal/Variables.d.ts.map +0 -1
- package/dist/compiler/internal/Variables.js.map +0 -1
package/src/runtime/Selection.ts
CHANGED
|
@@ -1,75 +1,86 @@
|
|
|
1
|
-
/** Selects compiler-owned
|
|
1
|
+
/** Selects compiler-owned variable scope classes without evaluating authoring code. @module */
|
|
2
2
|
import * as Scheme from '../internal/Scheme.js'
|
|
3
|
+
import * as Html from './CompositionHtml.js'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* Creates a validated selector with the compatible named
|
|
6
|
+
* Creates a validated selector with the compatible named set catalog.
|
|
6
7
|
* A selected scheme adds its stylesheet class beside the scope class and an inline `color-scheme`.
|
|
7
|
-
* @param entries Compatible
|
|
8
|
+
* @param entries Compatible set names paired with compiler-owned scope classes.
|
|
8
9
|
* @param html Whether selection returns HTML class/serialized-style props. Defaults to false (React className/object-style props).
|
|
9
|
-
* @returns A callable selector
|
|
10
|
+
* @returns A callable selector returning scope props.
|
|
10
11
|
* @throws {TypeError} When selection names, schemes, or option keys are invalid.
|
|
11
12
|
*/
|
|
12
13
|
export function create<
|
|
13
14
|
const entries extends readonly (readonly [string, string])[],
|
|
14
15
|
const html extends boolean = false,
|
|
15
16
|
>(entries: entries, html?: html): create.ReturnType<entries[number][0], html>
|
|
17
|
+
export function create(
|
|
18
|
+
entries: readonly (readonly [string, string])[],
|
|
19
|
+
html: boolean,
|
|
20
|
+
key: 'set',
|
|
21
|
+
defaultSet?: string,
|
|
22
|
+
): (input?: { set?: string | undefined; colorScheme?: string | undefined }) => {
|
|
23
|
+
className?: string
|
|
24
|
+
class?: string
|
|
25
|
+
style?: unknown
|
|
26
|
+
}
|
|
16
27
|
export function create(
|
|
17
28
|
entries: readonly (readonly [string, string])[],
|
|
18
29
|
html = false,
|
|
19
|
-
|
|
30
|
+
key: 'set' = 'set',
|
|
31
|
+
defaultSet?: string,
|
|
32
|
+
): unknown {
|
|
20
33
|
const catalog = Object.fromEntries(entries)
|
|
21
34
|
|
|
22
|
-
const select = (
|
|
35
|
+
const select = (
|
|
36
|
+
input: {
|
|
37
|
+
set?: string | undefined
|
|
38
|
+
colorScheme?: string | undefined
|
|
39
|
+
} = {},
|
|
40
|
+
) => {
|
|
41
|
+
const selected =
|
|
42
|
+
input && typeof input === 'object'
|
|
43
|
+
? (input[key] ?? defaultSet)
|
|
44
|
+
: undefined
|
|
23
45
|
if (
|
|
24
46
|
!input ||
|
|
25
47
|
typeof input !== 'object' ||
|
|
26
48
|
Array.isArray(input) ||
|
|
27
|
-
!Object.hasOwn(input,
|
|
28
|
-
typeof
|
|
29
|
-
!Object.hasOwn(catalog,
|
|
49
|
+
(!Object.hasOwn(input, key) && defaultSet === undefined) ||
|
|
50
|
+
typeof selected !== 'string' ||
|
|
51
|
+
!Object.hasOwn(catalog, selected!) ||
|
|
30
52
|
Object.keys(input).some(
|
|
31
|
-
(
|
|
53
|
+
(field) => field !== key && field !== 'colorScheme',
|
|
32
54
|
) ||
|
|
33
55
|
(input.colorScheme !== undefined &&
|
|
34
56
|
!['light', 'dark', 'light dark'].includes(input.colorScheme))
|
|
35
57
|
)
|
|
36
|
-
throw new TypeError('Invalid
|
|
58
|
+
throw new TypeError('Invalid variable selection.')
|
|
37
59
|
|
|
38
60
|
const scheme = input.colorScheme as Scheme.Name | undefined
|
|
39
61
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
? `${catalog[
|
|
43
|
-
: catalog[
|
|
44
|
-
...(scheme
|
|
45
|
-
? {
|
|
46
|
-
style: html ? `color-scheme:${scheme}` : { colorScheme: scheme },
|
|
47
|
-
}
|
|
48
|
-
: {}),
|
|
62
|
+
const props = {
|
|
63
|
+
className: scheme
|
|
64
|
+
? `${catalog[selected!]} ${Scheme.classes[scheme]}`
|
|
65
|
+
: catalog[selected!]!,
|
|
66
|
+
...(scheme ? { style: { colorScheme: scheme } } : {}),
|
|
49
67
|
}
|
|
68
|
+
return html ? Html.from(props) : props
|
|
50
69
|
}
|
|
51
70
|
|
|
52
|
-
return
|
|
53
|
-
select,
|
|
54
|
-
Object.getOwnPropertyDescriptors(
|
|
55
|
-
Object.fromEntries(
|
|
56
|
-
entries.map(([name, className]) => [name, { className }]),
|
|
57
|
-
),
|
|
58
|
-
),
|
|
59
|
-
) as unknown as create.ReturnType<string, boolean>
|
|
71
|
+
return select as create.ReturnType<string, boolean>
|
|
60
72
|
}
|
|
61
73
|
|
|
62
|
-
/** Typed compiler-owned selection
|
|
74
|
+
/** Typed compiler-owned scope selection. */
|
|
63
75
|
export declare namespace create {
|
|
64
76
|
type ReturnType<name extends string, html extends boolean = false> = {
|
|
65
77
|
<
|
|
66
78
|
const input extends {
|
|
67
|
-
readonly
|
|
79
|
+
readonly set: name
|
|
68
80
|
readonly colorScheme?: 'light' | 'dark' | 'light dark' | undefined
|
|
69
81
|
},
|
|
70
82
|
>(
|
|
71
|
-
input: input &
|
|
72
|
-
Record<Exclude<keyof input, 'theme' | 'colorScheme'>, never>,
|
|
83
|
+
input: input & Record<Exclude<keyof input, 'set' | 'colorScheme'>, never>,
|
|
73
84
|
): html extends true
|
|
74
85
|
? { readonly class: string; readonly style?: string | undefined }
|
|
75
86
|
: {
|
|
@@ -78,5 +89,5 @@ export declare namespace create {
|
|
|
78
89
|
| { readonly colorScheme: 'light' | 'dark' | 'light dark' }
|
|
79
90
|
| undefined
|
|
80
91
|
}
|
|
81
|
-
}
|
|
92
|
+
}
|
|
82
93
|
}
|
package/src/styleFunction.ts
CHANGED
|
@@ -4,25 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as Authoring from './internal/Authoring.js'
|
|
6
6
|
import type * as Binding from './internal/Binding.js'
|
|
7
|
+
import type * as Completion from './internal/Completion.js'
|
|
7
8
|
import type * as Literal from './internal/Literal.js'
|
|
8
9
|
import type * as Style from './Style.js'
|
|
9
10
|
|
|
10
|
-
/** Restricts callback hints to inferred declarations instead of expanding every property grammar. */
|
|
11
|
-
type CompletionProperties<styles = Record<string, unknown>> = {
|
|
12
|
-
readonly [property in keyof typeof Literal.rules & keyof styles]?:
|
|
13
|
-
| Literal.Properties[property]
|
|
14
|
-
| (string & {})
|
|
15
|
-
| number
|
|
16
|
-
| object
|
|
17
|
-
}
|
|
18
|
-
|
|
19
11
|
type Keys<value> = value extends unknown ? keyof value : never
|
|
20
12
|
|
|
13
|
+
// Keep named and custom-property instantiations separate so framework interfaces need no index signature.
|
|
14
|
+
type InlineProperties<properties extends string> = {
|
|
15
|
+
readonly [property in properties]?: string | number | undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
21
18
|
type VariableOptions<input> = input extends {
|
|
22
|
-
readonly
|
|
19
|
+
readonly vars: infer variables
|
|
23
20
|
}
|
|
24
21
|
? {
|
|
25
|
-
readonly
|
|
22
|
+
readonly vars: {
|
|
26
23
|
readonly [key in keyof variables]: string extends key
|
|
27
24
|
? variables[key]
|
|
28
25
|
: key extends `--${string}`
|
|
@@ -49,7 +46,7 @@ export function style<
|
|
|
49
46
|
values: values,
|
|
50
47
|
) => styles &
|
|
51
48
|
NoInfer<Style.Accepted<styles, {}, true> & Binding.Checked<styles>>) &
|
|
52
|
-
|
|
49
|
+
Completion.Properties<{}, NoInfer<styles>>,
|
|
53
50
|
// Exclude invalid callbacks by arity so they cannot mask object-property diagnostics.
|
|
54
51
|
...options: Parameters<callback> extends [Record<string, string | number>]
|
|
55
52
|
? values extends Binding.Inputs<values>
|
|
@@ -60,7 +57,7 @@ export function style<
|
|
|
60
57
|
export function style<const styles extends Record<string, unknown>>(
|
|
61
58
|
styles: styles &
|
|
62
59
|
NoInfer<Style.Accepted<styles, {}, true>> &
|
|
63
|
-
|
|
60
|
+
Completion.Properties,
|
|
64
61
|
options?: style.DefinitionOptions,
|
|
65
62
|
): style.ReturnType
|
|
66
63
|
export function style(
|
|
@@ -80,7 +77,7 @@ export declare namespace style {
|
|
|
80
77
|
type DefinitionOptions = { readonly id?: string | undefined }
|
|
81
78
|
/** Callable compiled bindings with required scalar inputs and styling overrides. */
|
|
82
79
|
type Dynamic<values, output extends Output = 'react'> = Reference &
|
|
83
|
-
(<const input extends values & Options
|
|
80
|
+
(<const input extends values & Options<output>>(
|
|
84
81
|
input: input &
|
|
85
82
|
VariableOptions<input> &
|
|
86
83
|
Record<Exclude<keyof input, keyof values | keyof Options>, never>,
|
|
@@ -90,13 +87,19 @@ export declare namespace style {
|
|
|
90
87
|
type ErrorType = Error
|
|
91
88
|
|
|
92
89
|
/** Styling overrides consumed by a transformed definition. */
|
|
93
|
-
type Options = {
|
|
90
|
+
type Options<output extends Output = 'react'> = {
|
|
94
91
|
/** External class names appended to the generated classes. */
|
|
95
92
|
readonly className?: string | undefined
|
|
96
|
-
/**
|
|
97
|
-
readonly style?:
|
|
93
|
+
/** Inline overrides. React accepts scalar values, while HTML requires CSS units. */
|
|
94
|
+
readonly style?:
|
|
95
|
+
| (output extends 'html'
|
|
96
|
+
? Literal.Properties
|
|
97
|
+
:
|
|
98
|
+
| InlineProperties<keyof typeof Literal.rules>
|
|
99
|
+
| InlineProperties<keyof Literal.Properties>)
|
|
100
|
+
| undefined
|
|
98
101
|
/** Inline custom-property assignments, merged before explicit style overrides. */
|
|
99
|
-
readonly
|
|
102
|
+
readonly vars?:
|
|
100
103
|
| Readonly<Record<`--${string}`, string | number | undefined>>
|
|
101
104
|
| undefined
|
|
102
105
|
}
|
|
@@ -118,7 +121,7 @@ export declare namespace style {
|
|
|
118
121
|
|
|
119
122
|
/** Callable definition; source rewriting supplies its implementation. */
|
|
120
123
|
type ReturnType<output extends Output = 'react'> = Reference &
|
|
121
|
-
(<const options extends Options = Options
|
|
124
|
+
(<const options extends Options<output> = Options<output>>(
|
|
122
125
|
options?: options &
|
|
123
126
|
VariableOptions<options> &
|
|
124
127
|
Record<Exclude<Keys<options>, keyof Options>, never>,
|