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