flexium 0.14.1 → 0.14.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.
@@ -0,0 +1,2 @@
1
+ function o(e,n,r){let{children:t,...i}=n||{};return {type:e,props:i,children:Array.isArray(t)?t:t!=null?[t]:[],key:r}}function a(e,n,r){return o(e,n,r)}function d(e,n,r){return o(e,n,r)}function p(e){return e.children}export{o as a,a as b,d as c,p as d};//# sourceMappingURL=chunk-RUYGSYEV.mjs.map
2
+ //# sourceMappingURL=chunk-RUYGSYEV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","jsxDEV","Fragment"],"mappings":"AAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,MAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,GAAY,IAAA,CAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,EAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAGO,SAASI,CAAAA,CAAON,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC5D,OAAOH,CAAAA,CAAIC,EAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASK,CAAAA,CAASN,CAAAA,CAAwB,CAC7C,OAAOA,EAAM,QACjB","file":"chunk-RUYGSYEV.mjs","sourcesContent":["import type { FNode, FNodeChild } from './dom/types'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\n// Development version (same as jsx for our purposes)\nexport function jsxDEV(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';function o(e,n,r){let{children:t,...i}=n||{};return {type:e,props:i,children:Array.isArray(t)?t:t!=null?[t]:[],key:r}}function a(e,n,r){return o(e,n,r)}function d(e,n,r){return o(e,n,r)}function p(e){return e.children}exports.a=o;exports.b=a;exports.c=d;exports.d=p;//# sourceMappingURL=chunk-TFXBDC6C.js.map
2
+ //# sourceMappingURL=chunk-TFXBDC6C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/jsx-runtime.ts"],"names":["jsx","type","props","key","children","otherProps","jsxs","jsxDEV","Fragment"],"mappings":"aAEO,SAASA,CAAAA,CAAIC,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CACzD,GAAM,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAW,CAAA,CAAIH,CAAAA,EAAS,EAAC,CAC9C,OAAO,CACH,IAAA,CAAAD,CAAAA,CACA,KAAA,CAAOI,CAAAA,CACP,QAAA,CAAU,MAAM,OAAA,CAAQD,CAAQ,CAAA,CAAIA,CAAAA,CAAYA,GAAY,IAAA,CAAO,CAACA,CAAQ,CAAA,CAAI,EAAC,CACjF,GAAA,CAAAD,CACJ,CACJ,CAEO,SAASG,CAAAA,CAAKL,CAAAA,CAAWC,EAAYC,CAAAA,CAAkB,CAC1D,OAAOH,CAAAA,CAAIC,CAAAA,CAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAGO,SAASI,CAAAA,CAAON,CAAAA,CAAWC,CAAAA,CAAYC,CAAAA,CAAkB,CAC5D,OAAOH,CAAAA,CAAIC,EAAMC,CAAAA,CAAOC,CAAG,CAC/B,CAEO,SAASK,CAAAA,CAASN,CAAAA,CAAwB,CAC7C,OAAOA,EAAM,QACjB","file":"chunk-TFXBDC6C.js","sourcesContent":["import type { FNode, FNodeChild } from './dom/types'\n\nexport function jsx(type: any, props: any, key?: any): FNode {\n const { children, ...otherProps } = props || {}\n return {\n type,\n props: otherProps,\n children: Array.isArray(children) ? children : (children != null ? [children] : []),\n key\n }\n}\n\nexport function jsxs(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\n// Development version (same as jsx for our purposes)\nexport function jsxDEV(type: any, props: any, key?: any): FNode {\n return jsx(type, props, key)\n}\n\nexport function Fragment(props: any): FNodeChild {\n return props.children\n}\n\nexport namespace JSX {\n export interface IntrinsicElements {\n [elemName: string]: any\n }\n export type Element = FNode | FNodeChild\n export interface ElementChildrenAttribute {\n children: {}\n }\n}\n"]}
package/dist/css.d.cts ADDED
@@ -0,0 +1,300 @@
1
+ import { F as FNode } from './types-DH8L3A5z.cjs';
2
+
3
+ /**
4
+ * CSS value types
5
+ */
6
+ type CSSValue = string | number;
7
+ /**
8
+ * Standard CSS properties with support for numbers (auto-converted to px)
9
+ */
10
+ interface CSSProperties {
11
+ display?: CSSValue;
12
+ position?: CSSValue;
13
+ top?: CSSValue;
14
+ right?: CSSValue;
15
+ bottom?: CSSValue;
16
+ left?: CSSValue;
17
+ zIndex?: CSSValue;
18
+ flex?: CSSValue;
19
+ flexDirection?: CSSValue;
20
+ flexWrap?: CSSValue;
21
+ flexGrow?: CSSValue;
22
+ flexShrink?: CSSValue;
23
+ flexBasis?: CSSValue;
24
+ justifyContent?: CSSValue;
25
+ alignItems?: CSSValue;
26
+ alignContent?: CSSValue;
27
+ alignSelf?: CSSValue;
28
+ gap?: CSSValue;
29
+ rowGap?: CSSValue;
30
+ columnGap?: CSSValue;
31
+ grid?: CSSValue;
32
+ gridTemplate?: CSSValue;
33
+ gridTemplateColumns?: CSSValue;
34
+ gridTemplateRows?: CSSValue;
35
+ gridColumn?: CSSValue;
36
+ gridRow?: CSSValue;
37
+ gridArea?: CSSValue;
38
+ width?: CSSValue;
39
+ height?: CSSValue;
40
+ minWidth?: CSSValue;
41
+ minHeight?: CSSValue;
42
+ maxWidth?: CSSValue;
43
+ maxHeight?: CSSValue;
44
+ padding?: CSSValue;
45
+ paddingTop?: CSSValue;
46
+ paddingRight?: CSSValue;
47
+ paddingBottom?: CSSValue;
48
+ paddingLeft?: CSSValue;
49
+ margin?: CSSValue;
50
+ marginTop?: CSSValue;
51
+ marginRight?: CSSValue;
52
+ marginBottom?: CSSValue;
53
+ marginLeft?: CSSValue;
54
+ border?: CSSValue;
55
+ borderWidth?: CSSValue;
56
+ borderStyle?: CSSValue;
57
+ borderColor?: CSSValue;
58
+ borderTop?: CSSValue;
59
+ borderRight?: CSSValue;
60
+ borderBottom?: CSSValue;
61
+ borderLeft?: CSSValue;
62
+ borderRadius?: CSSValue;
63
+ borderTopLeftRadius?: CSSValue;
64
+ borderTopRightRadius?: CSSValue;
65
+ borderBottomLeftRadius?: CSSValue;
66
+ borderBottomRightRadius?: CSSValue;
67
+ color?: CSSValue;
68
+ backgroundColor?: CSSValue;
69
+ background?: CSSValue;
70
+ backgroundImage?: CSSValue;
71
+ backgroundSize?: CSSValue;
72
+ backgroundPosition?: CSSValue;
73
+ backgroundRepeat?: CSSValue;
74
+ opacity?: CSSValue;
75
+ font?: CSSValue;
76
+ fontFamily?: CSSValue;
77
+ fontSize?: CSSValue;
78
+ fontWeight?: CSSValue;
79
+ fontStyle?: CSSValue;
80
+ lineHeight?: CSSValue;
81
+ letterSpacing?: CSSValue;
82
+ textAlign?: CSSValue;
83
+ textDecoration?: CSSValue;
84
+ textTransform?: CSSValue;
85
+ whiteSpace?: CSSValue;
86
+ wordBreak?: CSSValue;
87
+ overflow?: CSSValue;
88
+ overflowX?: CSSValue;
89
+ overflowY?: CSSValue;
90
+ textOverflow?: CSSValue;
91
+ boxShadow?: CSSValue;
92
+ textShadow?: CSSValue;
93
+ outline?: CSSValue;
94
+ outlineWidth?: CSSValue;
95
+ outlineStyle?: CSSValue;
96
+ outlineColor?: CSSValue;
97
+ outlineOffset?: CSSValue;
98
+ visibility?: CSSValue;
99
+ cursor?: CSSValue;
100
+ pointerEvents?: CSSValue;
101
+ userSelect?: CSSValue;
102
+ transform?: CSSValue;
103
+ transformOrigin?: CSSValue;
104
+ transition?: CSSValue;
105
+ transitionProperty?: CSSValue;
106
+ transitionDuration?: CSSValue;
107
+ transitionTimingFunction?: CSSValue;
108
+ transitionDelay?: CSSValue;
109
+ animation?: CSSValue;
110
+ animationName?: CSSValue;
111
+ animationDuration?: CSSValue;
112
+ animationTimingFunction?: CSSValue;
113
+ animationDelay?: CSSValue;
114
+ animationIterationCount?: CSSValue;
115
+ animationDirection?: CSSValue;
116
+ animationFillMode?: CSSValue;
117
+ content?: CSSValue;
118
+ objectFit?: CSSValue;
119
+ objectPosition?: CSSValue;
120
+ filter?: CSSValue;
121
+ backdropFilter?: CSSValue;
122
+ mixBlendMode?: CSSValue;
123
+ isolation?: CSSValue;
124
+ contain?: CSSValue;
125
+ aspectRatio?: CSSValue;
126
+ [key: string]: CSSValue | StyleObject | undefined;
127
+ }
128
+ /**
129
+ * Style object with support for nested selectors and at-rules
130
+ */
131
+ interface StyleObject extends CSSProperties {
132
+ /** Nested selectors: &:hover, &::before, & > div */
133
+ [key: `&${string}`]: StyleObject;
134
+ /** At-rules: @media, @supports, @container */
135
+ [key: `@${string}`]: StyleObject;
136
+ }
137
+ /**
138
+ * Keyframes definition
139
+ */
140
+ interface KeyframeDefinition {
141
+ [key: string]: CSSProperties;
142
+ }
143
+ /**
144
+ * Variant configuration for styled()
145
+ */
146
+ type VariantConfig = {
147
+ [variantName: string]: {
148
+ [variantValue: string]: StyleObject;
149
+ };
150
+ };
151
+ /**
152
+ * Default variants type
153
+ */
154
+ type DefaultVariants<V extends VariantConfig> = {
155
+ [K in keyof V]?: keyof V[K];
156
+ };
157
+ /**
158
+ * Styled component configuration
159
+ */
160
+ interface StyledConfig<V extends VariantConfig = VariantConfig> {
161
+ base: StyleObject;
162
+ variants?: V;
163
+ defaultVariants?: DefaultVariants<V>;
164
+ compoundVariants?: Array<{
165
+ [K in keyof V]?: keyof V[K];
166
+ } & {
167
+ css: StyleObject;
168
+ }>;
169
+ }
170
+ /**
171
+ * Props for styled components
172
+ */
173
+ type StyledProps<V extends VariantConfig = VariantConfig> = {
174
+ [K in keyof V]?: keyof V[K];
175
+ } & {
176
+ children?: any;
177
+ className?: string;
178
+ [key: string]: any;
179
+ };
180
+
181
+ /**
182
+ * Create a CSS class from a style object
183
+ *
184
+ * @example
185
+ * ```tsx
186
+ * const buttonClass = css({
187
+ * padding: '8px 16px',
188
+ * backgroundColor: 'blue',
189
+ * color: 'white',
190
+ * '&:hover': {
191
+ * backgroundColor: 'darkblue'
192
+ * }
193
+ * })
194
+ *
195
+ * <button className={buttonClass}>Click me</button>
196
+ * ```
197
+ */
198
+ declare function css(styles: StyleObject): string;
199
+ /**
200
+ * Combine multiple class names, filtering out falsy values
201
+ *
202
+ * @example
203
+ * ```tsx
204
+ * const className = cx(
205
+ * baseClass,
206
+ * isActive && activeClass,
207
+ * variant === 'primary' && primaryClass
208
+ * )
209
+ * ```
210
+ */
211
+ declare function cx(...classes: (string | boolean | null | undefined)[]): string;
212
+
213
+ type HTMLTag = 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' | 'b' | 'base' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'br' | 'button' | 'canvas' | 'caption' | 'cite' | 'code' | 'col' | 'colgroup' | 'data' | 'datalist' | 'dd' | 'del' | 'details' | 'dfn' | 'dialog' | 'div' | 'dl' | 'dt' | 'em' | 'embed' | 'fieldset' | 'figcaption' | 'figure' | 'footer' | 'form' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'head' | 'header' | 'hgroup' | 'hr' | 'html' | 'i' | 'iframe' | 'img' | 'input' | 'ins' | 'kbd' | 'label' | 'legend' | 'li' | 'link' | 'main' | 'map' | 'mark' | 'menu' | 'meta' | 'meter' | 'nav' | 'noscript' | 'object' | 'ol' | 'optgroup' | 'option' | 'output' | 'p' | 'picture' | 'pre' | 'progress' | 'q' | 'rp' | 'rt' | 'ruby' | 's' | 'samp' | 'script' | 'search' | 'section' | 'select' | 'slot' | 'small' | 'source' | 'span' | 'strong' | 'style' | 'sub' | 'summary' | 'sup' | 'svg' | 'table' | 'tbody' | 'td' | 'template' | 'textarea' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | 'tr' | 'track' | 'u' | 'ul' | 'var' | 'video' | 'wbr';
214
+ /**
215
+ * Create a styled component with variant support
216
+ *
217
+ * @example
218
+ * ```tsx
219
+ * const Button = styled('button', {
220
+ * base: {
221
+ * padding: '8px 16px',
222
+ * border: 'none',
223
+ * borderRadius: 4,
224
+ * cursor: 'pointer'
225
+ * },
226
+ * variants: {
227
+ * variant: {
228
+ * primary: { backgroundColor: 'blue', color: 'white' },
229
+ * secondary: { backgroundColor: 'gray', color: 'black' }
230
+ * },
231
+ * size: {
232
+ * sm: { padding: '4px 8px', fontSize: 12 },
233
+ * md: { padding: '8px 16px', fontSize: 14 },
234
+ * lg: { padding: '12px 24px', fontSize: 16 }
235
+ * }
236
+ * },
237
+ * defaultVariants: {
238
+ * variant: 'primary',
239
+ * size: 'md'
240
+ * }
241
+ * })
242
+ *
243
+ * // Usage
244
+ * <Button variant="secondary" size="lg">Click me</Button>
245
+ * ```
246
+ */
247
+ declare function styled<T extends HTMLTag, V extends VariantConfig = Record<string, never>>(tag: T, config: StyledConfig<V>): StyledComponent<T, V>;
248
+ type StyledComponent<T extends HTMLTag, V extends VariantConfig> = {
249
+ (props: StyledComponentProps<V>): FNode;
250
+ displayName: string;
251
+ };
252
+ type StyledComponentProps<V extends VariantConfig> = {
253
+ [K in keyof V]?: keyof V[K];
254
+ } & {
255
+ children?: any;
256
+ className?: string;
257
+ [key: string]: any;
258
+ };
259
+
260
+ /**
261
+ * Create a keyframes animation
262
+ *
263
+ * @example
264
+ * ```tsx
265
+ * const fadeIn = keyframes({
266
+ * from: { opacity: 0 },
267
+ * to: { opacity: 1 }
268
+ * })
269
+ *
270
+ * const slideIn = keyframes({
271
+ * '0%': { transform: 'translateX(-100%)' },
272
+ * '100%': { transform: 'translateX(0)' }
273
+ * })
274
+ *
275
+ * const className = css({
276
+ * animation: `${fadeIn} 0.3s ease-in-out`
277
+ * })
278
+ * ```
279
+ */
280
+ declare function keyframes(definition: KeyframeDefinition): string;
281
+
282
+ /**
283
+ * Get all collected styles for SSR
284
+ */
285
+ declare function getStyles(): string;
286
+ /**
287
+ * Get styles as a style tag for SSR
288
+ */
289
+ declare function getStyleTag(): string;
290
+ /**
291
+ * Reset collected styles and cache (for SSR between requests or testing)
292
+ */
293
+ declare function resetStyles(): void;
294
+ /**
295
+ * Hydrate styles on the client
296
+ * Call this after SSR to sync the cache with server-rendered styles
297
+ */
298
+ declare function hydrateStyles(): void;
299
+
300
+ export { type CSSProperties, type CSSValue, type DefaultVariants, type KeyframeDefinition, type StyleObject, type StyledConfig, type StyledProps, type VariantConfig, css, cx, getStyleTag, getStyles, hydrateStyles, keyframes, resetStyles, styled };
package/dist/css.d.ts ADDED
@@ -0,0 +1,300 @@
1
+ import { F as FNode } from './types-DH8L3A5z.js';
2
+
3
+ /**
4
+ * CSS value types
5
+ */
6
+ type CSSValue = string | number;
7
+ /**
8
+ * Standard CSS properties with support for numbers (auto-converted to px)
9
+ */
10
+ interface CSSProperties {
11
+ display?: CSSValue;
12
+ position?: CSSValue;
13
+ top?: CSSValue;
14
+ right?: CSSValue;
15
+ bottom?: CSSValue;
16
+ left?: CSSValue;
17
+ zIndex?: CSSValue;
18
+ flex?: CSSValue;
19
+ flexDirection?: CSSValue;
20
+ flexWrap?: CSSValue;
21
+ flexGrow?: CSSValue;
22
+ flexShrink?: CSSValue;
23
+ flexBasis?: CSSValue;
24
+ justifyContent?: CSSValue;
25
+ alignItems?: CSSValue;
26
+ alignContent?: CSSValue;
27
+ alignSelf?: CSSValue;
28
+ gap?: CSSValue;
29
+ rowGap?: CSSValue;
30
+ columnGap?: CSSValue;
31
+ grid?: CSSValue;
32
+ gridTemplate?: CSSValue;
33
+ gridTemplateColumns?: CSSValue;
34
+ gridTemplateRows?: CSSValue;
35
+ gridColumn?: CSSValue;
36
+ gridRow?: CSSValue;
37
+ gridArea?: CSSValue;
38
+ width?: CSSValue;
39
+ height?: CSSValue;
40
+ minWidth?: CSSValue;
41
+ minHeight?: CSSValue;
42
+ maxWidth?: CSSValue;
43
+ maxHeight?: CSSValue;
44
+ padding?: CSSValue;
45
+ paddingTop?: CSSValue;
46
+ paddingRight?: CSSValue;
47
+ paddingBottom?: CSSValue;
48
+ paddingLeft?: CSSValue;
49
+ margin?: CSSValue;
50
+ marginTop?: CSSValue;
51
+ marginRight?: CSSValue;
52
+ marginBottom?: CSSValue;
53
+ marginLeft?: CSSValue;
54
+ border?: CSSValue;
55
+ borderWidth?: CSSValue;
56
+ borderStyle?: CSSValue;
57
+ borderColor?: CSSValue;
58
+ borderTop?: CSSValue;
59
+ borderRight?: CSSValue;
60
+ borderBottom?: CSSValue;
61
+ borderLeft?: CSSValue;
62
+ borderRadius?: CSSValue;
63
+ borderTopLeftRadius?: CSSValue;
64
+ borderTopRightRadius?: CSSValue;
65
+ borderBottomLeftRadius?: CSSValue;
66
+ borderBottomRightRadius?: CSSValue;
67
+ color?: CSSValue;
68
+ backgroundColor?: CSSValue;
69
+ background?: CSSValue;
70
+ backgroundImage?: CSSValue;
71
+ backgroundSize?: CSSValue;
72
+ backgroundPosition?: CSSValue;
73
+ backgroundRepeat?: CSSValue;
74
+ opacity?: CSSValue;
75
+ font?: CSSValue;
76
+ fontFamily?: CSSValue;
77
+ fontSize?: CSSValue;
78
+ fontWeight?: CSSValue;
79
+ fontStyle?: CSSValue;
80
+ lineHeight?: CSSValue;
81
+ letterSpacing?: CSSValue;
82
+ textAlign?: CSSValue;
83
+ textDecoration?: CSSValue;
84
+ textTransform?: CSSValue;
85
+ whiteSpace?: CSSValue;
86
+ wordBreak?: CSSValue;
87
+ overflow?: CSSValue;
88
+ overflowX?: CSSValue;
89
+ overflowY?: CSSValue;
90
+ textOverflow?: CSSValue;
91
+ boxShadow?: CSSValue;
92
+ textShadow?: CSSValue;
93
+ outline?: CSSValue;
94
+ outlineWidth?: CSSValue;
95
+ outlineStyle?: CSSValue;
96
+ outlineColor?: CSSValue;
97
+ outlineOffset?: CSSValue;
98
+ visibility?: CSSValue;
99
+ cursor?: CSSValue;
100
+ pointerEvents?: CSSValue;
101
+ userSelect?: CSSValue;
102
+ transform?: CSSValue;
103
+ transformOrigin?: CSSValue;
104
+ transition?: CSSValue;
105
+ transitionProperty?: CSSValue;
106
+ transitionDuration?: CSSValue;
107
+ transitionTimingFunction?: CSSValue;
108
+ transitionDelay?: CSSValue;
109
+ animation?: CSSValue;
110
+ animationName?: CSSValue;
111
+ animationDuration?: CSSValue;
112
+ animationTimingFunction?: CSSValue;
113
+ animationDelay?: CSSValue;
114
+ animationIterationCount?: CSSValue;
115
+ animationDirection?: CSSValue;
116
+ animationFillMode?: CSSValue;
117
+ content?: CSSValue;
118
+ objectFit?: CSSValue;
119
+ objectPosition?: CSSValue;
120
+ filter?: CSSValue;
121
+ backdropFilter?: CSSValue;
122
+ mixBlendMode?: CSSValue;
123
+ isolation?: CSSValue;
124
+ contain?: CSSValue;
125
+ aspectRatio?: CSSValue;
126
+ [key: string]: CSSValue | StyleObject | undefined;
127
+ }
128
+ /**
129
+ * Style object with support for nested selectors and at-rules
130
+ */
131
+ interface StyleObject extends CSSProperties {
132
+ /** Nested selectors: &:hover, &::before, & > div */
133
+ [key: `&${string}`]: StyleObject;
134
+ /** At-rules: @media, @supports, @container */
135
+ [key: `@${string}`]: StyleObject;
136
+ }
137
+ /**
138
+ * Keyframes definition
139
+ */
140
+ interface KeyframeDefinition {
141
+ [key: string]: CSSProperties;
142
+ }
143
+ /**
144
+ * Variant configuration for styled()
145
+ */
146
+ type VariantConfig = {
147
+ [variantName: string]: {
148
+ [variantValue: string]: StyleObject;
149
+ };
150
+ };
151
+ /**
152
+ * Default variants type
153
+ */
154
+ type DefaultVariants<V extends VariantConfig> = {
155
+ [K in keyof V]?: keyof V[K];
156
+ };
157
+ /**
158
+ * Styled component configuration
159
+ */
160
+ interface StyledConfig<V extends VariantConfig = VariantConfig> {
161
+ base: StyleObject;
162
+ variants?: V;
163
+ defaultVariants?: DefaultVariants<V>;
164
+ compoundVariants?: Array<{
165
+ [K in keyof V]?: keyof V[K];
166
+ } & {
167
+ css: StyleObject;
168
+ }>;
169
+ }
170
+ /**
171
+ * Props for styled components
172
+ */
173
+ type StyledProps<V extends VariantConfig = VariantConfig> = {
174
+ [K in keyof V]?: keyof V[K];
175
+ } & {
176
+ children?: any;
177
+ className?: string;
178
+ [key: string]: any;
179
+ };
180
+
181
+ /**
182
+ * Create a CSS class from a style object
183
+ *
184
+ * @example
185
+ * ```tsx
186
+ * const buttonClass = css({
187
+ * padding: '8px 16px',
188
+ * backgroundColor: 'blue',
189
+ * color: 'white',
190
+ * '&:hover': {
191
+ * backgroundColor: 'darkblue'
192
+ * }
193
+ * })
194
+ *
195
+ * <button className={buttonClass}>Click me</button>
196
+ * ```
197
+ */
198
+ declare function css(styles: StyleObject): string;
199
+ /**
200
+ * Combine multiple class names, filtering out falsy values
201
+ *
202
+ * @example
203
+ * ```tsx
204
+ * const className = cx(
205
+ * baseClass,
206
+ * isActive && activeClass,
207
+ * variant === 'primary' && primaryClass
208
+ * )
209
+ * ```
210
+ */
211
+ declare function cx(...classes: (string | boolean | null | undefined)[]): string;
212
+
213
+ type HTMLTag = 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' | 'b' | 'base' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'br' | 'button' | 'canvas' | 'caption' | 'cite' | 'code' | 'col' | 'colgroup' | 'data' | 'datalist' | 'dd' | 'del' | 'details' | 'dfn' | 'dialog' | 'div' | 'dl' | 'dt' | 'em' | 'embed' | 'fieldset' | 'figcaption' | 'figure' | 'footer' | 'form' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'head' | 'header' | 'hgroup' | 'hr' | 'html' | 'i' | 'iframe' | 'img' | 'input' | 'ins' | 'kbd' | 'label' | 'legend' | 'li' | 'link' | 'main' | 'map' | 'mark' | 'menu' | 'meta' | 'meter' | 'nav' | 'noscript' | 'object' | 'ol' | 'optgroup' | 'option' | 'output' | 'p' | 'picture' | 'pre' | 'progress' | 'q' | 'rp' | 'rt' | 'ruby' | 's' | 'samp' | 'script' | 'search' | 'section' | 'select' | 'slot' | 'small' | 'source' | 'span' | 'strong' | 'style' | 'sub' | 'summary' | 'sup' | 'svg' | 'table' | 'tbody' | 'td' | 'template' | 'textarea' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | 'tr' | 'track' | 'u' | 'ul' | 'var' | 'video' | 'wbr';
214
+ /**
215
+ * Create a styled component with variant support
216
+ *
217
+ * @example
218
+ * ```tsx
219
+ * const Button = styled('button', {
220
+ * base: {
221
+ * padding: '8px 16px',
222
+ * border: 'none',
223
+ * borderRadius: 4,
224
+ * cursor: 'pointer'
225
+ * },
226
+ * variants: {
227
+ * variant: {
228
+ * primary: { backgroundColor: 'blue', color: 'white' },
229
+ * secondary: { backgroundColor: 'gray', color: 'black' }
230
+ * },
231
+ * size: {
232
+ * sm: { padding: '4px 8px', fontSize: 12 },
233
+ * md: { padding: '8px 16px', fontSize: 14 },
234
+ * lg: { padding: '12px 24px', fontSize: 16 }
235
+ * }
236
+ * },
237
+ * defaultVariants: {
238
+ * variant: 'primary',
239
+ * size: 'md'
240
+ * }
241
+ * })
242
+ *
243
+ * // Usage
244
+ * <Button variant="secondary" size="lg">Click me</Button>
245
+ * ```
246
+ */
247
+ declare function styled<T extends HTMLTag, V extends VariantConfig = Record<string, never>>(tag: T, config: StyledConfig<V>): StyledComponent<T, V>;
248
+ type StyledComponent<T extends HTMLTag, V extends VariantConfig> = {
249
+ (props: StyledComponentProps<V>): FNode;
250
+ displayName: string;
251
+ };
252
+ type StyledComponentProps<V extends VariantConfig> = {
253
+ [K in keyof V]?: keyof V[K];
254
+ } & {
255
+ children?: any;
256
+ className?: string;
257
+ [key: string]: any;
258
+ };
259
+
260
+ /**
261
+ * Create a keyframes animation
262
+ *
263
+ * @example
264
+ * ```tsx
265
+ * const fadeIn = keyframes({
266
+ * from: { opacity: 0 },
267
+ * to: { opacity: 1 }
268
+ * })
269
+ *
270
+ * const slideIn = keyframes({
271
+ * '0%': { transform: 'translateX(-100%)' },
272
+ * '100%': { transform: 'translateX(0)' }
273
+ * })
274
+ *
275
+ * const className = css({
276
+ * animation: `${fadeIn} 0.3s ease-in-out`
277
+ * })
278
+ * ```
279
+ */
280
+ declare function keyframes(definition: KeyframeDefinition): string;
281
+
282
+ /**
283
+ * Get all collected styles for SSR
284
+ */
285
+ declare function getStyles(): string;
286
+ /**
287
+ * Get styles as a style tag for SSR
288
+ */
289
+ declare function getStyleTag(): string;
290
+ /**
291
+ * Reset collected styles and cache (for SSR between requests or testing)
292
+ */
293
+ declare function resetStyles(): void;
294
+ /**
295
+ * Hydrate styles on the client
296
+ * Call this after SSR to sync the cache with server-rendered styles
297
+ */
298
+ declare function hydrateStyles(): void;
299
+
300
+ export { type CSSProperties, type CSSValue, type DefaultVariants, type KeyframeDefinition, type StyleObject, type StyledConfig, type StyledProps, type VariantConfig, css, cx, getStyleTag, getStyles, hydrateStyles, keyframes, resetStyles, styled };
package/dist/css.js ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';function C(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return "fx-"+(t>>>0).toString(36)}var W=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function K(e){return e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function P(e,t){return typeof t=="number"&&t!==0&&!W.has(e)?t+"px":String(t)}function k(e,t){let n="",r="";for(let i in e){let a=e[i];if(a!=null)if(i.startsWith("&")){let l=i.replace(/&/g,t);r+=k(a,l);}else if(i.startsWith("@"))r+=`${i}{${k(a,t)}}`;else {if(typeof a=="object")continue;n+=`${K(i)}:${P(i,a)};`;}}let s="";return n&&(s=`${t}{${n}}`),s+=r,s}function z(e,t){let n="";for(let r in t){let s=t[r],i="";for(let a in s){let l=s[a];l!=null&&typeof l!="object"&&(i+=`${K(a)}:${P(a,l)};`);}n+=`${r}{${i}}`;}return `@keyframes ${e}{${n}}`}var g=new Map,v=[],m=null;function M(){return typeof document<"u"&&"adoptedStyleSheets"in document&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype}function E(){return M()?(m||(m=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,m]),m):null}function V(e,t){if(g.has(e))return;g.set(e,true);let n=E();if(n)try{n.insertRule(t,n.cssRules.length);}catch(r){process.env.NODE_ENV!=="production"&&console.warn("[flexium/css] Invalid CSS rule:",t,r);}else v.push(t);}function O(e){return g.has(e)}function D(){return v.join("")}function H(){let e=D();return e?`<style data-flexium-css>${e}</style>`:""}function L(){v=[],g=new Map,m=null;}function A(){if(typeof document>"u")return;let e=document.querySelector("style[data-flexium-css]");if(e){let t=e.textContent||"",n=/\.fx-[a-z0-9]+/g,r;for(;(r=n.exec(t))!==null;){let s=r[0].slice(1);g.set(s,true);}}}M()&&A();function S(e){let t=JSON.stringify(e),n=C(t);if(O(n))return n;let r=k(e,"."+n);return V(n,r),n}function N(...e){return e.filter(Boolean).join(" ")}function q(e,t){let{base:n,variants:r,defaultVariants:s,compoundVariants:i}=t,a=S(n),l=new Map;function I(d,c){let h=`${d}:${c}`,f=l.get(h);return !f&&r?.[d]?.[c]&&(f=S(r[d][c]),l.set(h,f)),f||""}let T=new Map;function $(d){let{children:c,className:h,...f}=d,u={},j={};for(let o in f)r&&o in r?u[o]=f[o]??s?.[o]:j[o]=f[o];if(s)for(let o in s)o in u||(u[o]=String(s[o]));let w=[];for(let[o,x]of Object.entries(u))if(x){let y=I(o,String(x));y&&w.push(y);}if(i)for(let o of i){let{css:x,...y}=o,R=true;for(let[b,p]of Object.entries(y))if(u[b]!==p){R=false;break}if(R){let b=JSON.stringify(y),p=T.get(b);p||(p=S(x),T.set(b,p)),w.push(p);}}let F=N(a,...w,h);return {type:e,props:{...j,className:F},children:Array.isArray(c)?c:c!=null?[c]:[],key:void 0}}return $.displayName=`Styled(${e})`,$}function G(e){let t=JSON.stringify(e),n=C(t);if(O(n))return n;let r=z(n,e);return V(n,r),n}exports.css=S;exports.cx=N;exports.getStyleTag=H;exports.getStyles=D;exports.hydrateStyles=A;exports.keyframes=G;exports.resetStyles=L;exports.styled=q;//# sourceMappingURL=css.js.map
2
+ //# sourceMappingURL=css.js.map