mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
bcfac603f0
* added storybook * added avatar component * added button story * added dropdown button story * removed unused ellipsis component * cleaned up modal path * reorganized enroll secrets table file * added flash story; removed unused persistent flash * added fleet ace story * added checkbox story * added dropdown story * added input story * fixed storybook build * fixed avatar * added input with icon story * added radio button story * added select targets dropdown story * added slider story * added tooltip story * added info banner story * removed unused loaders; added spinner story * added modal story * removed unused NumberPill * added pagination story * lint fixes * added documentation to run * modified documentation * fixed corelayout test * fixed format for date-fns * fixed date format that breaks tests * wait for page
47 lines
1018 B
TypeScript
47 lines
1018 B
TypeScript
import React from "react";
|
|
import { Meta, Story } from "@storybook/react";
|
|
import { noop } from "lodash";
|
|
|
|
// @ts-ignore
|
|
import InputField from ".";
|
|
|
|
import "../../../../index.scss";
|
|
|
|
interface IInputFieldProps {
|
|
autofocus?: boolean;
|
|
disabled?: boolean;
|
|
error?: string;
|
|
inputClassName?: string;
|
|
inputWrapperClass?: string;
|
|
inputOptions?: Record<string, unknown>; // other html input props
|
|
name?: string;
|
|
placeholder: string;
|
|
type?: string;
|
|
value: string;
|
|
onFocus?: () => void;
|
|
onChange?: (value: string) => void;
|
|
}
|
|
|
|
export default {
|
|
component: InputField,
|
|
title: "Components/FormFields/Input",
|
|
args: {
|
|
autofocus: false,
|
|
disabled: false,
|
|
error: "",
|
|
inputClassName: "",
|
|
inputWrapperClass: "",
|
|
inputOptions: "",
|
|
name: "",
|
|
placeholder: "Type here...",
|
|
type: "",
|
|
value: "",
|
|
onFocus: noop,
|
|
onChange: noop,
|
|
},
|
|
} as Meta;
|
|
|
|
const Template: Story<IInputFieldProps> = (props) => <InputField {...props} />;
|
|
|
|
export const Default = Template.bind({});
|