@ambuj.bhaskar/react-component-library 0.6.0 → 0.6.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/dist/index.d.ts CHANGED
@@ -5,36 +5,32 @@ import * as React_2 from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
7
7
  /**
8
- * Button component props.
9
- /**
10
- * @typedef {Object} ButtonProps
11
- * @property {string} [variant="primary"] - Variant of the button, affects styling.
12
- * @property {string} [background="rgb(255, 204, 0)"] - Background color of the button.
13
- * @property {string} [border="#292929"] - Border color of the button.
14
- * @property {string} [container="hugging"] - Container type for button sizing.
15
- * @property {string} [width="13.5rem"] - Width of the button.
16
- * @property {string} [height="m"] - Height of the button.
17
- * @property {string} [padding="m"] - Padding inside the button.
18
- * @property {string} [gap="0.25rem"] - Gap between elements inside the button.
19
- * @property {string} [placement="center"] - Placement of the content inside the button.
20
- * @property {boolean} [disabled=false] - If true, the button is disabled.
21
- * @property {boolean} [loading=false] - If true, the button shows a loading state.
22
- * @property {string} [text=null] - Text to display inside the button.
23
- * @property {string} [textSize="s"] - Size of the text inside the button.
24
- * @property {string} [textColor="#292929"] - Color of the text inside the button.
25
- * @property {Object.<string, string>} [textColorStates=null] - Color states for the text.
26
- * @property {IconName} [icon=null] - Icon to display inside the button.
27
- * @property {string} [iconSize="s"] - Size of the icon inside the button.
28
- * @property {string} [iconColor="#292929"] - Color of the icon inside the button.
29
- * @property {string} [iconPosition="before"] - Position of the icon relative to the text.
30
- * @property {Object.<string, string>} [iconColorStates=null] - Color states for the icon.
31
- * @property {string} [className=null] - Additional class names for styling.
32
- * @property {...React.ComponentPropsWithoutRef<'button'>} [props=null] - Other button props
8
+ * The Button component.
9
+ *
10
+ * @param {ButtonProps} props - The props object.
11
+ * @prop {string} [variant=primary] - The variant of the button.
12
+ * @prop {string} [background=rgb(255, 204, 0)] - The background color of the button.
13
+ * @prop {string} [border=#292929] - The border color of the button.
14
+ * @prop {string} [container=hugging] - The container type of the button.
15
+ * @prop {string} [width=13.5rem] - The width of the button.
16
+ * @prop {string} [size=m] - The size of the button.
17
+ * @prop {string} [gap=0.25rem] - The gap between elements inside the button.
18
+ * @prop {string} [placement=center] - The placement of the content inside the button.
19
+ * @prop {boolean} [disabled=false] - If true, the button is disabled.
20
+ * @prop {boolean} [loading=false] - If true, the button shows a loading state.
21
+ * @prop {string} [text=null] - The text to display inside the button.
22
+ * @prop {string} [textSize] - The size of the text inside the button.
23
+ * @prop {string} [textColor=#292929] - The color of the text inside the button.
24
+ * @prop {object} [textColorStates=null] - Overrides the behaviour of color on default, hover, active states, which is intially set by the variant.
25
+ * @prop {IconName} [icon=null] - The icon to display inside the button.
26
+ * @prop {string} [iconSize] - The size of the icon inside the button.
27
+ * @prop {string} [iconColor=#292929] - The color of the icon inside the button.
28
+ * @prop {string} [iconPosition=before] - The position of the icon relative to the text.
29
+ * @prop {object} [iconColorStates=null] - Overrides the behaviour of color on default, hover, active states, which is intially set by the variant.
30
+ * @prop {string} [className=null] - Additional class names for styling.
33
31
  */
34
32
  export declare const Button: React.FC<ButtonProps>;
35
33
 
36
- declare type ButtonHeight = "s" | "m" | "l";
37
-
38
34
  declare type ButtonProps = HTMLButtonProps & {
39
35
  variant?: "primary" | "secondary" | "tertiary" | "nav";
40
36
  background?: Color;
@@ -42,9 +38,8 @@ declare type ButtonProps = HTMLButtonProps & {
42
38
  border?: Color;
43
39
  borderStates?: ColorStatesType;
44
40
  container?: "fixed" | "hugging";
45
- padding?: Padding;
41
+ size?: Size;
46
42
  width?: CSSstring;
47
- height?: ButtonHeight;
48
43
  gap?: CSSstring;
49
44
  placement?: JustifyContent;
50
45
  loading?: boolean;
@@ -54,7 +49,7 @@ declare type ButtonProps = HTMLButtonProps & {
54
49
  textColor?: Color;
55
50
  textColorStates?: ColorStatesType;
56
51
  icon?: IconName;
57
- iconSize?: "s" | "m" | "l";
52
+ iconSize?: IconProps["size"];
58
53
  iconColor?: Color;
59
54
  iconPosition?: IconPositionType;
60
55
  iconColorStates?: ColorStatesType;
@@ -202,8 +197,6 @@ declare type Option_2 = {
202
197
  value: string;
203
198
  };
204
199
 
205
- declare type Padding = "s" | "m" | "l";
206
-
207
200
  /**
208
201
  * A single select component.
209
202
  *
@@ -235,6 +228,8 @@ declare type SelectProps = {
235
228
  suffixIcon?: ReactNode | boolean;
236
229
  };
237
230
 
231
+ declare type Size = "s" | "m" | "l";
232
+
238
233
  /**
239
234
  * Spinner component props.
240
235
  *
@@ -253,4 +248,15 @@ declare type SVGprops = React.ComponentProps<"svg">;
253
248
 
254
249
  declare type TextSize = "xs" | "s" | "m" | "l" | "xl";
255
250
 
251
+ declare type Theme = {
252
+ [key: string]: string | Theme;
253
+ };
254
+
255
+ export declare const ThemeProvider: ({ theme, children }: ThemeProviderProps) => JSX_2.Element;
256
+
257
+ declare interface ThemeProviderProps {
258
+ theme: Theme;
259
+ children: ReactNode;
260
+ }
261
+
256
262
  export { }