@launchpad-ui/form 0.3.5 → 0.5.1-alpha.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/dist/Checkbox.d.ts +0 -36
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/CompactTextField.d.ts +0 -1
- package/dist/CompactTextField.d.ts.map +1 -1
- package/dist/FieldError.d.ts +3 -4
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FieldSet.d.ts +3 -6
- package/dist/FieldSet.d.ts.map +1 -1
- package/dist/Form.d.ts +2 -11
- package/dist/Form.d.ts.map +1 -1
- package/dist/FormField.d.ts +2 -1
- package/dist/FormField.d.ts.map +1 -1
- package/dist/FormGroup.d.ts +2 -6
- package/dist/FormGroup.d.ts.map +1 -1
- package/dist/FormHint.d.ts +2 -6
- package/dist/FormHint.d.ts.map +1 -1
- package/dist/IconField.d.ts +4 -4
- package/dist/IconField.d.ts.map +1 -1
- package/dist/Label.d.ts +3 -8
- package/dist/Label.d.ts.map +1 -1
- package/dist/Radio.d.ts +4 -50
- package/dist/Radio.d.ts.map +1 -1
- package/dist/RadioGroup.d.ts +3 -3
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RequiredAsterisk.d.ts +2 -4
- package/dist/RequiredAsterisk.d.ts.map +1 -1
- package/dist/Select.d.ts +3 -15
- package/dist/Select.d.ts.map +1 -1
- package/dist/TextArea.d.ts.map +1 -1
- package/dist/TextField.d.ts +0 -2
- package/dist/TextField.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +273 -372
- package/dist/index.es.js.map +1 -7
- package/dist/index.js +301 -443
- package/dist/index.js.map +1 -7
- package/dist/style.css +402 -0
- package/package.json +4 -4
- package/dist/InputGroup.d.ts +0 -7
- package/dist/InputGroup.d.ts.map +0 -1
- package/dist/styles/CompactTextField.css +0 -2
- package/dist/styles/CompactTextField.css.map +0 -1
- package/dist/styles/FieldSet.css +0 -2
- package/dist/styles/FieldSet.css.map +0 -1
- package/dist/styles/Form.css +0 -2
- package/dist/styles/Form.css.map +0 -1
- package/dist/styles/FormField.css +0 -2
- package/dist/styles/FormField.css.map +0 -1
- package/dist/styles/FormHint.css +0 -2
- package/dist/styles/FormHint.css.map +0 -1
- package/dist/styles/FormInput.css +0 -2
- package/dist/styles/FormInput.css.map +0 -1
- package/dist/styles/IconField.css +0 -2
- package/dist/styles/IconField.css.map +0 -1
- package/dist/styles/InputGroup.css +0 -2
- package/dist/styles/InputGroup.css.map +0 -1
- package/dist/styles/RequiredAsterisk.css +0 -2
- package/dist/styles/RequiredAsterisk.css.map +0 -1
- package/dist/styles/styles.css +0 -2
- package/dist/styles/styles.css.map +0 -1
package/dist/index.js.map
CHANGED
@@ -1,7 +1 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/index.ts", "../src/Checkbox.tsx", "../src/Label.tsx", "../src/RequiredAsterisk.tsx", "../src/CompactTextField.tsx", "../src/TextField.tsx", "../src/utils/index.ts", "../src/FieldError.tsx", "../src/FieldSet.tsx", "../src/Form.tsx", "../src/FormField.tsx", "../src/FormGroup.tsx", "../src/FormHint.tsx", "../src/IconField.tsx", "../src/InputGroup.tsx", "../src/Radio.tsx", "../src/RadioGroup.tsx", "../src/Select.tsx", "../src/TextArea.tsx"],
|
4
|
-
"sourcesContent": ["export type { CheckboxProps } from './Checkbox';\nexport type { CompactTextFieldProps } from './CompactTextField';\nexport type { FieldErrorProps } from './FieldError';\nexport type { FieldSetProps } from './FieldSet';\nexport type { FormProps } from './Form';\nexport type { FormFieldProps } from './FormField';\nexport type { FormGroupProps } from './FormGroup';\nexport type { FormHintProps } from './FormHint';\nexport type { IconFieldProps } from './IconField';\nexport type { InputGroupProps } from './InputGroup';\nexport type { LabelProps } from './Label';\nexport type { RadioProps } from './Radio';\nexport type { RadioGroupProps } from './RadioGroup';\nexport type { RequiredAsteriskProps } from './RequiredAsterisk';\nexport type { SelectProps } from './Select';\nexport type { TextAreaProps } from './TextArea';\nexport type { TextFieldProps } from './TextField';\n\nexport { Checkbox } from './Checkbox';\nexport { CompactTextField } from './CompactTextField';\nexport { FieldError } from './FieldError';\nexport { FieldSet } from './FieldSet';\nexport { Form } from './Form';\nexport { FormField } from './FormField';\nexport { FormGroup } from './FormGroup';\nexport { FormHint } from './FormHint';\nexport { IconField } from './IconField';\nexport { InputGroup } from './InputGroup';\nexport { Label } from './Label';\nexport { Radio } from './Radio';\nexport { RadioGroup } from './RadioGroup';\nexport { RequiredAsterisk } from './RequiredAsterisk';\nexport { Select } from './Select';\nexport { TextArea } from './TextArea';\nexport { TextField } from './TextField';\n", "import type { InputHTMLAttributes } from 'react';\n\nimport { forwardRef } from 'react';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {\n /**\n * Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.\n */\n 'aria-label'?: string;\n /**\n * id attribute of the label text elsewhere in the app, used for screen reader support\n * Use this for cases where you have a visible label on the page that is not close to\n * the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/\n */\n 'aria-labelledby'?: string;\n /**\n * Label for the Checkbox\n */\n children?: React.ReactNode;\n /**\n * The className to pass into the Checkbox's Label component\n */\n labelClassName?: string;\n /**\n * The test id for the data-test-id attribute for React Testing Library support\n */\n testId?: string;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n disabled,\n testId,\n checked,\n labelClassName,\n ...other\n },\n ref\n ) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <Label className={labelClassName}>\n <input\n {...other}\n ref={ref}\n checked={checked}\n aria-checked={checked ? 'true' : 'false'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className=\"Form-checkbox\"\n disabled={disabled}\n data-test-id={testId}\n type=\"checkbox\"\n />{' '}\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n", "import { cx } from 'classix';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\ntype LabelProps = {\n htmlFor?: string;\n required?: boolean;\n optional?: boolean;\n disabled?: boolean;\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n hidden?: boolean;\n};\n\nconst Label = ({\n htmlFor,\n disabled,\n className,\n children,\n required = false,\n optional = false,\n ...other\n}: LabelProps) => {\n const classes = cx('Form-label', className, disabled && 'Form-label--disabled');\n return (\n <label {...other} className={classes} htmlFor={htmlFor}>\n {children}\n {optional && !required && <small className=\"Form-labelOptional\">(optional)</small>}\n {required && !optional && <RequiredAsterisk />}\n </label>\n );\n};\n\nexport { Label };\nexport type { LabelProps };\n", "import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/RequiredAsterisk.css';\n\ntype RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement> & {\n testId?: string;\n};\n\nconst RequiredAsterisk = ({ className, testId, ...rest }: RequiredAsteriskProps) => {\n const classes = cx('RequiredAsterisk');\n\n return (\n <span className={classes} data-test-id={testId} {...rest}>\n *\n </span>\n );\n};\n\nexport { RequiredAsterisk };\nexport type { RequiredAsteriskProps };\n", "import type { TextFieldProps } from './TextField';\nimport type { FocusEvent } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef, useState } from 'react';\n\nimport { Label } from './Label';\nimport { TextField } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n label: string;\n needsErrorFeedback?: boolean;\n};\n\nconst CompactTextField = forwardRef<HTMLInputElement, CompactTextFieldProps>(\n (\n { className, id, name, label, type, needsErrorFeedback, value, onFocus, onBlur, ...rest },\n ref\n ) => {\n const [isActive, setIsActive] = useState(\n (typeof value === 'boolean' || value ? value.toString() : '').trim().length !== 0\n );\n\n const isActiveState = isActive || needsErrorFeedback;\n\n const classes = cx('CompactTextField', className, isActiveState && 'is-active');\n\n const placeholder = isActiveState ? '' : label;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setIsActive(true);\n if (onFocus) {\n onFocus(event);\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n const value = event.target.value || '';\n setIsActive(value.trim().length !== 0);\n if (onBlur) {\n onBlur(event);\n }\n };\n\n return (\n <div className={classes}>\n <Label htmlFor={id}>{label}</Label>\n <TextField\n {...rest}\n id={id}\n name={name}\n type={type}\n placeholder={placeholder}\n value={value}\n ref={ref}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </div>\n );\n }\n);\n\nCompactTextField.displayName = 'CompactTextField';\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n", "import type { InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n suffix?: string;\n testId?: string;\n tiny?: boolean;\n overrideWidth?: string;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n className,\n type = 'text',\n tiny = false,\n readOnly,\n tabIndex = 0,\n testId,\n suffix,\n overrideWidth,\n ...rest\n },\n ref\n ) => {\n const classes = overrideWidth\n ? className\n : cx('FormInput', `FormInput-${type}`, className, tiny && 'FormInput--tiny');\n if (suffix) {\n return (\n <div className=\"FormInput-suffixContainer\">\n <input\n {...rest}\n type={type}\n className={cx(classes, 'FormInput-suffix')}\n readOnly={readOnly}\n ref={ref}\n data-test-id={testId}\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n <label className=\"FormInput-suffix\" htmlFor={rest.id}>\n {suffix}\n </label>\n </div>\n );\n }\n\n return (\n <input\n {...rest}\n type={type}\n className={classes}\n readOnly={readOnly}\n tabIndex={tabIndex}\n ref={ref}\n data-test-id={testId}\n style={\n overrideWidth\n ? {\n width: overrideWidth,\n }\n : undefined\n }\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n );\n }\n);\n\nTextField.displayName = 'TextField';\n\nexport { TextField };\nexport type { TextFieldProps };\n", "type FieldPath = string | string[];\n\nconst createFieldErrorId = (fieldIdentifier?: FieldPath) =>\n fieldIdentifier ? `${[...fieldIdentifier].join('')}-err` : undefined;\n\nexport { createFieldErrorId };\nexport type { FieldPath };\n", "import type { FieldPath } from './utils';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\nimport { createFieldErrorId } from './utils';\n\ntype FieldErrorProps = {\n name: FieldPath;\n errorMessage?: string;\n className?: string;\n};\n\nconst FieldError = ({ name, errorMessage, className }: FieldErrorProps) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n <span\n className={cx('Form-fieldError', className)}\n aria-live=\"polite\"\n id={createFieldErrorId(name)}\n >\n {`Error - ${errorMessage}`}\n </span>\n );\n};\n\nexport { FieldError };\nexport type { FieldErrorProps };\n", "import type { ReactNode } from 'react';\n\nimport './styles/FieldSet.css';\n\ntype FieldSetProps = {\n children?: ReactNode;\n testId?: string;\n};\n\nconst FieldSet = ({ children, testId }: FieldSetProps) => {\n return (\n <fieldset className=\"FieldSet\" data-test-id={testId}>\n {children}\n </fieldset>\n );\n};\n\nexport { FieldSet };\nexport type { FieldSetProps };\n", "import type { FocusEvent, FormEvent, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormProps = {\n id?: string;\n name?: string;\n action?: string;\n className?: string;\n inline?: boolean;\n method?: string;\n // Increases margin between form fields to make room for error messages.\n // This prevents the form from shifting when rendering a field error.\n // This may be desired when the form contains external links that will\n // shift while clicking if the form shifts from validation.\n hasIncreasedErrorMargin?: boolean;\n onBlurCapture?(e: FocusEvent): void;\n onSubmit?(e: FormEvent<EventTarget>): void;\n ariaLabel?: string;\n children: ReactNode;\n};\n\nconst Form = (props: FormProps) => {\n const { id, name, className, inline, children, ariaLabel, hasIncreasedErrorMargin, ...rest } =\n props;\n const classes = cx(\n 'Form',\n className,\n inline && 'Form--inline',\n !!hasIncreasedErrorMargin && 'Form--increasedErrorMargin'\n );\n\n return (\n <form id={id} name={name} aria-label={ariaLabel} {...rest} className={classes}>\n {children}\n </form>\n );\n};\n\nexport { Form };\nexport type { FormProps };\n", "import { cx } from 'classix';\n\nimport { FieldError } from './FieldError';\nimport { FormGroup } from './FormGroup';\nimport { FormHint } from './FormHint';\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/FormField.css';\n\ntype FormFieldProps = {\n isRequired: boolean;\n label?: string;\n name: string;\n htmlFor: string;\n hint?: string;\n errorMessage?: string;\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n children: JSX.Element;\n className?: string;\n onBlur?: (field: string) => void;\n};\n\nconst FormField = ({\n isRequired,\n label,\n name,\n htmlFor,\n hint,\n errorMessage,\n ignoreValidation,\n isInvalid,\n children,\n className,\n onBlur,\n}: FormFieldProps) => {\n const handleBlur = () => {\n onBlur && onBlur(name);\n };\n\n return (\n <FormGroup\n className={cx('FormField', className)}\n name={name}\n ignoreValidation={ignoreValidation}\n isInvalid={isInvalid}\n onBlur={handleBlur}\n >\n {label && (\n <label htmlFor={htmlFor}>\n {label}\n {isRequired && <RequiredAsterisk />}\n </label>\n )}\n {hint && <FormHint className=\"FormField-hint\">{hint}</FormHint>}\n {children}\n <FieldError className=\"FormField-errorMessage\" name={name} errorMessage={errorMessage} />\n </FormGroup>\n );\n};\n\nexport type { FormFieldProps };\nexport { FormField };\n", "import type { ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormGroupProps = {\n name?: string | string[];\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n className?: string;\n onBlur?: () => void;\n testId?: string;\n children: ReactNode;\n};\n\nconst FormGroup = (props: FormGroupProps) => {\n const { className, name, ignoreValidation, isInvalid, children, testId, ...other } = props;\n\n const classes = cx('Form-group', className, !ignoreValidation && isInvalid && 'is-invalid');\n\n return (\n <div className={classes} data-test-id={testId} {...other}>\n {children}\n </div>\n );\n};\n\nexport { FormGroup };\nexport type { FormGroupProps };\n", "import type { ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormHint.css';\n\ntype FormHintProps = {\n children: ReactNode;\n className?: string;\n id?: string;\n};\n\nconst FormHint = ({ className, children, ...rest }: FormHintProps) => {\n const classes = cx('Form-hint', className);\n\n return (\n <div {...rest} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { FormHint };\nexport type { FormHintProps };\n", "import type { IconProps } from '@launchpad-ui/icons';\n\nimport { IconSize } from '@launchpad-ui/icons';\n\nimport './styles/IconField.css';\n\ntype IconFieldProps = {\n icon({ ...other }: IconProps): JSX.Element;\n children: JSX.Element | JSX.Element[];\n};\n\nconst IconField = ({ icon, children }: IconFieldProps) => {\n const Icon = icon;\n\n return (\n <div className=\"IconField\">\n {children}\n <Icon size={IconSize.SMALL} />\n </div>\n );\n};\n\nexport { IconField };\nexport type { IconFieldProps };\n", "import type { ComponentPropsWithRef } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/InputGroup.css';\n\ntype InputGroupProps = ComponentPropsWithRef<'div'>;\n\nconst InputGroup = ({ className, children, ...other }: InputGroupProps) => {\n const classes = cx('InputGroup', className);\n\n return (\n <div {...other} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { InputGroup };\nexport type { InputGroupProps };\n", "import { cx } from 'classix';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype RadioProps = {\n /**\n * Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.\n */\n 'aria-label'?: string;\n /**\n * 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/\n */\n 'aria-labelledby'?: string;\n /**\n * Is the Radio checked?\n */\n checked?: boolean;\n /**\n * Label for the Checkbox\n */\n children?: React.ReactNode;\n /**\n * Custom classname(s) to add to the Radio.\n */\n className?: string;\n /**\n * Is the Radio disabled?\n */\n disabled?: boolean;\n /**\n * The id to pair the Radio input with the label for screen reader support.\n */\n id?: string;\n /**\n * The className to pass into the Radio's Label component\n */\n labelClassName?: string;\n /**\n * 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.\n */\n name?: string;\n /**\n * The function to pass into the Radio onChange synthetic event handler.\n */\n onChange?(e: React.ChangeEvent): void;\n /**\n * Optional inline CSS styles to add to the Radio label.\n */\n labelStyle?: React.CSSProperties;\n /**\n * The value passed into Radio.\n */\n value: number | string;\n};\n\nconst Radio = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n checked = false,\n children,\n className,\n disabled = false,\n id,\n labelClassName,\n name,\n onChange = () => undefined,\n labelStyle,\n value,\n ...props\n}: RadioProps) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <>\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className={cx('Form-radio', className)}\n checked={checked}\n disabled={disabled}\n id={id}\n name={name}\n onChange={onChange}\n type=\"radio\"\n value={value}\n {...props}\n />\n <Label className={labelClassName} htmlFor={id} style={labelStyle}>\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n </>\n );\n};\n\nexport { Radio };\nexport type { RadioProps };\n", "import { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { Children, cloneElement, isValidElement, useRef } from 'react';\n\nimport { Label } from './Label';\nimport { Radio } from './Radio';\nimport './styles/Form.css';\n\ntype RadioGroupProps = {\n /**\n * The legend that describes this groups of radio buttons. The legend\n * is important for screen reader users.\n */\n legend?: string;\n /**\n * The children passed into the RadioGroup.\n */\n children?: React.ReactNode;\n /**\n * Custom classname(s) passed to the fieldset inner div.\n */\n className?: string;\n /**\n * Set the underlying Radio to disabled if the Radio's disabled prop is undefined.\n */\n disabled?: boolean;\n /**\n * The RadioGroup's id.\n */\n id?: string;\n /**\n * 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.\n */\n name: string;\n /**\n * This function is passed into each Radio onChange synthetic event handler.\n */\n onChange?(e: React.ChangeEvent | React.FormEvent<HTMLInputElement>): void;\n /**\n * The value to compare against the Radio's value to determine if the Radio will be checked.\n */\n value: string;\n};\n\nconst RadioGroup = (props: RadioGroupProps) => {\n const { name, value, onChange, children, disabled, legend, ...other } = props;\n const fieldsetRef = useRef<HTMLFieldSetElement>(null);\n\n function updateRadioElems(elem: React.ReactNode): React.ReactNode {\n if (!isValidElement(elem)) {\n return elem;\n }\n\n const item = elem as React.ReactElement;\n\n if (item?.type && item.type === Radio) {\n return cloneElement(item, {\n ...item.props,\n name,\n checked: item.props.value === value,\n onChange,\n disabled: typeof item.props?.disabled !== 'undefined' ? item.props.disabled : disabled,\n });\n }\n\n if (item?.type && item.type === Label) {\n return cloneElement(item, {\n ...item.props,\n onChange,\n disabled,\n });\n }\n\n const elemChildren = item?.props?.children;\n if (elemChildren) {\n if (Array.isArray(elemChildren)) {\n return cloneElement(item, {\n children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n });\n }\n return cloneElement(item, {\n children: updateRadioElems(elemChildren),\n });\n }\n\n if (item?.type && item.type !== Radio && item.type !== Label) {\n return item;\n }\n\n return null;\n }\n\n const radios = Children.map(children, (child) => updateRadioElems(child));\n return (\n <fieldset ref={fieldsetRef}>\n {legend && (\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n )}\n <div {...other}>{radios}</div>\n </fieldset>\n );\n};\n\nexport { RadioGroup };\nexport type { RadioGroupProps };\n", "import type { ChangeEvent, FocusEvent, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormInput.css';\n\ntype SelectProps = {\n children: ReactNode;\n className?: string;\n disabled?: boolean;\n id?: string;\n name?: string;\n onChange?(event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>): void;\n onBlur?(event: FocusEvent<HTMLSelectElement, HTMLElement>): void;\n testId?: string;\n value?: number | string;\n placeholder?: string;\n 'aria-label'?: string;\n};\n\nconst Select = ({ className, children, testId, ...rest }: SelectProps) => {\n const classes = cx('FormInput', 'FormInput-select', className);\n\n return (\n <select {...rest} className={classes} data-test-id={testId}>\n {children}\n </select>\n );\n};\n\nexport { Select };\nexport type { SelectProps };\n", "import type { TextareaHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(({ className, ...props }, ref) => {\n const onKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n e.key === 'ArrowRight' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft'\n ) {\n e.stopPropagation();\n }\n if (e.key === 'Escape') {\n e.nativeEvent.stopImmediatePropagation();\n }\n };\n\n return (\n <textarea\n {...props}\n className={cx('FormInput', className)}\n ref={ref}\n aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n onKeyDown={onKeyDown}\n />\n );\n});\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AO;AAqBH;AAhBJ,IAAM,eAAW,0BAA+C,CAAC,EAAE,cAAc,MAAM,GAAG,QAAQ;AAChG,QAAM,YAAY,CAAC,MAAgD;AACjE,QACE,EAAE,QAAQ,gBACV,EAAE,QAAQ,eACV,EAAE,QAAQ,aACV,EAAE,QAAQ,aACV;AACA,QAAE,gBAAgB;AAAA,IACpB;AACA,QAAI,EAAE,QAAQ,UAAU;AACtB,QAAE,YAAY,yBAAyB;AAAA,IACzC;AAAA,EACF;AAEA,SACE,4CAAC;AAAA,IACE,GAAG;AAAA,IACJ,eAAW,qBAAG,aAAa,SAAS;AAAA,IACpC;AAAA,IACA,oBAAkB,MAAM,uBAAuB,mBAAmB,MAAM,EAAE;AAAA,IAC1E;AAAA,GACF;AAEJ,CAAC;AAED,SAAS,cAAc;",
|
6
|
-
"names": ["import_classix", "import_Form", "import_classix", "import_react", "import_classix", "import_react", "import_FormInput", "value", "import_classix", "import_Form", "import_classix", "import_Form", "import_classix", "import_classix", "import_Form", "import_classix", "import_classix", "import_classix", "import_Form", "import_react", "import_Form", "import_classix", "import_FormInput", "import_classix", "import_react", "import_FormInput"]
|
7
|
-
}
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/RequiredAsterisk.tsx","../src/Label.tsx","../src/Checkbox.tsx","../src/utils/index.ts","../src/TextField.tsx","../src/CompactTextField.tsx","../src/FieldError.tsx","../src/FieldSet.tsx","../src/Form.tsx","../src/FormGroup.tsx","../src/FormHint.tsx","../src/FormField.tsx","../src/IconField.tsx","../src/Radio.tsx","../src/RadioGroup.tsx","../src/Select.tsx","../src/TextArea.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/RequiredAsterisk.css';\n\ntype RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement>;\n\nconst RequiredAsterisk = ({ className, ...rest }: RequiredAsteriskProps) => {\n const classes = cx('RequiredAsterisk', className);\n\n return (\n <span {...rest} className={classes}>\n *\n </span>\n );\n};\n\nexport { RequiredAsterisk };\nexport type { RequiredAsteriskProps };\n","import type { LabelHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\ntype LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n required?: boolean;\n optional?: boolean;\n disabled?: boolean;\n};\n\nconst Label = ({\n disabled,\n className,\n children,\n required = false,\n optional = false,\n ...rest\n}: LabelProps) => {\n const classes = cx('Form-label', className, disabled && 'Form-label--disabled');\n\n return (\n <label {...rest} className={classes}>\n {children}\n {optional && !required && <small className=\"Form-labelOptional\">(optional)</small>}\n {required && !optional && <RequiredAsterisk />}\n </label>\n );\n};\n\nexport { Label };\nexport type { LabelProps };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { forwardRef } from 'react';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {\n /**\n * The className to pass into the Checkbox's Label component\n */\n labelClassName?: string;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n disabled,\n checked,\n labelClassName,\n ...rest\n },\n ref\n ) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <Label className={labelClassName}>\n <input\n {...rest}\n ref={ref}\n checked={checked}\n aria-checked={checked ? 'true' : 'false'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className=\"Form-checkbox\"\n disabled={disabled}\n type=\"checkbox\"\n />{' '}\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n","type FieldPath = string | string[];\n\nconst createFieldErrorId = (fieldIdentifier?: FieldPath) =>\n fieldIdentifier ? `${[...fieldIdentifier].join('')}-err` : undefined;\n\nexport { createFieldErrorId };\nexport type { FieldPath };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n suffix?: string;\n tiny?: boolean;\n overrideWidth?: string;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n className,\n type = 'text',\n tiny = false,\n readOnly,\n tabIndex = 0,\n suffix,\n overrideWidth,\n ...rest\n },\n ref\n ) => {\n const classes = overrideWidth\n ? className\n : cx('FormInput', `FormInput-${type}`, className, tiny && 'FormInput--tiny');\n\n if (suffix) {\n return (\n <div className=\"FormInput-suffixContainer\">\n <input\n {...rest}\n type={type}\n className={cx(classes, 'FormInput-suffix')}\n readOnly={readOnly}\n ref={ref}\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n <label className=\"FormInput-suffix\" htmlFor={rest.id}>\n {suffix}\n </label>\n </div>\n );\n }\n\n return (\n <input\n {...rest}\n type={type}\n className={classes}\n readOnly={readOnly}\n tabIndex={tabIndex}\n ref={ref}\n style={\n overrideWidth\n ? {\n width: overrideWidth,\n }\n : undefined\n }\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n );\n }\n);\n\nTextField.displayName = 'TextField';\n\nexport { TextField };\nexport type { TextFieldProps };\n","import type { TextFieldProps } from './TextField';\nimport type { FocusEvent } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef, useState } from 'react';\n\nimport { Label } from './Label';\nimport { TextField } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n label: string;\n needsErrorFeedback?: boolean;\n};\n\nconst CompactTextField = forwardRef<HTMLInputElement, CompactTextFieldProps>(\n ({ className, id, label, needsErrorFeedback, value, onFocus, onBlur, ...rest }, ref) => {\n const [isActive, setIsActive] = useState(\n (typeof value === 'boolean' || value ? value.toString() : '').trim().length !== 0\n );\n\n const isActiveState = isActive || needsErrorFeedback;\n\n const classes = cx('CompactTextField', className, isActiveState && 'is-active');\n\n const placeholder = isActiveState ? '' : label;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setIsActive(true);\n if (onFocus) {\n onFocus(event);\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n const value = event.target.value || '';\n setIsActive(value.trim().length !== 0);\n if (onBlur) {\n onBlur(event);\n }\n };\n\n return (\n <div className={classes}>\n <Label htmlFor={id}>{label}</Label>\n <TextField\n {...rest}\n id={id}\n placeholder={placeholder}\n value={value}\n ref={ref}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </div>\n );\n }\n);\n\nCompactTextField.displayName = 'CompactTextField';\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n","import type { FieldPath } from './utils';\nimport type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\nimport { createFieldErrorId } from './utils';\n\ntype FieldErrorProps = HTMLAttributes<HTMLSpanElement> & {\n name: FieldPath;\n errorMessage?: string;\n};\n\nconst FieldError = ({ name, errorMessage, className, ...rest }: FieldErrorProps) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n <span\n {...rest}\n className={cx('Form-fieldError', className)}\n aria-live=\"polite\"\n id={createFieldErrorId(name)}\n >\n {`Error - ${errorMessage}`}\n </span>\n );\n};\n\nexport { FieldError };\nexport type { FieldErrorProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FieldSet.css';\n\ntype FieldSetProps = HTMLAttributes<HTMLFieldSetElement>;\n\nconst FieldSet = ({ children, className, ...rest }: FieldSetProps) => {\n const classes = cx('FieldSet', className);\n\n return (\n <fieldset className={classes} {...rest}>\n {children}\n </fieldset>\n );\n};\n\nexport { FieldSet };\nexport type { FieldSetProps };\n","import type { FormHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormProps = FormHTMLAttributes<HTMLFormElement> & {\n inline?: boolean;\n // Increases margin between form fields to make room for error messages.\n // This prevents the form from shifting when rendering a field error.\n // This may be desired when the form contains external links that will\n // shift while clicking if the form shifts from validation.\n hasIncreasedErrorMargin?: boolean;\n};\n\nconst Form = (props: FormProps) => {\n const { className, inline, children, hasIncreasedErrorMargin, ...rest } = props;\n\n const classes = cx(\n 'Form',\n className,\n inline && 'Form--inline',\n !!hasIncreasedErrorMargin && 'Form--increasedErrorMargin'\n );\n\n return (\n <form {...rest} className={classes}>\n {children}\n </form>\n );\n};\n\nexport { Form };\nexport type { FormProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormGroupProps = HTMLAttributes<HTMLDivElement> & {\n name?: string | string[];\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n};\n\nconst FormGroup = (props: FormGroupProps) => {\n const { className, name, ignoreValidation, isInvalid, children, ...rest } = props;\n\n const classes = cx('Form-group', className, !ignoreValidation && isInvalid && 'is-invalid');\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n );\n};\n\nexport { FormGroup };\nexport type { FormGroupProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormHint.css';\n\ntype FormHintProps = HTMLAttributes<HTMLDivElement>;\n\nconst FormHint = ({ className, children, ...rest }: FormHintProps) => {\n const classes = cx('Form-hint', className);\n\n return (\n <div {...rest} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { FormHint };\nexport type { FormHintProps };\n","import { cx } from 'classix';\n\nimport { FieldError } from './FieldError';\nimport { FormGroup } from './FormGroup';\nimport { FormHint } from './FormHint';\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/FormField.css';\n\ntype FormFieldProps = {\n isRequired: boolean;\n label?: string;\n name: string;\n htmlFor: string;\n hint?: string;\n errorMessage?: string;\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n children: JSX.Element;\n className?: string;\n onBlur?: (field: string) => void;\n 'data-test-id': string;\n};\n\nconst FormField = ({\n isRequired,\n label,\n name,\n htmlFor,\n hint,\n errorMessage,\n ignoreValidation,\n isInvalid,\n children,\n className,\n onBlur,\n 'data-test-id': testId,\n}: FormFieldProps) => {\n const handleBlur = () => {\n onBlur && onBlur(name);\n };\n\n return (\n <FormGroup\n className={cx('FormField', className)}\n name={name}\n ignoreValidation={ignoreValidation}\n isInvalid={isInvalid}\n onBlur={handleBlur}\n data-test-id={testId}\n >\n {label && (\n <label htmlFor={htmlFor}>\n {label}\n {isRequired && <RequiredAsterisk />}\n </label>\n )}\n {hint && <FormHint className=\"FormField-hint\">{hint}</FormHint>}\n {children}\n <FieldError className=\"FormField-errorMessage\" name={name} errorMessage={errorMessage} />\n </FormGroup>\n );\n};\n\nexport type { FormFieldProps };\nexport { FormField };\n","import type { IconProps } from '@launchpad-ui/icons';\nimport type { HTMLAttributes } from 'react';\n\nimport { IconSize } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\n\nimport './styles/IconField.css';\n\ntype IconFieldProps = HTMLAttributes<HTMLDivElement> & {\n icon(args: IconProps): JSX.Element;\n children: JSX.Element | JSX.Element[];\n};\n\nconst IconField = ({ icon, children, className, ...rest }: IconFieldProps) => {\n const Icon = icon;\n\n const classes = cx('IconField', className);\n\n return (\n <div className={classes} {...rest}>\n {children}\n <Icon size={IconSize.SMALL} />\n </div>\n );\n};\n\nexport { IconField };\nexport type { IconFieldProps };\n","import type { CSSProperties, InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n labelClassName?: string;\n labelStyle?: CSSProperties;\n};\n\nconst Radio = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n checked = false,\n children,\n className,\n disabled = false,\n id,\n labelClassName,\n labelStyle,\n ...rest\n}: RadioProps) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <>\n <input\n {...rest}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className={cx('Form-radio', className)}\n checked={checked}\n disabled={disabled}\n id={id}\n type=\"radio\"\n />\n <Label className={labelClassName} htmlFor={id} style={labelStyle}>\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n </>\n );\n};\n\nexport { Radio };\nexport type { RadioProps };\n","import type { ChangeEvent, FormEvent, ReactElement, ReactNode } from 'react';\n\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { Children, cloneElement, isValidElement, useRef } from 'react';\n\nimport { Label } from './Label';\nimport { Radio } from './Radio';\nimport './styles/Form.css';\n\ntype RadioGroupProps = {\n /**\n * The legend that describes this groups of radio buttons. The legend\n * is important for screen reader users.\n */\n legend?: string;\n /**\n * The children passed into the RadioGroup.\n */\n children?: ReactNode;\n /**\n * Custom classname(s) passed to the fieldset inner div.\n */\n className?: string;\n /**\n * Set the underlying Radio to disabled if the Radio's disabled prop is undefined.\n */\n disabled?: boolean;\n /**\n * The RadioGroup's id.\n */\n id?: string;\n /**\n * 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.\n */\n name: string;\n /**\n * This function is passed into each Radio onChange synthetic event handler.\n */\n onChange?(e: ChangeEvent | FormEvent<HTMLInputElement>): void;\n /**\n * The value to compare against the Radio's value to determine if the Radio will be checked.\n */\n value: string;\n};\n\nconst RadioGroup = (props: RadioGroupProps) => {\n const { name, value, onChange, children, disabled, legend, ...rest } = props;\n const fieldsetRef = useRef<HTMLFieldSetElement>(null);\n\n function updateRadioElems(elem: ReactNode): ReactNode {\n if (!isValidElement(elem)) {\n return elem;\n }\n\n const item = elem as ReactElement;\n\n if (item?.type && item.type === Radio) {\n return cloneElement(item, {\n ...item.props,\n name,\n checked: item.props.value === value,\n onChange,\n disabled: typeof item.props?.disabled !== 'undefined' ? item.props.disabled : disabled,\n });\n }\n\n if (item?.type && item.type === Label) {\n return cloneElement(item, {\n ...item.props,\n onChange,\n disabled,\n });\n }\n\n const elemChildren = item?.props?.children;\n if (elemChildren) {\n if (Array.isArray(elemChildren)) {\n return cloneElement(item, {\n children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n });\n }\n return cloneElement(item, {\n children: updateRadioElems(elemChildren),\n });\n }\n\n if (item?.type && item.type !== Radio && item.type !== Label) {\n return item;\n }\n\n return null;\n }\n\n const radios = Children.map(children, (child) => updateRadioElems(child));\n return (\n <fieldset ref={fieldsetRef}>\n {legend && (\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n )}\n <div {...rest}>{radios}</div>\n </fieldset>\n );\n};\n\nexport { RadioGroup };\nexport type { RadioGroupProps };\n","import type { SelectHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormInput.css';\n\ntype SelectProps = SelectHTMLAttributes<HTMLSelectElement>;\n\nconst Select = ({ className, children, ...rest }: SelectProps) => {\n const classes = cx('FormInput', 'FormInput-select', className);\n\n return (\n <select {...rest} className={classes}>\n {children}\n </select>\n );\n};\n\nexport { Select };\nexport type { SelectProps };\n","import type { KeyboardEvent, TextareaHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(({ className, ...props }, ref) => {\n const onKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n e.key === 'ArrowRight' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft'\n ) {\n e.stopPropagation();\n }\n if (e.key === 'Escape') {\n e.nativeEvent.stopImmediatePropagation();\n }\n };\n\n return (\n <textarea\n {...props}\n className={cx('FormInput', className)}\n ref={ref}\n aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n onKeyDown={onKeyDown}\n />\n );\n});\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],"names":["RequiredAsterisk","className","rest","classes","cx","Label","disabled","children","required","optional","_jsx","Checkbox","forwardRef","ariaLabel","ariaLabelledby","checked","labelClassName","ref","hasAriaLabel","undefined","console","warn","displayName","TextField","type","tiny","readOnly","tabIndex","suffix","overrideWidth","createFieldErrorId","id","width","CompactTextField","label","needsErrorFeedback","value","onFocus","onBlur","isActive","setIsActive","useState","toString","trim","length","isActiveState","placeholder","handleFocus","event","handleBlur","target","FieldError","name","errorMessage","FieldSet","Form","props","inline","hasIncreasedErrorMargin","FormGroup","ignoreValidation","isInvalid","FormHint","FormField","isRequired","htmlFor","hint","testId","_jsxs","IconField","icon","Icon","IconSize","SMALL","Radio","labelStyle","_Fragment","RadioGroup","onChange","legend","fieldsetRef","useRef","updateRadioElems","elem","isValidElement","item","cloneElement","elemChildren","Array","isArray","Children","map","elemChild","radios","child","VisuallyHidden","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;;;;AAQA,MAAMA,mBAAmB,CAAC;AAAA,EAAEC;AAAAA,KAAcC;AAAhB,MAAkD;AACpEC,QAAAA,UAAUC,QAAAA,GAAG,oBAAoBH,SAArB;AAElB;OACYC;AAAAA,IAAM,WAAWC;AAAAA,IAA3B,UAAA;AAAA,EAAA,CADF;AAKD;;ACHD,MAAME,QAAQ,CAAC;AAAA,EACbC;AAAAA,EACAL;AAAAA,EACAM;AAAAA,EACAC,WAAW;AAAA,EACXC,WAAW;AAAA,KACRP;AANU,MAOG;AAChB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U;AACtBD,QAAEG,YAAYC;IACf;AAAA,EAAA;AAGH;OAEQ/C;AAAAA,IACJ,WAAWpD,QAAAA,GAAG,aAAaH,SAAd;AAAA,IACb;AAAA,IACA,oBAAkBuD,MAAM,uBAAuB1B,mBAAmB0B,MAAMzB,EAAP;AAAA,IACjE;AAAA,EAAA,CANJ;AASD,CAxB0B;AA0B3BkE,SAAS3E,cAAc;;;;;;;;;;;;;;;;;"}
|
package/dist/style.css
ADDED
@@ -0,0 +1,402 @@
|
|
1
|
+
.RequiredAsterisk {
|
2
|
+
color: var(--color-system-red-700);
|
3
|
+
}
|
4
|
+
.Form-group {
|
5
|
+
margin: 2rem 0;
|
6
|
+
}
|
7
|
+
|
8
|
+
/* The margin for .Form-group and the min-height of .Form-fieldError
|
9
|
+
should be equal to avoid content shift when errors are shown */
|
10
|
+
|
11
|
+
.Form--increasedErrorMargin .Form-group {
|
12
|
+
margin: 2.8rem 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.Form--inline .Form-group {
|
16
|
+
display: inline-block;
|
17
|
+
vertical-align: middle;
|
18
|
+
margin: 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.Form .Form-group:first-child {
|
22
|
+
margin-top: 0;
|
23
|
+
}
|
24
|
+
|
25
|
+
.Form .Form-group:last-child {
|
26
|
+
margin-bottom: 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
.Form--inline .Form-group + .Form-group,
|
30
|
+
.Form--inline .Form-group + .Button {
|
31
|
+
margin-left: 1rem;
|
32
|
+
}
|
33
|
+
|
34
|
+
.Form-label {
|
35
|
+
font-size: 1.3rem;
|
36
|
+
font-family: var(--font-family-base);
|
37
|
+
word-break: break-word;
|
38
|
+
}
|
39
|
+
|
40
|
+
.Form-label--disabled {
|
41
|
+
color: var(--color-gray-800);
|
42
|
+
}
|
43
|
+
|
44
|
+
.Form-labelOptional {
|
45
|
+
margin-left: 0.4em;
|
46
|
+
color: var(--color-text-subtle-primary);
|
47
|
+
fill: var(--color-text-subtle-primary);
|
48
|
+
}
|
49
|
+
|
50
|
+
.Form-group .Form-label {
|
51
|
+
display: flex;
|
52
|
+
align-items: center;
|
53
|
+
margin-bottom: 0.2rem;
|
54
|
+
}
|
55
|
+
|
56
|
+
.u-d-inline .Form-label + .Form-label {
|
57
|
+
margin-left: 1rem;
|
58
|
+
}
|
59
|
+
|
60
|
+
.Form-group .Form-label + .Form-label {
|
61
|
+
margin-top: 0.5rem;
|
62
|
+
}
|
63
|
+
|
64
|
+
.Form .Form-error {
|
65
|
+
background: var(--color-system-red-600);
|
66
|
+
color: var(--color-white);
|
67
|
+
font-weight: var(--font-weight-regular);
|
68
|
+
padding: 0.7rem 1.4rem;
|
69
|
+
border-radius: var(--border-radius);
|
70
|
+
}
|
71
|
+
|
72
|
+
.Form-fieldError {
|
73
|
+
color: var(--color-system-red-600);
|
74
|
+
font-size: 1.3rem;
|
75
|
+
}
|
76
|
+
|
77
|
+
/* The margin for .Form-group and the min-height of .Form-fieldError
|
78
|
+
should be equal to avoid content shift when errors are shown */
|
79
|
+
|
80
|
+
.Form--increasedErrorMargin .Form-fieldError {
|
81
|
+
min-height: 2.8rem;
|
82
|
+
}
|
83
|
+
|
84
|
+
.Form-label .Form-fieldError {
|
85
|
+
float: right;
|
86
|
+
}
|
87
|
+
|
88
|
+
.Form:not(.Form--inline) .Form-fieldError {
|
89
|
+
display: block;
|
90
|
+
padding-top: 0.5rem;
|
91
|
+
text-align: left;
|
92
|
+
}
|
93
|
+
|
94
|
+
.Form--increasedErrorMargin:not(.Form--inline) .Form-fieldError {
|
95
|
+
padding-top: 0.1rem;
|
96
|
+
padding-bottom: 0.5rem;
|
97
|
+
}
|
98
|
+
|
99
|
+
.Form .is-invalid .Form-label {
|
100
|
+
color: var(--color-system-red-600);
|
101
|
+
}
|
102
|
+
|
103
|
+
::-moz-placeholder {
|
104
|
+
color: var(--color-gray-600);
|
105
|
+
}
|
106
|
+
|
107
|
+
::placeholder {
|
108
|
+
color: var(--color-gray-600);
|
109
|
+
}
|
110
|
+
|
111
|
+
.Form .is-invalid .Select-control,
|
112
|
+
.Form .is-invalid .CustomSelect > div,
|
113
|
+
.Form .is-invalid .FormInput {
|
114
|
+
border-color: var(--color-system-red-600);
|
115
|
+
}
|
116
|
+
|
117
|
+
.Form--increasedErrorMargin .Form-group.is-invalid {
|
118
|
+
margin-bottom: 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
.Form--increasedErrorMargin .Form-group.is-invalid + .Form-group {
|
122
|
+
margin-top: 0;
|
123
|
+
}
|
124
|
+
|
125
|
+
.Form--increasedErrorMargin .Form-group.is-invalid + .Form-hint {
|
126
|
+
margin-top: 0;
|
127
|
+
}
|
128
|
+
/* stylelint-disable no-descending-specificity */
|
129
|
+
|
130
|
+
.FormInput {
|
131
|
+
display: block;
|
132
|
+
width: 100%;
|
133
|
+
padding: 0.6rem 1rem;
|
134
|
+
font-size: 1.3rem;
|
135
|
+
font-family: var(--font-family-base);
|
136
|
+
line-height: var(--line-height-base);
|
137
|
+
background-color: var(--color-background-field);
|
138
|
+
color: var(--color-text);
|
139
|
+
border: 1px solid var(--color-gray-500);
|
140
|
+
border-radius: var(--border-radius);
|
141
|
+
transition: all 100ms linear;
|
142
|
+
}
|
143
|
+
|
144
|
+
.FormInput:-moz-placeholder-shown {
|
145
|
+
overflow: hidden;
|
146
|
+
text-overflow: ellipsis;
|
147
|
+
}
|
148
|
+
|
149
|
+
.FormInput:placeholder-shown {
|
150
|
+
overflow: hidden;
|
151
|
+
text-overflow: ellipsis;
|
152
|
+
}
|
153
|
+
|
154
|
+
input.FormInput,
|
155
|
+
select.FormInput {
|
156
|
+
height: 3.2rem;
|
157
|
+
}
|
158
|
+
|
159
|
+
input.FormInput:-moz-read-only {
|
160
|
+
background-color: var(--color-white-100);
|
161
|
+
}
|
162
|
+
|
163
|
+
.FormInput.is-disabled,
|
164
|
+
input.FormInput:disabled,
|
165
|
+
select.FormInput:disabled,
|
166
|
+
input.FormInput:read-only {
|
167
|
+
background-color: var(--color-white-100);
|
168
|
+
}
|
169
|
+
|
170
|
+
.FormInput.is-disabled:hover,
|
171
|
+
.FormInput:disabled:hover {
|
172
|
+
cursor: not-allowed;
|
173
|
+
}
|
174
|
+
|
175
|
+
textarea.FormInput {
|
176
|
+
min-height: 2.5em;
|
177
|
+
resize: none;
|
178
|
+
}
|
179
|
+
|
180
|
+
textarea.FormInput:-moz-read-only {
|
181
|
+
background-color: var(--color-white-100);
|
182
|
+
}
|
183
|
+
|
184
|
+
textarea.FormInput:disabled,
|
185
|
+
textarea.FormInput:read-only {
|
186
|
+
background-color: var(--color-white-100);
|
187
|
+
}
|
188
|
+
|
189
|
+
input.FormInput::-webkit-autofill {
|
190
|
+
box-shadow: 0 0 0 50px var(--color-background-field) inset;
|
191
|
+
}
|
192
|
+
|
193
|
+
/* Hide the type=search cancel button in Webkit for consistency */
|
194
|
+
|
195
|
+
input[type='search']::-webkit-search-decoration,
|
196
|
+
input[type='search']::-webkit-search-cancel-button,
|
197
|
+
input[type='search']::-webkit-search-results-button,
|
198
|
+
input[type='search']::-webkit-search-results-decoration {
|
199
|
+
display: none;
|
200
|
+
}
|
201
|
+
|
202
|
+
/* Hide the type=search cancel button in IE for consistency */
|
203
|
+
|
204
|
+
input[type='text']::-ms-clear,
|
205
|
+
input[type='text']::-ms-reveal {
|
206
|
+
display: none;
|
207
|
+
width: 0;
|
208
|
+
height: 0;
|
209
|
+
}
|
210
|
+
|
211
|
+
input[type='search']::-ms-clear,
|
212
|
+
input[type='search']::-ms-reveal {
|
213
|
+
display: none;
|
214
|
+
width: 0;
|
215
|
+
height: 0;
|
216
|
+
}
|
217
|
+
|
218
|
+
input[type='checkbox']:disabled {
|
219
|
+
pointer-events: none;
|
220
|
+
}
|
221
|
+
|
222
|
+
input.FormInput--tiny {
|
223
|
+
padding: 0.1rem 0.6rem;
|
224
|
+
height: 2.4rem;
|
225
|
+
}
|
226
|
+
|
227
|
+
.FormInput.is-focused,
|
228
|
+
.FormInput:focus {
|
229
|
+
outline: 0;
|
230
|
+
border-color: var(--color-focus);
|
231
|
+
box-shadow: 0 0 0 3px hsla(231.5, 100%, 62.5%, 0.1);
|
232
|
+
}
|
233
|
+
|
234
|
+
.FormInput[readonly],
|
235
|
+
.FormInput[readonly]:focus {
|
236
|
+
color: var(--color-text-subtle-primary);
|
237
|
+
border-color: var(--color-gray-500);
|
238
|
+
box-shadow: none;
|
239
|
+
}
|
240
|
+
|
241
|
+
.Form-checkbox {
|
242
|
+
align-self: flex-start; /* Default for .Form-label is center, but this looks bad on multi-line checkbox labels */
|
243
|
+
flex-shrink: 0; /* Make sure the input itself doesn't shrink in flex layouts */
|
244
|
+
margin-right: 0.5rem;
|
245
|
+
margin-top: 0.4rem;
|
246
|
+
}
|
247
|
+
|
248
|
+
.Form-radio {
|
249
|
+
margin-right: 0.5rem;
|
250
|
+
}
|
251
|
+
|
252
|
+
.FormInput-select {
|
253
|
+
-webkit-appearance: none;
|
254
|
+
-moz-appearance: none;
|
255
|
+
appearance: none;
|
256
|
+
background: transparent;
|
257
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.84L12 13.42l4.59-4.58L18 10.25l-6 6-6-6 1.41-1.41z" fill="%23646f7a"/></svg>');
|
258
|
+
background-size: 2rem;
|
259
|
+
background-repeat: no-repeat;
|
260
|
+
background-position: right 0.4em top 50%, 0 0;
|
261
|
+
padding-right: 2rem;
|
262
|
+
}
|
263
|
+
|
264
|
+
.FormInput-number {
|
265
|
+
min-width: 4.5rem;
|
266
|
+
}
|
267
|
+
|
268
|
+
.FormInput-suffixContainer {
|
269
|
+
display: inline-flex;
|
270
|
+
border: 1px solid var(--color-gray-500);
|
271
|
+
border-radius: var(--border-radius);
|
272
|
+
overflow: hidden;
|
273
|
+
transition: all 0.1s linear;
|
274
|
+
}
|
275
|
+
|
276
|
+
.FormInput-suffixContainer[focus-within] {
|
277
|
+
border-color: var(--color-focus);
|
278
|
+
box-shadow: 0 0 0 3px hsla(231.5, 100%, 62.5%, 0.1);
|
279
|
+
}
|
280
|
+
|
281
|
+
.FormInput-suffixContainer[focus-within] {
|
282
|
+
border-color: var(--color-focus);
|
283
|
+
box-shadow: 0 0 0 3px hsla(231.5, 100%, 62.5%, 0.1);
|
284
|
+
}
|
285
|
+
|
286
|
+
.FormInput-suffixContainer:focus-within {
|
287
|
+
border-color: var(--color-focus);
|
288
|
+
box-shadow: 0 0 0 3px hsla(231.5, 100%, 62.5%, 0.1);
|
289
|
+
}
|
290
|
+
|
291
|
+
.FormInput-suffixContainer .FormInput {
|
292
|
+
border: none;
|
293
|
+
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
294
|
+
}
|
295
|
+
|
296
|
+
.FormInput-suffixContainer .FormInput:focus {
|
297
|
+
box-shadow: none;
|
298
|
+
}
|
299
|
+
|
300
|
+
.FormInput-suffixContainer label.FormInput-suffix {
|
301
|
+
padding: 0 2px;
|
302
|
+
background-color: var(--color-gray-100);
|
303
|
+
color: var(--color-gray-500);
|
304
|
+
cursor: text;
|
305
|
+
display: inline-flex;
|
306
|
+
align-items: center;
|
307
|
+
position: static;
|
308
|
+
position: initial;
|
309
|
+
}
|
310
|
+
|
311
|
+
input.FormInput-suffix::-webkit-outer-spin-button,
|
312
|
+
input.FormInput-suffix::-webkit-inner-spin-button {
|
313
|
+
-webkit-appearance: none;
|
314
|
+
appearance: none;
|
315
|
+
margin: 0;
|
316
|
+
}
|
317
|
+
|
318
|
+
/* Firefox */
|
319
|
+
|
320
|
+
input.FormInput-suffix[type='number'] {
|
321
|
+
-webkit-appearance: textfield;
|
322
|
+
-moz-appearance: textfield;
|
323
|
+
appearance: textfield;
|
324
|
+
}
|
325
|
+
|
326
|
+
/* stylelint-enable no-descending-specificity */
|
327
|
+
.CompactTextField {
|
328
|
+
position: relative;
|
329
|
+
width: 100%;
|
330
|
+
}
|
331
|
+
|
332
|
+
.CompactTextField .Form-label {
|
333
|
+
position: absolute;
|
334
|
+
top: -2px;
|
335
|
+
left: 10px;
|
336
|
+
padding: 0 3px;
|
337
|
+
color: var(--color-text);
|
338
|
+
opacity: 0;
|
339
|
+
pointer-events: none;
|
340
|
+
background-color: var(--color-background);
|
341
|
+
transform-origin: 0 0; /* preserve left alignment after scaling */
|
342
|
+
transition: all 100ms ease-in-out;
|
343
|
+
z-index: 1; /* Fixes layout issue in Firefox */
|
344
|
+
}
|
345
|
+
|
346
|
+
.CompactTextField.is-active .Form-label {
|
347
|
+
border-radius: var(--border-radius);
|
348
|
+
opacity: 1;
|
349
|
+
pointer-events: auto;
|
350
|
+
transform: translate(0, -8px) scale(0.9); /* 2d transform to avoid webkit blurry text */
|
351
|
+
}
|
352
|
+
.FieldSet {
|
353
|
+
border: none;
|
354
|
+
margin: 2rem 0;
|
355
|
+
padding: 0;
|
356
|
+
}
|
357
|
+
.Form-hint {
|
358
|
+
display: block;
|
359
|
+
margin-top: 0.3rem;
|
360
|
+
font-size: 1.3rem;
|
361
|
+
font-weight: var(--font-weight-regular);
|
362
|
+
color: var(--color-text-subtle-primary);
|
363
|
+
}
|
364
|
+
.FormField-hint {
|
365
|
+
margin: 0;
|
366
|
+
font-size: 1.3rem;
|
367
|
+
color: var(--color-text-subtle-primary);
|
368
|
+
fill: var(--color-text-subtle-primary);
|
369
|
+
}
|
370
|
+
|
371
|
+
.Form .FormField .Form-label,
|
372
|
+
.Form .FormField .is-invalid .Form-label {
|
373
|
+
color: var(--color-text);
|
374
|
+
}
|
375
|
+
|
376
|
+
.FormField-errorMessage {
|
377
|
+
color: var(--color-system-red-600);
|
378
|
+
font-size: 1.3rem;
|
379
|
+
}
|
380
|
+
|
381
|
+
.FormField.Form-group {
|
382
|
+
margin: 1rem 0;
|
383
|
+
}
|
384
|
+
|
385
|
+
.FormField.Form-group:first-child {
|
386
|
+
margin-top: 0;
|
387
|
+
}
|
388
|
+
.IconField {
|
389
|
+
position: relative;
|
390
|
+
}
|
391
|
+
|
392
|
+
.IconField .FormInput {
|
393
|
+
padding-left: 3rem;
|
394
|
+
}
|
395
|
+
|
396
|
+
.FormInput ~ .Icon {
|
397
|
+
position: absolute;
|
398
|
+
fill: var(--color-gray-600);
|
399
|
+
top: 50%;
|
400
|
+
transform: translateY(-50%);
|
401
|
+
left: 1rem;
|
402
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@launchpad-ui/form",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.5.1-alpha.0",
|
4
4
|
"status": "beta",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -22,11 +22,11 @@
|
|
22
22
|
"require": "./dist/index.js"
|
23
23
|
},
|
24
24
|
"./package.json": "./package.json",
|
25
|
-
"./
|
25
|
+
"./style.css": "./dist/style.css"
|
26
26
|
},
|
27
27
|
"source": "src/index.ts",
|
28
28
|
"dependencies": {
|
29
|
-
"@launchpad-ui/icons": "~0.
|
29
|
+
"@launchpad-ui/icons": "~0.4.1-alpha.0",
|
30
30
|
"@launchpad-ui/tokens": "~0.1.5",
|
31
31
|
"@react-aria/visually-hidden": "^3.4.0",
|
32
32
|
"classix": "^2.1.13"
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"react-dom": "^18.2.0"
|
41
41
|
},
|
42
42
|
"scripts": {
|
43
|
-
"build": "tsc --project tsconfig.build.json
|
43
|
+
"build": "vite build -c ../../vite.config.ts && tsc --project tsconfig.build.json",
|
44
44
|
"clean": "rm -rf dist",
|
45
45
|
"e2e": "playwright test --config=../../playwright.config.ct.ts",
|
46
46
|
"lint": "eslint '**/*.{ts,tsx,js}' && stylelint '**/*.css' --ignore-path ../../.stylelintignore",
|
package/dist/InputGroup.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { ComponentPropsWithRef } from 'react';
|
2
|
-
import './styles/InputGroup.css';
|
3
|
-
declare type InputGroupProps = ComponentPropsWithRef<'div'>;
|
4
|
-
declare const InputGroup: ({ className, children, ...other }: InputGroupProps) => JSX.Element;
|
5
|
-
export { InputGroup };
|
6
|
-
export type { InputGroupProps };
|
7
|
-
//# sourceMappingURL=InputGroup.d.ts.map
|
package/dist/InputGroup.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
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,QAAA,MAAM,UAAU,sCAAuC,eAAe,gBAQrE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
.CompactTextField{width:100%;position:relative}.CompactTextField .Form-label{color:var(--color-text);opacity:0;pointer-events:none;background-color:var(--color-background);transform-origin:0 0;z-index:1;padding:0 3px;transition:all .1s ease-in-out;position:absolute;top:-2px;left:10px}.CompactTextField.is-active .Form-label{border-radius:var(--border-radius);opacity:1;pointer-events:auto;transform:matrix(.9,0,0,.9,0,-8)}
|
2
|
-
/*# sourceMappingURL=CompactTextField.css.map */
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,+CAKA,8OAcA","sources":["src/styles/CompactTextField.css"],"sourcesContent":[".CompactTextField {\n position: relative;\n width: 100%;\n}\n\n.CompactTextField .Form-label {\n position: absolute;\n top: -2px;\n left: 10px;\n padding: 0 3px;\n color: var(--color-text);\n opacity: 0;\n pointer-events: none;\n background-color: var(--color-background);\n transform-origin: 0 0; /* preserve left alignment after scaling */\n transition: all 100ms ease-in-out;\n z-index: 1; /* Fixes layout issue in Firefox */\n}\n\n.CompactTextField.is-active .Form-label {\n border-radius: var(--border-radius);\n opacity: 1;\n pointer-events: auto;\n transform: translate(0, -8px) scale(0.9); /* 2d transform to avoid webkit blurry text */\n}\n"],"names":[]}
|
package/dist/styles/FieldSet.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA","sources":["src/styles/FieldSet.css"],"sourcesContent":[".FieldSet {\n border: none;\n margin: 2rem 0;\n padding: 0;\n}\n"],"names":[]}
|
package/dist/styles/Form.css
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
.Form-group{margin:2rem 0}.Form--increasedErrorMargin .Form-group{margin:2.8rem 0}.Form--inline .Form-group{vertical-align:middle;margin:0;display:inline-block}.Form .Form-group:first-child{margin-top:0}.Form .Form-group:last-child{margin-bottom:0}.Form--inline .Form-group+.Form-group,.Form--inline .Form-group+.Button{margin-left:1rem}.Form-label{font-size:1.3rem;font-family:var(--font-family-base);word-break:break-word}.Form-label--disabled{color:var(--color-gray-800)}.Form-labelOptional{color:var(--color-text-subtle-primary);fill:var(--color-text-subtle-primary);margin-left:.4em}.Form-group .Form-label{align-items:center;margin-bottom:.2rem;display:flex}.u-d-inline .Form-label+.Form-label{margin-left:1rem}.Form-group .Form-label+.Form-label{margin-top:.5rem}.Form .Form-error{background:var(--color-system-red-600);color:var(--color-white);font-weight:var(--font-weight-regular);border-radius:var(--border-radius);padding:.7rem 1.4rem}.Form-fieldError{color:var(--color-system-red-600);font-size:1.3rem}.Form--increasedErrorMargin .Form-fieldError{min-height:2.8rem}.Form-label .Form-fieldError{float:right}.Form:not(.Form--inline) .Form-fieldError{text-align:left;padding-top:.5rem;display:block}.Form--increasedErrorMargin:not(.Form--inline) .Form-fieldError{padding-top:.1rem;padding-bottom:.5rem}.Form .is-invalid .Form-label{color:var(--color-system-red-600)}::placeholder{color:var(--color-gray-600)}.Form .is-invalid .Select-control,.Form .is-invalid .CustomSelect>div,.Form .is-invalid .FormInput{border-color:var(--color-system-red-600)}.Form--increasedErrorMargin .Form-group.is-invalid{margin-bottom:0}.Form--increasedErrorMargin .Form-group.is-invalid+.Form-group,.Form--increasedErrorMargin .Form-group.is-invalid+.Form-hint{margin-top:0}
|
2
|
-
/*# sourceMappingURL=Form.css.map */
|
package/dist/styles/Form.css.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,0BAMA,wDAIA,8EAMA,2CAIA,6CAIA,yFAKA,uFAMA,kDAIA,kHAMA,4EAMA,qDAIA,qDAIA,iLAQA,oEAOA,+DAIA,yCAIA,0FAMA,uGAKA,gEAIA,0CAIA,4IAMA,mEAIA","sources":["src/styles/Form.css"],"sourcesContent":[".Form-group {\n margin: 2rem 0;\n}\n\n/* The margin for .Form-group and the min-height of .Form-fieldError\n should be equal to avoid content shift when errors are shown */\n.Form--increasedErrorMargin .Form-group {\n margin: 2.8rem 0;\n}\n\n.Form--inline .Form-group {\n display: inline-block;\n vertical-align: middle;\n margin: 0;\n}\n\n.Form .Form-group:first-child {\n margin-top: 0;\n}\n\n.Form .Form-group:last-child {\n margin-bottom: 0;\n}\n\n.Form--inline .Form-group + .Form-group,\n.Form--inline .Form-group + .Button {\n margin-left: 1rem;\n}\n\n.Form-label {\n font-size: 1.3rem;\n font-family: var(--font-family-base);\n word-break: break-word;\n}\n\n.Form-label--disabled {\n color: var(--color-gray-800);\n}\n\n.Form-labelOptional {\n margin-left: 0.4em;\n color: var(--color-text-subtle-primary);\n fill: var(--color-text-subtle-primary);\n}\n\n.Form-group .Form-label {\n display: flex;\n align-items: center;\n margin-bottom: 0.2rem;\n}\n\n.u-d-inline .Form-label + .Form-label {\n margin-left: 1rem;\n}\n\n.Form-group .Form-label + .Form-label {\n margin-top: 0.5rem;\n}\n\n.Form .Form-error {\n background: var(--color-system-red-600);\n color: var(--color-white);\n font-weight: var(--font-weight-regular);\n padding: 0.7rem 1.4rem;\n border-radius: var(--border-radius);\n}\n\n.Form-fieldError {\n color: var(--color-system-red-600);\n font-size: 1.3rem;\n}\n\n/* The margin for .Form-group and the min-height of .Form-fieldError\n should be equal to avoid content shift when errors are shown */\n.Form--increasedErrorMargin .Form-fieldError {\n min-height: 2.8rem;\n}\n\n.Form-label .Form-fieldError {\n float: right;\n}\n\n.Form:not(.Form--inline) .Form-fieldError {\n display: block;\n padding-top: 0.5rem;\n text-align: left;\n}\n\n.Form--increasedErrorMargin:not(.Form--inline) .Form-fieldError {\n padding-top: 0.1rem;\n padding-bottom: 0.5rem;\n}\n\n.Form .is-invalid .Form-label {\n color: var(--color-system-red-600);\n}\n\n::placeholder {\n color: var(--color-gray-600);\n}\n\n.Form .is-invalid .Select-control,\n.Form .is-invalid .CustomSelect > div,\n.Form .is-invalid .FormInput {\n border-color: var(--color-system-red-600);\n}\n\n.Form--increasedErrorMargin .Form-group.is-invalid {\n margin-bottom: 0;\n}\n\n.Form--increasedErrorMargin .Form-group.is-invalid + .Form-group {\n margin-top: 0;\n}\n\n.Form--increasedErrorMargin .Form-group.is-invalid + .Form-hint {\n margin-top: 0;\n}\n"],"names":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
.FormField-hint{color:var(--color-text-subtle-primary);fill:var(--color-text-subtle-primary);margin:0;font-size:1.3rem}.Form .FormField .Form-label,.Form .FormField .is-invalid .Form-label{color:var(--color-text)}.FormField-errorMessage{color:var(--color-system-red-600);font-size:1.3rem}.FormField.Form-group{margin:1rem 0}.FormField.Form-group:first-child{margin-top:0}
|
2
|
-
/*# sourceMappingURL=FormField.css.map */
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA,uHAOA,8FAKA,2EAKA,oCAIA","sources":["src/styles/FormField.css"],"sourcesContent":[".FormField-hint {\n margin: 0;\n font-size: 1.3rem;\n color: var(--color-text-subtle-primary);\n fill: var(--color-text-subtle-primary);\n}\n\n.Form .FormField .Form-label,\n.Form .FormField .is-invalid .Form-label {\n color: var(--color-text);\n}\n\n.FormField-errorMessage {\n color: var(--color-system-red-600);\n font-size: 1.3rem;\n}\n\n.FormField.Form-group {\n margin: 1rem 0;\n}\n\n.FormField.Form-group:first-child {\n margin-top: 0;\n}\n"],"names":[]}
|
package/dist/styles/FormHint.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sourceRoot":null,"mappings":"AAAA","sources":["src/styles/FormHint.css"],"sourcesContent":[".Form-hint {\n display: block;\n margin-top: 0.3rem;\n font-size: 1.3rem;\n font-weight: var(--font-weight-regular);\n color: var(--color-text-subtle-primary);\n}\n"],"names":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
.FormInput{width:100%;font-size:1.3rem;font-family:var(--font-family-base);line-height:var(--line-height-base);background-color:var(--color-background-field);color:var(--color-text);border:1px solid var(--color-gray-500);border-radius:var(--border-radius);padding:.6rem 1rem;transition:all .1s linear;display:block}.FormInput:placeholder-shown{text-overflow:ellipsis;overflow:hidden}input.FormInput,select.FormInput{height:3.2rem}.FormInput.is-disabled,input.FormInput:disabled,select.FormInput:disabled,input.FormInput:read-only{background-color:var(--color-white-100)}.FormInput.is-disabled:hover,.FormInput:disabled:hover{cursor:not-allowed}textarea.FormInput{min-height:2.5em;resize:none}textarea.FormInput:disabled,textarea.FormInput:read-only{background-color:var(--color-white-100)}input.FormInput::-webkit-autofill{box-shadow:0 0 0 50px var(--color-background-field)inset}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{width:0;height:0;display:none}input[type=search]::-ms-clear,input[type=search]::-ms-reveal{width:0;height:0;display:none}input[type=checkbox]:disabled{pointer-events:none}input.FormInput--tiny{height:2.4rem;padding:.1rem .6rem}.FormInput.is-focused,.FormInput:focus{border-color:var(--color-focus);outline:0;box-shadow:0 0 0 3px #405bff1a}.FormInput[readonly],.FormInput[readonly]:focus{color:var(--color-text-subtle-primary);border-color:var(--color-gray-500);box-shadow:none}.Form-checkbox{flex-shrink:0;align-self:flex-start;margin-top:.4rem;margin-right:.5rem}.Form-radio{margin-right:.5rem}.FormInput-select{-webkit-appearance:none;appearance:none;background-color:#0000;background-image:url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7.41 8.84L12 13.42l4.59-4.58L18 10.25l-6 6-6-6 1.41-1.41z\" fill=\"%23646f7a\"/></svg>");background-position:right .4em top 50%,0 0;background-repeat:no-repeat;background-size:2rem;background-attachment:scroll;background-origin:padding-box;background-clip:border-box;padding-right:2rem}.FormInput-number{min-width:4.5rem}.FormInput-suffixContainer{border:1px solid var(--color-gray-500);border-radius:var(--border-radius);transition:all .1s linear;display:inline-flex;overflow:hidden}.FormInput-suffixContainer:focus-within{border-color:var(--color-focus);box-shadow:0 0 0 3px #405bff1a}.FormInput-suffixContainer .FormInput{border-radius:var(--border-radius)0 0 var(--border-radius);border:none}.FormInput-suffixContainer .FormInput:focus{box-shadow:none}.FormInput-suffixContainer label.FormInput-suffix{background-color:var(--color-gray-100);color:var(--color-gray-500);cursor:text;position:initial;align-items:center;padding:0 2px;display:inline-flex}input.FormInput-suffix::-webkit-outer-spin-button,input.FormInput-suffix::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}input.FormInput-suffix[type=number]{-webkit-appearance:textfield;appearance:textfield}
|
2
|
-
/*# sourceMappingURL=FormInput.css.map */
|