digital-rabbit-cl 1.3.1 → 1.3.3
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/dist/types/component-props.d.ts +215 -0
- package/dist/types/component-props.d.ts.map +1 -0
- package/dist/types/css-modules.d.ts +7 -0
- package/dist/types/css-modules.d.ts.map +1 -0
- package/dist/types/jest-dom.d.ts +1 -0
- package/dist/types/jest-dom.d.ts.map +1 -0
- package/dist/types/react-native.d.ts +41 -0
- package/dist/types/react-native.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ThemeColors, ThemeFonts, ThemeBorder, ThemeBreakpoints, ThemeLayout } from '../theme';
|
|
3
|
+
/**
|
|
4
|
+
* Typography props derived from theme.fonts
|
|
5
|
+
* All properties are optional to allow selective overrides
|
|
6
|
+
*/
|
|
7
|
+
export type TypographyProps = Partial<ThemeFonts>;
|
|
8
|
+
/**
|
|
9
|
+
* Color props derived from theme.colors
|
|
10
|
+
* Includes common aliases for better DX
|
|
11
|
+
*/
|
|
12
|
+
export interface ColorProps extends Partial<ThemeColors> {
|
|
13
|
+
/**
|
|
14
|
+
* Text/foreground color - alias for easier usage
|
|
15
|
+
* Falls back to theme.fonts.color or theme.colors.primary
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Background color
|
|
20
|
+
*/
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Border props derived from theme.border
|
|
25
|
+
* All properties are optional to allow selective overrides
|
|
26
|
+
*/
|
|
27
|
+
export interface BorderProps extends Partial<ThemeBorder> {
|
|
28
|
+
/**
|
|
29
|
+
* Border color - typically uses theme.colors.primary
|
|
30
|
+
* @example '#ccc', 'currentColor', 'transparent'
|
|
31
|
+
*/
|
|
32
|
+
borderColor?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Breakpoint props derived from theme.breakpoints
|
|
36
|
+
* All properties are optional to allow selective overrides
|
|
37
|
+
*/
|
|
38
|
+
export type BreakpointProps = Partial<ThemeBreakpoints>;
|
|
39
|
+
/**
|
|
40
|
+
* Layout and spacing props derived from theme.layout
|
|
41
|
+
* Includes both layout properties and spacing properties
|
|
42
|
+
* All properties are optional to allow selective overrides
|
|
43
|
+
*/
|
|
44
|
+
export interface LayoutProps extends Partial<ThemeLayout> {
|
|
45
|
+
/**
|
|
46
|
+
* Layout direction for flex/grid containers
|
|
47
|
+
* @example 'row', 'column'
|
|
48
|
+
*/
|
|
49
|
+
direction?: 'row' | 'column';
|
|
50
|
+
/**
|
|
51
|
+
* Minimum width
|
|
52
|
+
* @example '320px', '100%'
|
|
53
|
+
*/
|
|
54
|
+
minWidth?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Width
|
|
57
|
+
* @example '100%', '50vw', 'auto'
|
|
58
|
+
*/
|
|
59
|
+
width?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Height
|
|
62
|
+
* @example '100%', '50vh', 'auto'
|
|
63
|
+
*/
|
|
64
|
+
height?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Margin (all sides or individual)
|
|
67
|
+
* @example '1rem', '10px 20px', '1rem auto'
|
|
68
|
+
*/
|
|
69
|
+
margin?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Gap between flex/grid children
|
|
72
|
+
* @example '1rem', '10px', '0.5rem'
|
|
73
|
+
*/
|
|
74
|
+
gap?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* State props for interactive components
|
|
78
|
+
* These manage component state and are not part of theme
|
|
79
|
+
*/
|
|
80
|
+
export interface StateProps {
|
|
81
|
+
/**
|
|
82
|
+
* Disabled state
|
|
83
|
+
*/
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Error state
|
|
87
|
+
*/
|
|
88
|
+
error?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Loading state
|
|
91
|
+
*/
|
|
92
|
+
loading?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Active/selected state
|
|
95
|
+
*/
|
|
96
|
+
active?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Read-only state
|
|
99
|
+
*/
|
|
100
|
+
readonly?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Hover state props for interactive elements
|
|
104
|
+
* These define hover behavior
|
|
105
|
+
*/
|
|
106
|
+
export interface HoverProps {
|
|
107
|
+
/**
|
|
108
|
+
* Color on hover
|
|
109
|
+
*/
|
|
110
|
+
hoverTextColor?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Background color on hover
|
|
113
|
+
*/
|
|
114
|
+
hoverBackgroundColor?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Border color on hover
|
|
117
|
+
*/
|
|
118
|
+
hoverBorderColor?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Opacity on hover
|
|
121
|
+
* @example 0.8, 1
|
|
122
|
+
*/
|
|
123
|
+
hoverOpacity?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Base props that should be available on all components
|
|
127
|
+
*/
|
|
128
|
+
export interface BaseComponentProps {
|
|
129
|
+
/**
|
|
130
|
+
* Custom CSS class name
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Inline styles (use sparingly, prefer className)
|
|
135
|
+
*/
|
|
136
|
+
style?: React.CSSProperties;
|
|
137
|
+
/**
|
|
138
|
+
* Child elements
|
|
139
|
+
*/
|
|
140
|
+
children?: React.ReactNode;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Common props for form elements (Input, Textarea, Select)
|
|
144
|
+
* Contains HTML attributes shared across form elements
|
|
145
|
+
*/
|
|
146
|
+
export interface FormElementProps {
|
|
147
|
+
/**
|
|
148
|
+
* Element id attribute - used for label associations
|
|
149
|
+
*/
|
|
150
|
+
id?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Element name attribute - used for form submissions
|
|
153
|
+
*/
|
|
154
|
+
name?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Whether the field is required for form submission
|
|
157
|
+
*/
|
|
158
|
+
required?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Common props for text-based form inputs (Input, Textarea, Select)
|
|
162
|
+
* Contains value and placeholder-related props
|
|
163
|
+
*/
|
|
164
|
+
export interface TextInputProps {
|
|
165
|
+
/**
|
|
166
|
+
* Placeholder text displayed when empty
|
|
167
|
+
*/
|
|
168
|
+
placeholder?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Placeholder opacity - defaults to 0.3
|
|
171
|
+
* For Select, this affects the placeholder option opacity
|
|
172
|
+
*/
|
|
173
|
+
placeholderOpacity?: number;
|
|
174
|
+
/**
|
|
175
|
+
* Current value of the form element
|
|
176
|
+
*/
|
|
177
|
+
value?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Composite interface for layout components (Footer, Hero, ResponsiveSection)
|
|
181
|
+
* Combines color, layout, and breakpoint props
|
|
182
|
+
*/
|
|
183
|
+
export interface LayoutComponentStyleProps extends ColorProps, LayoutProps, BreakpointProps {
|
|
184
|
+
/**
|
|
185
|
+
* Vertical rhythm multiplier - uses theme.fonts.rhythm as base
|
|
186
|
+
*/
|
|
187
|
+
verticalRhythm?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Font size for layout text
|
|
190
|
+
*/
|
|
191
|
+
fontSize?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Utility type for extracting HTML attributes for specific elements
|
|
195
|
+
* Use this pattern instead of spreading props on root elements
|
|
196
|
+
*
|
|
197
|
+
* Note: For data-* attributes in tests, use type assertions:
|
|
198
|
+
* { 'data-testid': 'value' } as ElementSpecificProps<T>
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* interface MyComponentProps {
|
|
202
|
+
* divProps?: ElementSpecificProps<HTMLDivElement>;
|
|
203
|
+
* buttonProps?: ElementSpecificProps<HTMLButtonElement>;
|
|
204
|
+
* }
|
|
205
|
+
*/
|
|
206
|
+
export type ElementSpecificProps<T extends HTMLElement> = React.HTMLAttributes<T>;
|
|
207
|
+
/**
|
|
208
|
+
* Standard size variants used across components
|
|
209
|
+
*/
|
|
210
|
+
export type SizeVariant = 'small' | 'default' | 'large';
|
|
211
|
+
/**
|
|
212
|
+
* Standard color variants that map to theme colors
|
|
213
|
+
*/
|
|
214
|
+
export type ColorVariant = 'primary' | 'secondary' | 'accent' | 'error' | 'success' | 'warning';
|
|
215
|
+
//# sourceMappingURL=component-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpG;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,WAAW,CAAC;IACtD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,WAAW,CAAC;IACvD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,WAAW,CAAC;IACvD;;;OAG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AO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,UAAU,EAAE,WAAW,EAAE,eAAe;IACzF;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-modules.d.ts","sourceRoot":"","sources":["../../src/types/css-modules.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,cAAc,CAAC;IAC5B,MAAM,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACzC,eAAe,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=jest-dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest-dom.d.ts","sourceRoot":"","sources":["../../src/types/jest-dom.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare module 'react-native' {
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
interface ViewStyle {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
type TextStyle = ViewStyle;
|
|
7
|
+
interface ViewProps {
|
|
8
|
+
style?: ViewStyle | ViewStyle[];
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface TextProps {
|
|
12
|
+
style?: TextStyle | TextStyle[];
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
interface PressableProps extends ViewProps {
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
onPressIn?: () => void;
|
|
18
|
+
onPressOut?: () => void;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface TextInputProps {
|
|
22
|
+
style?: TextStyle | TextStyle[];
|
|
23
|
+
value?: string;
|
|
24
|
+
onChangeText?: (text: string) => void;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
placeholderTextColor?: string;
|
|
27
|
+
secureTextEntry?: boolean;
|
|
28
|
+
editable?: boolean;
|
|
29
|
+
multiline?: boolean;
|
|
30
|
+
numberOfLines?: number;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}
|
|
33
|
+
const View: ComponentType<ViewProps>;
|
|
34
|
+
const Text: ComponentType<TextProps>;
|
|
35
|
+
const Pressable: ComponentType<PressableProps>;
|
|
36
|
+
const TextInput: ComponentType<TextInputProps>;
|
|
37
|
+
const StyleSheet: {
|
|
38
|
+
create<T>(styles: T): T;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../src/types/react-native.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,cAAc,CAAC;IAC5B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;IAEjD,UAAiB,SAAS;QACxB,CAAC,G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