@navita/types 0.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/index.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ import { AtRule, Properties, SimplePseudos } from 'csstype';
2
+
3
+ type CSSVarFunction = `var(--${string})` | `var(--${string}, ${string | number})`;
4
+ type Contract = {
5
+ [key: string]: CSSVarFunction | null | Contract;
6
+ };
7
+ type Primitive = string | boolean | number | null | undefined;
8
+ type MapLeafNodes<Obj, LeafType> = {
9
+ [Prop in keyof Obj]: Obj[Prop] extends Primitive ? LeafType : Obj[Prop] extends Record<string | number, any> ? MapLeafNodes<Obj[Prop], LeafType> : never;
10
+ };
11
+ type NullableTokens = {
12
+ [key: string]: string | NullableTokens | null;
13
+ };
14
+ type Tokens = {
15
+ [key: string]: string | Tokens;
16
+ };
17
+ type ThemeVars<ThemeContract extends NullableTokens> = MapLeafNodes<ThemeContract, CSSVarFunction>;
18
+ type GlobalFontFaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>;
19
+ type FontFaceRule = Omit<GlobalFontFaceRule, 'fontFamily'>;
20
+ interface ContainerProperties {
21
+ container?: string;
22
+ containerType?: 'size' | 'inline-size' | (string & {});
23
+ containerName?: string;
24
+ }
25
+ type CSSTypeProperties = Properties<number | (string & {})> & ContainerProperties;
26
+ type CSSProperties = {
27
+ [Property in keyof CSSTypeProperties]: CSSTypeProperties[Property] | CSSVarFunction;
28
+ };
29
+ interface CSSKeyframes {
30
+ [time: string]: CSSProperties;
31
+ }
32
+ interface MediaQueries<StyleType> {
33
+ [string: `@media${string}`]: StyleType;
34
+ }
35
+ interface FeatureQueries<StyleType> {
36
+ [string: `@supports${string}`]: StyleType;
37
+ }
38
+ interface ContainerQueries<StyleType> {
39
+ [string: `@container${string}`]: StyleType;
40
+ }
41
+ type WithQueries<StyleType> = MediaQueries<StyleType & FeatureQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & FeatureQueries<StyleType>>> & FeatureQueries<StyleType & MediaQueries<StyleType & ContainerQueries<StyleType>> & ContainerQueries<StyleType & MediaQueries<StyleType>>> & ContainerQueries<StyleType & MediaQueries<StyleType & FeatureQueries<StyleType>> & FeatureQueries<StyleType & MediaQueries<StyleType>>>;
42
+ interface WithDirectDescendants<StyleType> {
43
+ [string: `> ${string}`]: StyleType;
44
+ }
45
+ interface WithNestedSelectors<StyleType> {
46
+ [string: `& ${string}`]: StyleType;
47
+ }
48
+ type WithPseudoSelectors<StyleType> = {
49
+ [key in SimplePseudos]?: StyleType;
50
+ };
51
+ interface StyleRule extends CSSProperties, WithQueries<StyleRule>, WithPseudoSelectors<StyleRule>, WithDirectDescendants<StyleRule>, WithNestedSelectors<StyleRule> {
52
+ }
53
+ type GlobalStyleRule = StyleRule;
54
+
55
+ export { CSSKeyframes, CSSProperties, CSSVarFunction, Contract, FontFaceRule, GlobalFontFaceRule, GlobalStyleRule, MapLeafNodes, NullableTokens, StyleRule, ThemeVars, Tokens, WithQueries };
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
package/index.mjs ADDED
@@ -0,0 +1 @@
1
+
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@navita/types",
3
+ "version": "0.0.0",
4
+ "exports": {
5
+ ".": {
6
+ "types": "./index.d.ts"
7
+ }
8
+ },
9
+ "dependencies": {
10
+ "csstype": "^3.1.1"
11
+ }
12
+ }