@xanui/core 1.1.5 → 1.1.6
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/ServerStyleTags.d.ts +5 -0
- package/Tag/index.d.ts +6 -0
- package/Tag/types.d.ts +181 -0
- package/Tag/useTagProps.d.ts +5 -0
- package/Transition/index.d.ts +34 -0
- package/Transition/variants.d.ts +134 -0
- package/breakpoint/useBreakpoint.d.ts +12 -0
- package/breakpoint/useBreakpointProps.d.ts +9 -0
- package/css/getProps.d.ts +5 -0
- package/css/getValue.d.ts +5 -0
- package/css/index.d.ts +16 -0
- package/css/types.d.ts +57 -0
- package/index.d.ts +19 -629
- package/isWindow.d.ts +3 -0
- package/package.json +5 -6
- package/theme/ThemeProvider.d.ts +14 -0
- package/theme/core.d.ts +6 -0
- package/theme/createThemeSwitcher.d.ts +9 -0
- package/theme/types.d.ts +127 -0
- package/useAnimation.d.ts +21 -0
- package/useColorTemplate.d.ts +6 -0
- package/useInterface.d.ts +5 -0
package/Tag/index.d.ts
ADDED
package/Tag/types.d.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
import { CSSValueType, BreakpointKeys, Aliases, CSSProps } from '../css/types.js';
|
|
3
|
+
import { ColorsRefTypes, TypographyRefTypes } from '../theme/types.js';
|
|
4
|
+
import { classNamesTypes } from 'pretty-class';
|
|
5
|
+
|
|
6
|
+
type TagComponentType = keyof React.JSX.IntrinsicElements | React.ComponentType<any>;
|
|
7
|
+
type TagProps<T extends TagComponentType = 'div'> = Omit<React.HTMLProps<T>, 'width' | 'height'> & {
|
|
8
|
+
component?: T;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
ref?: any;
|
|
11
|
+
} & CSSPropAsAttr;
|
|
12
|
+
type TagPropsRoot<T extends TagComponentType = 'div'> = TagProps<T> & {
|
|
13
|
+
sxr?: CSSProps;
|
|
14
|
+
};
|
|
15
|
+
interface TagCSSProperties {
|
|
16
|
+
alignContent: CSSValueType<"alignContent">;
|
|
17
|
+
alignItems: CSSValueType<"alignItems">;
|
|
18
|
+
alignSelf: CSSValueType<"alignSelf">;
|
|
19
|
+
animation: CSSValueType<"animation">;
|
|
20
|
+
animationComposition: CSSValueType<"animationComposition">;
|
|
21
|
+
animationDelay: CSSValueType<"animationDelay">;
|
|
22
|
+
animationDirection: CSSValueType<"animationDirection">;
|
|
23
|
+
animationDuration: CSSValueType<"animationDuration">;
|
|
24
|
+
animationFillMode: CSSValueType<"animationFillMode">;
|
|
25
|
+
animationIterationCount: CSSValueType<"animationIterationCount">;
|
|
26
|
+
animationName: CSSValueType<"animationName">;
|
|
27
|
+
animationTimingFunction: CSSValueType<"animationTimingFunction">;
|
|
28
|
+
backdropFilter: CSSValueType<"backdropFilter">;
|
|
29
|
+
background: CSSValueType<"background"> | ColorsRefTypes;
|
|
30
|
+
backgroundAttachment: CSSValueType<"backgroundAttachment">;
|
|
31
|
+
backgroundColor: CSSValueType<"backgroundColor"> | ColorsRefTypes;
|
|
32
|
+
backgroundImage: CSSValueType<"backgroundImage">;
|
|
33
|
+
backgroundOrigin: CSSValueType<"backgroundOrigin">;
|
|
34
|
+
backgroundPosition: CSSValueType<"backgroundPosition">;
|
|
35
|
+
backgroundRepeat: CSSValueType<"backgroundRepeat">;
|
|
36
|
+
backgroundSize: CSSValueType<"backgroundSize">;
|
|
37
|
+
border: CSSValueType<"border">;
|
|
38
|
+
borderBottom: CSSValueType<"borderBottom">;
|
|
39
|
+
borderBottomColor: CSSValueType<"borderBottomColor"> | ColorsRefTypes;
|
|
40
|
+
borderBottomStyle: CSSValueType<"borderBottomStyle">;
|
|
41
|
+
borderBottomWidth: CSSValueType<"borderBottomWidth">;
|
|
42
|
+
borderColor: CSS.Properties['borderColor'] | ColorsRefTypes;
|
|
43
|
+
borderImage: CSSValueType<"borderImage">;
|
|
44
|
+
borderLeft: CSSValueType<"borderLeft">;
|
|
45
|
+
borderLeftColor: CSSValueType<"borderLeftColor"> | ColorsRefTypes;
|
|
46
|
+
borderLeftStyle: CSSValueType<"borderLeftStyle">;
|
|
47
|
+
borderLeftWidth: CSSValueType<"borderLeftWidth">;
|
|
48
|
+
borderRadius: CSSValueType<"borderRadius">;
|
|
49
|
+
borderRight: CSSValueType<"borderRight">;
|
|
50
|
+
borderRightColor: CSSValueType<"borderRightColor"> | ColorsRefTypes;
|
|
51
|
+
borderRightStyle: CSSValueType<"borderRightStyle">;
|
|
52
|
+
borderRightWidth: CSSValueType<"borderRightWidth">;
|
|
53
|
+
borderStyle: CSSValueType<"borderStyle">;
|
|
54
|
+
borderTop: CSSValueType<"borderTop">;
|
|
55
|
+
borderTopColor: CSSValueType<"borderTopColor"> | ColorsRefTypes;
|
|
56
|
+
borderTopLeftRadius: CSSValueType<"borderTopLeftRadius">;
|
|
57
|
+
borderTopRightRadius: CSSValueType<"borderTopRightRadius">;
|
|
58
|
+
borderTopStyle: CSSValueType<"borderTopStyle">;
|
|
59
|
+
borderTopWidth: CSSValueType<"borderTopWidth">;
|
|
60
|
+
borderWidth: CSSValueType<"borderWidth">;
|
|
61
|
+
bottom: CSSValueType<"bottom">;
|
|
62
|
+
boxShadow: CSSValueType<"boxShadow"> | number;
|
|
63
|
+
boxSizing: CSSValueType<"boxSizing">;
|
|
64
|
+
cursor: CSSValueType<"cursor">;
|
|
65
|
+
color: CSS.Properties['color'] | ColorsRefTypes;
|
|
66
|
+
display: CSSValueType<"display">;
|
|
67
|
+
direction: "row" | "column" | CSSValueType<"direction">;
|
|
68
|
+
filter: CSSValueType<"filter">;
|
|
69
|
+
flex: CSSValueType<"flex">;
|
|
70
|
+
flexBasis: CSSValueType<"flexBasis">;
|
|
71
|
+
flexDirection: CSSValueType<"flexDirection">;
|
|
72
|
+
flexFlow: CSSValueType<"flexFlow">;
|
|
73
|
+
flexGrow: CSSValueType<"flexGrow">;
|
|
74
|
+
flexShrink: CSSValueType<"flexShrink">;
|
|
75
|
+
flexWrap: CSSValueType<"flexWrap">;
|
|
76
|
+
float: CSSValueType<"float">;
|
|
77
|
+
fontFamily: CSSValueType<"fontFamily"> | "default";
|
|
78
|
+
fontSize: CSSValueType<"fontSize"> | TypographyRefTypes;
|
|
79
|
+
fontStyle: CSSValueType<"fontStyle">;
|
|
80
|
+
fontWeight: CSSValueType<"fontWeight"> | TypographyRefTypes;
|
|
81
|
+
font: CSSValueType<"font"> | TypographyRefTypes;
|
|
82
|
+
gap: CSSValueType<"gap">;
|
|
83
|
+
grid: CSSValueType<"grid">;
|
|
84
|
+
gridArea: CSSValueType<"gridArea">;
|
|
85
|
+
gridAutoColumns: CSSValueType<"gridAutoColumns">;
|
|
86
|
+
gridAutoFlow: CSSValueType<"gridAutoFlow">;
|
|
87
|
+
gridAutoRows: CSSValueType<"gridAutoRows">;
|
|
88
|
+
gridColumn: CSSValueType<"gridColumn">;
|
|
89
|
+
gridColumnEnd: CSSValueType<"gridColumnEnd">;
|
|
90
|
+
gridColumnGap: CSSValueType<"gridColumnGap">;
|
|
91
|
+
gridColumnStart: CSSValueType<"gridColumnStart">;
|
|
92
|
+
gridGap: CSSValueType<"gridGap">;
|
|
93
|
+
gridRow: CSSValueType<"gridRow">;
|
|
94
|
+
gridRowEnd: CSSValueType<"gridRowEnd">;
|
|
95
|
+
gridRowGap: CSSValueType<"gridRowGap">;
|
|
96
|
+
gridRowStart: CSSValueType<"gridRowStart">;
|
|
97
|
+
gridTemplate: CSSValueType<"gridTemplate">;
|
|
98
|
+
gridTemplateAreas: CSSValueType<"gridTemplateAreas">;
|
|
99
|
+
gridTemplateColumns: CSSValueType<"gridTemplateColumns">;
|
|
100
|
+
gridTemplateRows: CSSValueType<"gridTemplateRows">;
|
|
101
|
+
height: CSSValueType<"height">;
|
|
102
|
+
justifyContent: CSSValueType<"justifyContent">;
|
|
103
|
+
justifyItems: CSSValueType<"justifyItems">;
|
|
104
|
+
justifySelf: CSSValueType<"justifySelf">;
|
|
105
|
+
left: CSSValueType<"left">;
|
|
106
|
+
letterSpacing: CSSValueType<"letterSpacing">;
|
|
107
|
+
lineBreak: CSSValueType<"lineBreak">;
|
|
108
|
+
lineHeight: CSSValueType<"lineHeight"> | TypographyRefTypes;
|
|
109
|
+
listStyle: CSSValueType<"listStyle">;
|
|
110
|
+
margin: CSSValueType<"margin">;
|
|
111
|
+
marginBlock: CSSValueType<"marginBlock">;
|
|
112
|
+
marginBlockEnd: CSSValueType<"marginBlockEnd">;
|
|
113
|
+
marginBlockStart: CSSValueType<"marginBlockStart">;
|
|
114
|
+
marginBottom: CSSValueType<"marginBottom">;
|
|
115
|
+
marginInline: CSSValueType<"marginInline">;
|
|
116
|
+
marginInlineEnd: CSSValueType<"marginInlineEnd">;
|
|
117
|
+
marginInlineStart: CSSValueType<"marginInlineStart">;
|
|
118
|
+
marginLeft: CSSValueType<"marginLeft">;
|
|
119
|
+
marginRight: CSSValueType<"marginRight">;
|
|
120
|
+
marginTop: CSSValueType<"marginTop">;
|
|
121
|
+
maxHeight: CSSValueType<"maxHeight">;
|
|
122
|
+
maxWidth: CSSValueType<"maxWidth"> | BreakpointKeys;
|
|
123
|
+
minHeight: CSSValueType<"minHeight">;
|
|
124
|
+
minWidth: CSSValueType<"minWidth"> | BreakpointKeys;
|
|
125
|
+
objectFit: CSSValueType<"objectFit">;
|
|
126
|
+
objectPosition: CSSValueType<"objectPosition">;
|
|
127
|
+
opacity: CSSValueType<"opacity">;
|
|
128
|
+
order: CSSValueType<"order">;
|
|
129
|
+
outline: CSSValueType<"outline">;
|
|
130
|
+
overflow: CSSValueType<"overflow">;
|
|
131
|
+
overflowX: CSSValueType<"overflowX">;
|
|
132
|
+
overflowY: CSSValueType<"overflowY">;
|
|
133
|
+
padding: CSSValueType<"padding">;
|
|
134
|
+
paddingBlock: CSSValueType<"paddingBlock">;
|
|
135
|
+
paddingBlockEnd: CSSValueType<"paddingBlockEnd">;
|
|
136
|
+
paddingBlockStart: CSSValueType<"paddingBlockStart">;
|
|
137
|
+
paddingBottom: CSSValueType<"paddingBottom">;
|
|
138
|
+
paddingInline: CSSValueType<"paddingInline">;
|
|
139
|
+
paddingInlineEnd: CSSValueType<"paddingInlineEnd">;
|
|
140
|
+
paddingInlineStart: CSSValueType<"paddingInlineStart">;
|
|
141
|
+
paddingLeft: CSSValueType<"paddingLeft">;
|
|
142
|
+
paddingRight: CSSValueType<"paddingRight">;
|
|
143
|
+
paddingTop: CSSValueType<"paddingTop">;
|
|
144
|
+
perspective: CSSValueType<"perspective">;
|
|
145
|
+
perspectiveOrigin: CSSValueType<"perspectiveOrigin">;
|
|
146
|
+
pointerEvents: CSSValueType<"pointerEvents">;
|
|
147
|
+
position: CSSValueType<"position">;
|
|
148
|
+
right: CSSValueType<"right">;
|
|
149
|
+
textAlign: CSSValueType<"textAlign">;
|
|
150
|
+
textDecoration: CSSValueType<"textDecoration">;
|
|
151
|
+
textShadow: CSSValueType<"textShadow">;
|
|
152
|
+
textTransform: CSSValueType<"textTransform">;
|
|
153
|
+
top: CSSValueType<"top">;
|
|
154
|
+
transform: CSSValueType<"transform">;
|
|
155
|
+
transformOrigin: CSSValueType<"transformOrigin">;
|
|
156
|
+
transformStyle: CSSValueType<"transformStyle">;
|
|
157
|
+
transition: CSSValueType<"transition">;
|
|
158
|
+
transitionDelay: CSSValueType<"transitionDelay">;
|
|
159
|
+
transitionDuration: CSSValueType<"transitionDuration">;
|
|
160
|
+
transitionProperty: CSSValueType<"transitionProperty">;
|
|
161
|
+
transitionTimingFunction: CSSValueType<"transitionTimingFunction">;
|
|
162
|
+
translate: CSSValueType<"translate">;
|
|
163
|
+
userSelect: CSSValueType<"userSelect">;
|
|
164
|
+
verticalAlign: CSSValueType<"verticalAlign">;
|
|
165
|
+
visibility: CSSValueType<"visibility">;
|
|
166
|
+
whiteSpace: CSSValueType<"whiteSpace">;
|
|
167
|
+
width: CSSValueType<"width"> | BreakpointKeys;
|
|
168
|
+
wordBreak: CSSValueType<"wordBreak">;
|
|
169
|
+
wordSpacing: CSSValueType<"wordSpacing">;
|
|
170
|
+
wordWrap: CSSValueType<"wordWrap">;
|
|
171
|
+
zIndex: CSSValueType<"zIndex">;
|
|
172
|
+
}
|
|
173
|
+
type CSSPropAsAttr = Partial<TagCSSProperties> & Aliases & {
|
|
174
|
+
baseClass?: string;
|
|
175
|
+
sx?: CSSProps;
|
|
176
|
+
hover?: CSSProps;
|
|
177
|
+
disabled?: boolean;
|
|
178
|
+
classNames?: classNamesTypes;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type { CSSPropAsAttr, TagComponentType, TagProps, TagPropsRoot };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React__default, { ReactElement } from 'react';
|
|
2
|
+
import { animationEases } from '../useAnimation.js';
|
|
3
|
+
import { CSSProps } from '../css/types.js';
|
|
4
|
+
import * as variants from './variants.js';
|
|
5
|
+
|
|
6
|
+
type TransitionVariantTypes = keyof typeof variants;
|
|
7
|
+
type TransitionElementProps = {
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
rect: DOMRect | null;
|
|
11
|
+
};
|
|
12
|
+
type TransitionState = "open" | "opened" | "close" | "closed";
|
|
13
|
+
type TransitionProps = {
|
|
14
|
+
children: ReactElement;
|
|
15
|
+
open: boolean;
|
|
16
|
+
variant: {
|
|
17
|
+
from: CSSProps;
|
|
18
|
+
to: CSSProps;
|
|
19
|
+
} | TransitionVariantTypes;
|
|
20
|
+
ease?: string;
|
|
21
|
+
easing?: keyof typeof animationEases;
|
|
22
|
+
duration?: number;
|
|
23
|
+
delay?: number;
|
|
24
|
+
disableInitialTransition?: boolean;
|
|
25
|
+
onOpen?: () => void;
|
|
26
|
+
onOpened?: () => void;
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
onClosed?: () => void;
|
|
29
|
+
onState?: (state: TransitionState) => void;
|
|
30
|
+
};
|
|
31
|
+
declare const Transition: ({ children, open, ...props }: TransitionProps) => React__default.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { Transition as default };
|
|
34
|
+
export type { TransitionElementProps, TransitionProps, TransitionState, TransitionVariantTypes };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { TransitionElementProps } from './index.js';
|
|
2
|
+
|
|
3
|
+
declare const slideDown: (_arg: TransitionElementProps) => {
|
|
4
|
+
from: {
|
|
5
|
+
transform: string;
|
|
6
|
+
};
|
|
7
|
+
to: {
|
|
8
|
+
transform: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare const slideUp: (_arg: TransitionElementProps) => {
|
|
12
|
+
from: {
|
|
13
|
+
transform: string;
|
|
14
|
+
};
|
|
15
|
+
to: {
|
|
16
|
+
transform: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const slideRight: (_arg: TransitionElementProps) => {
|
|
20
|
+
from: {
|
|
21
|
+
transform: string;
|
|
22
|
+
};
|
|
23
|
+
to: {
|
|
24
|
+
transform: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare const slideLeft: (_arg: TransitionElementProps) => {
|
|
28
|
+
from: {
|
|
29
|
+
transform: string;
|
|
30
|
+
};
|
|
31
|
+
to: {
|
|
32
|
+
transform: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
declare const fade: (_arg: TransitionElementProps) => {
|
|
36
|
+
from: {
|
|
37
|
+
opacity: number;
|
|
38
|
+
};
|
|
39
|
+
to: {
|
|
40
|
+
opacity: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
declare const fadeDown: (_arg: TransitionElementProps) => {
|
|
44
|
+
from: {
|
|
45
|
+
transform: string;
|
|
46
|
+
opacity: number;
|
|
47
|
+
};
|
|
48
|
+
to: {
|
|
49
|
+
transform: string;
|
|
50
|
+
opacity: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
declare const fadeUp: (_arg: TransitionElementProps) => {
|
|
54
|
+
from: {
|
|
55
|
+
transform: string;
|
|
56
|
+
opacity: number;
|
|
57
|
+
};
|
|
58
|
+
to: {
|
|
59
|
+
transform: string;
|
|
60
|
+
opacity: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
declare const fadeRight: (_arg: TransitionElementProps) => {
|
|
64
|
+
from: {
|
|
65
|
+
transform: string;
|
|
66
|
+
opacity: number;
|
|
67
|
+
};
|
|
68
|
+
to: {
|
|
69
|
+
transform: string;
|
|
70
|
+
opacity: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
declare const fadeLeft: (_arg: TransitionElementProps) => {
|
|
74
|
+
from: {
|
|
75
|
+
transform: string;
|
|
76
|
+
opacity: number;
|
|
77
|
+
};
|
|
78
|
+
to: {
|
|
79
|
+
transform: string;
|
|
80
|
+
opacity: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
declare const grow: (_arg: TransitionElementProps) => {
|
|
84
|
+
from: {
|
|
85
|
+
transform: string;
|
|
86
|
+
opacity: number;
|
|
87
|
+
};
|
|
88
|
+
to: {
|
|
89
|
+
transform: string;
|
|
90
|
+
opacity: number;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
declare const zoom: (_arg: TransitionElementProps) => {
|
|
94
|
+
from: {
|
|
95
|
+
transform: string;
|
|
96
|
+
opacity: number;
|
|
97
|
+
};
|
|
98
|
+
to: {
|
|
99
|
+
transform: string;
|
|
100
|
+
opacity: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
declare const zoomOver: (_arg: TransitionElementProps) => {
|
|
104
|
+
from: {
|
|
105
|
+
transform: string;
|
|
106
|
+
opacity: number;
|
|
107
|
+
};
|
|
108
|
+
to: {
|
|
109
|
+
transform: string;
|
|
110
|
+
opacity: number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
declare const collapsVerticle: (_arg: TransitionElementProps) => {
|
|
114
|
+
from: {
|
|
115
|
+
height: string;
|
|
116
|
+
overflow: string;
|
|
117
|
+
};
|
|
118
|
+
to: {
|
|
119
|
+
height: string;
|
|
120
|
+
overflow: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
declare const collapsHorizental: (_arg: TransitionElementProps) => {
|
|
124
|
+
from: {
|
|
125
|
+
width: string;
|
|
126
|
+
overflow: string;
|
|
127
|
+
};
|
|
128
|
+
to: {
|
|
129
|
+
width: string;
|
|
130
|
+
overflow: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { collapsHorizental, collapsVerticle, fade, fadeDown, fadeLeft, fadeRight, fadeUp, grow, slideDown, slideLeft, slideRight, slideUp, zoom, zoomOver };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BreakpointKeys } from '../css/types.js';
|
|
2
|
+
|
|
3
|
+
declare const useBreakpoint: () => {
|
|
4
|
+
value: BreakpointKeys;
|
|
5
|
+
is: (key: BreakpointKeys) => boolean;
|
|
6
|
+
isDown: (key: BreakpointKeys) => boolean;
|
|
7
|
+
isUp: (key: BreakpointKeys) => boolean;
|
|
8
|
+
isOrDown: (key: BreakpointKeys) => boolean;
|
|
9
|
+
isOrUp: (key: BreakpointKeys) => boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useBreakpoint as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BreakpointKeys } from '../css/types.js';
|
|
2
|
+
|
|
3
|
+
type useBreakpointPropsType<P> = P | {
|
|
4
|
+
[key in BreakpointKeys]?: P;
|
|
5
|
+
};
|
|
6
|
+
declare const useBreakpoinProps: <P extends object>(props: useBreakpointPropsType<P>) => useBreakpointPropsType<P>;
|
|
7
|
+
|
|
8
|
+
export { useBreakpoinProps as default };
|
|
9
|
+
export type { useBreakpointPropsType };
|
package/css/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as oncss_types from 'oncss/types';
|
|
2
|
+
import { CSSProps, CSSOptionProps } from './types.js';
|
|
3
|
+
|
|
4
|
+
declare const breakpoints: {
|
|
5
|
+
xs: number;
|
|
6
|
+
sm: number;
|
|
7
|
+
md: number;
|
|
8
|
+
lg: number;
|
|
9
|
+
xl: number;
|
|
10
|
+
};
|
|
11
|
+
declare const css: (props: CSSProps, options?: CSSOptionProps) => oncss_types.CSSFactoryType;
|
|
12
|
+
declare const adjustColor: (hex: string, factor: number) => string;
|
|
13
|
+
declare const adjustTextContrast: (color: string) => "#111111" | "#FFFFFF";
|
|
14
|
+
declare const alpha: (color: string, opacity?: number) => string;
|
|
15
|
+
|
|
16
|
+
export { adjustColor, adjustTextContrast, alpha, breakpoints, css };
|
package/css/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
import { ColorsRefTypes, TypographyRefTypes, ThemeOptions } from '../theme/types.js';
|
|
3
|
+
import * as oncss from 'oncss';
|
|
4
|
+
|
|
5
|
+
type FN = (theme: ThemeOptions) => string | number;
|
|
6
|
+
type CSSBreakpointType = {
|
|
7
|
+
[key in BreakpointKeys]: string | number;
|
|
8
|
+
};
|
|
9
|
+
type CSSValueType<T extends keyof CSS.Properties> = CSS.Properties[T] | Partial<CSSBreakpointType> | number;
|
|
10
|
+
type Aliases = {
|
|
11
|
+
bgcolor?: CSSValueType<'background'> | ColorsRefTypes;
|
|
12
|
+
bgimage?: CSSValueType<'backgroundImage'>;
|
|
13
|
+
bg?: CSSValueType<'background'> | ColorsRefTypes;
|
|
14
|
+
p?: CSSValueType<'padding'>;
|
|
15
|
+
pt?: CSSValueType<'padding'>;
|
|
16
|
+
pr?: CSSValueType<'padding'>;
|
|
17
|
+
pb?: CSSValueType<'padding'>;
|
|
18
|
+
pl?: CSSValueType<'padding'>;
|
|
19
|
+
px?: CSSValueType<'padding'>;
|
|
20
|
+
py?: CSSValueType<'margin'>;
|
|
21
|
+
m?: CSSValueType<'margin'>;
|
|
22
|
+
mt?: CSSValueType<'margin'>;
|
|
23
|
+
mr?: CSSValueType<'margin'>;
|
|
24
|
+
mb?: CSSValueType<'margin'>;
|
|
25
|
+
ml?: CSSValueType<'margin'>;
|
|
26
|
+
mx?: CSSValueType<'margin'>;
|
|
27
|
+
my?: CSSValueType<'margin'>;
|
|
28
|
+
size?: CSSValueType<'width'>;
|
|
29
|
+
spacing?: Partial<CSSBreakpointType> | number;
|
|
30
|
+
radius?: CSSValueType<'borderRadius'> | number;
|
|
31
|
+
borderRadius?: CSSValueType<'borderRadius'> | number;
|
|
32
|
+
shadow?: CSSValueType<'boxShadow'> | number;
|
|
33
|
+
flexBox?: boolean;
|
|
34
|
+
flexRow?: boolean;
|
|
35
|
+
flexColumn?: boolean;
|
|
36
|
+
flexWraped?: boolean;
|
|
37
|
+
direction?: "row" | "column" | CSSValueType<'direction'>;
|
|
38
|
+
gap?: CSSValueType<'gap'>;
|
|
39
|
+
color?: CSSValueType<'color'> | ColorsRefTypes;
|
|
40
|
+
width?: CSSValueType<'width'> | BreakpointKeys;
|
|
41
|
+
height?: CSSValueType<'height'>;
|
|
42
|
+
borderColor?: CSSValueType<'backgroundColor'> | ColorsRefTypes;
|
|
43
|
+
fontFamily?: CSSValueType<"fontFamily"> | "default";
|
|
44
|
+
fontSize?: CSSValueType<"fontSize"> | TypographyRefTypes;
|
|
45
|
+
minWidth?: CSSValueType<"minWidth"> | BreakpointKeys;
|
|
46
|
+
maxWidth?: CSSValueType<"maxWidth"> | BreakpointKeys;
|
|
47
|
+
minHeight?: CSSValueType<"minHeight">;
|
|
48
|
+
maxHeight?: CSSValueType<"maxHeight">;
|
|
49
|
+
};
|
|
50
|
+
type BreakpointKeys = "xs" | "sm" | "md" | "lg" | "xl";
|
|
51
|
+
type CSSProps = oncss.CSSProps<Aliases, BreakpointKeys>;
|
|
52
|
+
type CSSOptionProps = oncss.CSSOptionProps<Aliases, BreakpointKeys>;
|
|
53
|
+
type GlobalCSS = {
|
|
54
|
+
[key: string]: oncss.CSSPropsWithoutGlobal<Aliases, BreakpointKeys>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type { Aliases, BreakpointKeys, CSSBreakpointType, CSSOptionProps, CSSProps, CSSValueType, FN, GlobalCSS };
|