Socket
Socket
Sign inDemoInstall

@launchpad-ui/form

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@launchpad-ui/form - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

38

dist/Checkbox.d.ts

@@ -1,50 +0,14 @@

import type { InputHTMLAttributes, ReactNode } from 'react';
import type { InputHTMLAttributes } from 'react';
import './styles/Form.css';
declare type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
/**
* Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.
*/
'aria-label'?: string;
/**
* 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
* the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/
*/
'aria-labelledby'?: string;
/**
* Label for the Checkbox
*/
children?: ReactNode;
/**
* The className to pass into the Checkbox's Label component
*/
labelClassName?: string;
/**
* The test id for the data-test-id attribute for React Testing Library support
*/
testId?: string;
};
declare const Checkbox: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
/**
* Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.
*/
'aria-label'?: string | undefined;
/**
* 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
* the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/
*/
'aria-labelledby'?: string | undefined;
/**
* Label for the Checkbox
*/
children?: ReactNode;
/**
* The className to pass into the Checkbox's Label component
*/
labelClassName?: string | undefined;
/**
* The test id for the data-test-id attribute for React Testing Library support
*/
testId?: string | undefined;
} & import("react").RefAttributes<HTMLInputElement>>;

@@ -51,0 +15,0 @@ export { Checkbox };

@@ -11,3 +11,2 @@ /// <reference types="react" />

suffix?: string | undefined;
testId?: string | undefined;
tiny?: boolean | undefined;

@@ -14,0 +13,0 @@ overrideWidth?: string | undefined;

7

dist/FieldError.d.ts

@@ -1,12 +0,11 @@

/// <reference types="react" />
import type { FieldPath } from './utils';
import type { HTMLAttributes } from 'react';
import './styles/Form.css';
declare type FieldErrorProps = {
declare type FieldErrorProps = HTMLAttributes<HTMLSpanElement> & {
name: FieldPath;
errorMessage?: string;
className?: string;
};
declare const FieldError: ({ name, errorMessage, className }: FieldErrorProps) => JSX.Element | null;
declare const FieldError: ({ name, errorMessage, className, ...rest }: FieldErrorProps) => JSX.Element | null;
export { FieldError };
export type { FieldErrorProps };
//# sourceMappingURL=FieldError.d.ts.map

@@ -1,10 +0,7 @@

import type { ReactNode } from 'react';
import type { HTMLAttributes } from 'react';
import './styles/FieldSet.css';
declare type FieldSetProps = {
children?: ReactNode;
testId?: string;
};
declare const FieldSet: ({ children, testId }: FieldSetProps) => JSX.Element;
declare type FieldSetProps = HTMLAttributes<HTMLFieldSetElement>;
declare const FieldSet: ({ children, className, ...rest }: FieldSetProps) => JSX.Element;
export { FieldSet };
export type { FieldSetProps };
//# sourceMappingURL=FieldSet.d.ts.map

@@ -1,15 +0,6 @@

import type { FocusEvent, FormEvent, ReactNode } from 'react';
import type { FormHTMLAttributes } from 'react';
import './styles/Form.css';
declare type FormProps = {
id?: string;
name?: string;
action?: string;
className?: string;
declare type FormProps = FormHTMLAttributes<HTMLFormElement> & {
inline?: boolean;
method?: string;
hasIncreasedErrorMargin?: boolean;
onBlurCapture?(e: FocusEvent): void;
onSubmit?(e: FormEvent<EventTarget>): void;
ariaLabel?: string;
children: ReactNode;
};

@@ -16,0 +7,0 @@ declare const Form: (props: FormProps) => JSX.Element;

@@ -15,6 +15,7 @@ /// <reference types="react" />

onBlur?: (field: string) => void;
'data-test-id': string;
};
declare const FormField: ({ isRequired, label, name, htmlFor, hint, errorMessage, ignoreValidation, isInvalid, children, className, onBlur, }: FormFieldProps) => JSX.Element;
declare const FormField: ({ isRequired, label, name, htmlFor, hint, errorMessage, ignoreValidation, isInvalid, children, className, onBlur, "data-test-id": testId, }: FormFieldProps) => JSX.Element;
export type { FormFieldProps };
export { FormField };
//# sourceMappingURL=FormField.d.ts.map

@@ -1,11 +0,7 @@

import type { ReactNode } from 'react';
import type { HTMLAttributes } from 'react';
import './styles/Form.css';
declare type FormGroupProps = {
declare type FormGroupProps = HTMLAttributes<HTMLDivElement> & {
name?: string | string[];
ignoreValidation?: boolean;
isInvalid?: boolean;
className?: string;
onBlur?: () => void;
testId?: string;
children: ReactNode;
};

@@ -12,0 +8,0 @@ declare const FormGroup: (props: FormGroupProps) => JSX.Element;

@@ -1,8 +0,4 @@

import type { ReactNode } from 'react';
import type { HTMLAttributes } from 'react';
import './styles/FormHint.css';
declare type FormHintProps = {
children: ReactNode;
className?: string;
id?: string;
};
declare type FormHintProps = HTMLAttributes<HTMLDivElement>;
declare const FormHint: ({ className, children, ...rest }: FormHintProps) => JSX.Element;

@@ -9,0 +5,0 @@ export { FormHint };

@@ -1,11 +0,11 @@

/// <reference types="react" />
import type { IconProps } from '@launchpad-ui/icons';
import type { HTMLAttributes } from 'react';
import './styles/IconField.css';
declare type IconFieldProps = {
icon({ ...other }: IconProps): JSX.Element;
declare type IconFieldProps = HTMLAttributes<HTMLDivElement> & {
icon(args: IconProps): JSX.Element;
children: JSX.Element | JSX.Element[];
};
declare const IconField: ({ icon, children }: IconFieldProps) => JSX.Element;
declare const IconField: ({ icon, children, className, ...rest }: IconFieldProps) => JSX.Element;
export { IconField };
export type { IconFieldProps };
//# sourceMappingURL=IconField.d.ts.map

@@ -10,3 +10,2 @@ export type { CheckboxProps } from './Checkbox';

export type { IconFieldProps } from './IconField';
export type { InputGroupProps } from './InputGroup';
export type { LabelProps } from './Label';

@@ -28,3 +27,2 @@ export type { RadioProps } from './Radio';

export { IconField } from './IconField';
export { InputGroup } from './InputGroup';
export { Label } from './Label';

@@ -31,0 +29,0 @@ export { Radio } from './Radio';

@@ -10,10 +10,8 @@ import './style.css';

className,
testId,
...rest
}) => {
const classes = cx("RequiredAsterisk");
const classes = cx("RequiredAsterisk", className);
return /* @__PURE__ */ jsx("span", {
...rest,
className: classes,
"data-test-id": testId,
...rest,
children: "*"

@@ -24,3 +22,2 @@ });

const Label = ({
htmlFor,
disabled,

@@ -31,9 +28,8 @@ className,

optional = false,
...other
...rest
}) => {
const classes = cx("Form-label", className, disabled && "Form-label--disabled");
return /* @__PURE__ */ jsxs("label", {
...other,
...rest,
className: classes,
htmlFor,
children: [children, optional && !required && /* @__PURE__ */ jsx("small", {

@@ -50,6 +46,5 @@ className: "Form-labelOptional",

disabled,
testId,
checked,
labelClassName,
...other
...rest
}, ref) => {

@@ -63,3 +58,3 @@ const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;

children: [/* @__PURE__ */ jsx("input", {
...other,
...rest,
ref,

@@ -72,3 +67,2 @@ checked,

disabled,
"data-test-id": testId,
type: "checkbox"

@@ -90,3 +84,2 @@ }), " ", disabled ? /* @__PURE__ */ jsx("span", {

tabIndex = 0,
testId,
suffix,

@@ -106,3 +99,2 @@ overrideWidth,

ref,
"data-test-id": testId,
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)

@@ -123,3 +115,2 @@ }), /* @__PURE__ */ jsx("label", {

ref,
"data-test-id": testId,
style: overrideWidth ? {

@@ -136,5 +127,3 @@ width: overrideWidth

id,
name,
label,
type,
needsErrorFeedback,

@@ -171,4 +160,2 @@ value,

id,
name,
type,
placeholder,

@@ -186,3 +173,4 @@ value,

errorMessage,
className
className,
...rest
}) => {

@@ -193,2 +181,3 @@ if (!errorMessage) {

return /* @__PURE__ */ jsx("span", {
...rest,
className: cx("Form-fieldError", className),

@@ -203,7 +192,9 @@ "aria-live": "polite",

children,
testId
className,
...rest
}) => {
const classes = cx("FieldSet", className);
return /* @__PURE__ */ jsx("fieldset", {
className: "FieldSet",
"data-test-id": testId,
className: classes,
...rest,
children

@@ -214,8 +205,5 @@ });

const {
id,
name,
className,
inline,
children,
ariaLabel,
hasIncreasedErrorMargin,

@@ -226,5 +214,2 @@ ...rest

return /* @__PURE__ */ jsx("form", {
id,
name,
"aria-label": ariaLabel,
...rest,

@@ -242,4 +227,3 @@ className: classes,

children,
testId,
...other
...rest
} = props;

@@ -249,4 +233,3 @@ const classes = cx("Form-group", className, !ignoreValidation && isInvalid && "is-invalid");

className: classes,
"data-test-id": testId,
...other,
...rest,
children

@@ -280,3 +263,4 @@ });

className,
onBlur
onBlur,
"data-test-id": testId
}) => {

@@ -292,2 +276,3 @@ const handleBlur = () => {

onBlur: handleBlur,
"data-test-id": testId,
children: [label && /* @__PURE__ */ jsxs("label", {

@@ -309,7 +294,11 @@ htmlFor,

icon,
children
children,
className,
...rest
}) => {
const Icon = icon;
const classes = cx("IconField", className);
return /* @__PURE__ */ jsxs("div", {
className: "IconField",
className: classes,
...rest,
children: [children, /* @__PURE__ */ jsx(Icon, {

@@ -320,15 +309,2 @@ size: IconSize.SMALL

};
const InputGroup$1 = "";
const InputGroup = ({
className,
children,
...other
}) => {
const classes = cx("InputGroup", className);
return /* @__PURE__ */ jsx("div", {
...other,
className: classes,
children
});
};
const Radio = ({

@@ -343,7 +319,4 @@ "aria-label": ariaLabel,

labelClassName,
name,
onChange = () => void 0,
labelStyle,
value,
...props
...rest
}) => {

@@ -356,2 +329,3 @@ const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;

children: [/* @__PURE__ */ jsx("input", {
...rest,
"aria-label": ariaLabel,

@@ -363,7 +337,3 @@ "aria-labelledby": ariaLabelledby,

id,
name,
onChange,
type: "radio",
value,
...props
type: "radio"
}), /* @__PURE__ */ jsx(Label, {

@@ -388,3 +358,3 @@ className: labelClassName,

legend,
...other
...rest
} = props;

@@ -438,3 +408,3 @@ const fieldsetRef = useRef(null);

}), /* @__PURE__ */ jsx("div", {
...other,
...rest,
children: radios

@@ -447,3 +417,2 @@ })]

children,
testId,
...rest

@@ -455,3 +424,2 @@ }) => {

className: classes,
"data-test-id": testId,
children

@@ -491,3 +459,2 @@ });

IconField,
InputGroup,
Label,

@@ -494,0 +461,0 @@ Radio,

@@ -12,10 +12,8 @@ require('./style.css');

className,
testId,
...rest
}) => {
const classes = classix.cx("RequiredAsterisk");
const classes = classix.cx("RequiredAsterisk", className);
return /* @__PURE__ */ jsxRuntime.jsx("span", {
...rest,
className: classes,
"data-test-id": testId,
...rest,
children: "*"

@@ -26,3 +24,2 @@ });

const Label = ({
htmlFor,
disabled,

@@ -33,9 +30,8 @@ className,

optional = false,
...other
...rest
}) => {
const classes = classix.cx("Form-label", className, disabled && "Form-label--disabled");
return /* @__PURE__ */ jsxRuntime.jsxs("label", {
...other,
...rest,
className: classes,
htmlFor,
children: [children, optional && !required && /* @__PURE__ */ jsxRuntime.jsx("small", {

@@ -52,6 +48,5 @@ className: "Form-labelOptional",

disabled,
testId,
checked,
labelClassName,
...other
...rest
}, ref) => {

@@ -65,3 +60,3 @@ const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;

children: [/* @__PURE__ */ jsxRuntime.jsx("input", {
...other,
...rest,
ref,

@@ -74,3 +69,2 @@ checked,

disabled,
"data-test-id": testId,
type: "checkbox"

@@ -92,3 +86,2 @@ }), " ", disabled ? /* @__PURE__ */ jsxRuntime.jsx("span", {

tabIndex = 0,
testId,
suffix,

@@ -108,3 +101,2 @@ overrideWidth,

ref,
"data-test-id": testId,
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)

@@ -125,3 +117,2 @@ }), /* @__PURE__ */ jsxRuntime.jsx("label", {

ref,
"data-test-id": testId,
style: overrideWidth ? {

@@ -138,5 +129,3 @@ width: overrideWidth

id,
name,
label,
type,
needsErrorFeedback,

@@ -173,4 +162,2 @@ value,

id,
name,
type,
placeholder,

@@ -188,3 +175,4 @@ value,

errorMessage,
className
className,
...rest
}) => {

@@ -195,2 +183,3 @@ if (!errorMessage) {

return /* @__PURE__ */ jsxRuntime.jsx("span", {
...rest,
className: classix.cx("Form-fieldError", className),

@@ -205,7 +194,9 @@ "aria-live": "polite",

children,
testId
className,
...rest
}) => {
const classes = classix.cx("FieldSet", className);
return /* @__PURE__ */ jsxRuntime.jsx("fieldset", {
className: "FieldSet",
"data-test-id": testId,
className: classes,
...rest,
children

@@ -216,8 +207,5 @@ });

const {
id,
name,
className,
inline,
children,
ariaLabel,
hasIncreasedErrorMargin,

@@ -228,5 +216,2 @@ ...rest

return /* @__PURE__ */ jsxRuntime.jsx("form", {
id,
name,
"aria-label": ariaLabel,
...rest,

@@ -244,4 +229,3 @@ className: classes,

children,
testId,
...other
...rest
} = props;

@@ -251,4 +235,3 @@ const classes = classix.cx("Form-group", className, !ignoreValidation && isInvalid && "is-invalid");

className: classes,
"data-test-id": testId,
...other,
...rest,
children

@@ -282,3 +265,4 @@ });

className,
onBlur
onBlur,
"data-test-id": testId
}) => {

@@ -294,2 +278,3 @@ const handleBlur = () => {

onBlur: handleBlur,
"data-test-id": testId,
children: [label && /* @__PURE__ */ jsxRuntime.jsxs("label", {

@@ -311,7 +296,11 @@ htmlFor,

icon,
children
children,
className,
...rest
}) => {
const Icon = icon;
const classes = classix.cx("IconField", className);
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
className: "IconField",
className: classes,
...rest,
children: [children, /* @__PURE__ */ jsxRuntime.jsx(Icon, {

@@ -322,15 +311,2 @@ size: icons.IconSize.SMALL

};
const InputGroup$1 = "";
const InputGroup = ({
className,
children,
...other
}) => {
const classes = classix.cx("InputGroup", className);
return /* @__PURE__ */ jsxRuntime.jsx("div", {
...other,
className: classes,
children
});
};
const Radio = ({

@@ -345,7 +321,4 @@ "aria-label": ariaLabel,

labelClassName,
name,
onChange = () => void 0,
labelStyle,
value,
...props
...rest
}) => {

@@ -358,2 +331,3 @@ const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;

children: [/* @__PURE__ */ jsxRuntime.jsx("input", {
...rest,
"aria-label": ariaLabel,

@@ -365,7 +339,3 @@ "aria-labelledby": ariaLabelledby,

id,
name,
onChange,
type: "radio",
value,
...props
type: "radio"
}), /* @__PURE__ */ jsxRuntime.jsx(Label, {

@@ -390,3 +360,3 @@ className: labelClassName,

legend,
...other
...rest
} = props;

@@ -440,3 +410,3 @@ const fieldsetRef = react.useRef(null);

}), /* @__PURE__ */ jsxRuntime.jsx("div", {
...other,
...rest,
children: radios

@@ -449,3 +419,2 @@ })]

children,
testId,
...rest

@@ -457,3 +426,2 @@ }) => {

className: classes,
"data-test-id": testId,
children

@@ -492,3 +460,2 @@ });

exports.IconField = IconField;
exports.InputGroup = InputGroup;
exports.Label = Label;

@@ -495,0 +462,0 @@ exports.Radio = Radio;

@@ -1,16 +0,11 @@

import type { CSSProperties, ReactNode } from 'react';
import type { LabelHTMLAttributes } from 'react';
import './styles/Form.css';
declare type LabelProps = {
htmlFor?: string;
declare type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
required?: boolean;
optional?: boolean;
disabled?: boolean;
children?: ReactNode;
className?: string;
style?: CSSProperties;
hidden?: boolean;
};
declare const Label: ({ htmlFor, disabled, className, children, required, optional, ...other }: LabelProps) => JSX.Element;
declare const Label: ({ disabled, className, children, required, optional, ...rest }: LabelProps) => JSX.Element;
export { Label };
export type { LabelProps };
//# sourceMappingURL=Label.d.ts.map

@@ -1,56 +0,10 @@

import type { ChangeEvent, CSSProperties, ReactNode } from 'react';
import type { CSSProperties, InputHTMLAttributes } from 'react';
import './styles/Form.css';
declare type RadioProps = {
/**
* Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.
*/
'aria-label'?: string;
/**
* 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/
*/
'aria-labelledby'?: string;
/**
* Is the Radio checked?
*/
checked?: boolean;
/**
* Label for the Checkbox
*/
children?: ReactNode;
/**
* Custom classname(s) to add to the Radio.
*/
className?: string;
/**
* Is the Radio disabled?
*/
disabled?: boolean;
/**
* The id to pair the Radio input with the label for screen reader support.
*/
id?: string;
/**
* The className to pass into the Radio's Label component
*/
declare type RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {
labelClassName?: string;
/**
* 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.
*/
name?: string;
/**
* The function to pass into the Radio onChange synthetic event handler.
*/
onChange?(e: ChangeEvent): void;
/**
* Optional inline CSS styles to add to the Radio label.
*/
labelStyle?: CSSProperties;
/**
* The value passed into Radio.
*/
value: number | string;
};
declare const Radio: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, checked, children, className, disabled, id, labelClassName, name, onChange, labelStyle, value, ...props }: RadioProps) => JSX.Element;
declare const Radio: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, checked, children, className, disabled, id, labelClassName, labelStyle, ...rest }: RadioProps) => JSX.Element;
export { Radio };
export type { RadioProps };
//# sourceMappingURL=Radio.d.ts.map
import type { HTMLAttributes } from 'react';
import './styles/RequiredAsterisk.css';
declare type RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement> & {
testId?: string;
};
declare const RequiredAsterisk: ({ className, testId, ...rest }: RequiredAsteriskProps) => JSX.Element;
declare type RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement>;
declare const RequiredAsterisk: ({ className, ...rest }: RequiredAsteriskProps) => JSX.Element;
export { RequiredAsterisk };
export type { RequiredAsteriskProps };
//# sourceMappingURL=RequiredAsterisk.d.ts.map

@@ -1,19 +0,7 @@

import type { ChangeEvent, FocusEvent, ReactNode } from 'react';
import type { SelectHTMLAttributes } from 'react';
import './styles/FormInput.css';
declare type SelectProps = {
children: ReactNode;
className?: string;
disabled?: boolean;
id?: string;
name?: string;
onChange?(event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>): void;
onBlur?(event: FocusEvent<HTMLSelectElement, HTMLElement>): void;
testId?: string;
value?: number | string;
placeholder?: string;
'aria-label'?: string;
};
declare const Select: ({ className, children, testId, ...rest }: SelectProps) => JSX.Element;
declare type SelectProps = SelectHTMLAttributes<HTMLSelectElement>;
declare const Select: ({ className, children, ...rest }: SelectProps) => JSX.Element;
export { Select };
export type { SelectProps };
//# sourceMappingURL=Select.d.ts.map

@@ -5,3 +5,2 @@ import type { InputHTMLAttributes } from 'react';

suffix?: string;
testId?: string;
tiny?: boolean;

@@ -12,3 +11,2 @@ overrideWidth?: string;

suffix?: string | undefined;
testId?: string | undefined;
tiny?: boolean | undefined;

@@ -15,0 +13,0 @@ overrideWidth?: string | undefined;

{
"name": "@launchpad-ui/form",
"version": "0.4.0",
"version": "0.5.0",
"status": "beta",

@@ -5,0 +5,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc