@cronocode/react-box 0.3.9 → 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 CHANGED
@@ -1,173 +1,8 @@
1
1
  import React from 'react';
2
- import { SizeType, ColorType, CursorType, FontSizeType, BaseFontColorType, BaseBgColorType, BaseBorderColorType, BackgroundType, ShadowType, BaseOutlineColorType } from './css.variables';
3
- import { Hovered } from './types';
2
+ import { BoxStyles } from './types';
4
3
  import ClassNameUtils from './utils/className/classNameUtils';
5
- interface BoxDisplay {
6
- display?: 'none' | 'block' | 'inline-block' | 'flex' | 'inline-flex' | 'grid';
7
- inline?: boolean;
8
- }
9
- interface BoxSizing {
10
- boxSizing?: 'border-box' | 'content-box';
11
- }
12
- interface BoxPosition {
13
- position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
14
- inset?: SizeType;
15
- top?: SizeType;
16
- right?: SizeType;
17
- bottom?: SizeType;
18
- left?: SizeType;
19
- }
20
- declare type BoxSizeValue = 'fit' | 'fit-screen' | 'auto' | 'fit-content' | 'max-content' | 'min-content';
21
- interface BoxSize {
22
- width?: BoxSizeValue;
23
- height?: BoxSizeValue;
24
- minWidth?: BoxSizeValue;
25
- minHeight?: BoxSizeValue;
26
- maxWidth?: BoxSizeValue;
27
- maxHeight?: BoxSizeValue;
28
- }
29
- interface BoxMargin {
30
- margin?: SizeType | 'auto';
31
- m?: SizeType | 'auto';
32
- marginHorizontal?: SizeType | 'auto';
33
- mx?: SizeType | 'auto';
34
- marginVertical?: SizeType | 'auto';
35
- my?: SizeType | 'auto';
36
- marginTop?: SizeType | 'auto';
37
- mt?: SizeType | 'auto';
38
- marginRight?: SizeType | 'auto';
39
- mr?: SizeType | 'auto';
40
- marginBottom?: SizeType | 'auto';
41
- mb?: SizeType | 'auto';
42
- marginLeft?: SizeType | 'auto';
43
- ml?: SizeType | 'auto';
44
- }
45
- declare type BoxBorderAndOutlineStyleType = 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'none' | 'hidden';
46
- interface BoxOutline {
47
- outline?: SizeType;
48
- outlineStyle?: BoxBorderAndOutlineStyleType;
49
- outlineOffset?: SizeType;
50
- }
51
- interface BoxBorder {
52
- border?: SizeType;
53
- b?: SizeType;
54
- borderHorizontal?: SizeType;
55
- bx?: SizeType;
56
- borderVertical?: SizeType;
57
- by?: SizeType;
58
- borderTop?: SizeType;
59
- bt?: SizeType;
60
- borderRight?: SizeType;
61
- br?: SizeType;
62
- borderBottom?: SizeType;
63
- bb?: SizeType;
64
- borderLeft?: SizeType;
65
- bl?: SizeType;
66
- borderStyle?: BoxBorderAndOutlineStyleType;
67
- bStyle?: BoxBorderAndOutlineStyleType;
68
- borderRadius?: SizeType;
69
- bRadius?: SizeType;
70
- borderRadiusTop?: SizeType;
71
- bRadiusTop?: SizeType;
72
- borderRadiusRight?: SizeType;
73
- bRadiusRight?: SizeType;
74
- borderRadiusBottom?: SizeType;
75
- bRadiusBottom?: SizeType;
76
- borderRadiusLeft?: SizeType;
77
- bRadiusLeft?: SizeType;
78
- borderRadiusTopLeft?: SizeType;
79
- bRadiusTopLeft?: SizeType;
80
- borderRadiusTopRight?: SizeType;
81
- bRadiusTopRight?: SizeType;
82
- borderRadiusBottomLeft?: SizeType;
83
- bRadiusBottomLeft?: SizeType;
84
- borderRadiusBottomRight?: SizeType;
85
- bRadiusBottomRight?: SizeType;
86
- }
87
- interface BoxPadding {
88
- padding?: SizeType;
89
- p?: SizeType;
90
- paddingHorizontal?: SizeType;
91
- px?: SizeType;
92
- paddingVertical?: SizeType;
93
- py?: SizeType;
94
- paddingTop?: SizeType;
95
- pt?: SizeType;
96
- paddingRight?: SizeType;
97
- pr?: SizeType;
98
- paddingBottom?: SizeType;
99
- pb?: SizeType;
100
- paddingLeft?: SizeType;
101
- pl?: SizeType;
102
- }
103
- interface BoxShadow {
104
- shadow?: ShadowType;
105
- }
106
- interface BoxBackground {
107
- bg?: BackgroundType;
108
- background?: BackgroundType;
109
- }
110
- interface BoxColors {
111
- color?: ColorType | BaseFontColorType;
112
- colorHover?: ColorType | BaseFontColorType;
113
- backgroundColor?: ColorType | BaseBgColorType;
114
- bgColor?: ColorType | BaseBgColorType;
115
- backgroundColorHover?: ColorType | BaseBgColorType;
116
- bgColorHover?: ColorType | BaseBgColorType;
117
- borderColor?: ColorType | BaseBorderColorType;
118
- bColor?: ColorType | BaseBorderColorType;
119
- borderColorHover?: ColorType | BaseBorderColorType;
120
- bColorHover?: ColorType | BaseBorderColorType;
121
- outlineColor?: ColorType | BaseOutlineColorType;
122
- outlineColorHover?: ColorType | BaseOutlineColorType;
123
- }
124
- interface BoxCursor {
125
- cursor?: CursorType;
126
- }
127
- interface BoxZIndex {
128
- zIndex?: SizeType;
129
- }
130
- interface BoxOverflow {
131
- overflow?: 'auto' | 'hidden' | 'scroll' | 'visible';
132
- overflowX?: 'auto' | 'hidden' | 'scroll' | 'visible';
133
- overflowY?: 'auto' | 'hidden' | 'scroll' | 'visible';
134
- }
135
- interface BoxOpacity {
136
- opacity?: 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
137
- }
138
- interface BoxFont {
139
- fontSize?: FontSizeType;
140
- lineHeight?: FontSizeType;
141
- fontWeight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
142
- letterSpacing?: SizeType;
143
- }
144
- interface BoxText {
145
- textDecoration?: 'none' | 'underline';
146
- textTransform?: 'none' | 'capitalize' | 'lowercase' | 'uppercase';
147
- textAlign?: 'left' | 'right' | 'center';
148
- }
149
- interface BoxFlex {
150
- flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
151
- justifyContent?: 'start' | 'end' | 'flex-start' | 'flex-end' | 'center' | 'left' | 'right' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
152
- alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'start' | 'end' | 'self-start' | 'self-end';
153
- alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end' | 'baseline';
154
- flex1?: boolean;
155
- direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
156
- gap?: SizeType;
157
- rowGap?: SizeType;
158
- columnGap?: SizeType;
159
- order?: SizeType;
160
- flexGrow?: SizeType;
161
- flexShrink?: SizeType;
162
- alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
163
- justifySelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
164
- }
165
- interface BoxHover {
166
- hover?: boolean;
167
- }
168
- declare type BoxStyles = BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxOutline & BoxBorder & BoxPadding & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxHover;
169
4
  declare type TagPropsType<TTag extends keyof React.ReactHTML> = Omit<React.ComponentProps<TTag>, 'className' | 'style'>;
170
- interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles, Hovered<BoxStyles> {
5
+ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles {
171
6
  children?: React.ReactNode | ((props: {
172
7
  isHover: boolean;
173
8
  }) => React.ReactNode);
@@ -179,7 +14,6 @@ interface Props<TTag extends keyof React.ReactHTML> extends BoxStyles, Hovered<B
179
14
  export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: Props<TTag>): React.DetailedReactHTMLElement<{
180
15
  style: React.ComponentProps<TTag>["style"] | undefined;
181
16
  className: string;
182
- hidden?: React.ComponentProps<TTag>["hidden"] | undefined;
183
17
  slot?: React.ComponentProps<TTag>["slot"] | undefined;
184
18
  title?: React.ComponentProps<TTag>["title"] | undefined;
185
19
  color?: React.ComponentProps<TTag>["color"] | undefined;
@@ -195,6 +29,7 @@ export default function Box<TTag extends keyof React.ReactHTML = 'div'>(props: P
195
29
  contextMenu?: React.ComponentProps<TTag>["contextMenu"] | undefined;
196
30
  dir?: React.ComponentProps<TTag>["dir"] | undefined;
197
31
  draggable?: React.ComponentProps<TTag>["draggable"] | undefined;
32
+ hidden?: React.ComponentProps<TTag>["hidden"] | undefined;
198
33
  id?: React.ComponentProps<TTag>["id"] | undefined;
199
34
  lang?: React.ComponentProps<TTag>["lang"] | undefined;
200
35
  placeholder?: React.ComponentProps<TTag>["placeholder"] | undefined;