@cronocode/react-box 0.4.0 → 0.4.1
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/box.d.ts +3 -168
- package/box.module.css.js +2 -11501
- package/components/flex.d.ts +3 -3
- package/package.json +6 -5
- package/style.css +1 -1
- package/types.d.ts +213 -1
- package/css.variables.d.ts +0 -26
package/types.d.ts
CHANGED
|
@@ -1,3 +1,215 @@
|
|
|
1
1
|
export declare type Hovered<T> = {
|
|
2
|
-
[K in keyof T as K extends string ? `${K}
|
|
2
|
+
[K in keyof T as K extends string ? `${K}H` : never]: T[K];
|
|
3
3
|
};
|
|
4
|
+
export declare type Focused<T> = {
|
|
5
|
+
[K in keyof T as K extends string ? `${K}F` : never]: T[K];
|
|
6
|
+
};
|
|
7
|
+
export declare type Activated<T> = {
|
|
8
|
+
[K in keyof T as K extends string ? `${K}A` : never]: T[K];
|
|
9
|
+
};
|
|
10
|
+
export declare const styleVariables: {
|
|
11
|
+
display: readonly ["none", "block", "inline-block", "flex", "inline-flex", "grid"];
|
|
12
|
+
boxSizing: readonly ["border-box", "content-box"];
|
|
13
|
+
position: readonly ["static", "relative", "absolute", "fixed", "sticky"];
|
|
14
|
+
sizeSpecialValues: readonly ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"];
|
|
15
|
+
borderAndOutlineStyles: readonly ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"];
|
|
16
|
+
overflows: readonly ["auto", "hidden", "scroll", "visible"];
|
|
17
|
+
textDecoration: readonly ["none", "underline"];
|
|
18
|
+
textTransform: readonly ["none", "capitalize", "lowercase", "uppercase"];
|
|
19
|
+
textAlign: readonly ["left", "right", "center", "justify"];
|
|
20
|
+
opacity: readonly [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
21
|
+
cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
|
|
22
|
+
sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100];
|
|
23
|
+
sizeMultiplier: number;
|
|
24
|
+
baseColors: readonly ["none", "transparent", "black", "white", "primary", "primaryLight", "primaryDark", "secondary", "secondaryLight", "secondaryDark", "tertiary", "tertiaryLight", "tertiaryDark", "blue", "blueLight", "blueDark", "red", "redLight", "redDark", "purple", "purpleLight", "purpleDark", "yellow", "yellowLight", "yellowDark", "pink", "pinkLight", "pinkDark", "green", "greenLight", "greenDark", "orange", "orangeLight", "orangeDark", "navy", "navyLight", "navyDark", "teal", "tealLight", "tealDark", "violet", "violetLight", "violetDark", "gray", "grayLight", "grayDark", "brown", "brownLight", "brownDark", "orange", "orangeLight", "orangeDark"];
|
|
25
|
+
borderSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
26
|
+
fontColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
27
|
+
bgColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
28
|
+
borderColors: readonly [1, 2, 3, 4, 5];
|
|
29
|
+
outlineColors: readonly [1, 2, 3, 4, 5];
|
|
30
|
+
backgrounds: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
31
|
+
shadows: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
32
|
+
fontSizes: readonly [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 58, 64, 70, 78, 86, 96];
|
|
33
|
+
fontWeight: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
34
|
+
zIndexSizes: readonly [1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 100, 101, 102, 103, 104, 105, 1000, 1001, 1002, 1003, 1004, 1005];
|
|
35
|
+
justifyContent: readonly ["start", "end", "flex-start", "flex-end", "center", "left", "right", "space-between", "space-around", "space-evenly", "stretch"];
|
|
36
|
+
alignItems: readonly ["stretch", "flex-start", "flex-end", "center", "baseline", "start", "end", "self-start", "self-end"];
|
|
37
|
+
alignContent: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly", "stretch", "start", "end", "baseline"];
|
|
38
|
+
flexDirection: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
39
|
+
gap: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
40
|
+
order: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
|
|
41
|
+
flexWrap: readonly ["nowrap", "wrap", "wrap-reverse"];
|
|
42
|
+
flexGrow: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
43
|
+
flexShrink: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
44
|
+
flexSelf: readonly ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
45
|
+
outlineOffset: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
46
|
+
};
|
|
47
|
+
declare type GapType = typeof styleVariables.gap[number];
|
|
48
|
+
declare type BoxSizeValue = typeof styleVariables.sizeSpecialValues[number];
|
|
49
|
+
declare type BorderSizeType = typeof styleVariables.borderSizes[number];
|
|
50
|
+
declare type SizeType = typeof styleVariables.sizes[number];
|
|
51
|
+
declare type ColorType = typeof styleVariables.baseColors[number];
|
|
52
|
+
declare type BaseFontColorType = typeof styleVariables.fontColors[number];
|
|
53
|
+
declare type BaseBgColorType = typeof styleVariables.bgColors[number];
|
|
54
|
+
declare type BaseBorderColorType = typeof styleVariables.borderColors[number];
|
|
55
|
+
declare type BaseOutlineColorType = typeof styleVariables.outlineColors[number];
|
|
56
|
+
declare type BackgroundType = typeof styleVariables.backgrounds[number];
|
|
57
|
+
declare type ShadowType = typeof styleVariables.shadows[number];
|
|
58
|
+
declare type CursorType = typeof styleVariables.cursors[number];
|
|
59
|
+
declare type OverflowType = typeof styleVariables.overflows[number];
|
|
60
|
+
declare type FontSizeType = typeof styleVariables.fontSizes[number];
|
|
61
|
+
declare type FontWeightType = typeof styleVariables.fontWeight[number];
|
|
62
|
+
declare type ZIndexSizeType = typeof styleVariables.zIndexSizes[number];
|
|
63
|
+
declare type OpacitySizeType = typeof styleVariables.opacity[number];
|
|
64
|
+
declare type TextDecorationType = typeof styleVariables.textDecoration[number];
|
|
65
|
+
declare type TextTransformType = typeof styleVariables.textTransform[number];
|
|
66
|
+
declare type TextAlignType = typeof styleVariables.textAlign[number];
|
|
67
|
+
declare type BorderAndOutlineStyleType = typeof styleVariables.borderAndOutlineStyles[number];
|
|
68
|
+
interface BoxPseudoClasses {
|
|
69
|
+
hover?: boolean;
|
|
70
|
+
focus?: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface BoxDisplay {
|
|
73
|
+
display?: typeof styleVariables.display[number];
|
|
74
|
+
inline?: boolean;
|
|
75
|
+
}
|
|
76
|
+
interface BoxSizing {
|
|
77
|
+
boxSizing?: typeof styleVariables.boxSizing[number];
|
|
78
|
+
}
|
|
79
|
+
interface BoxPosition {
|
|
80
|
+
position?: typeof styleVariables.position[number];
|
|
81
|
+
inset?: SizeType;
|
|
82
|
+
top?: SizeType;
|
|
83
|
+
right?: SizeType;
|
|
84
|
+
bottom?: SizeType;
|
|
85
|
+
left?: SizeType;
|
|
86
|
+
}
|
|
87
|
+
interface BoxSize {
|
|
88
|
+
width?: BoxSizeValue;
|
|
89
|
+
height?: BoxSizeValue;
|
|
90
|
+
minWidth?: BoxSizeValue;
|
|
91
|
+
minHeight?: BoxSizeValue;
|
|
92
|
+
maxWidth?: BoxSizeValue;
|
|
93
|
+
maxHeight?: BoxSizeValue;
|
|
94
|
+
}
|
|
95
|
+
interface BoxMargin {
|
|
96
|
+
margin?: SizeType | 'auto';
|
|
97
|
+
m?: SizeType | 'auto';
|
|
98
|
+
marginHorizontal?: SizeType | 'auto';
|
|
99
|
+
mx?: SizeType | 'auto';
|
|
100
|
+
marginVertical?: SizeType | 'auto';
|
|
101
|
+
my?: SizeType | 'auto';
|
|
102
|
+
marginTop?: SizeType | 'auto';
|
|
103
|
+
mt?: SizeType | 'auto';
|
|
104
|
+
marginRight?: SizeType | 'auto';
|
|
105
|
+
mr?: SizeType | 'auto';
|
|
106
|
+
marginBottom?: SizeType | 'auto';
|
|
107
|
+
mb?: SizeType | 'auto';
|
|
108
|
+
marginLeft?: SizeType | 'auto';
|
|
109
|
+
ml?: SizeType | 'auto';
|
|
110
|
+
}
|
|
111
|
+
interface BoxPadding {
|
|
112
|
+
padding?: SizeType;
|
|
113
|
+
p?: SizeType;
|
|
114
|
+
paddingHorizontal?: SizeType;
|
|
115
|
+
px?: SizeType;
|
|
116
|
+
paddingVertical?: SizeType;
|
|
117
|
+
py?: SizeType;
|
|
118
|
+
paddingTop?: SizeType;
|
|
119
|
+
pt?: SizeType;
|
|
120
|
+
paddingRight?: SizeType;
|
|
121
|
+
pr?: SizeType;
|
|
122
|
+
paddingBottom?: SizeType;
|
|
123
|
+
pb?: SizeType;
|
|
124
|
+
paddingLeft?: SizeType;
|
|
125
|
+
pl?: SizeType;
|
|
126
|
+
}
|
|
127
|
+
interface BoxOutline {
|
|
128
|
+
outline?: BorderSizeType;
|
|
129
|
+
outlineStyle?: BorderAndOutlineStyleType;
|
|
130
|
+
outlineOffset?: typeof styleVariables.outlineOffset[number];
|
|
131
|
+
}
|
|
132
|
+
interface BoxBorder {
|
|
133
|
+
border?: BorderSizeType;
|
|
134
|
+
b?: BorderSizeType;
|
|
135
|
+
borderHorizontal?: BorderSizeType;
|
|
136
|
+
bx?: BorderSizeType;
|
|
137
|
+
borderVertical?: BorderSizeType;
|
|
138
|
+
by?: BorderSizeType;
|
|
139
|
+
borderTop?: BorderSizeType;
|
|
140
|
+
bt?: BorderSizeType;
|
|
141
|
+
borderRight?: BorderSizeType;
|
|
142
|
+
br?: BorderSizeType;
|
|
143
|
+
borderBottom?: BorderSizeType;
|
|
144
|
+
bb?: BorderSizeType;
|
|
145
|
+
borderLeft?: BorderSizeType;
|
|
146
|
+
bl?: BorderSizeType;
|
|
147
|
+
borderStyle?: BorderAndOutlineStyleType;
|
|
148
|
+
borderRadius?: SizeType;
|
|
149
|
+
borderRadiusTop?: SizeType;
|
|
150
|
+
borderRadiusRight?: SizeType;
|
|
151
|
+
borderRadiusBottom?: SizeType;
|
|
152
|
+
borderRadiusLeft?: SizeType;
|
|
153
|
+
borderRadiusTopLeft?: SizeType;
|
|
154
|
+
borderRadiusTopRight?: SizeType;
|
|
155
|
+
borderRadiusBottomLeft?: SizeType;
|
|
156
|
+
borderRadiusBottomRight?: SizeType;
|
|
157
|
+
}
|
|
158
|
+
interface BoxShadow {
|
|
159
|
+
shadow?: ShadowType;
|
|
160
|
+
}
|
|
161
|
+
interface BoxBackground {
|
|
162
|
+
background?: BackgroundType;
|
|
163
|
+
bg?: BackgroundType;
|
|
164
|
+
}
|
|
165
|
+
interface BoxColors {
|
|
166
|
+
color?: ColorType | BaseFontColorType;
|
|
167
|
+
backgroundColor?: ColorType | BaseBgColorType;
|
|
168
|
+
bgColor?: ColorType | BaseBgColorType;
|
|
169
|
+
borderColor?: ColorType | BaseBorderColorType;
|
|
170
|
+
outlineColor?: ColorType | BaseOutlineColorType;
|
|
171
|
+
}
|
|
172
|
+
interface BoxCursor {
|
|
173
|
+
cursor?: CursorType;
|
|
174
|
+
}
|
|
175
|
+
interface BoxZIndex {
|
|
176
|
+
zIndex?: ZIndexSizeType;
|
|
177
|
+
}
|
|
178
|
+
interface BoxOverflow {
|
|
179
|
+
overflow?: OverflowType;
|
|
180
|
+
overflowX?: OverflowType;
|
|
181
|
+
overflowY?: OverflowType;
|
|
182
|
+
}
|
|
183
|
+
interface BoxOpacity {
|
|
184
|
+
opacity?: OpacitySizeType;
|
|
185
|
+
}
|
|
186
|
+
interface BoxFont {
|
|
187
|
+
fontSize?: FontSizeType;
|
|
188
|
+
lineHeight?: FontSizeType;
|
|
189
|
+
fontWeight?: FontWeightType;
|
|
190
|
+
letterSpacing?: SizeType;
|
|
191
|
+
}
|
|
192
|
+
interface BoxText {
|
|
193
|
+
textDecoration?: TextDecorationType;
|
|
194
|
+
textTransform?: TextTransformType;
|
|
195
|
+
textAlign?: TextAlignType;
|
|
196
|
+
}
|
|
197
|
+
interface BoxFlex {
|
|
198
|
+
flexWrap?: typeof styleVariables.flexWrap[number];
|
|
199
|
+
justifyContent?: typeof styleVariables.justifyContent[number];
|
|
200
|
+
alignItems?: typeof styleVariables.alignItems[number];
|
|
201
|
+
alignContent?: typeof styleVariables.alignContent[number];
|
|
202
|
+
flex1?: boolean;
|
|
203
|
+
flexDirection?: typeof styleVariables.flexDirection[number];
|
|
204
|
+
gap?: GapType;
|
|
205
|
+
rowGap?: GapType;
|
|
206
|
+
columnGap?: GapType;
|
|
207
|
+
order?: typeof styleVariables.order[number];
|
|
208
|
+
flexGrow?: typeof styleVariables.flexGrow[number];
|
|
209
|
+
flexShrink?: typeof styleVariables.flexShrink[number];
|
|
210
|
+
alignSelf?: typeof styleVariables.flexSelf[number];
|
|
211
|
+
justifySelf?: typeof styleVariables.flexSelf[number];
|
|
212
|
+
}
|
|
213
|
+
declare type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline;
|
|
214
|
+
export declare type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
|
|
215
|
+
export {};
|
package/css.variables.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
declare const variables: {
|
|
2
|
-
sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100];
|
|
3
|
-
sizeMultiplier: number;
|
|
4
|
-
colors: readonly ["none", "transparent", "black", "white", "primary", "primaryLight", "primaryDark", "secondary", "secondaryLight", "secondaryDark", "tertiary", "tertiaryLight", "tertiaryDark", "blue", "blueLight", "blueDark", "red", "redLight", "redDark", "purple", "purpleLight", "purpleDark", "yellow", "yellowLight", "yellowDark", "pink", "pinkLight", "pinkDark", "green", "greenLight", "greenDark", "orange", "orangeLight", "orangeDark", "navy", "navyLight", "navyDark", "teal", "tealLight", "tealDark", "violet", "violetLight", "violetDark", "gray", "grayLight", "grayDark", "brown", "brownLight", "brownDark", "orange", "orangeLight", "orangeDark"];
|
|
5
|
-
fontColors: readonly ["color1", "color2", "color3", "color4", "color5", "color6", "color7", "color8", "color9", "color10"];
|
|
6
|
-
bgColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
7
|
-
borderColors: readonly [1, 2, 3, 4, 5];
|
|
8
|
-
outlineColors: readonly [1, 2, 3, 4, 5];
|
|
9
|
-
backgrounds: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
10
|
-
shadows: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
11
|
-
cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
|
|
12
|
-
fontSizes: readonly [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 58, 64, 70, 78, 86, 96];
|
|
13
|
-
borderAndOutlineStyles: readonly ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"];
|
|
14
|
-
};
|
|
15
|
-
export declare type SizeType = typeof variables.sizes[number];
|
|
16
|
-
export declare type ColorType = typeof variables.colors[number];
|
|
17
|
-
export declare type BaseFontColorType = typeof variables.fontColors[number];
|
|
18
|
-
export declare type BaseBgColorType = typeof variables.bgColors[number];
|
|
19
|
-
export declare type BaseBorderColorType = typeof variables.borderColors[number];
|
|
20
|
-
export declare type BaseOutlineColorType = typeof variables.outlineColors[number];
|
|
21
|
-
export declare type BackgroundType = typeof variables.backgrounds[number];
|
|
22
|
-
export declare type ShadowType = typeof variables.shadows[number];
|
|
23
|
-
export declare type CursorType = typeof variables.cursors[number];
|
|
24
|
-
export declare type FontSizeType = typeof variables.fontSizes[number];
|
|
25
|
-
export declare type BorderAndOutlineStyleType = typeof variables.borderAndOutlineStyles[number];
|
|
26
|
-
export default variables;
|