dap-design-system
Version:
Official design system for the DÁP (dap.gov.hu)
100 lines (99 loc) • 9.01 kB
TypeScript
import { default as DapDSIcon } from '../icon/icon.component';
import { default as DapDSIconButton } from '../icon-button/icon-button.component';
import { InputBaseElement } from '../input/input-base-element';
/**
* `dap-ds-copybox-input`
* @summary A copybox input is a field for copying an input value.
* @element dap-ds-copybox-input
* @title - CopyBox input
*
* @property {string} label - The label of the input.
* @property {string} placeholder - The placeholder of the input.
* @property {string} description - The description of the input.
* @property {string} tooltip - The tooltip of the input.
* @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The position of the tooltip. Can be `top`, `right`, `bottom`, or `left`.
* @property {'success' | 'error'} status - The status of the input. Can be `success` or `error`.
* @property {'xs' | 'sm' | 'sm'} size - The size of the input. Default is `sm`.
* @property {string} name - The name of the input.
* @property {string} value - The value of the input.
* @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 {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 {boolean} loading - The loading state of the input. Default is false.
* @property {boolean} optional - The optional state of the input.
* @property {string} optionalLabel - The optional label of the input.
* @property {string} requiredLabel - The required indicator of the input. (default: '*')
* @property {boolean} subtle - The weight of the label. Default is `false`
* @property {string} copyButtonAriaLabel - The aria label of the copy button.
*
* @event {{ value: string }} dds-copy - Fired when the user clicks on the copy button.
* @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.
* @event {{ void }} dds-not-allowed - Emitted when the value cannot be copied.
*
* @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)
*
* @csspart base - The base container of the component.
* @csspart postfix - The inner postfix icon part of the component.
* @csspart button - The button of the component.
* @csspart copy-button-base - The base of the copy button.
* @csspart copy-button-content - The content of the copy button.
* @csspart copy-icon - The copy icon of the component.
* @csspart copy-icon-base - The base of the copy icon.
*/
export default class DapDSCopyBoxInput extends InputBaseElement {
static tagName: string;
static dependencies: {
'dap-ds-icon-button': typeof DapDSIconButton;
'dap-ds-icon': typeof DapDSIcon;
};
constructor();
copyButtonAriaLabel?: string;
/** `data-testid` for the copy button. */
copyButtonTestId: string;
render(): import('lit-html').TemplateResult<1>;
onCopy(): void;
private copyToClipboard;
}