@ambuj.bhaskar/react-component-library 0.8.4 → 0.9.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/assets/index.css +1 -1
- package/dist/index.cjs +82 -82
- package/dist/index.d.ts +48 -9
- package/dist/index.js +9701 -9277
- package/dist/index.umd.js +69 -69
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -153,18 +153,22 @@ declare type IconProps = SVGprops & {
|
|
|
153
153
|
declare const IconRegistry: Record<string, any>;
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
* Input component
|
|
156
|
+
* Input component.
|
|
157
157
|
*
|
|
158
|
-
* @prop {string} [className] - Additional class names for styling.
|
|
159
|
-
* @prop {string | number} [value] - The value of the input.
|
|
160
|
-
* @prop {"s" | "m" | "l"} [height] -
|
|
161
|
-
* @prop {CSSstring} [width] -
|
|
162
|
-
* @prop {"flex-start"
|
|
158
|
+
* @prop {string} [className=""] - Additional class names for styling.
|
|
159
|
+
* @prop {string | number | undefined} [value] - The current value of the input.
|
|
160
|
+
* @prop {"s" | "m" | "l"} [height="m"] - Height of the input field.
|
|
161
|
+
* @prop {CSSstring} [width="24rem"] - Width of the component.
|
|
162
|
+
* @prop {JustifyContent} [placement="flex-start"] - Placement of the content inside the input.
|
|
163
163
|
* @prop {IconName} [icon] - The icon to display inside the input.
|
|
164
|
-
* @prop {
|
|
165
|
-
* @prop {
|
|
164
|
+
* @prop {string} [backgroundColor="#2929291a"] - Background color of the input.
|
|
165
|
+
* @prop {string} [textColor="#292929"] - Color of the text inside the input.
|
|
166
|
+
* @prop {string} [borderColor="#292929"] - Border color of the input.
|
|
167
|
+
* @prop {"before" | "after"} [iconPosition="after"] - Position of the icon relative to the text.
|
|
168
|
+
* @prop {string} [iconColor="#292929"] - Color of the icon inside the input.
|
|
166
169
|
* @prop {boolean} [disabled=false] - If true, the input is disabled.
|
|
167
|
-
* @prop {(
|
|
170
|
+
* @prop {(val: string) => void} [onChange=() => {}] - Callback when the input value changes.
|
|
171
|
+
* @prop {React.ComponentProps<HTMLInputElement>} ...props - Additional props to pass to the input element.
|
|
168
172
|
*/
|
|
169
173
|
export declare const Input: React.FC<InputProps>;
|
|
170
174
|
|
|
@@ -178,6 +182,9 @@ declare type InputProps = HTMLInputProps & {
|
|
|
178
182
|
iconPosition?: "before" | "after";
|
|
179
183
|
iconColor?: Color;
|
|
180
184
|
disabled?: boolean;
|
|
185
|
+
backgroundColor?: Color;
|
|
186
|
+
textColor?: Color;
|
|
187
|
+
borderColor?: Color;
|
|
181
188
|
};
|
|
182
189
|
|
|
183
190
|
declare type JustifyContent = "center" | "start" | "end" | "flex-start" | "flex-end" | "left" | "right" | "baseline" | "first baseline" | "last baseline" | "space-between" | "space-around" | "space-evenly" | "stretch";
|
|
@@ -288,6 +295,38 @@ declare type SpinnerProps = {
|
|
|
288
295
|
|
|
289
296
|
declare type SVGprops = React.ComponentProps<"svg">;
|
|
290
297
|
|
|
298
|
+
/**
|
|
299
|
+
* A simple switch component.
|
|
300
|
+
*
|
|
301
|
+
* @remarks
|
|
302
|
+
* This component is a simple on/off switch.
|
|
303
|
+
*
|
|
304
|
+
* @param {SwitchProps} props - The props for the switch component.
|
|
305
|
+
* @param {boolean} [props.value=false] - Whether the switch is checked or not.
|
|
306
|
+
* @param {boolean} [props.disabled=false] - Whether the switch is disabled or not.
|
|
307
|
+
* @param {ReactNode} [props.checkedChildren] - The content of the switch when checked.
|
|
308
|
+
* @param {ReactNode} [props.unCheckedChildren] - The content of the switch when unchecked.
|
|
309
|
+
* @param {boolean} [props.loading] - Whether the switch is in loading state.
|
|
310
|
+
* @param {string} [props.uncheckedBackgroundColor] - Background color when unchecked.
|
|
311
|
+
* @param {string} [props.checkedBackgroundColor] - Background color when checked.
|
|
312
|
+
* @param {string} [props.disabledBackgroundColor] - Background color when disabled.
|
|
313
|
+
*
|
|
314
|
+
* @returns {React.ReactElement} - The switch component.
|
|
315
|
+
*/
|
|
316
|
+
export declare const Switch: React.FC<SwitchProps>;
|
|
317
|
+
|
|
318
|
+
declare type SwitchProps = {
|
|
319
|
+
value?: boolean;
|
|
320
|
+
disabled?: boolean;
|
|
321
|
+
checkedChildren?: ReactNode;
|
|
322
|
+
unCheckedChildren?: ReactNode;
|
|
323
|
+
onChange?: (checked: boolean) => void;
|
|
324
|
+
loading?: boolean;
|
|
325
|
+
uncheckedBackgroundColor?: Color;
|
|
326
|
+
checkedBackgroundColor?: Color;
|
|
327
|
+
disabledBackgroundColor?: Color;
|
|
328
|
+
};
|
|
329
|
+
|
|
291
330
|
declare type TextSize = "xs" | "s" | "m" | "l" | "xl";
|
|
292
331
|
|
|
293
332
|
declare type Theme = Partial<{
|