@launchpad-ui/form 0.1.0
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/README.md +14 -0
- package/dist/Checkbox.d.ts +36 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/CompactTextField.d.ts +22 -0
- package/dist/CompactTextField.d.ts.map +1 -0
- package/dist/FieldError.d.ts +12 -0
- package/dist/FieldError.d.ts.map +1 -0
- package/dist/FieldSet.d.ts +10 -0
- package/dist/FieldSet.d.ts.map +1 -0
- package/dist/Form.d.ts +19 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/FormField.d.ts +19 -0
- package/dist/FormField.d.ts.map +1 -0
- package/dist/FormGroup.d.ts +15 -0
- package/dist/FormGroup.d.ts.map +1 -0
- package/dist/FormHint.d.ts +11 -0
- package/dist/FormHint.d.ts.map +1 -0
- package/dist/IconField.d.ts +11 -0
- package/dist/IconField.d.ts.map +1 -0
- package/dist/InputGroup.d.ts +6 -0
- package/dist/InputGroup.d.ts.map +1 -0
- package/dist/Label.d.ts +14 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Radio.d.ts +56 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/RadioGroup.d.ts +41 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RequiredAsterisk.d.ts +8 -0
- package/dist/RequiredAsterisk.d.ts.map +1 -0
- package/dist/Select.d.ts +17 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/TextArea.d.ts +12 -0
- package/dist/TextArea.d.ts.map +1 -0
- package/dist/TextField.d.ts +21 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +511 -0
- package/dist/index.es.js.map +7 -0
- package/dist/index.js +556 -0
- package/dist/index.js.map +7 -0
- package/dist/styles/CompactTextField.css +2 -0
- package/dist/styles/CompactTextField.css.map +1 -0
- package/dist/styles/FieldSet.css +2 -0
- package/dist/styles/FieldSet.css.map +1 -0
- package/dist/styles/Form.css +2 -0
- package/dist/styles/Form.css.map +1 -0
- package/dist/styles/FormField.css +2 -0
- package/dist/styles/FormField.css.map +1 -0
- package/dist/styles/FormHint.css +2 -0
- package/dist/styles/FormHint.css.map +1 -0
- package/dist/styles/FormInput.css +2 -0
- package/dist/styles/FormInput.css.map +1 -0
- package/dist/styles/IconField.css +2 -0
- package/dist/styles/IconField.css.map +1 -0
- package/dist/styles/InputGroup.css +2 -0
- package/dist/styles/InputGroup.css.map +1 -0
- package/dist/styles/RequiredAsterisk.css +2 -0
- package/dist/styles/RequiredAsterisk.css.map +1 -0
- package/dist/styles/styles.css +2 -0
- package/dist/styles/styles.css.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# @launchpad-ui/form
|
2
|
+
|
3
|
+
> Elements for composing forms, such as input fields, labels, radio buttons, etc.
|
4
|
+
|
5
|
+
[](https://www.npmjs.com/package/@launchpad-ui/form)
|
6
|
+
[](https://bundlephobia.com/result?p=@launchpad-ui/form)
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
```sh
|
11
|
+
$ yarn add @launchpad-ui/form
|
12
|
+
# or
|
13
|
+
$ npm install @launchpad-ui/form
|
14
|
+
```
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Component, InputHTMLAttributes, RefObject } from 'react';
|
2
|
+
import './styles/Form.css';
|
3
|
+
declare type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
|
4
|
+
/**
|
5
|
+
* Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.
|
6
|
+
*/
|
7
|
+
'aria-label'?: string;
|
8
|
+
/**
|
9
|
+
* id attribute of the label text elsewhere in the app, used for screen reader support
|
10
|
+
* Use this for cases where you have a visible label on the page that is not close to
|
11
|
+
* the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/
|
12
|
+
*/
|
13
|
+
'aria-labelledby'?: string;
|
14
|
+
/**
|
15
|
+
* Label for the Checkbox
|
16
|
+
*/
|
17
|
+
children?: React.ReactNode;
|
18
|
+
/**
|
19
|
+
* The className to pass into the Checkbox's Label component
|
20
|
+
*/
|
21
|
+
labelClassName?: string;
|
22
|
+
/**
|
23
|
+
* The test id for the data-test-id attribute for React Testing Library support
|
24
|
+
*/
|
25
|
+
testId?: string;
|
26
|
+
};
|
27
|
+
declare class Checkbox extends Component<CheckboxProps> {
|
28
|
+
inputRef: RefObject<HTMLInputElement>;
|
29
|
+
constructor(props: CheckboxProps);
|
30
|
+
value(): string | undefined;
|
31
|
+
checked(): boolean | undefined;
|
32
|
+
render(): JSX.Element;
|
33
|
+
}
|
34
|
+
export { Checkbox };
|
35
|
+
export type { CheckboxProps };
|
36
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,mBAAmB,CAAC;AAE3B,aAAK,aAAa,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC3D;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,cAAM,QAAS,SAAQ,SAAS,CAAC,aAAa,CAAC;IAC7C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAE1B,KAAK,EAAE,aAAa;IAKhC,KAAK;IAIL,OAAO;IAIP,MAAM;CAqCP;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Component, FocusEvent } from 'react';
|
2
|
+
import { TextField, TextFieldProps } from './TextField';
|
3
|
+
import './styles/CompactTextField.css';
|
4
|
+
import './styles/FormInput.css';
|
5
|
+
declare type CompactTextFieldProps = TextFieldProps & {
|
6
|
+
label: string;
|
7
|
+
needsErrorFeedback?: boolean;
|
8
|
+
};
|
9
|
+
declare class CompactTextField extends Component<CompactTextFieldProps, {
|
10
|
+
isActive: boolean;
|
11
|
+
}> {
|
12
|
+
textField?: TextField | null;
|
13
|
+
constructor(props: CompactTextFieldProps);
|
14
|
+
render(): JSX.Element;
|
15
|
+
handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
16
|
+
handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
17
|
+
value: () => string | undefined;
|
18
|
+
focus: () => void;
|
19
|
+
}
|
20
|
+
export { CompactTextField };
|
21
|
+
export type { CompactTextFieldProps };
|
22
|
+
//# sourceMappingURL=CompactTextField.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CompactTextField.d.ts","sourceRoot":"","sources":["../src/CompactTextField.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,+BAA+B,CAAC;AACvC,OAAO,wBAAwB,CAAC;AAEhC,aAAK,qBAAqB,GAAG,cAAc,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,cAAM,gBAAiB,SAAQ,SAAS,CAAC,qBAAqB,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;IACpF,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;gBAEjB,KAAK,EAAE,qBAAqB;IASxC,MAAM;IA6BN,WAAW,UAAW,WAAW,gBAAgB,CAAC,UAKhD;IAEF,UAAU,UAAW,WAAW,gBAAgB,CAAC,UAM/C;IAEF,KAAK,2BAAwD;IAE7D,KAAK,aAIH;CACH;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { FieldPath } from './utils';
|
3
|
+
import './styles/Form.css';
|
4
|
+
declare type FieldErrorProps = {
|
5
|
+
name: FieldPath;
|
6
|
+
errorMessage?: string;
|
7
|
+
className?: string;
|
8
|
+
};
|
9
|
+
declare const FieldError: ({ name, errorMessage, className }: FieldErrorProps) => JSX.Element | null;
|
10
|
+
export { FieldError };
|
11
|
+
export type { FieldErrorProps };
|
12
|
+
//# sourceMappingURL=FieldError.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../src/FieldError.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,OAAO,mBAAmB,CAAC;AAG3B,aAAK,eAAe,GAAG;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,UAAU,sCAAuC,eAAe,uBAcrE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ReactNode } from 'react';
|
2
|
+
import './styles/FieldSet.css';
|
3
|
+
declare type FieldSetProps = {
|
4
|
+
children?: ReactNode;
|
5
|
+
testId?: string;
|
6
|
+
};
|
7
|
+
declare const FieldSet: ({ children, testId }: FieldSetProps) => JSX.Element;
|
8
|
+
export { FieldSet };
|
9
|
+
export type { FieldSetProps };
|
10
|
+
//# sourceMappingURL=FieldSet.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FieldSet.d.ts","sourceRoot":"","sources":["../src/FieldSet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,uBAAuB,CAAC;AAE/B,aAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,QAAQ,yBAA0B,aAAa,gBAMpD,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/Form.d.ts
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { FocusEvent, FormEvent, ReactNode } from 'react';
|
2
|
+
import './styles/Form.css';
|
3
|
+
declare type FormProps = {
|
4
|
+
id?: string;
|
5
|
+
name?: string;
|
6
|
+
action?: string;
|
7
|
+
className?: string;
|
8
|
+
inline?: boolean;
|
9
|
+
method?: string;
|
10
|
+
hasIncreasedErrorMargin?: boolean;
|
11
|
+
onBlurCapture?(e: FocusEvent): void;
|
12
|
+
onSubmit?(e: FormEvent<EventTarget>): void;
|
13
|
+
ariaLabel?: string;
|
14
|
+
children: ReactNode;
|
15
|
+
};
|
16
|
+
declare const Form: (props: FormProps) => JSX.Element;
|
17
|
+
export { Form };
|
18
|
+
export type { FormProps };
|
19
|
+
//# sourceMappingURL=Form.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../src/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9D,OAAO,mBAAmB,CAAC;AAE3B,aAAK,SAAS,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,IAAI,UAAW,SAAS,gBAa7B,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import './styles/FormField.css';
|
3
|
+
declare type FormFieldProps = {
|
4
|
+
isRequired: boolean;
|
5
|
+
label?: string;
|
6
|
+
name: string;
|
7
|
+
htmlFor: string;
|
8
|
+
hint?: string;
|
9
|
+
errorMessage?: string;
|
10
|
+
ignoreValidation?: boolean;
|
11
|
+
isInvalid?: boolean;
|
12
|
+
children: JSX.Element;
|
13
|
+
className?: string;
|
14
|
+
onBlur?: (field: string) => void;
|
15
|
+
};
|
16
|
+
declare const FormField: ({ isRequired, label, name, htmlFor, hint, errorMessage, ignoreValidation, isInvalid, children, className, onBlur, }: FormFieldProps) => JSX.Element;
|
17
|
+
export type { FormFieldProps };
|
18
|
+
export { FormField };
|
19
|
+
//# sourceMappingURL=FormField.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../src/FormField.tsx"],"names":[],"mappings":";AAMA,OAAO,wBAAwB,CAAC;AAEhC,aAAK,cAAc,GAAG;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,SAAS,wHAYZ,cAAc,gBAwBhB,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { ReactNode } from 'react';
|
2
|
+
import './styles/Form.css';
|
3
|
+
declare type FormGroupProps = {
|
4
|
+
name?: string | string[];
|
5
|
+
ignoreValidation?: boolean;
|
6
|
+
isInvalid?: boolean;
|
7
|
+
className?: string;
|
8
|
+
onBlur?: () => void;
|
9
|
+
testId?: string;
|
10
|
+
children: ReactNode;
|
11
|
+
};
|
12
|
+
declare const FormGroup: (props: FormGroupProps) => JSX.Element;
|
13
|
+
export { FormGroup };
|
14
|
+
export type { FormGroupProps };
|
15
|
+
//# sourceMappingURL=FormGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FormGroup.d.ts","sourceRoot":"","sources":["../src/FormGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,mBAAmB,CAAC;AAE3B,aAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,cAAc,gBAYvC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { ReactNode } from 'react';
|
2
|
+
import './styles/FormHint.css';
|
3
|
+
declare type FormHintProps = {
|
4
|
+
children: ReactNode;
|
5
|
+
className?: string;
|
6
|
+
id?: string;
|
7
|
+
};
|
8
|
+
declare const FormHint: ({ className, children, ...rest }: FormHintProps) => JSX.Element;
|
9
|
+
export { FormHint };
|
10
|
+
export type { FormHintProps };
|
11
|
+
//# sourceMappingURL=FormHint.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FormHint.d.ts","sourceRoot":"","sources":["../src/FormHint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,uBAAuB,CAAC;AAE/B,aAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,QAAQ,qCAAsC,aAAa,gBAQhE,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { IconProps } from '@launchpad-ui/icons';
|
3
|
+
import './styles/IconField.css';
|
4
|
+
declare type IconFieldProps = {
|
5
|
+
icon({ ...other }: IconProps): JSX.Element;
|
6
|
+
children: JSX.Element | JSX.Element[];
|
7
|
+
};
|
8
|
+
declare const IconField: ({ icon, children }: IconFieldProps) => JSX.Element;
|
9
|
+
export { IconField };
|
10
|
+
export type { IconFieldProps };
|
11
|
+
//# sourceMappingURL=IconField.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"IconField.d.ts","sourceRoot":"","sources":["../src/IconField.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,wBAAwB,CAAC;AAEhC,aAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC;IAC3C,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACvC,CAAC;AAEF,QAAA,MAAM,SAAS,uBAAwB,cAAc,gBASpD,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
2
|
+
import './styles/InputGroup.css';
|
3
|
+
declare type InputGroupProps = ComponentPropsWithRef<'div'>;
|
4
|
+
export declare const InputGroup: ({ className, children, ...other }: InputGroupProps) => JSX.Element;
|
5
|
+
export {};
|
6
|
+
//# sourceMappingURL=InputGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../src/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,yBAAyB,CAAC;AAEjC,aAAK,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEpD,eAAO,MAAM,UAAU,sCAAuC,eAAe,gBAQ5E,CAAC"}
|
package/dist/Label.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import './styles/Form.css';
|
3
|
+
export declare type LabelProps = {
|
4
|
+
htmlFor?: string;
|
5
|
+
required?: boolean;
|
6
|
+
optional?: boolean;
|
7
|
+
disabled?: boolean;
|
8
|
+
children?: React.ReactNode;
|
9
|
+
className?: string;
|
10
|
+
style?: React.CSSProperties;
|
11
|
+
hidden?: boolean;
|
12
|
+
};
|
13
|
+
export declare const Label: ({ htmlFor, disabled, className, children, required, optional, ...other }: LabelProps) => JSX.Element;
|
14
|
+
//# sourceMappingURL=Label.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../src/Label.tsx"],"names":[],"mappings":";AAGA,OAAO,mBAAmB,CAAC;AAE3B,oBAAY,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,KAAK,6EAQf,UAAU,gBASZ,CAAC"}
|
package/dist/Radio.d.ts
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import './styles/Form.css';
|
3
|
+
declare type RadioProps = {
|
4
|
+
/**
|
5
|
+
* Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.
|
6
|
+
*/
|
7
|
+
'aria-label'?: string;
|
8
|
+
/**
|
9
|
+
* id attribute of the label text elsewhere in the app, used for screen reader support. Use this for cases where you have a visible label on the page that **is not close to** to the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/
|
10
|
+
*/
|
11
|
+
'aria-labelledby'?: string;
|
12
|
+
/**
|
13
|
+
* Is the Radio checked?
|
14
|
+
*/
|
15
|
+
checked?: boolean;
|
16
|
+
/**
|
17
|
+
* Label for the Checkbox
|
18
|
+
*/
|
19
|
+
children?: React.ReactNode;
|
20
|
+
/**
|
21
|
+
* Custom classname(s) to add to the Radio.
|
22
|
+
*/
|
23
|
+
className?: string;
|
24
|
+
/**
|
25
|
+
* Is the Radio disabled?
|
26
|
+
*/
|
27
|
+
disabled?: boolean;
|
28
|
+
/**
|
29
|
+
* The id to pair the Radio input with the label for screen reader support.
|
30
|
+
*/
|
31
|
+
id?: string;
|
32
|
+
/**
|
33
|
+
* The className to pass into the Radio's Label component
|
34
|
+
*/
|
35
|
+
labelClassName?: string;
|
36
|
+
/**
|
37
|
+
* Name to apply to the underlying Radio. Pass in the same name value to each Radio when grouping in a RadioGroup for screen reader support.
|
38
|
+
*/
|
39
|
+
name?: string;
|
40
|
+
/**
|
41
|
+
* The function to pass into the Radio onChange synthetic event handler.
|
42
|
+
*/
|
43
|
+
onChange?(e: React.ChangeEvent): void;
|
44
|
+
/**
|
45
|
+
* Optional inline CSS styles to add to the Radio label.
|
46
|
+
*/
|
47
|
+
labelStyle?: object;
|
48
|
+
/**
|
49
|
+
* The value passed into Radio.
|
50
|
+
*/
|
51
|
+
value: number | string;
|
52
|
+
};
|
53
|
+
declare const Radio: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, checked, children, className, disabled, id, labelClassName, name, onChange, labelStyle, value, ...props }: RadioProps) => JSX.Element;
|
54
|
+
export { Radio };
|
55
|
+
export type { RadioProps };
|
56
|
+
//# sourceMappingURL=Radio.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../src/Radio.tsx"],"names":[],"mappings":";AAGA,OAAO,mBAAmB,CAAC;AAE3B,aAAK,UAAU,GAAG;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,KAAK,4KAcR,UAAU,gBA6BZ,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import './styles/Form.css';
|
3
|
+
declare type RadioGroupProps = {
|
4
|
+
/**
|
5
|
+
* The legend that describes this groups of radio buttons. The legend
|
6
|
+
* is important for screen reader users.
|
7
|
+
*/
|
8
|
+
legend?: string;
|
9
|
+
/**
|
10
|
+
* The children passed into the RadioGroup.
|
11
|
+
*/
|
12
|
+
children?: React.ReactNode;
|
13
|
+
/**
|
14
|
+
* Custom classname(s) passed to the fieldset inner div.
|
15
|
+
*/
|
16
|
+
className?: string;
|
17
|
+
/**
|
18
|
+
* Set the underlying Radio to disabled if the Radio's disabled prop is undefined.
|
19
|
+
*/
|
20
|
+
disabled?: boolean;
|
21
|
+
/**
|
22
|
+
* The RadioGroup's id.
|
23
|
+
*/
|
24
|
+
id?: string;
|
25
|
+
/**
|
26
|
+
* Name to apply to the underlying Radio. The same name value is passed to each Radio when grouping in a RadioGroup for screen reader support.
|
27
|
+
*/
|
28
|
+
name: string;
|
29
|
+
/**
|
30
|
+
* This function is passed into each Radio onChange synthetic event handler.
|
31
|
+
*/
|
32
|
+
onChange?(e: React.ChangeEvent | React.FormEvent<HTMLInputElement>): void;
|
33
|
+
/**
|
34
|
+
* The value to compare against the Radio's value to determine if the Radio will be checked.
|
35
|
+
*/
|
36
|
+
value: string;
|
37
|
+
};
|
38
|
+
declare const RadioGroup: (props: RadioGroupProps) => JSX.Element;
|
39
|
+
export { RadioGroup };
|
40
|
+
export type { RadioGroupProps };
|
41
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../src/RadioGroup.tsx"],"names":[],"mappings":";AAKA,OAAO,mBAAmB,CAAC;AAE3B,aAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAC1E;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,UAAU,UAAW,eAAe,gBAyDzC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
2
|
+
import './styles/RequiredAsterisk.css';
|
3
|
+
declare type RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement> & {
|
4
|
+
testId?: string;
|
5
|
+
};
|
6
|
+
declare const RequiredAsterisk: ({ className, testId, ...rest }: RequiredAsteriskProps) => JSX.Element;
|
7
|
+
export { RequiredAsterisk };
|
8
|
+
//# sourceMappingURL=RequiredAsterisk.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RequiredAsterisk.d.ts","sourceRoot":"","sources":["../src/RequiredAsterisk.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,+BAA+B,CAAC;AAEvC,aAAK,qBAAqB,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,gBAAgB,mCAAoC,qBAAqB,gBAQ9E,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/Select.d.ts
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { ChangeEvent, ReactNode } from 'react';
|
2
|
+
import './styles/FormInput.css';
|
3
|
+
declare type SelectProps = {
|
4
|
+
children: ReactNode;
|
5
|
+
className?: string;
|
6
|
+
disabled?: boolean;
|
7
|
+
id?: string;
|
8
|
+
name?: string;
|
9
|
+
onChange?(event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>): void;
|
10
|
+
testId?: string;
|
11
|
+
value?: number | string;
|
12
|
+
'aria-label'?: string;
|
13
|
+
};
|
14
|
+
declare const Select: ({ className, children, testId, ...rest }: SelectProps) => JSX.Element;
|
15
|
+
export { Select };
|
16
|
+
export type { SelectProps };
|
17
|
+
//# sourceMappingURL=Select.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpD,OAAO,wBAAwB,CAAC;AAEhC,aAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,MAAM,6CAA8C,WAAW,gBAQpE,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Component, RefObject, TextareaHTMLAttributes } from 'react';
|
2
|
+
import './styles/FormInput.css';
|
3
|
+
declare type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
4
|
+
declare class TextArea extends Component<TextAreaProps> {
|
5
|
+
textareaRef: RefObject<HTMLTextAreaElement>;
|
6
|
+
constructor(props: TextAreaProps);
|
7
|
+
render(): JSX.Element;
|
8
|
+
focus(): void;
|
9
|
+
}
|
10
|
+
export { TextArea };
|
11
|
+
export type { TextAreaProps };
|
12
|
+
//# sourceMappingURL=TextArea.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,SAAS,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,wBAAwB,CAAC;AAGhC,aAAK,aAAa,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAEjE,cAAM,QAAS,SAAQ,SAAS,CAAC,aAAa,CAAC;IAC7C,WAAW,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;gBAEhC,KAAK,EAAE,aAAa;IAKhC,MAAM;IAcN,KAAK;CAGN;AAgBD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { Component, InputHTMLAttributes, RefObject } from 'react';
|
2
|
+
import './styles/FormInput.css';
|
3
|
+
declare type TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {
|
4
|
+
suffix?: string;
|
5
|
+
testId?: string;
|
6
|
+
tiny?: boolean;
|
7
|
+
overrideWidth?: string;
|
8
|
+
};
|
9
|
+
declare class TextField extends Component<TextFieldProps> {
|
10
|
+
inputRef: RefObject<HTMLInputElement>;
|
11
|
+
constructor(props: TextFieldProps);
|
12
|
+
render(): JSX.Element;
|
13
|
+
getElement(): HTMLInputElement | null;
|
14
|
+
value(): string | undefined;
|
15
|
+
focus(): void;
|
16
|
+
blur(): void;
|
17
|
+
select(): void;
|
18
|
+
}
|
19
|
+
export type { TextFieldProps };
|
20
|
+
export { TextField };
|
21
|
+
//# sourceMappingURL=TextField.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../src/TextField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,wBAAwB,CAAC;AAGhC,aAAK,cAAc,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,cAAM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAC1B,KAAK,EAAE,cAAc;IAKjC,MAAM;IAyDN,UAAU;IAIV,KAAK;IAIL,KAAK;IAIL,IAAI;IAIJ,MAAM;CAGP;AAED,YAAY,EAAE,cAAc,EAAE,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
export type { CheckboxProps } from './Checkbox';
|
2
|
+
export type { CompactTextFieldProps } from './CompactTextField';
|
3
|
+
export type { FormFieldProps } from './FormField';
|
4
|
+
export type { FormHintProps } from './FormHint';
|
5
|
+
export type { FormProps } from './Form';
|
6
|
+
export type { IconFieldProps } from './IconField';
|
7
|
+
export type { LabelProps } from './Label';
|
8
|
+
export type { RadioGroupProps } from './RadioGroup';
|
9
|
+
export type { RadioProps } from './Radio';
|
10
|
+
export type { SelectProps } from './Select';
|
11
|
+
export type { TextAreaProps } from './TextArea';
|
12
|
+
export { Checkbox } from './Checkbox';
|
13
|
+
export { CompactTextField } from './CompactTextField';
|
14
|
+
export { FieldError } from './FieldError';
|
15
|
+
export { FieldSet } from './FieldSet';
|
16
|
+
export { Form } from './Form';
|
17
|
+
export { FormField } from './FormField';
|
18
|
+
export { FormGroup } from './FormGroup';
|
19
|
+
export { FormHint } from './FormHint';
|
20
|
+
export { IconField } from './IconField';
|
21
|
+
export { InputGroup } from './InputGroup';
|
22
|
+
export { Label } from './Label';
|
23
|
+
export { Radio } from './Radio';
|
24
|
+
export { RadioGroup } from './RadioGroup';
|
25
|
+
export { RequiredAsterisk } from './RequiredAsterisk';
|
26
|
+
export { Select } from './Select';
|
27
|
+
export { TextArea } from './TextArea';
|
28
|
+
export { TextField } from './TextField';
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|