@n3e/styled 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,527 @@
1
+ /// <reference types="react" />
2
+ import * as PropTypes from 'prop-types';
3
+ import * as CSS from 'csstype';
4
+
5
+ declare const PSEUDO_ELEMENTS: readonly ["after", "backdrop", "before", "cue", "cueRegion", "firstLetter", "firstLine", "fileSelectorButton", "marker", "placeholder", "selection"];
6
+ declare const PSEUDO_ELEMENT_FUNCTIONS: readonly ["part", "slotted"];
7
+ declare const PSEUDO_CLASSES: readonly ["active", "anyLink", "autofill", "checked", "default", "defined", "disabled", "empty", "enabled", "first", "firstChild", "firstOfType", "fullscreen", "focus", "focusVisible", "focusWithin", "hover", "indeterminate", "inRange", "invalid", "lastChild", "lastOfType", "left", "link", "modal", "onlyChild", "onlyOfType", "optional", "outOfRange", "pictureInPicture", "placeholderShown", "paused", "playing", "readOnly", "readWrite", "required", "right", "root", "scope", "target", "valid", "visited"];
8
+ declare const PCF_STRING: readonly ["host", "lang"];
9
+ declare const PCF_STRING_ARRAY: readonly ["is", "not", "where"];
10
+ declare const PCF_NUMBER_OR_STRING: readonly ["nthChild", "nthLastChild", "nthLastOfType", "nthOfType"];
11
+
12
+ type CSSAttributes = object & CSS.Properties & CSS.PropertiesHyphen;
13
+ interface PropsFunction {
14
+ (arg: unknown): false | undefined | CSSProperties;
15
+ }
16
+ interface CSSNestedAttributes {
17
+ [key: string]: CSSAttributes | PropsFunction | CSSNestedAttributes;
18
+ }
19
+ type CSSProperties = CSSAttributes | CSSNestedAttributes;
20
+ type UnknownProp = {
21
+ [key: string]: unknown;
22
+ };
23
+
24
+ type MediaTypes = 'print' | 'screen';
25
+ type TypeMethods = {
26
+ [key in MediaTypes]: () => MediaQueryAPI;
27
+ };
28
+ interface DefinedFeatures {
29
+ anyPointer(arg: 'fine' | 'coarse' | 'none'): MediaQueryAPI;
30
+ colorGamut(arg: 'srgb' | 'p3' | 'rec2020'): MediaQueryAPI;
31
+ displayMode(arg: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'): MediaQueryAPI;
32
+ orientation(arg: 'landscape' | 'portrait'): MediaQueryAPI;
33
+ overflowBlock(arg: 'none' | 'scroll' | 'optional-paged' | 'paged'): MediaQueryAPI;
34
+ pointer(arg: 'fine' | 'coarse' | 'none'): MediaQueryAPI;
35
+ prefersColorScheme(arg: 'light' | 'dark'): MediaQueryAPI;
36
+ prefersContrast(arg: 'no-preference' | 'more' | 'less'): MediaQueryAPI;
37
+ scripting(arg: 'none' | 'initial-only' | 'enabled'): MediaQueryAPI;
38
+ update(arg: 'none' | 'slow' | 'fast'): MediaQueryAPI;
39
+ }
40
+ interface RangeFeatures {
41
+ height(arg: string): MediaQueryAPI;
42
+ minHeight(arg: string): MediaQueryAPI;
43
+ maxHeight(arg: string): MediaQueryAPI;
44
+ width(arg: string): MediaQueryAPI;
45
+ minWidth(arg: string): MediaQueryAPI;
46
+ maxWidth(arg: string): MediaQueryAPI;
47
+ /**
48
+ * Test aspect ratio of the viewport by supplying
49
+ * a `ratio` CSS data type.
50
+ *
51
+ * @example
52
+ * mq().aspectRatio('1/1')
53
+ */
54
+ aspectRatio(arg: string): MediaQueryAPI;
55
+ /**
56
+ * Test minimum aspect ratio of the viewport by supplying
57
+ * a `ratio` CSS data type.
58
+ *
59
+ * @example
60
+ * mq().minAspectRatio('8/5')
61
+ */
62
+ minAspectRatio(arg: string): MediaQueryAPI;
63
+ /**
64
+ * Test maximum aspect ratio of the viewport by supplying
65
+ * a `ratio` CSS data type.
66
+ *
67
+ * @example
68
+ * mq().maxAspectRatio('3/2')
69
+ */
70
+ maxAspectRatio(arg: string): MediaQueryAPI;
71
+ /**
72
+ * Test the bits per color component (red, green, blue) of
73
+ * the output device by supplying an `integer` CSS data type.
74
+ *
75
+ * Leave empty to test any device.
76
+ *
77
+ * @example
78
+ * mq().color()
79
+ */
80
+ color(arg?: number): MediaQueryAPI;
81
+ /**
82
+ * Test the minimum bits per color component (red, green, blue) of
83
+ * the output device by supplying an `integer` CSS data type.
84
+ *
85
+ * Leave empty to test any device.
86
+ *
87
+ * @example
88
+ * mq().minColor(8)
89
+ */
90
+ minColor(arg?: number): MediaQueryAPI;
91
+ /**
92
+ * Test the maximum bits per color component (red, green, blue) of
93
+ * the output device by supplying an `integer` CSS data type.
94
+ *
95
+ * Leave empty to test any device.
96
+ *
97
+ * @example
98
+ * mq().maxColor(8)
99
+ */
100
+ maxColor(arg?: number): MediaQueryAPI;
101
+ /**
102
+ * Test the number of entries in the output device's color lookup
103
+ * table by supplying an `integer` CSS data type.
104
+ *
105
+ * Leave empty to test any device.
106
+ *
107
+ * @example
108
+ * mq().colorIndex()
109
+ */
110
+ colorIndex(arg?: number): MediaQueryAPI;
111
+ /**
112
+ * Test the minimum number of entries in the output device's
113
+ * color lookup table by supplying an `integer` CSS data type.
114
+ *
115
+ * Leave empty to test any device.
116
+ *
117
+ * @example
118
+ * mq().minColorIndex(1500)
119
+ */
120
+ minColorIndex(arg?: number): MediaQueryAPI;
121
+ /**
122
+ * Test the maximum number of entries in the output device's
123
+ * color lookup table by supplying an `integer` CSS data type.
124
+ *
125
+ * Leave empty to test any device.
126
+ *
127
+ * @example
128
+ * mq().maxColorIndex(1500)
129
+ */
130
+ maxColorIndex(arg?: number): MediaQueryAPI;
131
+ /**
132
+ * Test the number of bits per pixel in the monochrome frame
133
+ * buffer of the output device by supplying an `integer`
134
+ * CSS data type.
135
+ *
136
+ * Leave empty to test non-monochrome device.
137
+ *
138
+ * @example
139
+ * mq().monochrome()
140
+ * @example
141
+ * mq().monochrome(0)
142
+ */
143
+ monochrome(arg?: number): MediaQueryAPI;
144
+ /**
145
+ * Test the minimum number of bits per pixel in the monochrome
146
+ * frame buffer of the output device by supplying an `integer`
147
+ * CSS data type.
148
+ *
149
+ * Leave empty to test non-monochrome device.
150
+ *
151
+ * @example
152
+ * mq().minMonochrome()
153
+ * @example
154
+ * mq().minMonochrome(0)
155
+ */
156
+ minMonochrome(arg?: number): MediaQueryAPI;
157
+ /**
158
+ * Test the maximum number of bits per pixel in the monochrome
159
+ * frame buffer of the output device by supplying an `integer`
160
+ * CSS data type.
161
+ *
162
+ * Leave empty to test non-monochrome device.
163
+ *
164
+ * @example
165
+ * mq().maxMonochrome()
166
+ * @example
167
+ * mq().maxMonochrome(0)
168
+ */
169
+ maxMonochrome(arg?: number): MediaQueryAPI;
170
+ /**
171
+ * Test the pixel density of the output device by supplying
172
+ * a `resolution` CSS data type.
173
+ *
174
+ * @example
175
+ * mq().resolution('150dpi')
176
+ */
177
+ resolution(arg: string): MediaQueryAPI;
178
+ /**
179
+ * Test the minimum pixel density of the output device by
180
+ * supplying a `resolution` CSS data type.
181
+ *
182
+ * @example
183
+ * mq().minResolution('72dpi')
184
+ */
185
+ minResolution(arg: string): MediaQueryAPI;
186
+ /**
187
+ * Test the maximum pixel density of the output device by
188
+ * supplying a `resolution` CSS data type.
189
+ *
190
+ * @example
191
+ * mq().maxResolution('300dpi')
192
+ */
193
+ maxResolution(arg: string): MediaQueryAPI;
194
+ }
195
+ interface ToggleFeatures {
196
+ anyHover(arg: 'none' | 'hover'): MediaQueryAPI;
197
+ hover(arg: 'none' | 'hover'): MediaQueryAPI;
198
+ forcedColors(arg: 'none' | 'active'): MediaQueryAPI;
199
+ grid(arg: '0' | '1'): MediaQueryAPI;
200
+ invertedColors(arg: 'none' | 'inverted'): MediaQueryAPI;
201
+ overflowInline(arg: 'none' | 'scroll'): MediaQueryAPI;
202
+ prefersReducedMotion(arg: 'no-preference' | 'reduce'): MediaQueryAPI;
203
+ }
204
+ type FeatureMethods = Prettify<DefinedFeatures & RangeFeatures & ToggleFeatures>;
205
+ interface MediaQueryAPI extends TypeMethods, FeatureMethods {
206
+ /**
207
+ * Creates range feature to query the `min-width`
208
+ * of the viewport against the given value in `pixels`.
209
+ *
210
+ * @example
211
+ * mq().from(768) // '@media (min-width: 768px)'
212
+ */
213
+ from(arg: number): MediaQueryAPI;
214
+ /**
215
+ * Creates range feature to query the `max-width`
216
+ * of the viewport against the given value in `pixels`.
217
+ *
218
+ * @example
219
+ * mq().to(991) // '@media (max-width: 991px)'
220
+ */
221
+ to(arg: number): MediaQueryAPI;
222
+ feature(name: string, value?: number | string): MediaQueryAPI;
223
+ toString(): string;
224
+ }
225
+
226
+ type PseudoClass = CreateType<typeof PSEUDO_CLASSES[number], string>;
227
+ type PseudoClassFunctionString = CreateType<typeof PCF_STRING[number], (arg: string) => string>;
228
+ type PseudoClassFunctionStringArray = CreateType<typeof PCF_STRING_ARRAY[number], (...args: string[]) => string>;
229
+ type PseudoClassFunctionNumberOrString = CreateType<typeof PCF_NUMBER_OR_STRING[number], (arg: number | string) => string>;
230
+ type PseudoClasses = Prettify<PseudoClass & PseudoClassFunctionString & PseudoClassFunctionStringArray & PseudoClassFunctionNumberOrString>;
231
+ type PseudoElement = CreateType<typeof PSEUDO_ELEMENTS[number], string>;
232
+ type PseudoElementFunction = CreateType<typeof PSEUDO_ELEMENT_FUNCTIONS[number], (arg: string) => string>;
233
+ type PseudoElements = Prettify<PseudoElement & PseudoElementFunction>;
234
+ type ComponentSelector = string | {
235
+ toString(): string;
236
+ };
237
+ interface Combinators {
238
+ or(...data: string[]): string;
239
+ and(...data: string[]): string;
240
+ }
241
+ interface StyleHelper extends Combinators, PseudoClasses, PseudoElements {
242
+ attribute(name: string): AttributeAPI;
243
+ data(attribute: string): AttributeAPI;
244
+ /**
245
+ * Helper to create descendent selector(s) accepts both
246
+ * complex CSS selector(s) OR StyledComponent(s)
247
+ */
248
+ selector<T extends ComponentSelector>(...data: T[]): string;
249
+ /**
250
+ * Prop base styles where key is the prop name and
251
+ * value can be Object Styles OR a function that
252
+ * accepts an argument and renders styles based on
253
+ * the given value
254
+ *
255
+ * @example
256
+ * [style.prop('isActive')]: {
257
+ * ...rules
258
+ * }
259
+ * @example
260
+ * [style.prop('alignment')]: (alignment) => ({
261
+ * textAlign: alignment
262
+ * })
263
+ */
264
+ prop<P>(name: Extract<keyof P, string>): string;
265
+ props: {
266
+ /**
267
+ * Prop matcher function to test `all` given prop names
268
+ * exist AND its value is not false.
269
+ *
270
+ * Value can be Object Styles OR a function that accepts
271
+ * props object as its only argument.
272
+ *
273
+ * @example
274
+ * [style.props.all(
275
+ * 'isChecked',
276
+ * 'border'
277
+ * )]: {
278
+ * ...rules
279
+ * }
280
+ * @example
281
+ * [style.props.all(
282
+ * 'isChecked',
283
+ * 'borderColor'
284
+ * )]: ({ borderColor }) => ({
285
+ * border: `4px dashed ${borderColor}`
286
+ * })
287
+ */
288
+ all<P>(...names: Extract<keyof P, string>[]): string;
289
+ /**
290
+ * Prop matcher function to test `any` given prop names
291
+ * exist AND its value is not false.
292
+ *
293
+ * Value can be Object Styles OR a function that accepts
294
+ * props object as its only argument.
295
+ *
296
+ * @example
297
+ * [style.props.any(
298
+ * 'isChecked',
299
+ * 'border'
300
+ * )]: {
301
+ * ...rules
302
+ * }
303
+ * @example
304
+ * [style.props.any(
305
+ * 'isChecked',
306
+ * 'borderColor'
307
+ * )]: ({ borderColor = 'pink' }) => ({
308
+ * border: `4px dashed ${borderColor}`
309
+ * })
310
+ */
311
+ any<P>(...names: Extract<keyof P, string>[]): string;
312
+ /**
313
+ * Prop matcher function to test that the given props do not exist.
314
+ *
315
+ * @example
316
+ * [style.props.not(
317
+ * 'config',
318
+ * 'hasGutters'
319
+ * )]: {
320
+ * ...rules
321
+ * }
322
+ */
323
+ not<P>(...names: Extract<keyof P, string>[]): string;
324
+ };
325
+ }
326
+ interface AttributeAPI {
327
+ equals(...items: string[]): string;
328
+ /** Attribute selector for matching whole word */
329
+ contains(...items: string[]): string;
330
+ /** Attribute selector for matching substring */
331
+ containsAny(...items: string[]): string;
332
+ startsWith(...items: string[]): string;
333
+ endsWith(...items: string[]): string;
334
+ toString(): string;
335
+ }
336
+
337
+ type CreateType<T extends PropertyKey, V> = {
338
+ [K in keyof PropertyKey as T]: V;
339
+ };
340
+ type Prettify<T> = {
341
+ [K in keyof T]: T[K];
342
+ } & unknown;
343
+
344
+ type ReactPropTypes<T> = {
345
+ [K in keyof T]?: PropTypes.Validator<T[K] | null | undefined>;
346
+ };
347
+ interface FunctionalComponent<P = SomeProps> {
348
+ (props: P, ref?: React.ForwardedRef<unknown>): React.ReactElement<P>;
349
+ displayName?: string;
350
+ }
351
+ type SomeProps = UnknownProp & {
352
+ children?: React.ReactNode;
353
+ className?: string;
354
+ };
355
+ type EnhancedType<T, P> = T extends GenericComponent ? GenericComponent<P> : StyledComponent<P>;
356
+ interface EnhancedProps<T, P> {
357
+ propTypes: ReactPropTypes<P>;
358
+ styles: CSSProperties;
359
+ toString(): string;
360
+ /**
361
+ * Harness the styles and propTypes from other
362
+ * components simply by "extending" them.
363
+ *
364
+ * You can even pass plain object literal(s) as
365
+ * arguments on top of styled components including
366
+ * `generic`(s).
367
+ */
368
+ extend<K>(...items: ExtendableItem[]): EnhancedType<T, P & K>;
369
+ /**
370
+ * Provides a mechanism to passing string based CSS
371
+ * styles.
372
+ *
373
+ * This is mainly used for global styles, At-rules
374
+ * such as `@keyframe`, `@font-face`, `@counter-style`
375
+ * etc.
376
+ */
377
+ withCSS(...styles: string[]): EnhancedType<T, P>;
378
+ /**
379
+ * Built-in typechecking support for props.
380
+ *
381
+ * This is the same as applying `propTypes` attribute
382
+ * on components.
383
+ */
384
+ withProps(props: ReactPropTypes<P>): EnhancedType<T, P>;
385
+ /**
386
+ * Out of the box support for `ref` forwarding.
387
+ *
388
+ * This invokes React's `forwardRef` functionality
389
+ * automatically.
390
+ */
391
+ withRef(): EnhancedType<T, P>;
392
+ }
393
+ type StyledComponent<P = UnknownProp> = FunctionalComponent<P> & EnhancedProps<StyledComponent, P>;
394
+ interface FactoryHOC<P> {
395
+ <K>(C: FunctionalComponent<K>): StyledComponent<P & K>;
396
+ }
397
+ type GenericComponent<P = UnknownProp> = FactoryHOC<P> & EnhancedProps<GenericComponent, P>;
398
+ type ExtendableItem = CSSProperties | GenericComponent | StyledComponent;
399
+
400
+ /**
401
+ * API for creating React styled component(s)
402
+ */
403
+ declare const styled: {
404
+ generic: <P = UnknownProp>(arg?: CSSProperties | undefined) => GenericComponent<P>;
405
+ object: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
406
+ a: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
407
+ abbr: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
408
+ address: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
409
+ area: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
410
+ article: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
411
+ aside: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
412
+ audio: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
413
+ b: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
414
+ base: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
415
+ bdi: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
416
+ bdo: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
417
+ blockquote: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
418
+ body: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
419
+ br: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
420
+ button: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
421
+ canvas: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
422
+ caption: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
423
+ cite: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
424
+ code: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
425
+ col: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
426
+ colgroup: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
427
+ data: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
428
+ datalist: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
429
+ dd: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
430
+ del: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
431
+ details: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
432
+ dfn: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
433
+ dialog: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
434
+ div: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
435
+ dl: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
436
+ dt: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
437
+ em: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
438
+ embed: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
439
+ fieldset: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
440
+ figcaption: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
441
+ figure: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
442
+ footer: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
443
+ form: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
444
+ h1: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
445
+ h2: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
446
+ h3: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
447
+ h4: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
448
+ h5: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
449
+ h6: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
450
+ head: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
451
+ header: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
452
+ hgroup: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
453
+ hr: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
454
+ html: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
455
+ i: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
456
+ iframe: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
457
+ img: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
458
+ input: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
459
+ ins: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
460
+ kbd: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
461
+ label: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
462
+ legend: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
463
+ li: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
464
+ link: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
465
+ main: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
466
+ map: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
467
+ mark: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
468
+ math: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
469
+ menu: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
470
+ meta: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
471
+ meter: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
472
+ nav: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
473
+ noscript: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
474
+ ol: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
475
+ optgroup: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
476
+ option: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
477
+ output: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
478
+ p: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
479
+ picture: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
480
+ portal: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
481
+ pre: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
482
+ progress: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
483
+ q: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
484
+ rp: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
485
+ rt: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
486
+ ruby: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
487
+ s: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
488
+ samp: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
489
+ script: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
490
+ section: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
491
+ select: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
492
+ small: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
493
+ source: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
494
+ span: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
495
+ strong: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
496
+ style: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
497
+ sub: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
498
+ summary: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
499
+ sup: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
500
+ svg: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
501
+ table: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
502
+ tbody: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
503
+ td: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
504
+ textarea: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
505
+ tfoot: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
506
+ th: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
507
+ thead: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
508
+ time: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
509
+ title: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
510
+ tr: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
511
+ track: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
512
+ u: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
513
+ ul: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
514
+ var: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
515
+ video: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
516
+ wbr: <P_1 = UnknownProp>(arg?: CSSProperties | undefined) => StyledComponent<P_1>;
517
+ };
518
+
519
+ declare const mq: (...mediaTypes: MediaTypes[]) => MediaQueryAPI;
520
+
521
+ declare const style: StyleHelper;
522
+
523
+ declare const getStyles: () => string;
524
+
525
+ declare const ServerStyles: () => JSX.Element;
526
+
527
+ export { CSSProperties, ServerStyles, StyledComponent, styled as default, getStyles, mq, style };
@@ -0,0 +1,2 @@
1
+ /** @license styled v0.1.0. Copyright (c) N3E. */
2
+ import e from'react';const t='undefined'!=typeof window,r=e=>t=>typeof t===e,n=r('function'),s=r('number'),a=r('string'),o=r('object'),i=e=>t=>t===e,l=i(!0),c=i(!1),d=i(null),p=i(void 0),u=e=>o(e)&&!d(e)&&!Array.isArray(e),h=e=>a(e)||s(e),m=e=>d(e)||p(e),{stringify:y}=JSON,f=e=>(...t)=>`${e}-${(e=>(e=>{let t=-2128831035;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=16777619*t>>>0;return t})(y(e,((e,t)=>n(t)?`[Function ${e}]`:t))).toString(36))(t)}`,g=f('e'),b=f('s'),S=f('d'),w=f('c'),v=(e,t)=>{for(const r in t)Object.defineProperty(e,r,{value:t[r]});return e},$=(...e)=>e.join(''),C=e=>t=>$(t,e),T=e=>t=>$(e,t),R=T('.'),j=(e,t)=>{return t.split('||').flatMap((r=e,e=>r.map(C(e))));var r},O=e=>e.join('||'),E=e=>(...t)=>t.filter(Boolean).join(e),k=E(' '),_=e=>`(${e})`,N=(e,t)=>Object.entries(t).reduce(((t,[r,n])=>({...t,[r]:u(n)&&r in e?N(e[r],n):n})),{...e}),x=e=>e.trim().replace(/([A-Z])+/g,'-$1').toLowerCase(),A=(...e)=>t=>e.some((e=>t.startsWith(e))),M=e=>e.replace(/ {2}|\r\n|\n|\r/gm,'').trim(),L='@media',W=['print','screen'],P=['host','lang','is','not','where','nthChild','nthLastChild','nthLastOfType','nthOfType'],D='all',I='any',q='not',B='only',F='data-styled-sheet',H=(e,r)=>{const n=t?window:global,s=`__STYLED_${e}_REGISTER`;return s in n||Object.defineProperty(n,s,{value:Object.freeze(r())}),n[s]},G=e=>({add:(t,r)=>e.get(t)||e.set(t,{...r(),toString:()=>t}).get(t),get:t=>e.get(t),has:t=>e.has(t),__getDataStore:()=>new Map(e)}),Y=H('CACHE',(()=>G(new Map))),z=H('SHEET',(()=>{const e=new Map,t=([e,t])=>`<style ${F}="${e}">${t.css()}</style>`;return{...G(e),getStyles:()=>[...e].map(t).join('')}})),J=H('PROPS',(()=>({...G(new Map),names:new Set}))),{getStyles:U}=z,V=e=>t=>!m(e[t])&&!c(e[t]),Z=(e,t)=>{const r={[D]:e=>t.every(V(e)),[I]:e=>t.some(V(e)),[q]:e=>t.every((e=>t=>m(e[t]))(e)),[B]:e=>V(e)(t[0])};return t.forEach((e=>J.names.add(e))),{keys:t,predicate:r[e]}},K=e=>(...t)=>J.add(`props.${e}(${t})`,(()=>Z(e,t))).toString(),Q=i('content'),X=A('@container',L,'@supports'),ee=A(':','[',' ','>','~','+','.'),te=e=>()=>e,re=(e,t)=>{const r=Q(e)||s(t)?y:M;return`${x(e)}:${r(t)};`},ne=e=>(t,r)=>r.reduceRight(e,t),se=(e,t)=>`${t}{${e}}`,ae=ne(se),oe=ne(((e,t)=>({[t]:{...e}}))),ie=(e,t,r)=>n=>{const s=1===r.length?n[r[0]]:n,a=t(s);return u(a)?oe(a,e):{}},le=(...e)=>{const[t]=e,r=[e.map(R).join('')],s=(e,r,a,o)=>{const i=n(e),l=!J.has(a),c=J.get(a),[d,p]=(m=e,Object.entries(m).reduce((([e,t],[r,s])=>[h(s)?$(e,re(r,s)):e,u(s)||n(s)?{...t,[r]:s}:t]),['',{}]));var m;const y=X(a)?[...o,a]:o,f=ee(a)?j(r,a):r;return Object.entries(p).reduce(((e,[r,n])=>{if(!l)return e;const{computables:a,rules:o}=s(n,f,r,y);return{baseClassName:t,computables:[...e.computables,...a],rules:[...e.rules,...o]}}),{baseClassName:t,computables:l?[]:[{...c,identity:i?w:te(S(e)),yield:i?ie(o,e,c.keys):te(e)}],rules:l&&d?[ae(se(d,f.join()),y)]:[]})};return e=>s(e,r,'',[])},ce=(e,t=F)=>'undefined'==typeof document?void 0:document.querySelector(`style[${t}=${e}]`)||(e=>{const t=document.createElement(e),r={appendTo:e=>e.appendChild(t)&&r,withAttribute:(e,n)=>t.setAttribute(e,n)||r,unwrap:()=>t};return r})('style').withAttribute(t,e).appendTo(document.head).unwrap(),de=(e,t)=>(t.textContent||'').includes(e),pe=e=>t=>{if(!de(t,e)){const r=document.createTextNode(t);e.appendChild(r)}},ue=(e,t=e.sheet)=>r=>{try{if(t&&!de(r,e)){const e=t.cssRules.length;t.insertRule(r,e)}}catch(e){console.error(`DOMException: Failed to parse "${r}"`)}},he=(e,r)=>n=>{const s=Y.has(e),{baseClassName:a,computables:o,globals:i=[],rules:c}=Y.add(e,r);if(!s){const r=()=>((e,r=ce(e))=>{const n=new Map,s=t&&l(window.__STYLED_SLOW_MODE)?pe:ue;return{inject:(e,t)=>{n.has(e)||(r&&t.forEach(s(r)),n.set(e,t))},css:()=>[...n.values()].flat().join('')}})(a);z.add(a,r).inject(e,[...c,...i])}return o.length?n(e):[]},me=e=>{const t=r=>Y.get(r).computables.reduce(((n,s)=>{if(!s.predicate(e))return n;const a=s.yield(e),o=s.identity(a),i=`${o} (${r})`;return[...n,o,...he(i,(()=>le(Y.get(r).baseClassName,o)(a)))(t)]}),[]);return t},ye={plainStyles:[],propTypes:{},hasRef:!1},fe=(e,t,r=ye)=>(n={})=>{const s=g({name:e,...n}),a=(e,t)=>({...r,[e]:t}),o=o=>v(o,{propTypes:r.propTypes,styles:n,toString:()=>R(s),extend:(...s)=>{const[o,i]=(l=s,c=[n,r.propTypes],l.reduce((([e,t],r)=>{const n=r||{},s=n.styles||n,a=n.propTypes||{};return[N(e,s),{...t,...a}]}),c));var l,c;return fe(e,t,a('propTypes',i))(o)},withCSS:(...r)=>fe(e,t,a('plainStyles',r))(n),withProps:s=>{const o={...r.propTypes,...s};return fe(e,t,a('propTypes',o))(n)},withRef:()=>fe(e,t,a('hasRef',!0))(n)});return o(t?t({classIdentity:s,displayName:`styled.${e}`,styleRules:n,plainStyles:r.plainStyles,hasRef:r.hasRef}):t=>fe(e,v(ge(t),{propTypes:r.propTypes}),r)(n))},ge=t=>({classIdentity:r,displayName:s,styleRules:o,plainStyles:i,hasRef:l})=>{const c=((e,t)=>{const r=b(e),n=()=>({...le(r)(e),...t.length&&{globals:t.map(M)}});return e=>[r,...he(r,n)(me(e))]})(o,i),d=({children:s,className:o='',...i},l)=>{const d=a(t)?((e,t=J.names)=>Object.entries(e).reduce(((e,[r,n])=>({...e,...!t.has(r)&&{[r]:n}})),{}))(i):i,p=(e=>!m(e)&&((e=>'current'in(e||{}))(e)||n(e)))(l)?{ref:l}:void 0,u=k(r,...c(i),o);return e.createElement(t,{...d,...p,className:u},s)};return d.displayName=s,l?e.forwardRef(d):d},be=['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','math','menu','meta','meter','nav','noscript','object','ol','optgroup','option','output','p','picture','portal','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','svg','table','tbody','td','textarea','tfoot','th','thead','time','title','tr','track','u','ul','var','video','wbr'].reduce(((e,t)=>({...e,[t]:fe(t,ge(t))})),{generic:fe('generic')}),Se=C('px'),we=[...W,'anyPointer','colorGamut','displayMode','orientation','overflowBlock','pointer','prefersColorScheme','prefersContrast','scripting','update','anyHover','hover','forcedColors','grid','invertedColors','overflowInline','prefersReducedMotion',...((...e)=>t=>t.reduce(((t,r)=>{return[...t,...e.map(C((n=r,n.charAt(0).toUpperCase()+n.slice(1)))),r];var n}),[]))('min','max')(['height','width','aspectRatio','color','colorIndex','monochrome','resolution'])],ve=E(' and '),$e=E(', '),Ce=(...e)=>{const t=new Set(e),r=new Set,n=(e,t)=>r.add(_([x(e),t].filter(h).join(':'))),s={...we.reduce(((e,r)=>({...e,[r]:W.includes(r)?()=>t.add(r)&&s:e=>n(r,e)&&s})),{}),feature:(e,t)=>n(e,t)&&s,from:e=>s.minWidth(Se(e)),to:e=>s.maxWidth(Se(e)),toString:()=>k(L,ve($e(...t),...r))};return s},Te=e=>(...t)=>O(t.map(e)),Re={and:(...e)=>O(e.reduce(j,[''])),or:(...e)=>O(e)},je=e=>(t,r)=>[...t,...r].reduce(((t,n)=>{const s=$(e,x(n)),a=r.includes(n);return{...t,[n]:a?(...e)=>$(s,_(e)):s}}),{}),Oe=je('::')(['after','backdrop','before','cue','cueRegion','firstLetter','firstLine','fileSelectorButton','marker','placeholder','selection'],['part','slotted']),Ee=je(':')(['active','anyLink','autofill','checked','default','defined','disabled','empty','enabled','first','firstChild','firstOfType','fullscreen','focus','focusVisible','focusWithin','hover','indeterminate','inRange','invalid','lastChild','lastOfType','left','link','modal','onlyChild','onlyOfType','optional','outOfRange','pictureInPicture','placeholderShown','paused','playing','readOnly','readWrite','required','right','root','scope','target','valid','visited'],P),ke=e=>`[${e}]`,_e=e=>{const t=x(e),r=e=>r=>ke($(t,e,y(r)));return{equals:Te(r('=')),contains:Te(r('~=')),containsAny:Te(r('*=')),startsWith:Te(r('^=')),endsWith:Te(r('$=')),toString:()=>ke(t)}},Ne={...Re,...Oe,...Ee,attribute:_e,data:e=>_e(`data-${e}`),selector:Te(T(' ')),prop:K(B),props:{[D]:K(D),[I]:K(I),[q]:K(q)}},xe=()=>e.createElement(e.Fragment,{},[...z.__getDataStore()].map((([t,r])=>e.createElement('style',{[F]:t,key:t},r.css()))));export{xe as ServerStyles,be as default,U as getStyles,Ce as mq,Ne as style};
Binary file