dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
106 lines (105 loc) • 9.54 kB
TypeScript
import { InputBaseElement } from './input-base-element';
/**
* `dap-ds-input`
* @summary An input is a field used to collect user input.
* @element dap-ds-input
* @title - Input
*
* @property {string} label - The label of the input.
* @property {boolean} hideLabel - Visually hides the label while keeping it available to assistive technology. (default: false)
* @property {string} description - The description of the input.
* @property {string} optionalLabel - Text of optional label.
* @property {string} requiredLabel - Text of required indicator. (default: '*')
* @property {boolean} subtle - Text weight of label. If true the label is subtle. Default value is false.
* @property {string} value - The value of the input.
* @property {string} placeholder - The placeholder of the input.
* @property {boolean} loading - The loading state of the input. Default is false.
* @property {string} tooltip - The tooltip of the input.
* @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The tooltip placement of the input.
* @property {string} tooltipAriaLabel - The aria label of the tooltip.
* @property {string} feedback - The feedback of the input.
* @property {'negative' | 'positive' | 'warning'} feedbackType - The feedback type of the input. Can be `negative`, `positive`, or `warning`.
* @property {'succes' | 'error'} status - The status of the input. Can be `success` or `error`.
* @property {'xs' | 'sm' | 'lg'} size - The size of the input. Default is `sm`.
* @property {string} sizeMap - Responsive size map (e.g. "xs:lg").
* @property {string} name - The name of the input.
* @property {'text' | 'number' | 'button' | 'color' | 'email' | 'hidden' | 'reset' | 'submit' | 'url' | 'password'| 'file' | 'time'} type - The type of the input. Default is 'text'.
* @property {boolean} disabled - The disabled state of the input. Default is false.
* @property {boolean} required - The required state of the input. Default is false.
* @property {boolean} readonly - The readonly state of the input. Default is false.
* @property {boolean} autofocus - The autofocus state of the input. Default is false.
* @property {boolean} autocapitalize - The autocapitalize state of the input. Default is false.
* @property {number} minlength - The minimum length of the input.
* @property {number} maxlength - The maximum length of the input.
* @property {number} min - The minimum value of the number input.
* @property {number} max - The maximum value of the number input.
* @property {number} step - The step value of the number input.
* @property {string} inputmode - The inputmode of the input.
* @property {string} pattern - The regex pattern of the input.
*
* @cssproperty --dds-input-height-xs - The height of the extra small input. (default: var(--dds-spacing-800)).
* @cssproperty --dds-input-height-sm - The height of the small input. (default: var(--dds-spacing-1000)).
* @cssproperty --dds-input-height-lg - The height of the large input. (default: var(--dds-spacing-1200)).
* @cssproperty --dds-input-padding-xs - The padding of the extra small input. (default: 0 var(--dds-spacing-200)).
* @cssproperty --dds-input-padding-sm - The padding of the small input. (default: 0 var(--dds-spacing-300)).
* @cssproperty --dds-input-padding-lg - The padding of the large input. (default: 0 var(--dds-spacing-400)).
* @cssproperty --dds-input-font-size-xs - The font size of the extra small input. (default: var(--dds-font-sm)).
* @cssproperty --dds-input-font-size-sm - The font size of the small input. (default: var(--dds-font-base)).
* @cssproperty --dds-input-font-size-lg - The font size of the large input. (default: var(--dds-font-lg)).
* @cssproperty --dds-input-border - The border of the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).
* @cssproperty --dds-input-background - The background color of the input. (default: var(--dds-fields-background-default)).
* @cssproperty --dds-input-text-color - The text color of the input. (default: var(--dds-text-neutral-base)).
* @cssproperty --dds-input-border-radius - The border radius of the input. (default: var(--dds-radius-base)).
* @cssproperty --dds-input-disabled-border - The border of the disabled input. (default: 0 solid var(--dds-border-neutral-disabled)).
* @cssproperty --dds-input-disabled-background - The background color of the disabled input. (default: var(--dds-fields-background-disabled)).
* @cssproperty --dds-input-disabled-text - The text color of the disabled input. (default: var(--dds-text-neutral-disabled)).
* @cssproperty --dds-input-readonly-border - The border of the readonly input. (default: 0 solid var(--dds-border-neutral-subtle)).
* @cssproperty --dds-input-readonly-background - The background color of the readonly input. (default: var(--dds-fields-background-read-only)).
* @cssproperty --dds-input-readonly-text - The text color of the readonly input. (default: var(--dds-text-neutral-subtle)).
* @cssproperty --dds-input-success-border - The border of the success input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).
* @cssproperty --dds-input-error-border - The border of the error input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).
* @cssproperty --dds-input-addon-background - The background color of the input addon. (default: var(--dds-fields-background-default)).
* @cssproperty --dds-input-addon-success-background - The background color of the success input addon. (default: var(--dds-fields-background-default)).
* @cssproperty --dds-input-addon-error-background - The background color of the error input addon. (default: var(--dds-fields-background-default)).
* @cssproperty --dds-input-addon-border-before - The border of the addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).
* @cssproperty --dds-input-addon-border-after - The border of the addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).
* @cssproperty --dds-input-addon-border-width-before - The border width of the addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).
* @cssproperty --dds-input-addon-border-width-after - The border width of the addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).
* @cssproperty --dds-input-addon-success-border - The border of the success addon. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).
* @cssproperty --dds-input-addon-success-border-before - The border of the success addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).
* @cssproperty --dds-input-addon-success-border-after - The border of the success addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).
* @cssproperty --dds-input-addon-success-border-width-before - The border width of the success addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).
* @cssproperty --dds-input-addon-success-border-width-after - The border width of the success addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).
* @cssproperty --dds-input-addon-error-border-before - The border of the error addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).
* @cssproperty --dds-input-addon-error-border-after - The border of the error addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).
* @cssproperty --dds-input-addon-error-border-width-before - The border width of the error addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).
* @cssproperty --dds-input-addon-error-border-width-after - The border width of the error addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).
*
* @event {{ value: string }} dds-change - Fired when the input value changes.
* @event {{ value: string }} dds-input - Fired when the input value changes.
* @event {{ value: string, originalEvent: Event }} dds-keydown - Fired when a key is pressed down.
* @event {{ void }} dds-blur - Fired when the input loses focus.
* @event {{ void }} dds-focus - Emitted when the input gains focus.
*
* @slot postfix - The postfix of the input.
* @slot prefix - The prefix of the input.
* @slot addon-before - The addon before the input.
* @slot addon-after - The addon after the input.
* @slot feedback-icon - The custom icon of the feedback.
*
* @csspart base - The main input container.
* @csspart input - The input element.
* @csspart label - The label of the input.
* @csspart description - The description of the input.
* @csspart feedback - The feedback of the input.
* @csspart tooltip - The tooltip of the input.
* @csspart addon-before - The addon before the input.
* @csspart addon-after - The addon after the input.
* @csspart prefix - The prefix of the input.
* @csspart postfix - The postfix of the input.
*
*/
export default class DapDSInput extends InputBaseElement {
static tagName: string;
render(): import('lit-html').TemplateResult<1>;
}