{"version":3,"sources":["../../../../src/nhsuk/components/radios/_index.scss"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,+BAA+B;AAC/B,4BAA4B;AAC5B,8BAA8B;AAC9B,oBAAoB;AACpB,2BAA2B;AAC3B,sBAAsB;AACtB,kBAAkB;AAClB,mBAAmB;AACnB,mBAAmB;;AAEnB,GAAG;AACH,mBAAmB;AACnB,EAAE;AACF,2BAA2B;AAC3B,GAAG;;AAEH;EACE,gDAAgD;EAChD,yEAAyE;;EAEzE;IACE,oEAAoE;IACpE,eAAe;EACjB;;EAEA;IACE,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,mDAAmD;EACrD;;EAEA;IACE,aAAa;EACf;;EAEA,yEAAyE;EACzE;;IAEE,+EAA+E;EACjF;;EAEA,uEAAuE;EACvE,uEAAuE;EACvE;IACE;MACE,mDAAmD;IACrD;EACF;;EAEA;IACE,uEAAuE;IACvE,iEAAiE;IACjE,UAAU;;IAEV,+BAA+B;IAC/B,gCAAgC;IAChC,SAAS;;IAET,UAAU;;IAEV,eAAe;EACjB;;EAEA;IACE,sBAAsB;;IAEtB,kBAAkB;;IAElB,wEAAwE;IACxE,yEAAyE;IACzE,iEAAiE;IACjE,gDAAgD;IAChD,gBAAgB;IAChB,qGAAqG;;IAErG,eAAe;IACf,8BAA8B;IAC9B,0BAA0B;EAC5B;;EAEA,gBAAgB;EAChB;IACE,WAAW;;IAEX,sBAAsB;;IAEtB,kBAAkB;IAClB,4CAA4C;IAC5C,6CAA6C;;IAE7C,yBAAyB;IACzB,0BAA0B;;IAE1B,yEAAyE;IACzE,kBAAkB;;IAElB,0CAA0C;EAC5C;;EAEA,kBAAkB;EAClB,CAAC;EACD,qEAAqE;EACrE,2DAA2D;EAC3D;IACE,WAAW;;IAEX,kBAAkB;;IAElB,2EAA2E;IAC3E,wEAAwE;IACxE,sDAAsD;IACtD,0CAA0C;IAC1C,2CAA2C;;IAE3C,QAAQ;IACR,SAAS;;IAET,8BAA8B;IAC9B,gCA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D;MACE,+BAA+B;IACjC;;IAEA;MACE,gEAAgE;;MAEhE,oEAAoE;MACpE,8BAA8B;MAC9B,oEAAoE;IACtE;;IAEA,gBAAgB;IAChB,CAAC;IACD,wEAAwE;IACxE,kBAAkB;IAClB;MACE,kBAAkB,EAAE,GAAG;MACvB,2CAA2C;MAC3C,+BAA+B,EAAE,GAAG;MACpC,gCAAgC,EAAE,GAAG;IACvC;;IAEA,kBAAkB;IAClB,CAAC;IACD,iDAAiD;IACjD;MACE,0CAA0C;MAC1C,mGAAmG;MACnG,kCAAkC;IACpC;;IAEA,wCAAwC;IACxC;MACE,qGAAqG;IACvG;;IAEA,6CAA6C;IAC7C;MACE,gGAAgG;MAChG;6DACuD;IACzD;;IAEA;MACE,+BAA+B;MAC/B,qFAAqF;IACvF;;IAEA,+BAA+B;IAC/B,CAAC;IACD,qEAAqE;IACrE,sEAAsE;IACtE,oEAAoE;IACpE,wCAAwC;IACxC;;MAEE,iDAAiD;MACjD,kDAAkD;MAClD,qDAAqD;MACrD,mBAAmB;MACnB,wDAAwD;IAC1D;;IAEA,yEAAyE;IACzE,+BAA+B;IAC/B,CAAC;IACD,wEAAwE;IACxE,oDAAoD;IACpD;;MAEE,iBAAiB;MACjB;;oDAE8C,EAAE,GAAG;;MAEnD,wEAAwE;MACxE;QACE,wBAAwB;MAC1B;IACF;;IAEA,wEAAwE;IACxE,yCAAyC;IACzC,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,2DAA2D;IAC3D;MACE;;QAEE,mBAAmB;MACrB;;MAEA;;QAEE,+DAA+D;MACjE;IACF;EACF;AACF","file":"_index.scss","sourcesContent":["@use \"sass:math\";\n@use \"../../core/settings\" as *;\n@use \"../../core/tools\" as *;\n@use \"../../core/helpers\" as *;\n@use \"settings\" as *;\n@forward \"../error-message\";\n@forward \"../fieldset\";\n@forward \"../hint\";\n@forward \"../label\";\n@forward \"settings\";\n\n////\n/// Radios component\n///\n/// @group components/radios\n////\n\n@include nhsuk-exports(\"nhsuk/components/radios\") {\n  $nhsuk-touch-target-gutter: nhsuk-px-to-rem(4px);\n  $nhsuk-touch-target-size: $nhsuk-radios-size + $nhsuk-touch-target-gutter;\n\n  .nhsuk-radios {\n    margin: -$nhsuk-radios-offset nhsuk-px-to-rem(-$nhsuk-radios-offset);\n    margin-right: 0;\n  }\n\n  .nhsuk-radios__item {\n    display: flex;\n    position: relative;\n    flex-wrap: wrap;\n    margin-top: nhsuk-spacing(2) - $nhsuk-radios-offset;\n  }\n\n  .nhsuk-radios__item:first-child {\n    margin-top: 0;\n  }\n\n  // Add default margin to items that follow conditionally revealing content\n  .nhsuk-radios__conditional + .nhsuk-radios__item,\n  .nhsuk-radios--small .nhsuk-radios__conditional + .nhsuk-radios__item {\n    @include nhsuk-responsive-margin(4, \"top\", $adjustment: - $nhsuk-radios-offset);\n  }\n\n  // Remove margin from items that follow conditionally revealing content,\n  // but only apply when JavaScript is supported and the content is hidden\n  .nhsuk-radios__conditional--hidden + .nhsuk-radios__item {\n    @include nhsuk-frontend-supported {\n      margin-top: nhsuk-spacing(2) - $nhsuk-radios-offset;\n    }\n  }\n\n  .nhsuk-radios__input {\n    // Allow the input to sit above the label, enabling its proper detection\n    // when exploring by touch or using automation tools like Selenium\n    z-index: 1;\n\n    width: $nhsuk-touch-target-size;\n    height: $nhsuk-touch-target-size;\n    margin: 0;\n\n    opacity: 0;\n\n    cursor: pointer;\n  }\n\n  .nhsuk-radios__label {\n    box-sizing: border-box;\n\n    align-self: center;\n\n    // Ensure that the width of the label is never more than the width of the\n    // container minus the input. This prevents the label from wrapping due to\n    // __item using flex-wrap because we want hints on a separate line\n    max-width: calc(100% - $nhsuk-touch-target-size);\n    margin-bottom: 0;\n    padding: (nhsuk-spacing(1) + $nhsuk-border-width-form-element) $nhsuk-radios-label-padding-left-right;\n\n    cursor: pointer;\n    // remove 300ms pause on mobile\n    touch-action: manipulation;\n  }\n\n  // ( ) Radio ring\n  .nhsuk-radios__label::before {\n    content: \"\";\n\n    box-sizing: border-box;\n\n    position: absolute;\n    top: math.div($nhsuk-touch-target-gutter, 2);\n    left: math.div($nhsuk-touch-target-gutter, 2);\n\n    width: $nhsuk-radios-size;\n    height: $nhsuk-radios-size;\n\n    border: $nhsuk-border-width-form-element solid $nhsuk-input-border-colour;\n    border-radius: 50%;\n\n    background: $nhsuk-input-background-colour;\n  }\n\n  //  •  Radio button\n  //\n  // We create the 'button' entirely out of 'border' so that they remain\n  // 'filled' even when colours are overridden in the browser.\n  .nhsuk-radios__label::after {\n    content: \"\";\n\n    position: absolute;\n\n    // Positioned by getting half the touch target, so we have the centre of the\n    // input, then moving into position using CSS translate, thus positioning\n    // the centre of the button in the centre of the input.\n    top: math.div($nhsuk-touch-target-size, 2);\n    left: math.div($nhsuk-touch-target-size, 2);\n\n    width: 0;\n    height: 0;\n\n    // Align radio button to centre\n    transform: translate(-50%, -50%);\n\n    border: nhsuk-px-to-rem(10px) solid currentcolor;\n    border-radius: 50%;\n\n    opacity: 0;\n\n    background: currentcolor;\n  }\n\n  .nhsuk-radios__hint {\n    display: block;\n    width: 100%;\n    margin-top: nhsuk-spacing(-1);\n    padding-right: $nhsuk-radios-label-padding-left-right;\n    padding-left: $nhsuk-radios-label-padding-left-right + $nhsuk-touch-target-size;\n  }\n\n  // This is to bypass nhsuk-hint's specificity on hints following labels having\n  // a margin bottom of 8px (nhsuk-spacing(2)). Because radios are flexbox,\n  // the margin doesn't collapse so we have to do this manually.\n  .nhsuk-label:not(.nhsuk-label--m):not(.nhsuk-label--l):not(.nhsuk-label--xl) + .nhsuk-radios__hint {\n    margin-bottom: 0;\n  }\n\n  // Focused state\n  .nhsuk-radios__input:focus + .nhsuk-radios__label::before {\n    @include nhsuk-focused-radio($nhsuk-radios-focus-width);\n  }\n\n  // Selected state\n  .nhsuk-radios__input:checked + .nhsuk-radios__label::after {\n    opacity: 1;\n  }\n\n  // Disabled state\n  .nhsuk-radios__input:disabled,\n  .nhsuk-radios__input:disabled + .nhsuk-radios__label {\n    cursor: not-allowed;\n  }\n\n  .nhsuk-radios__input:disabled + .nhsuk-radios__label,\n  .nhsuk-radios__input:disabled ~ .nhsuk-hint {\n    opacity: 0.5;\n  }\n\n  // =========================================================\n  // Inline radios\n  // =========================================================\n\n  .nhsuk-radios--inline {\n    @media #{nhsuk-from-breakpoint(tablet)} {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: flex-start;\n      row-gap: nhsuk-spacing(2) - $nhsuk-radios-offset;\n\n      &.nhsuk-radios--small {\n        row-gap: 0;\n      }\n\n      .nhsuk-radios__item {\n        max-width: calc(50% - $nhsuk-radios-label-padding-left-right - nhsuk-spacing(4));\n        margin-top: 0;\n        margin-right: nhsuk-spacing(4);\n      }\n    }\n  }\n\n  // =========================================================\n  // Dividers ('or')\n  // =========================================================\n\n  .nhsuk-radios__divider {\n    width: $nhsuk-radios-size;\n    margin: nhsuk-spacing(2) - $nhsuk-radios-offset nhsuk-px-to-rem($nhsuk-radios-offset);\n    text-align: center;\n    @include nhsuk-text-colour;\n    @include nhsuk-font($size: 19);\n  }\n\n  // =========================================================\n  // Conditional reveals\n  // =========================================================\n\n  // Calculate the amount of padding needed to keep the border centered against\n  // the radios.\n  $conditional-border-padding: math.div($nhsuk-touch-target-size, 2) - nhsuk-px-to-rem($nhsuk-border-width-form-element);\n  // Move the border centered with the radios\n  $conditional-margin-left: $conditional-border-padding;\n  // Move the contents of the conditional inline with the label\n  $conditional-padding-left: $conditional-border-padding + $nhsuk-radios-label-padding-left-right;\n\n  .nhsuk-radios__conditional {\n    margin-top: nhsuk-spacing(2) - $nhsuk-radios-offset;\n    margin-bottom: $nhsuk-radios-offset;\n    margin-left: $conditional-margin-left;\n    padding-left: $conditional-padding-left;\n    border-left: nhsuk-px-to-rem($nhsuk-border-width) solid nhsuk-colour(\"grey-3\");\n  }\n\n  .nhsuk-radios__conditional--hidden {\n    @include nhsuk-frontend-supported {\n      display: none;\n    }\n  }\n\n  // =========================================================\n  // Small radios\n  // =========================================================\n\n  .nhsuk-radios--small {\n    $input-offset: math.div($nhsuk-touch-target-size - $nhsuk-radios-small-size, 2);\n\n    .nhsuk-radios__item {\n      margin-top: 0;\n    }\n\n    // Remove margin from items that follow conditionally revealing content,\n    // but only apply when JavaScript is supported and the content is hidden\n    .nhsuk-radios__conditional--hidden + .nhsuk-radios__item {\n      @include nhsuk-frontend-supported {\n        margin-top: 0;\n      }\n    }\n\n    // Shift the touch target into the left margin so that the visible edge of\n    // the control is aligned\n    //\n    //   ┆Which colour is your favourite?\n    //  ┌┆───┐\n    //  │┆() │ Purple\n    //  └┆▲──┘\n    //  ▲┆└─ Radio pseudo element, aligned with margin\n    //  └─── Touch target (invisible input), shifted into the margin\n    .nhsuk-radios__input {\n      margin-left: $input-offset * -1;\n    }\n\n    .nhsuk-radios__label {\n      max-width: calc(100% - $nhsuk-touch-target-size + $input-offset);\n\n      // Create a tiny space between the small radio hover state so that it\n      // doesn't clash with the label\n      padding-left: $nhsuk-radios-label-padding-left-right - $input-offset;\n    }\n\n    // ( ) Radio ring\n    //\n    // Reduce the size of the control [1], vertically centering it within the\n    // touch target [2]\n    .nhsuk-radios__label::before {\n      top: $input-offset; // 2\n      left: nhsuk-px-to-rem($nhsuk-radios-offset);\n      width: $nhsuk-radios-small-size; // 1\n      height: $nhsuk-radios-small-size; // 1\n    }\n\n    //  •  Radio button\n    //\n    // Reduce the size of the 'button' within the ring\n    .nhsuk-radios__label::after {\n      top: math.div($nhsuk-touch-target-size, 2);\n      left: math.div($nhsuk-touch-target-size, 2) - $input-offset + nhsuk-px-to-rem($nhsuk-radios-offset);\n      border-width: nhsuk-px-to-rem(5px);\n    }\n\n    // Fix position of hint with small radios\n    .nhsuk-radios__hint {\n      padding-left: $nhsuk-touch-target-size + $nhsuk-radios-label-padding-left-right - ($input-offset * 2);\n    }\n\n    // Align conditional reveals with small radios\n    .nhsuk-radios__conditional {\n      margin-left: $conditional-border-padding - $input-offset + nhsuk-px-to-rem($nhsuk-radios-offset);\n      padding-left: $conditional-border-padding + $nhsuk-radios-label-padding-left-right -\n        $input-offset - nhsuk-px-to-rem($nhsuk-radios-offset);\n    }\n\n    .nhsuk-radios__divider {\n      width: $nhsuk-radios-small-size;\n      margin: nhsuk-spacing(1) - $nhsuk-radios-offset nhsuk-px-to-rem($nhsuk-radios-offset);\n    }\n\n    // Hover state for small radios.\n    //\n    // We use a hover state for small radios because the touch target size\n    // is so much larger than their visible size, and so we need to provide\n    // feedback to the user as to which radio they will select when their\n    // cursor is outside of the visible area.\n    .nhsuk-radios__input:not(:disabled):hover + .nhsuk-radios__label::before,\n    .nhsuk-radios__input:not(:disabled) + .nhsuk-radios__label:hover::before {\n      // Forced colours modes tend to ignore box-shadow.\n      // Apply an outline for those modes to use instead.\n      outline: $nhsuk-radios-focus-width dashed transparent;\n      outline-offset: 1px;\n      box-shadow: 0 0 0 $nhsuk-hover-width $nhsuk-hover-colour;\n    }\n\n    // Because we've overridden the border-shadow provided by the focus state,\n    // we need to redefine that too.\n    //\n    // We use two box shadows, one that restores the original focus state [1]\n    // and another that then applies the hover state [2].\n    .nhsuk-radios__input:focus:hover + .nhsuk-radios__label::before,\n    .nhsuk-radios__input:focus + .nhsuk-radios__label:hover::before {\n      // prettier-ignore\n      box-shadow:\n        0 0 0 $nhsuk-radios-focus-width $nhsuk-focus-colour, // 1\n        0 0 0 $nhsuk-hover-width $nhsuk-hover-colour; // 2\n\n      // Set different HCM colour when we have both hover/focus applied at once\n      @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n        outline-color: Highlight;\n      }\n    }\n\n    // For devices that explicitly don't support hover, don't provide a hover\n    // state (e.g. on touch devices like iOS).\n    //\n    // We can't use `@media (hover: hover)` because we wouldn't get the hover\n    // state in browsers that don't support `@media (hover)` (like Internet\n    // Explorer) – so we have to 'undo' the hover state instead.\n    @media (hover: none), (pointer: coarse) {\n      .nhsuk-radios__input:not(:disabled):hover + .nhsuk-radios__label::before,\n      .nhsuk-radios__input:not(:disabled) + .nhsuk-radios__label:hover::before {\n        box-shadow: initial;\n      }\n\n      .nhsuk-radios__input:focus:hover + .nhsuk-radios__label::before,\n      .nhsuk-radios__input:focus + .nhsuk-radios__label:hover::before {\n        box-shadow: 0 0 0 $nhsuk-radios-focus-width $nhsuk-focus-colour;\n      }\n    }\n  }\n}\n"]}
