@webstudio-is/css-engine 0.191.4 → 0.191.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.
Files changed (32) hide show
  1. package/lib/index.js +953 -0
  2. package/lib/types/__generated__/types.d.ts +2 -0
  3. package/lib/types/core/atomic.d.ts +14 -0
  4. package/lib/types/core/atomic.test.d.ts +1 -0
  5. package/lib/types/core/compare-media.d.ts +6 -0
  6. package/lib/types/core/compare-media.test.d.ts +1 -0
  7. package/lib/types/core/create-style-sheet.d.ts +4 -0
  8. package/lib/types/core/css-engine.stories.d.ts +5 -0
  9. package/lib/types/core/equal-media.d.ts +2 -0
  10. package/lib/types/core/equal-media.test.d.ts +1 -0
  11. package/lib/types/core/find-applicable-media.d.ts +2 -0
  12. package/lib/types/core/find-applicable-media.test.d.ts +1 -0
  13. package/lib/types/core/index.d.ts +13 -0
  14. package/lib/types/core/match-media.d.ts +2 -0
  15. package/lib/types/core/match-media.test.d.ts +1 -0
  16. package/lib/types/core/merger.d.ts +274 -0
  17. package/lib/types/core/merger.test.d.ts +1 -0
  18. package/lib/types/core/prefixer.d.ts +2 -0
  19. package/lib/types/core/prefixer.test.d.ts +1 -0
  20. package/lib/types/core/rules.d.ts +104 -0
  21. package/lib/types/core/style-element.d.ts +10 -0
  22. package/lib/types/core/style-sheet-regular.d.ts +3 -0
  23. package/lib/types/core/style-sheet-regular.test.d.ts +1 -0
  24. package/lib/types/core/style-sheet.d.ts +24 -0
  25. package/lib/types/core/to-property.d.ts +4 -0
  26. package/lib/types/core/to-property.test.d.ts +1 -0
  27. package/lib/types/core/to-value.d.ts +3 -0
  28. package/lib/types/core/to-value.test.d.ts +1 -0
  29. package/lib/types/css.d.ts +1 -0
  30. package/lib/types/index.d.ts +4 -0
  31. package/lib/types/schema.d.ts +3925 -0
  32. package/package.json +3 -3
@@ -0,0 +1,2 @@
1
+ export type Property = "WebkitFontSmoothing" | "MozOsxFontSmoothing" | "-webkit-box-orient" | "-webkit-line-clamp" | "-webkit-overflow-scrolling" | "-webkit-tap-highlight-color" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "clip" | "clipPath" | "color" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "containerName" | "containerType" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "fieldSizing" | "filter" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesisSmallCaps" | "fontSynthesisStyle" | "fontSynthesisWeight" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "height" | "hyphenateCharacter" | "hyphenateLimitChars" | "hyphens" | "imageOrientation" | "imageRendering" | "inlineSize" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineBreak" | "lineHeight" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "page" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "printColorAdjust" | "quotes" | "resize" | "right" | "rotate" | "rowGap" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "textWrapMode" | "textWrapStyle" | "top" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionBehavior" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpaceCollapse" | "widows" | "width" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex" | "zoom";
2
+ export type Unit = "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
@@ -0,0 +1,14 @@
1
+ import type { StyleSheet } from "./style-sheet";
2
+ import { NestingRule } from "./rules";
3
+ import { type TransformValue } from "./to-value";
4
+ type Options = {
5
+ /** in case of undefined the rule will not be split into atomics */
6
+ getKey: (rule: NestingRule) => string | undefined;
7
+ transformValue?: TransformValue;
8
+ classes?: Map<string, string[]>;
9
+ };
10
+ export declare const generateAtomic: (sheet: StyleSheet, options: Options) => {
11
+ cssText: string;
12
+ classes: Map<string, string[]>;
13
+ };
14
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { MediaRuleOptions } from "./rules";
2
+ /**
3
+ * Sort by minWidth descending or maxWidth ascending
4
+ * We want media querries with bigger minWidth to override the smaller once, but the smaller maxWidth to override the bigger once.
5
+ */
6
+ export declare const compareMedia: (optionA: MediaRuleOptions, optionB: MediaRuleOptions) => number;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { StyleSheetRegular } from "./style-sheet-regular";
2
+ export declare const createRegularStyleSheet: (options?: {
3
+ name?: string;
4
+ }) => StyleSheetRegular;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ component: string;
3
+ };
4
+ export default _default;
5
+ export declare const Basic: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { MediaRuleOptions } from "./rules";
2
+ export declare const equalMedia: (left: MediaRuleOptions, right: MediaRuleOptions) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { MediaRuleOptions } from "./rules";
2
+ export declare const findApplicableMedia: <Media extends MediaRuleOptions>(media: Array<Media>, width: number) => Media | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export type { StyleMap, NestingRule, MediaRule, PlaintextRule, FontFaceRule, } from "./rules";
2
+ export { prefixStyles } from "./prefixer";
3
+ export { mergeStyles } from "./merger";
4
+ export { generateStyleMap } from "./rules";
5
+ export type { StyleSheetRegular } from "./style-sheet-regular";
6
+ export * from "./create-style-sheet";
7
+ export * from "./to-value";
8
+ export { hyphenateProperty } from "./to-property";
9
+ export * from "./match-media";
10
+ export * from "./equal-media";
11
+ export * from "./compare-media";
12
+ export * from "./find-applicable-media";
13
+ export * from "./atomic";
@@ -0,0 +1,2 @@
1
+ import type { MediaRuleOptions } from "./rules";
2
+ export declare const matchMedia: (options: MediaRuleOptions, width: number) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,274 @@
1
+ import { StyleValue } from "../schema";
2
+ import type { StyleMap } from "./rules";
3
+ export declare const mergeStyles: (styleMap: StyleMap) => Map<string, {
4
+ value: {
5
+ value: string;
6
+ type: "asset";
7
+ } | {
8
+ type: "url";
9
+ url: string;
10
+ };
11
+ type: "image";
12
+ hidden?: boolean | undefined;
13
+ } | {
14
+ value: number;
15
+ type: "unit";
16
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
17
+ hidden?: boolean | undefined;
18
+ } | {
19
+ value: string;
20
+ type: "keyword";
21
+ hidden?: boolean | undefined;
22
+ } | {
23
+ value: string;
24
+ type: "unparsed";
25
+ hidden?: boolean | undefined;
26
+ } | {
27
+ type: "rgb";
28
+ r: number;
29
+ g: number;
30
+ b: number;
31
+ alpha: number;
32
+ hidden?: boolean | undefined;
33
+ } | {
34
+ type: "function";
35
+ name: string;
36
+ args: StyleValue;
37
+ hidden?: boolean;
38
+ } | {
39
+ value: string;
40
+ type: "var";
41
+ fallback?: {
42
+ value: number;
43
+ type: "unit";
44
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
45
+ hidden?: boolean | undefined;
46
+ } | {
47
+ value: string;
48
+ type: "keyword";
49
+ hidden?: boolean | undefined;
50
+ } | {
51
+ value: string;
52
+ type: "unparsed";
53
+ hidden?: boolean | undefined;
54
+ } | {
55
+ type: "rgb";
56
+ r: number;
57
+ g: number;
58
+ b: number;
59
+ alpha: number;
60
+ hidden?: boolean | undefined;
61
+ } | undefined;
62
+ hidden?: boolean | undefined;
63
+ } | {
64
+ value: ({
65
+ value: {
66
+ value: string;
67
+ type: "asset";
68
+ } | {
69
+ type: "url";
70
+ url: string;
71
+ };
72
+ type: "image";
73
+ hidden?: boolean | undefined;
74
+ } | {
75
+ value: number;
76
+ type: "unit";
77
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
78
+ hidden?: boolean | undefined;
79
+ } | {
80
+ value: string;
81
+ type: "keyword";
82
+ hidden?: boolean | undefined;
83
+ } | {
84
+ value: string;
85
+ type: "unparsed";
86
+ hidden?: boolean | undefined;
87
+ } | {
88
+ type: "rgb";
89
+ r: number;
90
+ g: number;
91
+ b: number;
92
+ alpha: number;
93
+ hidden?: boolean | undefined;
94
+ } | {
95
+ type: "function";
96
+ name: string;
97
+ args: StyleValue;
98
+ hidden?: boolean;
99
+ } | {
100
+ value: string;
101
+ type: "var";
102
+ fallback?: {
103
+ value: number;
104
+ type: "unit";
105
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
106
+ hidden?: boolean | undefined;
107
+ } | {
108
+ value: string;
109
+ type: "keyword";
110
+ hidden?: boolean | undefined;
111
+ } | {
112
+ value: string;
113
+ type: "unparsed";
114
+ hidden?: boolean | undefined;
115
+ } | {
116
+ type: "rgb";
117
+ r: number;
118
+ g: number;
119
+ b: number;
120
+ alpha: number;
121
+ hidden?: boolean | undefined;
122
+ } | undefined;
123
+ hidden?: boolean | undefined;
124
+ })[];
125
+ type: "tuple";
126
+ hidden?: boolean | undefined;
127
+ } | {
128
+ value: string;
129
+ type: "invalid";
130
+ hidden?: boolean | undefined;
131
+ } | {
132
+ value: ({
133
+ value: {
134
+ value: string;
135
+ type: "asset";
136
+ } | {
137
+ type: "url";
138
+ url: string;
139
+ };
140
+ type: "image";
141
+ hidden?: boolean | undefined;
142
+ } | {
143
+ value: number;
144
+ type: "unit";
145
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
146
+ hidden?: boolean | undefined;
147
+ } | {
148
+ value: string;
149
+ type: "keyword";
150
+ hidden?: boolean | undefined;
151
+ } | {
152
+ value: string;
153
+ type: "unparsed";
154
+ hidden?: boolean | undefined;
155
+ } | {
156
+ type: "rgb";
157
+ r: number;
158
+ g: number;
159
+ b: number;
160
+ alpha: number;
161
+ hidden?: boolean | undefined;
162
+ } | {
163
+ type: "function";
164
+ name: string;
165
+ args: StyleValue;
166
+ hidden?: boolean;
167
+ } | {
168
+ value: string;
169
+ type: "var";
170
+ fallback?: {
171
+ value: number;
172
+ type: "unit";
173
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
174
+ hidden?: boolean | undefined;
175
+ } | {
176
+ value: string;
177
+ type: "keyword";
178
+ hidden?: boolean | undefined;
179
+ } | {
180
+ value: string;
181
+ type: "unparsed";
182
+ hidden?: boolean | undefined;
183
+ } | {
184
+ type: "rgb";
185
+ r: number;
186
+ g: number;
187
+ b: number;
188
+ alpha: number;
189
+ hidden?: boolean | undefined;
190
+ } | undefined;
191
+ hidden?: boolean | undefined;
192
+ } | {
193
+ value: ({
194
+ value: {
195
+ value: string;
196
+ type: "asset";
197
+ } | {
198
+ type: "url";
199
+ url: string;
200
+ };
201
+ type: "image";
202
+ hidden?: boolean | undefined;
203
+ } | {
204
+ value: number;
205
+ type: "unit";
206
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
207
+ hidden?: boolean | undefined;
208
+ } | {
209
+ value: string;
210
+ type: "keyword";
211
+ hidden?: boolean | undefined;
212
+ } | {
213
+ value: string;
214
+ type: "unparsed";
215
+ hidden?: boolean | undefined;
216
+ } | {
217
+ type: "rgb";
218
+ r: number;
219
+ g: number;
220
+ b: number;
221
+ alpha: number;
222
+ hidden?: boolean | undefined;
223
+ } | {
224
+ type: "function";
225
+ name: string;
226
+ args: StyleValue;
227
+ hidden?: boolean;
228
+ } | {
229
+ value: string;
230
+ type: "var";
231
+ fallback?: {
232
+ value: number;
233
+ type: "unit";
234
+ unit: "number" | "%" | "deg" | "grad" | "rad" | "turn" | "db" | "fr" | "hz" | "khz" | "cm" | "mm" | "q" | "in" | "pt" | "pc" | "px" | "em" | "rem" | "ex" | "rex" | "cap" | "rcap" | "ch" | "rch" | "ic" | "ric" | "lh" | "rlh" | "vw" | "svw" | "lvw" | "dvw" | "vh" | "svh" | "lvh" | "dvh" | "vi" | "svi" | "lvi" | "dvi" | "vb" | "svb" | "lvb" | "dvb" | "vmin" | "svmin" | "lvmin" | "dvmin" | "vmax" | "svmax" | "lvmax" | "dvmax" | "cqw" | "cqh" | "cqi" | "cqb" | "cqmin" | "cqmax" | "dpi" | "dpcm" | "dppx" | "x" | "st" | "s" | "ms";
235
+ hidden?: boolean | undefined;
236
+ } | {
237
+ value: string;
238
+ type: "keyword";
239
+ hidden?: boolean | undefined;
240
+ } | {
241
+ value: string;
242
+ type: "unparsed";
243
+ hidden?: boolean | undefined;
244
+ } | {
245
+ type: "rgb";
246
+ r: number;
247
+ g: number;
248
+ b: number;
249
+ alpha: number;
250
+ hidden?: boolean | undefined;
251
+ } | undefined;
252
+ hidden?: boolean | undefined;
253
+ })[];
254
+ type: "tuple";
255
+ hidden?: boolean | undefined;
256
+ } | {
257
+ value: string;
258
+ type: "invalid";
259
+ hidden?: boolean | undefined;
260
+ })[];
261
+ type: "layers";
262
+ hidden?: boolean | undefined;
263
+ } | {
264
+ value: string[];
265
+ type: "fontFamily";
266
+ hidden?: boolean | undefined;
267
+ } | {
268
+ type: "guaranteedInvalid";
269
+ hidden?: boolean | undefined;
270
+ } | {
271
+ value: "";
272
+ type: "unset";
273
+ hidden?: boolean | undefined;
274
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { StyleMap } from "./rules";
2
+ export declare const prefixStyles: (styleMap: StyleMap) => StyleMap;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,104 @@
1
+ import type { StyleValue } from "../schema";
2
+ import { type TransformValue } from "./to-value";
3
+ export type StyleMap = Map<string, StyleValue>;
4
+ export declare const generateStyleMap: ({ style, indent, transformValue, }: {
5
+ style: StyleMap;
6
+ indent?: number;
7
+ transformValue?: TransformValue;
8
+ }) => string;
9
+ export type Declaration = {
10
+ breakpoint: string;
11
+ selector: string;
12
+ property: string;
13
+ value: StyleValue;
14
+ };
15
+ type DeclarationKey = Omit<Declaration, "value">;
16
+ /**
17
+ * Reusable style rule in any nesting rule
18
+ *
19
+ * @mixin name {
20
+ * \@media breakpoint {
21
+ * &selector {
22
+ * property: value
23
+ * }
24
+ * }
25
+ * }
26
+ */
27
+ export declare class MixinRule {
28
+ #private;
29
+ isDirtyBreakpoint(breakpoint: string): boolean;
30
+ /**
31
+ * reset breakpoints invalidation
32
+ */
33
+ clearBreakpoints(): void;
34
+ setDeclaration(declaration: Declaration): void;
35
+ deleteDeclaration(declaration: DeclarationKey): void;
36
+ getDeclarations(): MapIterator<Declaration>;
37
+ }
38
+ /**
39
+ * Universal style rule with nested selectors and media queries support
40
+ * Rules are generated by each media query
41
+ * and heavily cached to avoid complex computation
42
+ *
43
+ * selector {
44
+ * \@media breakpoint {
45
+ * &selector {
46
+ * property: value
47
+ * }
48
+ * }
49
+ * }
50
+ */
51
+ export declare class NestingRule {
52
+ #private;
53
+ constructor(mixinRules: Map<string, MixinRule>, selector: string, descendantSuffix: string);
54
+ getSelector(): string;
55
+ setSelector(selector: string): void;
56
+ getDescendantSuffix(): string;
57
+ addMixin(mixin: string): void;
58
+ applyMixins(mixins: string[]): void;
59
+ setDeclaration(declaration: Declaration): void;
60
+ deleteDeclaration(declaration: DeclarationKey): void;
61
+ getMergedDeclarations(): Declaration[];
62
+ toString({ breakpoint, indent, transformValue, }: {
63
+ breakpoint: string;
64
+ indent?: number;
65
+ transformValue?: TransformValue;
66
+ }): string;
67
+ }
68
+ export type MediaRuleOptions = {
69
+ minWidth?: number;
70
+ maxWidth?: number;
71
+ mediaType?: "all" | "screen" | "print";
72
+ };
73
+ export declare class MediaRule {
74
+ #private;
75
+ options: MediaRuleOptions;
76
+ rules: Map<string, PlaintextRule>;
77
+ constructor(name: string, options?: MediaRuleOptions);
78
+ insertRule(rule: PlaintextRule): PlaintextRule;
79
+ get cssText(): string;
80
+ toString(): string;
81
+ generateRule({ nestingRules, transformValue, }: {
82
+ nestingRules: NestingRule[];
83
+ transformValue?: TransformValue;
84
+ }): string;
85
+ }
86
+ export declare class PlaintextRule {
87
+ cssText: string;
88
+ constructor(cssText: string);
89
+ toString(): string;
90
+ }
91
+ export type FontFaceOptions = {
92
+ fontFamily: string;
93
+ fontStyle?: "normal" | "italic" | "oblique";
94
+ fontWeight?: number | string;
95
+ fontDisplay: "swap" | "auto" | "block" | "fallback" | "optional";
96
+ src: string;
97
+ };
98
+ export declare class FontFaceRule {
99
+ #private;
100
+ constructor(options: FontFaceOptions);
101
+ get cssText(): string;
102
+ toString(): string;
103
+ }
104
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare class StyleElement {
2
+ #private;
3
+ constructor(name?: string);
4
+ get isMounted(): boolean;
5
+ mount(): void;
6
+ unmount(): void;
7
+ render(cssText: string): void;
8
+ setAttribute(name: string, value: string): void;
9
+ getAttribute(name: string): string | null | undefined;
10
+ }
@@ -0,0 +1,3 @@
1
+ import { StyleSheet } from "./style-sheet";
2
+ export declare class StyleSheetRegular extends StyleSheet {
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { MediaRule, MixinRule, NestingRule, PlaintextRule, type FontFaceOptions, type MediaRuleOptions } from "./rules";
2
+ import { StyleElement } from "./style-element";
3
+ import type { TransformValue } from "./to-value";
4
+ export declare class StyleSheet {
5
+ #private;
6
+ nestingRules: Map<string, NestingRule>;
7
+ constructor(element: StyleElement);
8
+ setTransformer(transformValue: TransformValue): void;
9
+ addMediaRule(id: string, options?: MediaRuleOptions): MediaRule;
10
+ addPlaintextRule(cssText: string): PlaintextRule | Map<string, PlaintextRule>;
11
+ addMixinRule(name: string): MixinRule;
12
+ addNestingRule(selector: string, descendantSuffix?: string): NestingRule;
13
+ addFontFaceRule(options: FontFaceOptions): number;
14
+ generateWith({ nestingRules, transformValue, }: {
15
+ nestingRules: NestingRule[];
16
+ transformValue?: TransformValue;
17
+ }): string;
18
+ get cssText(): string;
19
+ clear(): void;
20
+ render(): void;
21
+ unmount(): void;
22
+ setAttribute(name: string, value: string): void;
23
+ getAttribute(name: string): string | null | undefined;
24
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Hyphenates a camelcased CSS property name
3
+ */
4
+ export declare const hyphenateProperty: (property: string) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { StyleValue } from "../schema";
2
+ export type TransformValue = (styleValue: StyleValue) => undefined | StyleValue;
3
+ export declare const toValue: (styleValue: undefined | StyleValue, transformValue?: TransformValue) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const cssWideKeywords: Set<string>;
@@ -0,0 +1,4 @@
1
+ export * from "./core/index";
2
+ export * from "./schema";
3
+ export * from "./css";
4
+ export type { Property as __Property, Unit as __Unit, } from "./__generated__/types";