{"version":3,"file":"input.module.mjs","names":[],"sources":["../../../../package/common/input/input.module.pcss"],"sourcesContent":["/* Chrome fills a field on page load without firing anything React can see, and an animation\n   bound to the pseudo-class is the only hook it offers. The declarations are inert on purpose;\n   the pair exists to be listened for — see handleAutofillAnimation in input.tsx. */\n@keyframes inputAutofillStart {\n  from {\n    opacity: 1;\n  }\n}\n\n@keyframes inputAutofillEnd {\n  from {\n    opacity: 1;\n  }\n}\n\n.required-mark {\n  padding: 0 0 0 4px;\n  color: var(--required-mark-color, var(--error-color));\n}\n\n.input {\n  position: relative;\n  width: 100%;\n\n  --input-notch-height: 1.75em;\n  --input-icon-size: 1.2em;\n  --input-icon-offset: 0.6em;\n  --input-icon-gutter: 2.2em;\n\n  /* Where the text starts, and so where the placeholder and the resting label start too. */\n  --input-padding-inline: 7.5px;\n  --field-label-offset: 0px;\n\n  /* A floating label hangs about 4px into the field, so a value centred under it looked pressed\n     against it. Everything that centres on the field moves down by this, splitting the difference. */\n  &-withLabel {\n    --field-label-offset: 1px;\n  }\n\n  /* The visible border lives on `fieldset`/`container` below, not this root — buried inside a\n     `<label>`, out of reach of a plain ancestor selector. --group-radius-* are custom properties\n     (not defined here) that a wrapping ButtonGroup sets per corner on the position it occupies;\n     unlike border-radius itself they inherit through any nesting depth, so they reach these\n     descendants and flatten the right corners when this Input sits inside a ButtonGroup. */\n  --input-radius: var(--group-radius-tl, var(--default-border-radius))\n    var(--group-radius-tr, var(--default-border-radius)) var(--group-radius-br, var(--default-border-radius))\n    var(--group-radius-bl, var(--default-border-radius));\n\n  &-placeholder {\n    position: absolute;\n    top: calc(50% + var(--field-label-offset));\n    left: var(--input-padding-inline);\n    transform: translateY(-50%);\n    transition: all 0.2s;\n    opacity: 0;\n    user-select: none;\n    pointer-events: none;\n\n    &-shown {\n      animation: 0.2s fadeIn 0.3s forwards;\n    }\n\n    &-multiline {\n      top: 14px;\n      transform: translateY(0);\n    }\n  }\n\n  &-matLabel {\n    position: absolute;\n    transition: all 0.3s;\n    left: var(--input-padding-inline);\n    right: 0;\n    top: calc(50% + var(--field-label-offset));\n    transform: translateY(-50%);\n    font-size: 1em;\n    color: var(--input-label-resting-color, var(--text-light));\n    pointer-events: none;\n    user-select: none;\n\n    &-floating {\n      inset: 0 0 auto 14px;\n      font-size: 0.8em;\n      color: var(--input-label-floating-color, var(--text-color));\n      transform: translateY(-50%);\n    }\n\n    &-multiline {\n      top: 14px;\n      transform: translateY(0);\n    }\n  }\n\n  &-fieldset {\n    position: absolute;\n    width: 100%;\n    margin: 0;\n    padding: 0;\n    min-width: 0;\n    box-sizing: border-box;\n    border-radius: var(--input-radius);\n    font-size: 0.8em;\n    inset: calc(var(--input-notch-height) / -2) 0 0;\n    padding-left: 8px;\n    border-width: 1px;\n    border-style: solid;\n    border-color: var(--border-color);\n    pointer-events: none;\n    user-select: none;\n\n    &-legend {\n      display: block;\n\n      /* Not taken from the text: an empty span gets no line box, which raised a label-less\n         field's border half a notch. */\n      height: var(--input-notch-height);\n      max-width: 0;\n      transition: max-width 0.2s;\n      white-space: nowrap;\n      padding: 0;\n\n      &-active {\n        max-width: 300px;\n      }\n\n      span {\n        line-height: var(--input-notch-height);\n        padding: 0 5px;\n        opacity: 0;\n      }\n\n      span:empty {\n        padding: 0;\n      }\n    }\n  }\n\n  &-iconLeft {\n    .input-matLabel {\n      left: var(--input-icon-gutter);\n\n      &-floating {\n        left: calc(var(--input-icon-gutter) + 0.5em);\n      }\n    }\n\n    .input-placeholder {\n      left: var(--input-icon-gutter);\n    }\n\n    .input-fieldset {\n      padding-left: var(--input-icon-gutter);\n    }\n  }\n\n  &-container {\n    display: flex;\n    align-items: center;\n    border-radius: var(--input-radius);\n    background-color: var(--input-background);\n    transition: border-color;\n    cursor: text;\n    height: 100%;\n    box-sizing: border-box;\n    padding-top: calc(var(--field-label-offset) * 2);\n\n    /* The height lives here rather than in the input's line, which the HTML standard keeps at least\n       as tall as the font's own `normal`: in Firefox and Safari, Open Sans made the field 36px beside\n       a 34px Dropdown. The same formula as MultiSelect's min-height and NumberInput's split button. */\n    min-height: calc(1.25em + 14px);\n\n    &-multiline {\n      overflow: hidden;\n      padding-top: 10px;\n      align-items: flex-start;\n\n      /* Matches the textarea's padding-top, so they sit on its first line. */\n      .input-field-icon,\n      .input-field-suffix {\n        margin-top: 4px;\n      }\n    }\n\n    /* Not on the textarea, whose grip would sit beside the icons. The textarea's\n       align-self: stretch is what makes it follow. */\n    &-resizable {\n      resize: vertical;\n    }\n\n    /* On the container, not the field, so it reaches under the icons and the suffix too. */\n    &-disabled {\n      background-color: var(--disabled-input-color);\n    }\n\n    &-border {\n      transition: border-color;\n      background-color: var(--input-background);\n      outline: none;\n\n      &-focused {\n        outline-color: var(--focus-border-color, var(--primary-color));\n        border-color: var(--focus-border-color, var(--primary-color));\n      }\n\n      &-searchFocused {\n        outline-color: var(--search-input-color);\n        outline-width: 2px;\n        border-color: var(--search-input-color);\n      }\n\n      &-invalid {\n        outline-color: var(--error-border-color);\n        border-color: var(--error-border-color);\n      }\n\n      &-invalid:hover {\n        outline-color: var(--error-border-color);\n        border-color: var(--error-border-color);\n      }\n\n      &-error {\n        outline-color: var(--error-border-color);\n        border-color: var(--error-border-color);\n      }\n    }\n  }\n\n  &-label {\n    display: flex;\n    color: var(--text-color);\n    height: 100%;\n\n    &-column {\n      flex-direction: column;\n    }\n\n    &-text {\n      margin-right: 5px;\n      margin-bottom: 6px;\n      display: flex;\n      align-items: center;\n      color: color(var(--border-color) lightness(40%));\n      background-color: transparent;\n      font-size: 12px;\n      position: absolute;\n      top: -15px;\n      white-space: nowrap;\n    }\n  }\n\n  &-upper-right-label {\n    position: absolute;\n    transform: translateY(calc(-100% - 1.5px));\n    right: 8px;\n    min-height: 12px;\n    font-size: 12px;\n    color: color(var(--border-color) lightness(40%));\n  }\n\n  &-field {\n    appearance: none;\n    -webkit-appearance: none;\n    font-family: inherit;\n    font-size: inherit;\n    box-sizing: border-box;\n    resize: none;\n    width: 100%;\n    border: none;\n    border-radius: var(--default-border-radius);\n    overflow: hidden;\n    line-height: 1.25;\n    color: var(--text-color);\n    background: transparent;\n\n    /* A single-line input centres its own text, so filling the container puts that text on the\n       container's middle, where the icons, the suffix and the label centre too. */\n    align-self: stretch;\n\n    &:focus {\n      outline: none;\n    }\n\n    &::placeholder {\n      color: var(--text-light);\n    }\n\n    /* Chrome overrides `background` and `color` on an autofilled field outright. Clipping the\n       background to the glyphs is what removes it: the page cannot win on colour, but it can\n       say where a background paints, and -webkit-text-fill-color then beats the text colour.\n       The field is transparent either way, so what shows through is whatever is really behind\n       it — no surface has to declare itself, which an inset-shadow cover-up would have needed. */\n    &:-webkit-autofill,\n    &:-webkit-autofill:hover,\n    &:-webkit-autofill:focus,\n    &:-webkit-autofill:active {\n      animation-name: inputAutofillStart;\n      animation-duration: 1ms;\n      -webkit-background-clip: text;\n      background-clip: text;\n      -webkit-text-fill-color: var(--text-color);\n      caret-color: var(--text-color);\n    }\n\n    &:not(:-webkit-autofill) {\n      animation-name: inputAutofillEnd;\n      animation-duration: 1ms;\n    }\n\n    /* The browser's own search-cancel decoration doesn't match the theme — Search has its own\n       themed clear icon (see isSearchCleared in input.tsx) that replaces it. */\n    &::-webkit-search-cancel-button,\n    &::-webkit-search-decoration {\n      -webkit-appearance: none;\n      appearance: none;\n      display: none;\n    }\n\n    /* The left icon's margins carry the gap, so the text starts exactly at --input-icon-gutter,\n       where the label, the placeholder and the notch are drawn. */\n    &-withIcon-left {\n      padding-left: 0 !important;\n    }\n\n    &-suffix {\n      padding-right: 9px;\n    }\n\n    &-date {\n      padding: 0 9px;\n      color-scheme: dark;\n\n      svg {\n        color: var(--input-icon-color);\n      }\n    }\n\n    &-default {\n      padding: 0 var(--input-padding-inline);\n    }\n\n    &[disabled] {\n      color: var(--disabled-font-color);\n      -webkit-text-fill-color: var(--disabled-font-color);\n      opacity: 1;\n\n      &::placeholder {\n        color: var(--disabled-font-color);\n        -webkit-text-fill-color: var(--disabled-font-color);\n      }\n    }\n\n    &-readOnly {\n      cursor: default;\n      color: var(--text-dark);\n      -webkit-text-fill-color: var(--text-dark);\n    }\n\n    &-uppercase {\n      text-transform: uppercase;\n    }\n\n    &-multiline {\n      overflow-y: auto;\n      padding-top: 4px;\n      padding-bottom: 6px;\n      min-height: 30px;\n\n      &-autoResize {\n        overflow: hidden;\n      }\n    }\n\n    &-icon {\n      appearance: none;\n      -webkit-appearance: none;\n      box-sizing: border-box;\n      cursor: pointer;\n      -webkit-tap-highlight-color: transparent;\n      background-color: transparent;\n      border: none;\n      outline: none;\n      flex: none;\n      margin-right: var(--input-icon-offset);\n      color: var(--input-icon-color);\n      width: var(--input-icon-size) !important;\n      height: var(--input-icon-size) !important;\n      user-select: none;\n\n      &:focus-visible {\n        outline: 1px solid var(--focus-border-color, var(--primary-color));\n        outline-offset: 2px;\n      }\n\n      &-left {\n        margin-left: var(--input-icon-offset);\n        margin-right: calc(var(--input-icon-gutter) - var(--input-icon-offset) - var(--input-icon-size));\n      }\n\n      &-notClickable {\n        pointer-events: none;\n      }\n\n      &-clear {\n        transition: 0.15s ease-out;\n        transition-property: width, margin-right, opacity;\n\n        &-hidden {\n          width: 0 !important;\n          margin-right: 0;\n          opacity: 0;\n          visibility: hidden;\n\n          /* Only on the way out: visibility holds at visible until the fade has played. */\n          transition-property: width, margin-right, opacity, visibility;\n        }\n      }\n    }\n  }\n\n  &-error {\n    height: 1em;\n    padding-top: 3px;\n    color: var(--error-font-color);\n    font-size: 11px;\n  }\n\n  @keyframes fadeIn {\n    from {\n      opacity: 0;\n    }\n\n    to {\n      opacity: 0.5;\n    }\n  }\n}\n\n/* The label's glide between resting and floating is the motion; it still moves, just instantly.\n   The clear button keeps its fade, while the suffix beside it jumps instead of sliding. */\n@media (prefers-reduced-motion: reduce) {\n  .input-matLabel,\n  .input-placeholder {\n    transition: none;\n  }\n\n  .input-field-icon-clear {\n    transition-property: opacity, visibility;\n  }\n}\n"],"mappings":""}