primer_view_components 0.0.118 → 0.0.119

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/item.rb +1 -1
  8. data/app/components/primer/alpha/action_list.rb +1 -1
  9. data/app/components/primer/alpha/dialog.rb +2 -2
  10. data/app/components/primer/alpha/text_field.css +1 -1
  11. data/app/components/primer/alpha/text_field.css.json +1 -1
  12. data/app/components/primer/alpha/text_field.css.map +1 -1
  13. data/app/components/primer/alpha/text_field.pcss +6 -0
  14. data/app/components/primer/alpha/toggle_switch.css +1 -1
  15. data/app/components/primer/alpha/toggle_switch.css.json +1 -1
  16. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  17. data/app/components/primer/alpha/toggle_switch.html.erb +4 -2
  18. data/app/components/primer/alpha/toggle_switch.js +23 -11
  19. data/app/components/primer/alpha/toggle_switch.pcss +6 -0
  20. data/app/components/primer/alpha/toggle_switch.ts +27 -11
  21. data/app/components/primer/alpha/tool_tip.js +0 -3
  22. data/app/components/primer/alpha/tool_tip.ts +0 -4
  23. data/app/components/primer/alpha/tooltip.rb +4 -3
  24. data/app/components/primer/beta/icon_button.rb +1 -1
  25. data/app/components/primer/component.rb +4 -0
  26. data/app/components/primer/icon_button.rb +1 -1
  27. data/app/components/primer/primer.d.ts +1 -0
  28. data/app/components/primer/primer.js +1 -0
  29. data/app/components/primer/primer.ts +1 -0
  30. data/app/forms/example_toggle_switch_form.rb +1 -1
  31. data/lib/primer/forms/dsl/input.rb +1 -1
  32. data/lib/primer/forms/toggle_switch.html.erb +7 -2
  33. data/lib/primer/forms/toggle_switch.rb +2 -4
  34. data/lib/primer/forms/toggle_switch_input.d.ts +5 -0
  35. data/lib/primer/forms/toggle_switch_input.js +29 -0
  36. data/lib/primer/forms/toggle_switch_input.ts +19 -0
  37. data/lib/primer/view_components/version.rb +1 -1
  38. data/previews/primer/alpha/tooltip_preview.rb +8 -8
  39. data/previews/primer/beta/clipboard_copy_preview.rb +1 -1
  40. data/previews/primer/forms/forms_preview/example_toggle_switch_form.html.erb +3 -1
  41. data/static/arguments.json +2 -2
  42. metadata +5 -16
@@ -155,7 +155,7 @@ module Primer
155
155
  description_scheme: DEFAULT_DESCRIPTION_SCHEME,
156
156
  active: false,
157
157
  on_click: nil,
158
- id: SecureRandom.hex,
158
+ id: self.class.generate_id,
159
159
  **system_arguments
160
160
  )
161
161
  @list = list
@@ -60,7 +60,7 @@ module Primer
60
60
  show_dividers: false,
61
61
  **system_arguments
62
62
  )
63
- @id = "action-list-#{SecureRandom.uuid}"
63
+ @id = self.class.generate_id
64
64
  @role = role
65
65
 
66
66
  @system_arguments = system_arguments
@@ -121,14 +121,14 @@ module Primer
121
121
  position: DEFAULT_POSITION,
122
122
  position_narrow: DEFAULT_POSITION_NARROW,
123
123
  visually_hide_title: false,
124
- id: "dialog-#{(36**3 + rand(36**4)).to_s(36)}",
124
+ id: self.class.generate_id,
125
125
  **system_arguments
126
126
  )
127
127
  @system_arguments = deny_tag_argument(**system_arguments)
128
128
 
129
129
  @system_arguments[:tag] = "modal-dialog"
130
130
  @system_arguments[:role] = "dialog"
131
- @system_arguments[:id] = id.to_s
131
+ @system_arguments[:id] = id
132
132
  @system_arguments[:aria] = { modal: true }
133
133
  @system_arguments[:classes] = class_names(
134
134
  "Overlay",
@@ -1,3 +1,3 @@
1
1
  .FormControl{display:inline-flex;flex-direction:column;gap:var(--base-size-4,4px)}.FormControl--fullWidth{display:flex}.FormControl-label{color:var(--color-fg-default);font-size:var(--primer-text-body-size-medium,14px);font-weight:var(--base-text-weight-semibold,600);line-height:var(--primer-text-body-lineHeight-medium,1.42857);-webkit-user-select:none;user-select:none}.FormControl-caption{color:var(--color-fg-muted);font-size:var(--primer-text-caption-size,12px);font-weight:var(--primer-text-caption-weight,400);line-height:var(--primer-text-caption-lineHeight,1.33333);margin-bottom:0}.FormControl-inlineValidation{fill:var(--color-danger-fg);align-items:center;color:var(--color-danger-fg);display:flex;flex-direction:row;font-size:var(--primer-text-caption-size,12px);font-weight:var(--base-text-weight-semibold,600);gap:var(--base-size-4,4px)}.FormControl-inlineValidation p{margin-bottom:0}.FormControl-input,.FormControl-select,.FormControl-textarea{background-color:var(--color-canvas-default);border:var(--primer-borderWidth-thin,1px) solid var(--color-border-default);color:var(--color-fg-default)}.FormControl-input[disabled],.FormControl-select[disabled],.FormControl-textarea[disabled]{-webkit-text-fill-color:var(--color-primer-fg-disabled);background-color:var(--color-input-disabled-bg);border-color:var(--color-border-default);color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}.FormControl-input[invalid]:not(:focus),.FormControl-select[invalid]:not(:focus),.FormControl-textarea[invalid]:not(:focus){border-color:var(--color-danger-emphasis)}.FormControl-input:not([type=checkbox],[type=radio]):focus,.FormControl-select:not([type=checkbox],[type=radio]):focus,.FormControl-textarea:not([type=checkbox],[type=radio]):focus{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}.FormControl-input:not([type=checkbox],[type=radio]):focus:not(:focus-visible),.FormControl-select:not([type=checkbox],[type=radio]):focus:not(:focus-visible),.FormControl-textarea:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:#0000;border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px #0000 var(--color-accent-fg);outline:none}.FormControl-input:not([type=checkbox],[type=radio]):focus-visible,.FormControl-select:not([type=checkbox],[type=radio]):focus-visible,.FormControl-textarea:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}.FormControl-input,.FormControl-select,.FormControl-textarea{border-radius:var(--primer-borderRadius-medium,6px);font-size:var(--primer-text-body-size-medium,14px);line-height:var(--primer-text-body-lineHeight-medium,1.42857);padding-block:calc(var(--primer-control-medium-paddingBlock, 6px) - var(--primer-borderWidth-thin, 1px));padding-inline:var(--primer-control-medium-paddingInline-condensed,8px);transition:80ms cubic-bezier(.33,1,.68,1);transition-property:color,background-color,box-shadow,border-color;width:100%}.FormControl-input[disabled]::placeholder,.FormControl-select[disabled]::placeholder,.FormControl-textarea[disabled]::placeholder{color:var(--color-primer-fg-disabled)}.FormControl-input[readonly],.FormControl-select[readonly],.FormControl-textarea[readonly]{background-color:var(--color-input-disabled-bg)}.FormControl-input::placeholder,.FormControl-select::placeholder,.FormControl-textarea::placeholder{color:var(--color-fg-subtle);opacity:1}.FormControl-input.FormControl-small,.FormControl-select.FormControl-small,.FormControl-textarea.FormControl-small{font-size:var(--primer-text-body-size-small,12px);height:var(--primer-control-small-size,28px);padding-block:var(--primer-control-small-paddingBlock,4px);padding-inline:var(--primer-control-small-paddingInline-normal,8px)}.FormControl-input.FormControl-medium,.FormControl-select.FormControl-medium,.FormControl-textarea.FormControl-medium{height:var(--primer-control-medium-size,32px)}.FormControl-input.FormControl-large,.FormControl-select.FormControl-large,.FormControl-textarea.FormControl-large{height:var(--primer-control-large-size,40px);padding-block:var(--primer-control-large-paddingBlock,10px);padding-inline:var(--primer-control-large-paddingInline-normal,12px)}.FormControl-input.FormControl-inset,.FormControl-select.FormControl-inset,.FormControl-textarea.FormControl-inset{background-color:var(--color-canvas-inset)}.FormControl-input.FormControl-inset:focus,.FormControl-input.FormControl-inset:focus-visible,.FormControl-select.FormControl-inset:focus,.FormControl-select.FormControl-inset:focus-visible,.FormControl-textarea.FormControl-inset:focus,.FormControl-textarea.FormControl-inset:focus-visible{background-color:var(--color-canvas-default)}.FormControl-input.FormControl-monospace,.FormControl-select.FormControl-monospace,.FormControl-textarea.FormControl-monospace{font-family:var(
2
2
  --primer-fontStack-monospace,"ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace"
3
- )}.FormControl-input.FormControl-error,.FormControl-select.FormControl-error,.FormControl-textarea.FormControl-error{border-color:var(--color-danger-emphasis)}.FormControl-input.FormControl-success,.FormControl-select.FormControl-success,.FormControl-textarea.FormControl-success{border-color:var(--color-success-emphasis)}.FormControl-input.FormControl-warning,.FormControl-select.FormControl-warning,.FormControl-textarea.FormControl-warning{border-color:var(--color-attention-emphasis)}.FormControl-input-wrap{display:grid;position:relative}.FormControl-input-wrap .FormControl-input-leadingVisualWrap{color:var(--color-fg-muted);display:block;height:var(--base-size-16,16px);left:var(--base-size-8,8px);pointer-events:none;position:absolute;top:var(--base-size-8,8px);width:var(--base-size-16,16px)}.FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual{display:block;-webkit-user-select:none;user-select:none}.FormControl-input-wrap .FormControl-input-trailingAction{align-items:center;background:#0000;border:0;border-radius:var(--primer-borderRadius-small);color:var(--color-fg-muted);cursor:pointer;display:grid;height:var(--primer-control-xsmall-size,24px);justify-content:center;padding:0;position:absolute;right:var(--base-size-4,4px);top:var(--base-size-4,4px);transition:.2s cubic-bezier(.3,0,.5,1);transition-property:color,background-color,border-color;width:var(--primer-control-xsmall-size,24px);z-index:4}.FormControl-input-wrap .FormControl-input-trailingAction svg{-webkit-user-select:none;user-select:none}.FormControl-input-wrap .FormControl-input-trailingAction[disabled]{color:var(--color-primer-fg-disabled);pointer-events:none}.FormControl-input-wrap .FormControl-input-trailingAction:hover{background:var(--color-action-list-item-default-hover-bg)}.FormControl-input-wrap .FormControl-input-trailingAction:active{background:var(--color-action-list-item-default-active-bg)}.FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before{background:var(--color-border-default);content:"";display:block;height:var(--base-size-16);left:calc(var(--base-size-4, 4px)*-1);position:absolute;top:calc((var(--primer-control-xsmall-size) - var(--base-size-16))/2);width:var(--primer-borderWidth-thin)}.FormControl-input-wrap .FormControl-input-trailingAction:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}@media (pointer:coarse){.FormControl-input-wrap .FormControl-input-trailingAction:after{min-height:var(--primer-control-minTarget-coarse,44px);min-width:var(--primer-control-minTarget-coarse,44px)}}.FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input{padding-inline-start:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px))}.FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input{padding-inline-end:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px))}.FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input{padding-inline-end:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap{left:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);top:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem)}.FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small{padding-inline-end:calc(var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-small-gap, 8px))}.FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small{padding-inline-end:calc(var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-small-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction{height:calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));width:calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px))}.FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before{top:calc((var(--primer-control-xsmall-size) - var(--base-size-16))/4)}.FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap{left:var(--primer-control-medium-paddingInline-normal,12px);top:var(--primer-control-medium-paddingInline-normal,12px)}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large{padding-inline-start:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px))}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large{padding-inline-end:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px))}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large{padding-inline-end:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction{height:var(--primer-control-small-size,28px);right:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);top:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);width:var(--primer-control-small-size,28px)}.FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before{height:var(--base-size-20);top:unset}.FormControl-select-wrap{display:grid;grid-template-columns:minmax(0,auto) var(--base-size-16,16px)}.FormControl-select-wrap:after{background-color:var(--color-fg-muted);content:"";grid-column:2;grid-row:1;height:var(--base-size-16,16px);-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9IiM1ODYwNjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQuNDI3IDkuNDI3IDMuMzk2IDMuMzk2YS4yNTEuMjUxIDAgMCAwIC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwIDAgMTEuMzk2IDlINC42MDRhLjI1LjI1IDAgMCAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3IDcuODIgMy4wNzJhLjI1LjI1IDAgMCAxIC4zNTQgMEwxMS41NyA2LjQ3YS4yNS4yNSAwIDAgMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMCAxLS4xNzctLjQyN3oiLz48L3N2Zz4=");mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9IiM1ODYwNjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQuNDI3IDkuNDI3IDMuMzk2IDMuMzk2YS4yNTEuMjUxIDAgMCAwIC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwIDAgMTEuMzk2IDlINC42MDRhLjI1LjI1IDAgMCAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3IDcuODIgMy4wNzJhLjI1LjI1IDAgMCAxIC4zNTQgMEwxMS41NyA2LjQ3YS4yNS4yNSAwIDAgMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMCAxLS4xNzctLjQyN3oiLz48L3N2Zz4=");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;padding-right:var(--base-size-4,4px);place-self:center end;pointer-events:none;width:var(--base-size-16,16px)}.FormControl-select-wrap .FormControl-select{-webkit-appearance:none;appearance:none;grid-column:1/-1;grid-row:1;padding-right:var(--base-size-20,20px)}.FormControl-checkbox-wrap,.FormControl-radio-wrap{display:inline-grid;gap:var(--base-size-8,8px);grid-template-columns:min-content auto}.FormControl-checkbox-wrap .FormControl-checkbox-labelWrap,.FormControl-checkbox-wrap .FormControl-radio-labelWrap,.FormControl-radio-wrap .FormControl-checkbox-labelWrap,.FormControl-radio-wrap .FormControl-radio-labelWrap{display:flex;flex-direction:column;gap:var(--base-size-4,4px)}.FormControl-checkbox-wrap .FormControl-label,.FormControl-radio-wrap .FormControl-label{cursor:pointer}input[type=checkbox].FormControl-checkbox{background-color:var(--color-canvas-default);border:var(--primer-borderWidth-thin,1px) solid var(--color-border-default);color:var(--color-fg-default)}input.FormControl-checkbox[type=checkbox][disabled]{-webkit-text-fill-color:var(--color-primer-fg-disabled);background-color:var(--color-input-disabled-bg);border-color:var(--color-border-default);color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-checkbox[type=checkbox][invalid]:not(:focus){border-color:var(--color-danger-emphasis)}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:#0000;border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px #0000 var(--color-accent-fg);outline:none}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input[type=checkbox].FormControl-checkbox{-webkit-appearance:none;appearance:none;border-color:var(--color-neutral-emphasis);border-radius:var(--primer-borderRadius-small,3px);cursor:pointer;display:grid;height:var(--base-size-16,16px);margin:.125rem 0 0;place-content:center;position:relative;transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1);width:var(--base-size-16,16px)}input.FormControl-checkbox[type=checkbox]:before{background-color:var(--color-fg-on-emphasis);clip-path:inset(var(--base-size-16,16px) 0 0 0);content:"";height:var(--base-size-16,16px);-webkit-mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjc4LjIyYS43NS43NSAwIDAgMSAwIDEuMDYxTDQuNTIgOC41NDFhLjc1Mi43NTIgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1MS43NTEgMCAwIDEgMS4wNjIgMFoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=");mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjc4LjIyYS43NS43NSAwIDAgMSAwIDEuMDYxTDQuNTIgOC41NDFhLjc1Mi43NTIgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1MS43NTEgMCAwIDEgMS4wNjIgMFoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:75%;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16,16px)}@media screen and (prefers-reduced-motion:no-preference){input.FormControl-checkbox[type=checkbox]:before{animation:checkmarkOut 80ms cubic-bezier(.65,0,.35,1) forwards}}input.FormControl-checkbox[type=checkbox]:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label,input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label{color:var(--color-primer-fg-disabled);cursor:not-allowed}input.FormControl-checkbox[type=checkbox]:checked{background:var(--color-accent-fg);border-color:var(--color-accent-fg);transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0ms}input.FormControl-checkbox[type=checkbox]:checked:before{transition:visibility 0s linear 0s;visibility:visible}@media screen and (prefers-reduced-motion:no-preference){input.FormControl-checkbox[type=checkbox]:checked:before{animation:checkmarkIn 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}}input.FormControl-checkbox[type=checkbox]:checked:disabled{background-color:var(--color-primer-fg-disabled);border-color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-checkbox[type=checkbox]:checked:disabled:before{background-color:var(--color-fg-on-emphasis)}@media (forced-colors:active){input.FormControl-checkbox[type=checkbox]:checked{background-color:canvastext;border-color:canvastext}}input.FormControl-checkbox[type=checkbox]:focus-visible{box-shadow:none;outline:2px solid var(--color-accent-fg);outline-offset:2px}input.FormControl-checkbox[type=checkbox]:indeterminate:before{-webkit-mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgMWExIDEgMCAwIDEgMS0xaDhhMSAxIDAgMSAxIDAgMkgxYTEgMSAwIDAgMS0xLTFaIiBmaWxsPSIjZmZmIi8+PC9zdmc+");mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgMWExIDEgMCAwIDEgMS0xaDhhMSAxIDAgMSAxIDAgMkgxYTEgMSAwIDAgMS0xLTFaIiBmaWxsPSIjZmZmIi8+PC9zdmc+");visibility:visible}input[type=radio].FormControl-radio{background-color:var(--color-canvas-default);border:var(--primer-borderWidth-thin,1px) solid var(--color-border-default);color:var(--color-fg-default)}input.FormControl-radio[type=radio][disabled]{-webkit-text-fill-color:var(--color-primer-fg-disabled);background-color:var(--color-input-disabled-bg);border-color:var(--color-border-default);color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-radio[type=radio][invalid]:not(:focus){border-color:var(--color-danger-emphasis)}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:#0000;border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px #0000 var(--color-accent-fg);outline:none}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input[type=radio].FormControl-radio{-webkit-appearance:none;appearance:none;border-color:var(--color-neutral-emphasis);border-radius:var(--primer-borderRadius-full,100vh);cursor:pointer;height:var(--base-size-16,16px);margin:.125rem 0 0;position:relative;transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1);width:var(--base-size-16,16px)}input.FormControl-radio[type=radio]:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}input.FormControl-radio[type=radio]:checked{border-color:var(--color-accent-fg);border-width:var(--base-size-4,4px)}input.FormControl-radio[type=radio]:checked:disabled{border-color:var(--color-primer-fg-disabled);cursor:not-allowed}input.FormControl-radio[type=radio]:focus-visible{box-shadow:none;outline:2px solid var(--color-accent-fg);outline-offset:2px}@media (forced-colors:active){input[type=radio].FormControl-radio{background-color:canvastext;border-color:canvastext}}@keyframes checkmarkIn{0%{clip-path:inset(var(--base-size-16,16px) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes checkmarkOut{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,16px) 0 0 0)}}
3
+ )}.FormControl-input.FormControl-error,.FormControl-select.FormControl-error,.FormControl-textarea.FormControl-error{border-color:var(--color-danger-emphasis)}.FormControl-input.FormControl-success,.FormControl-select.FormControl-success,.FormControl-textarea.FormControl-success{border-color:var(--color-success-emphasis)}.FormControl-input.FormControl-warning,.FormControl-select.FormControl-warning,.FormControl-textarea.FormControl-warning{border-color:var(--color-attention-emphasis)}.FormControl-toggleSwitchInput{align-items:flex-start;display:flex;gap:var(--base-size-16,16px)}.FormControl-input-wrap{display:grid;position:relative}.FormControl-input-wrap .FormControl-input-leadingVisualWrap{color:var(--color-fg-muted);display:block;height:var(--base-size-16,16px);left:var(--base-size-8,8px);pointer-events:none;position:absolute;top:var(--base-size-8,8px);width:var(--base-size-16,16px)}.FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual{display:block;-webkit-user-select:none;user-select:none}.FormControl-input-wrap .FormControl-input-trailingAction{align-items:center;background:#0000;border:0;border-radius:var(--primer-borderRadius-small);color:var(--color-fg-muted);cursor:pointer;display:grid;height:var(--primer-control-xsmall-size,24px);justify-content:center;padding:0;position:absolute;right:var(--base-size-4,4px);top:var(--base-size-4,4px);transition:.2s cubic-bezier(.3,0,.5,1);transition-property:color,background-color,border-color;width:var(--primer-control-xsmall-size,24px);z-index:4}.FormControl-input-wrap .FormControl-input-trailingAction svg{-webkit-user-select:none;user-select:none}.FormControl-input-wrap .FormControl-input-trailingAction[disabled]{color:var(--color-primer-fg-disabled);pointer-events:none}.FormControl-input-wrap .FormControl-input-trailingAction:hover{background:var(--color-action-list-item-default-hover-bg)}.FormControl-input-wrap .FormControl-input-trailingAction:active{background:var(--color-action-list-item-default-active-bg)}.FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before{background:var(--color-border-default);content:"";display:block;height:var(--base-size-16);left:calc(var(--base-size-4, 4px)*-1);position:absolute;top:calc((var(--primer-control-xsmall-size) - var(--base-size-16))/2);width:var(--primer-borderWidth-thin)}.FormControl-input-wrap .FormControl-input-trailingAction:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}@media (pointer:coarse){.FormControl-input-wrap .FormControl-input-trailingAction:after{min-height:var(--primer-control-minTarget-coarse,44px);min-width:var(--primer-control-minTarget-coarse,44px)}}.FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input{padding-inline-start:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px))}.FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input{padding-inline-end:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px))}.FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input{padding-inline-end:calc(var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-medium-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap{left:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);top:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem)}.FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small{padding-inline-end:calc(var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-small-gap, 8px))}.FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small{padding-inline-end:calc(var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) + var(--primer-control-small-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction{height:calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));width:calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px))}.FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before{top:calc((var(--primer-control-xsmall-size) - var(--base-size-16))/4)}.FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap{left:var(--primer-control-medium-paddingInline-normal,12px);top:var(--primer-control-medium-paddingInline-normal,12px)}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large{padding-inline-start:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px))}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large{padding-inline-end:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px))}.FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large{padding-inline-end:calc(var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) + var(--primer-control-large-gap, 8px) + var(--primer-borderWidth-thin, 1px))}.FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction{height:var(--primer-control-small-size,28px);right:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);top:calc(var(--primer-control-medium-paddingInline-condensed, 8px) - .125rem);width:var(--primer-control-small-size,28px)}.FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before{height:var(--base-size-20);top:unset}.FormControl-select-wrap{display:grid;grid-template-columns:minmax(0,auto) var(--base-size-16,16px)}.FormControl-select-wrap:after{background-color:var(--color-fg-muted);content:"";grid-column:2;grid-row:1;height:var(--base-size-16,16px);-webkit-mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9IiM1ODYwNjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQuNDI3IDkuNDI3IDMuMzk2IDMuMzk2YS4yNTEuMjUxIDAgMCAwIC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwIDAgMTEuMzk2IDlINC42MDRhLjI1LjI1IDAgMCAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3IDcuODIgMy4wNzJhLjI1LjI1IDAgMCAxIC4zNTQgMEwxMS41NyA2LjQ3YS4yNS4yNSAwIDAgMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMCAxLS4xNzctLjQyN3oiLz48L3N2Zz4=");mask:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9IiM1ODYwNjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQuNDI3IDkuNDI3IDMuMzk2IDMuMzk2YS4yNTEuMjUxIDAgMCAwIC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwIDAgMTEuMzk2IDlINC42MDRhLjI1LjI1IDAgMCAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3IDcuODIgMy4wNzJhLjI1LjI1IDAgMCAxIC4zNTQgMEwxMS41NyA2LjQ3YS4yNS4yNSAwIDAgMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMCAxLS4xNzctLjQyN3oiLz48L3N2Zz4=");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;padding-right:var(--base-size-4,4px);place-self:center end;pointer-events:none;width:var(--base-size-16,16px)}.FormControl-select-wrap .FormControl-select{-webkit-appearance:none;appearance:none;grid-column:1/-1;grid-row:1;padding-right:var(--base-size-20,20px)}.FormControl-checkbox-wrap,.FormControl-radio-wrap{display:inline-grid;gap:var(--base-size-8,8px);grid-template-columns:min-content auto}.FormControl-checkbox-wrap .FormControl-checkbox-labelWrap,.FormControl-checkbox-wrap .FormControl-radio-labelWrap,.FormControl-radio-wrap .FormControl-checkbox-labelWrap,.FormControl-radio-wrap .FormControl-radio-labelWrap{display:flex;flex-direction:column;gap:var(--base-size-4,4px)}.FormControl-checkbox-wrap .FormControl-label,.FormControl-radio-wrap .FormControl-label{cursor:pointer}input[type=checkbox].FormControl-checkbox{background-color:var(--color-canvas-default);border:var(--primer-borderWidth-thin,1px) solid var(--color-border-default);color:var(--color-fg-default)}input.FormControl-checkbox[type=checkbox][disabled]{-webkit-text-fill-color:var(--color-primer-fg-disabled);background-color:var(--color-input-disabled-bg);border-color:var(--color-border-default);color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-checkbox[type=checkbox][invalid]:not(:focus){border-color:var(--color-danger-emphasis)}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:#0000;border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px #0000 var(--color-accent-fg);outline:none}input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input[type=checkbox].FormControl-checkbox{-webkit-appearance:none;appearance:none;border-color:var(--color-neutral-emphasis);border-radius:var(--primer-borderRadius-small,3px);cursor:pointer;display:grid;height:var(--base-size-16,16px);margin:.125rem 0 0;place-content:center;position:relative;transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1);width:var(--base-size-16,16px)}input.FormControl-checkbox[type=checkbox]:before{background-color:var(--color-fg-on-emphasis);clip-path:inset(var(--base-size-16,16px) 0 0 0);content:"";height:var(--base-size-16,16px);-webkit-mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjc4LjIyYS43NS43NSAwIDAgMSAwIDEuMDYxTDQuNTIgOC41NDFhLjc1Mi43NTIgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1MS43NTEgMCAwIDEgMS4wNjIgMFoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=");mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjc4LjIyYS43NS43NSAwIDAgMSAwIDEuMDYxTDQuNTIgOC41NDFhLjc1Mi43NTIgMCAwIDEtMS4wNjIgMEwuMjAyIDUuMjg1YS43NS43NSAwIDAgMSAxLjA2MS0xLjA2MWwyLjcyNSAyLjcyM0wxMC43MTguMjJhLjc1MS43NTEgMCAwIDEgMS4wNjIgMFoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:75%;mask-size:75%;transition:visibility 0s linear .23s;visibility:hidden;width:var(--base-size-16,16px)}@media screen and (prefers-reduced-motion:no-preference){input.FormControl-checkbox[type=checkbox]:before{animation:checkmarkOut 80ms cubic-bezier(.65,0,.35,1) forwards}}input.FormControl-checkbox[type=checkbox]:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label,input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label{color:var(--color-primer-fg-disabled);cursor:not-allowed}input.FormControl-checkbox[type=checkbox]:checked{background:var(--color-accent-fg);border-color:var(--color-accent-fg);transition:background-color,border-color 80ms cubic-bezier(.32,0,.67,0) 0ms}input.FormControl-checkbox[type=checkbox]:checked:before{transition:visibility 0s linear 0s;visibility:visible}@media screen and (prefers-reduced-motion:no-preference){input.FormControl-checkbox[type=checkbox]:checked:before{animation:checkmarkIn 80ms cubic-bezier(.65,0,.35,1) 80ms forwards}}input.FormControl-checkbox[type=checkbox]:checked:disabled{background-color:var(--color-primer-fg-disabled);border-color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-checkbox[type=checkbox]:checked:disabled:before{background-color:var(--color-fg-on-emphasis)}@media (forced-colors:active){input.FormControl-checkbox[type=checkbox]:checked{background-color:canvastext;border-color:canvastext}}input.FormControl-checkbox[type=checkbox]:focus-visible{box-shadow:none;outline:2px solid var(--color-accent-fg);outline-offset:2px}input.FormControl-checkbox[type=checkbox]:indeterminate:before{-webkit-mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgMWExIDEgMCAwIDEgMS0xaDhhMSAxIDAgMSAxIDAgMkgxYTEgMSAwIDAgMS0xLTFaIiBmaWxsPSIjZmZmIi8+PC9zdmc+");mask-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTAgMWExIDEgMCAwIDEgMS0xaDhhMSAxIDAgMSAxIDAgMkgxYTEgMSAwIDAgMS0xLTFaIiBmaWxsPSIjZmZmIi8+PC9zdmc+");visibility:visible}input[type=radio].FormControl-radio{background-color:var(--color-canvas-default);border:var(--primer-borderWidth-thin,1px) solid var(--color-border-default);color:var(--color-fg-default)}input.FormControl-radio[type=radio][disabled]{-webkit-text-fill-color:var(--color-primer-fg-disabled);background-color:var(--color-input-disabled-bg);border-color:var(--color-border-default);color:var(--color-primer-fg-disabled);cursor:not-allowed;opacity:1}input.FormControl-radio[type=radio][invalid]:not(:focus){border-color:var(--color-danger-emphasis)}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus:not(:focus-visible){border-color:#0000;border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px #0000 var(--color-accent-fg);outline:none}input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus-visible{border-color:var(--color-accent-fg);box-shadow:inset 0 0 0 1px var(--color-accent-fg);outline:none}input[type=radio].FormControl-radio{-webkit-appearance:none;appearance:none;border-color:var(--color-neutral-emphasis);border-radius:var(--primer-borderRadius-full,100vh);cursor:pointer;height:var(--base-size-16,16px);margin:.125rem 0 0;position:relative;transition:background-color,border-color 80ms cubic-bezier(.33,1,.68,1);width:var(--base-size-16,16px)}input.FormControl-radio[type=radio]:after{content:"";height:100%;left:50%;min-height:var(--primer-control-medium-size,32px) var(--primer-control-medium-size,32px);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}input.FormControl-radio[type=radio]:checked{border-color:var(--color-accent-fg);border-width:var(--base-size-4,4px)}input.FormControl-radio[type=radio]:checked:disabled{border-color:var(--color-primer-fg-disabled);cursor:not-allowed}input.FormControl-radio[type=radio]:focus-visible{box-shadow:none;outline:2px solid var(--color-accent-fg);outline-offset:2px}@media (forced-colors:active){input[type=radio].FormControl-radio{background-color:canvastext;border-color:canvastext}}@keyframes checkmarkIn{0%{clip-path:inset(var(--base-size-16,16px) 0 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes checkmarkOut{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(var(--base-size-16,16px) 0 0 0)}}
@@ -1 +1 @@
1
- {"name":"alpha/text_field","selectors":[".FormControl",".FormControl--fullWidth",".FormControl-label",".FormControl-caption",".FormControl-inlineValidation",".FormControl-inlineValidation p",".FormControl-input",".FormControl-select",".FormControl-textarea",".FormControl-input[disabled]",".FormControl-select[disabled]",".FormControl-textarea[disabled]",".FormControl-input[invalid]:not(:focus)",".FormControl-select[invalid]:not(:focus)",".FormControl-textarea[invalid]:not(:focus)",".FormControl-input:not([type=checkbox]","[type=radio]):focus",".FormControl-select:not([type=checkbox]",".FormControl-textarea:not([type=checkbox]","[type=radio]):focus:not(:focus-visible)","[type=radio]):focus-visible",".FormControl-input[disabled]::placeholder",".FormControl-select[disabled]::placeholder",".FormControl-textarea[disabled]::placeholder",".FormControl-input[readonly]",".FormControl-select[readonly]",".FormControl-textarea[readonly]",".FormControl-input::placeholder",".FormControl-select::placeholder",".FormControl-textarea::placeholder",".FormControl-input.FormControl-small",".FormControl-select.FormControl-small",".FormControl-textarea.FormControl-small",".FormControl-input.FormControl-medium",".FormControl-select.FormControl-medium",".FormControl-textarea.FormControl-medium",".FormControl-input.FormControl-large",".FormControl-select.FormControl-large",".FormControl-textarea.FormControl-large",".FormControl-input.FormControl-inset",".FormControl-select.FormControl-inset",".FormControl-textarea.FormControl-inset",".FormControl-input.FormControl-inset:focus",".FormControl-input.FormControl-inset:focus-visible",".FormControl-select.FormControl-inset:focus",".FormControl-select.FormControl-inset:focus-visible",".FormControl-textarea.FormControl-inset:focus",".FormControl-textarea.FormControl-inset:focus-visible",".FormControl-input.FormControl-monospace",".FormControl-select.FormControl-monospace",".FormControl-textarea.FormControl-monospace",".FormControl-input.FormControl-error",".FormControl-select.FormControl-error",".FormControl-textarea.FormControl-error",".FormControl-input.FormControl-success",".FormControl-select.FormControl-success",".FormControl-textarea.FormControl-success",".FormControl-input.FormControl-warning",".FormControl-select.FormControl-warning",".FormControl-textarea.FormControl-warning",".FormControl-input-wrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual",".FormControl-input-wrap .FormControl-input-trailingAction",".FormControl-input-wrap .FormControl-input-trailingAction svg",".FormControl-input-wrap .FormControl-input-trailingAction[disabled]",".FormControl-input-wrap .FormControl-input-trailingAction:hover",".FormControl-input-wrap .FormControl-input-trailingAction:active",".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before",".FormControl-input-wrap .FormControl-input-trailingAction:after",".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",".FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before",".FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before",".FormControl-select-wrap",".FormControl-select-wrap:after",".FormControl-select-wrap .FormControl-select",".FormControl-checkbox-wrap",".FormControl-radio-wrap",".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",".FormControl-checkbox-wrap .FormControl-radio-labelWrap",".FormControl-radio-wrap .FormControl-checkbox-labelWrap",".FormControl-radio-wrap .FormControl-radio-labelWrap",".FormControl-checkbox-wrap .FormControl-label",".FormControl-radio-wrap .FormControl-label","input[type=checkbox].FormControl-checkbox","input.FormControl-checkbox[type=checkbox][disabled]","input.FormControl-checkbox[type=checkbox][invalid]:not(:focus)","input.FormControl-checkbox[type=checkbox]:not([type=checkbox]","input.FormControl-checkbox[type=checkbox]:before","input.FormControl-checkbox[type=checkbox]:after","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox]:checked","input.FormControl-checkbox[type=checkbox]:checked:before","input.FormControl-checkbox[type=checkbox]:checked:disabled","input.FormControl-checkbox[type=checkbox]:checked:disabled:before","input.FormControl-checkbox[type=checkbox]:focus-visible","input.FormControl-checkbox[type=checkbox]:indeterminate:before","input[type=radio].FormControl-radio","input.FormControl-radio[type=radio][disabled]","input.FormControl-radio[type=radio][invalid]:not(:focus)","input.FormControl-radio[type=radio]:not([type=checkbox]","input.FormControl-radio[type=radio]:after","input.FormControl-radio[type=radio]:checked","input.FormControl-radio[type=radio]:checked:disabled","input.FormControl-radio[type=radio]:focus-visible","0%","to"]}
1
+ {"name":"alpha/text_field","selectors":[".FormControl",".FormControl--fullWidth",".FormControl-label",".FormControl-caption",".FormControl-inlineValidation",".FormControl-inlineValidation p",".FormControl-input",".FormControl-select",".FormControl-textarea",".FormControl-input[disabled]",".FormControl-select[disabled]",".FormControl-textarea[disabled]",".FormControl-input[invalid]:not(:focus)",".FormControl-select[invalid]:not(:focus)",".FormControl-textarea[invalid]:not(:focus)",".FormControl-input:not([type=checkbox]","[type=radio]):focus",".FormControl-select:not([type=checkbox]",".FormControl-textarea:not([type=checkbox]","[type=radio]):focus:not(:focus-visible)","[type=radio]):focus-visible",".FormControl-input[disabled]::placeholder",".FormControl-select[disabled]::placeholder",".FormControl-textarea[disabled]::placeholder",".FormControl-input[readonly]",".FormControl-select[readonly]",".FormControl-textarea[readonly]",".FormControl-input::placeholder",".FormControl-select::placeholder",".FormControl-textarea::placeholder",".FormControl-input.FormControl-small",".FormControl-select.FormControl-small",".FormControl-textarea.FormControl-small",".FormControl-input.FormControl-medium",".FormControl-select.FormControl-medium",".FormControl-textarea.FormControl-medium",".FormControl-input.FormControl-large",".FormControl-select.FormControl-large",".FormControl-textarea.FormControl-large",".FormControl-input.FormControl-inset",".FormControl-select.FormControl-inset",".FormControl-textarea.FormControl-inset",".FormControl-input.FormControl-inset:focus",".FormControl-input.FormControl-inset:focus-visible",".FormControl-select.FormControl-inset:focus",".FormControl-select.FormControl-inset:focus-visible",".FormControl-textarea.FormControl-inset:focus",".FormControl-textarea.FormControl-inset:focus-visible",".FormControl-input.FormControl-monospace",".FormControl-select.FormControl-monospace",".FormControl-textarea.FormControl-monospace",".FormControl-input.FormControl-error",".FormControl-select.FormControl-error",".FormControl-textarea.FormControl-error",".FormControl-input.FormControl-success",".FormControl-select.FormControl-success",".FormControl-textarea.FormControl-success",".FormControl-input.FormControl-warning",".FormControl-select.FormControl-warning",".FormControl-textarea.FormControl-warning",".FormControl-toggleSwitchInput",".FormControl-input-wrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual",".FormControl-input-wrap .FormControl-input-trailingAction",".FormControl-input-wrap .FormControl-input-trailingAction svg",".FormControl-input-wrap .FormControl-input-trailingAction[disabled]",".FormControl-input-wrap .FormControl-input-trailingAction:hover",".FormControl-input-wrap .FormControl-input-trailingAction:active",".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before",".FormControl-input-wrap .FormControl-input-trailingAction:after",".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",".FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before",".FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before",".FormControl-select-wrap",".FormControl-select-wrap:after",".FormControl-select-wrap .FormControl-select",".FormControl-checkbox-wrap",".FormControl-radio-wrap",".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",".FormControl-checkbox-wrap .FormControl-radio-labelWrap",".FormControl-radio-wrap .FormControl-checkbox-labelWrap",".FormControl-radio-wrap .FormControl-radio-labelWrap",".FormControl-checkbox-wrap .FormControl-label",".FormControl-radio-wrap .FormControl-label","input[type=checkbox].FormControl-checkbox","input.FormControl-checkbox[type=checkbox][disabled]","input.FormControl-checkbox[type=checkbox][invalid]:not(:focus)","input.FormControl-checkbox[type=checkbox]:not([type=checkbox]","input.FormControl-checkbox[type=checkbox]:before","input.FormControl-checkbox[type=checkbox]:after","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox]:checked","input.FormControl-checkbox[type=checkbox]:checked:before","input.FormControl-checkbox[type=checkbox]:checked:disabled","input.FormControl-checkbox[type=checkbox]:checked:disabled:before","input.FormControl-checkbox[type=checkbox]:focus-visible","input.FormControl-checkbox[type=checkbox]:indeterminate:before","input[type=radio].FormControl-radio","input.FormControl-radio[type=radio][disabled]","input.FormControl-radio[type=radio][invalid]:not(:focus)","input.FormControl-radio[type=radio]:not([type=checkbox]","input.FormControl-radio[type=radio]:after","input.FormControl-radio[type=radio]:checked","input.FormControl-radio[type=radio]:checked:disabled","input.FormControl-radio[type=radio]:focus-visible","0%","to"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["text_field.pcss","../../../../lib/postcss_mixins/focusBoxShadowInset.pcss","<no source>","../../../../lib/postcss_mixins/focusOutline.pcss"],"names":[],"mappings":"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","file":"text_field.css","sourcesContent":["/* FormControl */\n\n/* groups label, field, caption and inline error message */\n.FormControl {\n display: inline-flex;\n flex-direction: column;\n gap: var(--base-size-4, 4px);\n}\n\n/* fill container */\n.FormControl--fullWidth {\n display: flex;\n}\n\n/* <label> */\n.FormControl-label {\n font-size: var(--primer-text-body-size-medium, 14px);\n font-weight: var(--base-text-weight-semibold, 600);\n line-height: var(--primer-text-body-lineHeight-medium, calc(20 / 14));\n color: var(--color-fg-default);\n user-select: none;\n}\n\n/* optional caption */\n.FormControl-caption {\n margin-bottom: 0;\n font-size: var(--primer-text-caption-size, 12px);\n font-weight: var(--primer-text-caption-weight, 400);\n line-height: var(--primer-text-caption-lineHeight, calc(16 / 12));\n color: var(--color-fg-muted);\n}\n\n/* inline validation message */\n.FormControl-inlineValidation {\n display: flex;\n font-size: var(--primer-text-caption-size, 12px);\n font-weight: var(--base-text-weight-semibold, 600);\n color: var(--color-danger-fg);\n fill: var(--color-danger-fg);\n flex-direction: row;\n align-items: center;\n gap: var(--base-size-4, 4px);\n\n & p {\n margin-bottom: 0;\n }\n}\n\n/* shared among all form control components (input, select, textarea, checkbox, radio) */\n@define-mixin Field {\n color: var(--color-fg-default);\n background-color: var(--color-canvas-default);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-border-default);\n\n &[disabled] {\n color: var(--color-primer-fg-disabled);\n cursor: not-allowed;\n background-color: var(--color-input-disabled-bg);\n border-color: var(--color-border-default);\n opacity: 1;\n -webkit-text-fill-color: var(--color-primer-fg-disabled);\n }\n\n &:not(:focus)[invalid] {\n border-color: var(--color-danger-emphasis);\n }\n\n &:not([type='checkbox'], [type='radio']):focus {\n @mixin focusBoxShadowInset;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n border-color: transparent;\n\n @mixin focusBoxShadowInset 1px transparent;\n }\n }\n\n /* default focus state */\n &:not([type='checkbox'], [type='radio']):focus-visible {\n @mixin focusBoxShadowInset;\n }\n}\n\n/* TextInput structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** │ ├─ .FormControl-input-wrap\n** │ │ ├─ .FormControl-input-leadingVisualWrap\n** │ │ │ ├─ .FormControl-input-leadingVisual\n** │ │ ├─ .FormControl-input\n** │ │ ├─ .FormControl-input-trailingAction\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n/* // Select structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** │ ├─ .FormControl-select-wrap\n** │ │ ├─ .FormControl-select\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n/* // Textarea structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** ├─ .FormControl-textarea\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n.FormControl-input,\n.FormControl-select,\n.FormControl-textarea {\n @mixin Field;\n\n width: 100%;\n font-size: var(--primer-text-body-size-medium, 14px);\n line-height: var(--primer-text-body-lineHeight-medium, calc(20 / 14));\n border-radius: var(--primer-borderRadius-medium, 6px);\n transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);\n transition-property: color, background-color, box-shadow, border-color;\n padding-inline: var(--primer-control-medium-paddingInline-condensed, 8px);\n padding-block: calc(var(--primer-control-medium-paddingBlock, 6px) - var(--primer-borderWidth-thin, 1px));\n\n &[disabled] {\n &::placeholder {\n color: var(--color-primer-fg-disabled);\n }\n }\n\n &[readonly] {\n background-color: var(--color-input-disabled-bg);\n }\n\n &::placeholder {\n color: var(--color-fg-subtle);\n opacity: 1;\n }\n\n /* sizes */\n\n &.FormControl-small {\n height: var(--primer-control-small-size, 28px);\n padding-inline: var(--primer-control-small-paddingInline-normal, 8px);\n padding-block: var(--primer-control-small-paddingBlock, 4px);\n font-size: var(--primer-text-body-size-small, 12px);\n }\n\n &.FormControl-medium {\n height: var(--primer-control-medium-size, 32px);\n }\n\n &.FormControl-large {\n height: var(--primer-control-large-size, 40px);\n padding-inline: var(--primer-control-large-paddingInline-normal, 12px);\n padding-block: var(--primer-control-large-paddingBlock, 10px);\n }\n\n /* variants */\n\n &.FormControl-inset {\n background-color: var(--color-canvas-inset);\n\n &:focus-visible,\n &:focus {\n background-color: var(--color-canvas-default);\n }\n }\n\n &.FormControl-monospace {\n font-family:\n var(\n --primer-fontStack-monospace,\n 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace'\n );\n }\n\n /* validation states */\n\n &.FormControl-error {\n border-color: var(--color-danger-emphasis);\n }\n\n &.FormControl-success {\n border-color: var(--color-success-emphasis);\n }\n\n &.FormControl-warning {\n border-color: var(--color-attention-emphasis);\n }\n}\n\n/* positioning for leading/trailing items for TextInput */\n.FormControl-input-wrap {\n position: relative;\n display: grid;\n\n & .FormControl-input-leadingVisualWrap {\n position: absolute;\n top: var(--base-size-8, 8px);\n left: var(--base-size-8, 8px);\n display: block;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n color: var(--color-fg-muted);\n pointer-events: none;\n\n /* octicon */\n & .FormControl-input-leadingVisual {\n display: block;\n user-select: none;\n }\n }\n\n /* TODO: replace with new Button component */\n & .FormControl-input-trailingAction {\n position: absolute;\n top: var(--base-size-4, 4px);\n right: var(--base-size-4, 4px);\n z-index: 4;\n display: grid;\n width: var(--primer-control-xsmall-size, 24px);\n height: var(--primer-control-xsmall-size, 24px);\n padding: 0;\n color: var(--color-fg-muted);\n cursor: pointer;\n background: transparent;\n border: 0;\n border-radius: var(--primer-borderRadius-small);\n transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);\n transition-property: color, background-color, border-color;\n align-items: center;\n justify-content: center;\n\n & svg {\n user-select: none;\n }\n\n &[disabled] {\n color: var(--color-primer-fg-disabled);\n pointer-events: none;\n }\n\n &:hover {\n background: var(--color-action-list-item-default-hover-bg);\n }\n\n &:active {\n background: var(--color-action-list-item-default-active-bg);\n }\n\n /* show vertical divider line between field and button */\n &.FormControl-input-trailingAction--divider {\n &::before {\n position: absolute;\n top: calc((var(--primer-control-xsmall-size) - var(--base-size-16)) / 2);\n left: calc(var(--base-size-4, 4px) * -1);\n display: block;\n width: var(--primer-borderWidth-thin);\n height: var(--base-size-16);\n content: '';\n background: var(--color-border-default);\n }\n }\n\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n\n @media (pointer: coarse) {\n min-width: var(--primer-control-minTarget-coarse, 44px);\n min-height: var(--primer-control-minTarget-coarse, 44px);\n }\n }\n }\n\n /* if leadingVisual is present */\n\n /*\n\t┌──32px──┬────────────────────┐\n\t╎ ┌───┐ ┌────────────────┐ ╎\n\t╎ 16px 16px ╎\n\t╎ └───┘ └────────────────┘ ╎\n\t└───────8px───────────────────┘\n\t*/\n\n &.FormControl-input-wrap--leadingVisual {\n & .FormControl-input {\n padding-inline-start:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px)\n ); /* 32px */\n }\n }\n\n /*\n\t┌──────────────────┬──32px──┐\n\t╎ ┌──────────────┐ ┌────┐ ╎\n\t╎ 24px 24px ╎\n\t╎ └──────────────┘ └────┘ ╎\n\t└──────────────────┴────────┘\n */\n\n /* if trailingAction is present */\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input {\n padding-inline-end:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px)\n ); /* 32px */\n }\n\n /*\n\t\t32px + 1px border\n\t\t┌──────────────────┬──33px──┐\n\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t╎ 24px 24px ╎\n\t\t╎ └──────────────┘ └────┘ ╎\n\t\t└──────────────────┴────────┘\n\t\t*/\n\n /* if trailingAction divider is present, add 1px padding to accomodate input field text\n ** can be refactored to has(.FormControl-input-trailingAction--divider) */\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input {\n padding-inline-end:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 33px */\n }\n }\n }\n\n /* size modifications can be refactored with :has() - FormControl-input-wrap:has(.FormControl-large)\n // sizes */\n &.FormControl-small {\n & .FormControl-input-leadingVisualWrap {\n top: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n left: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n }\n\n /*\n ┌──────────────────┬──28px──┐\n ╎ ┌──────────────┐ ┌────┐ ╎\n ╎ 20px 20px ╎\n ╎ └──────────────┘ └────┘ ╎\n └──────────────────┴────────┘\n */\n\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input.FormControl-small {\n padding-inline-end:\n calc(\n var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-small-gap, 8px)\n ); /* 28px */\n }\n\n /*\n\t\t\t28px + 1px border\n\t\t\t┌──────────────────┬──29px──┐\n\t\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t\t╎ 20px 20px ╎\n\t\t\t╎ └──────────────┘ └────┘ ╎\n\t\t\t└──────────────────┴────────┘\n\t\t\t*/\n\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input.FormControl-small {\n padding-inline-end:\n calc(\n var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-small-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 29px */\n }\n }\n }\n\n & .FormControl-input-trailingAction {\n width: calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));\n height: calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));\n\n &::before {\n top: calc((var(--primer-control-xsmall-size) - var(--base-size-16)) / 4); /* 2px */\n }\n }\n }\n\n &.FormControl-large {\n & .FormControl-input-leadingVisualWrap {\n top: var(--primer-control-medium-paddingInline-normal, 12px);\n left: var(--primer-control-medium-paddingInline-normal, 12px);\n }\n\n /*\n ┌──36px──┬───12px padding──────┐\n ╎ ┌───┐ ┌────────────────┐ ╎\n ╎ 16px 16px ╎\n ╎ └───┘ └────────────────┘ ╎\n └12px───8px───────────────────┘\n */\n\n &.FormControl-input-wrap--leadingVisual {\n & .FormControl-input.FormControl-large {\n padding-inline-start:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px)\n ); /* 36px */\n }\n }\n\n /*\n ┌──────────────────┬──36px──┐\n ╎ ┌──────────────┐ ┌────┐ ╎\n ╎ 28px 28px ╎\n ╎ └──────────────┘ └────┘ ╎\n └──────────────────┴────────┘\n */\n\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input.FormControl-large {\n padding-inline-end:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px)\n ); /* 36px */\n }\n\n /*\n\t\t\t┌──────────────────┬──37px──┐\n\t\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t\t╎ 28px 28px ╎\n\t\t\t╎ └──────────────┘ └────┘ ╎\n\t\t\t└──────────────────┴────────┘\n\t\t\t*/\n\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input.FormControl-large {\n padding-inline-end:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 37px */\n }\n }\n }\n\n & .FormControl-input-trailingAction {\n top: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n right: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n width: var(--primer-control-small-size, 28px);\n height: var(--primer-control-small-size, 28px);\n\n &::before {\n top: unset;\n height: var(--base-size-20);\n }\n }\n }\n}\n\n.FormControl-select-wrap {\n display: grid;\n grid-template-columns: minmax(0, auto) var(--base-size-16, 16px);\n\n /* mask allows for background-color to respect themes */\n &::after {\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n padding-right: var(--base-size-4, 4px);\n pointer-events: none;\n content: '';\n background-color: var(--color-fg-muted);\n mask: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzU4NjA2OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=');\n mask-size: contain;\n mask-repeat: no-repeat;\n grid-column: 2;\n grid-row: 1;\n place-self: center end;\n }\n\n /* spans entire grid below mask */\n & .FormControl-select {\n grid-column: 1/-1;\n grid-row: 1;\n appearance: none;\n padding-right: var(--base-size-20, 20px);\n }\n}\n\n/* checkbox + radio specific styles */\n\n/* // Checkbox + Radio structure\n** ===================\n**\n** .FormControl-radio-wrap\n** ├─ .FormControl-radio\n** ├─ .FormControl-radio-labelWrap\n** │ ├─ .FormControl-label\n** │ ├─ .FormControl-caption */\n\n.FormControl-checkbox-wrap,\n.FormControl-radio-wrap {\n display: inline-grid;\n grid-template-columns: min-content auto;\n gap: var(--base-size-8, 8px);\n\n & .FormControl-checkbox-labelWrap,\n & .FormControl-radio-labelWrap {\n display: flex;\n flex-direction: column;\n gap: var(--base-size-4, 4px);\n }\n\n & .FormControl-label {\n cursor: pointer;\n }\n}\n\n/* these selectors are temporary to override base.scss\n** once Field styles are widely adopted, we can adjust this and the global base styles */\ninput[type='checkbox'].FormControl-checkbox {\n @mixin Field;\n\n position: relative;\n display: grid;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n margin: 0;\n margin-top: 0.125rem; /* 2px to center align with label (20px line-height) */\n cursor: pointer;\n border-color: var(--color-neutral-emphasis);\n border-radius: var(--primer-borderRadius-small, 3px);\n transition: background-color, border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */\n appearance: none;\n place-content: center;\n\n &::before {\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n visibility: hidden;\n content: '';\n background-color: var(--color-fg-on-emphasis);\n transition: visibility 0s linear 230ms;\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n\n /* octicon checkmark image */\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzgwMyAwLjIxOTYyNUMxMS45MjEgMC4zNjA0MjcgMTIgMC41NTEzMDUgMTIgMC43NTAzMTNDMTIgMC45NDkzMjEgMTEuOTIxIDEuMTQwMTkgMTEuNzgwMyAxLjI4MUw0LjUxODYgOC41NDA0MkM0LjM3Nzc1IDguNjgxIDQuMTg2ODIgOC43NiAzLjk4Nzc0IDguNzZDMy43ODg2NyA4Ljc2IDMuNTk3NzMgOC42ODEgMy40NTY4OSA4LjU0MDQyTDAuMjAxNjIyIDUuMjg2MkMwLjA2ODkyNzcgNS4xNDM4MyAtMC4wMDMzMDkwNSA0Ljk1NTU1IDAuMDAwMTE2NDkzIDQuNzYwOThDMC4wMDM1NTIwNSA0LjU2NjQzIDAuMDgyMzg5NCA0LjM4MDgxIDAuMjIwMDMyIDQuMjQzMjFDMC4zNTc2NjUgNC4xMDU2MiAwLjU0MzM1NSA0LjAyNjgxIDAuNzM3OTcgNC4wMjMzOEMwLjkzMjU4NCA0LjAxOTk0IDEuMTIwOTMgNC4wOTIxNyAxLjI2MzM0IDQuMjI0ODJMMy45ODc3NCA2Ljk0ODM1TDEwLjcxODYgMC4yMTk2MjVDMTAuODU5NSAwLjA3ODk5MjMgMTEuMDUwNCAwIDExLjI0OTUgMEMxMS40NDg1IDAgMTEuNjM5NSAwLjA3ODk5MjMgMTEuNzgwMyAwLjIxOTYyNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=');\n mask-size: 75%;\n mask-repeat: no-repeat;\n mask-position: center;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: checkmarkOut 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards; /* slightly snappier animation out */\n }\n }\n\n /* extend touch target */\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n }\n\n &[disabled] {\n & ~ .FormControl-checkbox-labelWrap,\n & ~ .FormControl-radio-labelWrap {\n & .FormControl-label {\n color: var(--color-primer-fg-disabled);\n cursor: not-allowed;\n }\n }\n }\n\n &:checked {\n background: var(--color-accent-fg);\n border-color: var(--color-accent-fg);\n transition: background-color, border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0ms; /* unchecked -> checked */\n\n &::before {\n visibility: visible;\n transition: visibility 0s linear 0s;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards 80ms;\n }\n }\n\n &:disabled {\n cursor: not-allowed;\n background-color: var(--color-primer-fg-disabled);\n border-color: var(--color-primer-fg-disabled);\n opacity: 1;\n\n &::before {\n background-color: var(--color-fg-on-emphasis);\n }\n }\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n }\n\n &:focus-visible {\n @mixin focusOutline 2px;\n }\n\n &:indeterminate {\n &::before {\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAxQzAgMC40NDc3MTUgMC40NDc3MTUgMCAxIDBIOUM5LjU1MjI5IDAgMTAgMC40NDc3MTUgMTAgMUMxMCAxLjU1MjI4IDkuNTUyMjkgMiA5IDJIMUMwLjQ0NzcxNSAyIDAgMS41NTIyOCAwIDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');\n visibility: visible;\n }\n }\n}\n\ninput[type='radio'].FormControl-radio {\n @mixin Field;\n\n position: relative;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n margin: 0;\n margin-top: 0.125rem; /* 2px to center align with label (20px line-height) */\n cursor: pointer;\n border-color: var(--color-neutral-emphasis);\n border-radius: var(--primer-borderRadius-full, 100vh);\n transition: background-color, border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */\n appearance: none;\n\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n }\n\n &:checked {\n border-color: var(--color-accent-fg);\n border-width: var(--base-size-4, 4px);\n\n &:disabled {\n cursor: not-allowed;\n border-color: var(--color-primer-fg-disabled);\n }\n }\n\n &:focus-visible {\n @mixin focusOutline 2px;\n }\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n}\n\n@keyframes checkmarkIn {\n from {\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n }\n\n to {\n clip-path: inset(0 0 0 0);\n }\n}\n\n@keyframes checkmarkOut {\n from {\n clip-path: inset(0 0 0 0);\n }\n\n to {\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n }\n}\n","/* inset box-shadow for form controls */\n@define-mixin focusBoxShadowInset $outlineWidth: 1px, $outlineColor: var(--color-accent-fg) {\n border-color: var(--color-accent-fg);\n outline: none;\n box-shadow: inset 0 0 0 $outlineWidth $outlineColor;\n}\n",null,"@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--color-accent-fg) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
1
+ {"version":3,"sources":["text_field.pcss","../../../../lib/postcss_mixins/focusBoxShadowInset.pcss","<no source>","../../../../lib/postcss_mixins/focusOutline.pcss"],"names":[],"mappings":"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","file":"text_field.css","sourcesContent":["/* FormControl */\n\n/* groups label, field, caption and inline error message */\n.FormControl {\n display: inline-flex;\n flex-direction: column;\n gap: var(--base-size-4, 4px);\n}\n\n/* fill container */\n.FormControl--fullWidth {\n display: flex;\n}\n\n/* <label> */\n.FormControl-label {\n font-size: var(--primer-text-body-size-medium, 14px);\n font-weight: var(--base-text-weight-semibold, 600);\n line-height: var(--primer-text-body-lineHeight-medium, calc(20 / 14));\n color: var(--color-fg-default);\n user-select: none;\n}\n\n/* optional caption */\n.FormControl-caption {\n margin-bottom: 0;\n font-size: var(--primer-text-caption-size, 12px);\n font-weight: var(--primer-text-caption-weight, 400);\n line-height: var(--primer-text-caption-lineHeight, calc(16 / 12));\n color: var(--color-fg-muted);\n}\n\n/* inline validation message */\n.FormControl-inlineValidation {\n display: flex;\n font-size: var(--primer-text-caption-size, 12px);\n font-weight: var(--base-text-weight-semibold, 600);\n color: var(--color-danger-fg);\n fill: var(--color-danger-fg);\n flex-direction: row;\n align-items: center;\n gap: var(--base-size-4, 4px);\n\n & p {\n margin-bottom: 0;\n }\n}\n\n/* shared among all form control components (input, select, textarea, checkbox, radio) */\n@define-mixin Field {\n color: var(--color-fg-default);\n background-color: var(--color-canvas-default);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-border-default);\n\n &[disabled] {\n color: var(--color-primer-fg-disabled);\n cursor: not-allowed;\n background-color: var(--color-input-disabled-bg);\n border-color: var(--color-border-default);\n opacity: 1;\n -webkit-text-fill-color: var(--color-primer-fg-disabled);\n }\n\n &:not(:focus)[invalid] {\n border-color: var(--color-danger-emphasis);\n }\n\n &:not([type='checkbox'], [type='radio']):focus {\n @mixin focusBoxShadowInset;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n border-color: transparent;\n\n @mixin focusBoxShadowInset 1px transparent;\n }\n }\n\n /* default focus state */\n &:not([type='checkbox'], [type='radio']):focus-visible {\n @mixin focusBoxShadowInset;\n }\n}\n\n/* TextInput structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** │ ├─ .FormControl-input-wrap\n** │ │ ├─ .FormControl-input-leadingVisualWrap\n** │ │ │ ├─ .FormControl-input-leadingVisual\n** │ │ ├─ .FormControl-input\n** │ │ ├─ .FormControl-input-trailingAction\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n/* // Select structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** │ ├─ .FormControl-select-wrap\n** │ │ ├─ .FormControl-select\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n/* // Textarea structure\n** ===================\n**\n** .FormControl\n** ├─ .FormControl-label\n** ├─ .FormControl-textarea\n** ├─ .FormControl-inlineValidation\n** ├─ .FormControl-caption */\n\n.FormControl-input,\n.FormControl-select,\n.FormControl-textarea {\n @mixin Field;\n\n width: 100%;\n font-size: var(--primer-text-body-size-medium, 14px);\n line-height: var(--primer-text-body-lineHeight-medium, calc(20 / 14));\n border-radius: var(--primer-borderRadius-medium, 6px);\n transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);\n transition-property: color, background-color, box-shadow, border-color;\n padding-inline: var(--primer-control-medium-paddingInline-condensed, 8px);\n padding-block: calc(var(--primer-control-medium-paddingBlock, 6px) - var(--primer-borderWidth-thin, 1px));\n\n &[disabled] {\n &::placeholder {\n color: var(--color-primer-fg-disabled);\n }\n }\n\n &[readonly] {\n background-color: var(--color-input-disabled-bg);\n }\n\n &::placeholder {\n color: var(--color-fg-subtle);\n opacity: 1;\n }\n\n /* sizes */\n\n &.FormControl-small {\n height: var(--primer-control-small-size, 28px);\n padding-inline: var(--primer-control-small-paddingInline-normal, 8px);\n padding-block: var(--primer-control-small-paddingBlock, 4px);\n font-size: var(--primer-text-body-size-small, 12px);\n }\n\n &.FormControl-medium {\n height: var(--primer-control-medium-size, 32px);\n }\n\n &.FormControl-large {\n height: var(--primer-control-large-size, 40px);\n padding-inline: var(--primer-control-large-paddingInline-normal, 12px);\n padding-block: var(--primer-control-large-paddingBlock, 10px);\n }\n\n /* variants */\n\n &.FormControl-inset {\n background-color: var(--color-canvas-inset);\n\n &:focus-visible,\n &:focus {\n background-color: var(--color-canvas-default);\n }\n }\n\n &.FormControl-monospace {\n font-family:\n var(\n --primer-fontStack-monospace,\n 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace'\n );\n }\n\n /* validation states */\n\n &.FormControl-error {\n border-color: var(--color-danger-emphasis);\n }\n\n &.FormControl-success {\n border-color: var(--color-success-emphasis);\n }\n\n &.FormControl-warning {\n border-color: var(--color-attention-emphasis);\n }\n}\n\n.FormControl-toggleSwitchInput {\n display: flex;\n align-items: flex-start;\n gap: var(--base-size-16, 16px);\n}\n\n/* positioning for leading/trailing items for TextInput */\n.FormControl-input-wrap {\n position: relative;\n display: grid;\n\n & .FormControl-input-leadingVisualWrap {\n position: absolute;\n top: var(--base-size-8, 8px);\n left: var(--base-size-8, 8px);\n display: block;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n color: var(--color-fg-muted);\n pointer-events: none;\n\n /* octicon */\n & .FormControl-input-leadingVisual {\n display: block;\n user-select: none;\n }\n }\n\n /* TODO: replace with new Button component */\n & .FormControl-input-trailingAction {\n position: absolute;\n top: var(--base-size-4, 4px);\n right: var(--base-size-4, 4px);\n z-index: 4;\n display: grid;\n width: var(--primer-control-xsmall-size, 24px);\n height: var(--primer-control-xsmall-size, 24px);\n padding: 0;\n color: var(--color-fg-muted);\n cursor: pointer;\n background: transparent;\n border: 0;\n border-radius: var(--primer-borderRadius-small);\n transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);\n transition-property: color, background-color, border-color;\n align-items: center;\n justify-content: center;\n\n & svg {\n user-select: none;\n }\n\n &[disabled] {\n color: var(--color-primer-fg-disabled);\n pointer-events: none;\n }\n\n &:hover {\n background: var(--color-action-list-item-default-hover-bg);\n }\n\n &:active {\n background: var(--color-action-list-item-default-active-bg);\n }\n\n /* show vertical divider line between field and button */\n &.FormControl-input-trailingAction--divider {\n &::before {\n position: absolute;\n top: calc((var(--primer-control-xsmall-size) - var(--base-size-16)) / 2);\n left: calc(var(--base-size-4, 4px) * -1);\n display: block;\n width: var(--primer-borderWidth-thin);\n height: var(--base-size-16);\n content: '';\n background: var(--color-border-default);\n }\n }\n\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n\n @media (pointer: coarse) {\n min-width: var(--primer-control-minTarget-coarse, 44px);\n min-height: var(--primer-control-minTarget-coarse, 44px);\n }\n }\n }\n\n /* if leadingVisual is present */\n\n /*\n\t┌──32px──┬────────────────────┐\n\t╎ ┌───┐ ┌────────────────┐ ╎\n\t╎ 16px 16px ╎\n\t╎ └───┘ └────────────────┘ ╎\n\t└───────8px───────────────────┘\n\t*/\n\n &.FormControl-input-wrap--leadingVisual {\n & .FormControl-input {\n padding-inline-start:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px)\n ); /* 32px */\n }\n }\n\n /*\n\t┌──────────────────┬──32px──┐\n\t╎ ┌──────────────┐ ┌────┐ ╎\n\t╎ 24px 24px ╎\n\t╎ └──────────────┘ └────┘ ╎\n\t└──────────────────┴────────┘\n */\n\n /* if trailingAction is present */\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input {\n padding-inline-end:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px)\n ); /* 32px */\n }\n\n /*\n\t\t32px + 1px border\n\t\t┌──────────────────┬──33px──┐\n\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t╎ 24px 24px ╎\n\t\t╎ └──────────────┘ └────┘ ╎\n\t\t└──────────────────┴────────┘\n\t\t*/\n\n /* if trailingAction divider is present, add 1px padding to accomodate input field text\n ** can be refactored to has(.FormControl-input-trailingAction--divider) */\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input {\n padding-inline-end:\n calc(\n var(--primer-control-medium-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-medium-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 33px */\n }\n }\n }\n\n /* size modifications can be refactored with :has() - FormControl-input-wrap:has(.FormControl-large)\n // sizes */\n &.FormControl-small {\n & .FormControl-input-leadingVisualWrap {\n top: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n left: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n }\n\n /*\n ┌──────────────────┬──28px──┐\n ╎ ┌──────────────┐ ┌────┐ ╎\n ╎ 20px 20px ╎\n ╎ └──────────────┘ └────┘ ╎\n └──────────────────┴────────┘\n */\n\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input.FormControl-small {\n padding-inline-end:\n calc(\n var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-small-gap, 8px)\n ); /* 28px */\n }\n\n /*\n\t\t\t28px + 1px border\n\t\t\t┌──────────────────┬──29px──┐\n\t\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t\t╎ 20px 20px ╎\n\t\t\t╎ └──────────────┘ └────┘ ╎\n\t\t\t└──────────────────┴────────┘\n\t\t\t*/\n\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input.FormControl-small {\n padding-inline-end:\n calc(\n var(--primer-control-small-paddingInline-condensed, 8px) + var(--base-size-16, 16px) +\n var(--primer-control-small-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 29px */\n }\n }\n }\n\n & .FormControl-input-trailingAction {\n width: calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));\n height: calc(var(--primer-control-small-size, 28px) - var(--base-size-8, 8px));\n\n &::before {\n top: calc((var(--primer-control-xsmall-size) - var(--base-size-16)) / 4); /* 2px */\n }\n }\n }\n\n &.FormControl-large {\n & .FormControl-input-leadingVisualWrap {\n top: var(--primer-control-medium-paddingInline-normal, 12px);\n left: var(--primer-control-medium-paddingInline-normal, 12px);\n }\n\n /*\n ┌──36px──┬───12px padding──────┐\n ╎ ┌───┐ ┌────────────────┐ ╎\n ╎ 16px 16px ╎\n ╎ └───┘ └────────────────┘ ╎\n └12px───8px───────────────────┘\n */\n\n &.FormControl-input-wrap--leadingVisual {\n & .FormControl-input.FormControl-large {\n padding-inline-start:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px)\n ); /* 36px */\n }\n }\n\n /*\n ┌──────────────────┬──36px──┐\n ╎ ┌──────────────┐ ┌────┐ ╎\n ╎ 28px 28px ╎\n ╎ └──────────────┘ └────┘ ╎\n └──────────────────┴────────┘\n */\n\n &.FormControl-input-wrap--trailingAction {\n & .FormControl-input.FormControl-large {\n padding-inline-end:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px)\n ); /* 36px */\n }\n\n /*\n\t\t\t┌──────────────────┬──37px──┐\n\t\t\t╎ ┌──────────────┐ ┌────┐ ╎\n\t\t\t╎ 28px 28px ╎\n\t\t\t╎ └──────────────┘ └────┘ ╎\n\t\t\t└──────────────────┴────────┘\n\t\t\t*/\n\n &.FormControl-input-wrap-trailingAction--divider {\n & .FormControl-input.FormControl-large {\n padding-inline-end:\n calc(\n var(--primer-control-large-paddingInline-normal, 12px) + var(--base-size-16, 16px) +\n var(--primer-control-large-gap, 8px) + var(--primer-borderWidth-thin, 1px)\n ); /* 37px */\n }\n }\n }\n\n & .FormControl-input-trailingAction {\n top: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n right: calc(var(--primer-control-medium-paddingInline-condensed, 8px) - 0.125rem); /* 6px */\n width: var(--primer-control-small-size, 28px);\n height: var(--primer-control-small-size, 28px);\n\n &::before {\n top: unset;\n height: var(--base-size-20);\n }\n }\n }\n}\n\n.FormControl-select-wrap {\n display: grid;\n grid-template-columns: minmax(0, auto) var(--base-size-16, 16px);\n\n /* mask allows for background-color to respect themes */\n &::after {\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n padding-right: var(--base-size-4, 4px);\n pointer-events: none;\n content: '';\n background-color: var(--color-fg-muted);\n mask: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzU4NjA2OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=');\n mask-size: contain;\n mask-repeat: no-repeat;\n grid-column: 2;\n grid-row: 1;\n place-self: center end;\n }\n\n /* spans entire grid below mask */\n & .FormControl-select {\n grid-column: 1/-1;\n grid-row: 1;\n appearance: none;\n padding-right: var(--base-size-20, 20px);\n }\n}\n\n/* checkbox + radio specific styles */\n\n/* // Checkbox + Radio structure\n** ===================\n**\n** .FormControl-radio-wrap\n** ├─ .FormControl-radio\n** ├─ .FormControl-radio-labelWrap\n** │ ├─ .FormControl-label\n** │ ├─ .FormControl-caption */\n\n.FormControl-checkbox-wrap,\n.FormControl-radio-wrap {\n display: inline-grid;\n grid-template-columns: min-content auto;\n gap: var(--base-size-8, 8px);\n\n & .FormControl-checkbox-labelWrap,\n & .FormControl-radio-labelWrap {\n display: flex;\n flex-direction: column;\n gap: var(--base-size-4, 4px);\n }\n\n & .FormControl-label {\n cursor: pointer;\n }\n}\n\n/* these selectors are temporary to override base.scss\n** once Field styles are widely adopted, we can adjust this and the global base styles */\ninput[type='checkbox'].FormControl-checkbox {\n @mixin Field;\n\n position: relative;\n display: grid;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n margin: 0;\n margin-top: 0.125rem; /* 2px to center align with label (20px line-height) */\n cursor: pointer;\n border-color: var(--color-neutral-emphasis);\n border-radius: var(--primer-borderRadius-small, 3px);\n transition: background-color, border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */\n appearance: none;\n place-content: center;\n\n &::before {\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n visibility: hidden;\n content: '';\n background-color: var(--color-fg-on-emphasis);\n transition: visibility 0s linear 230ms;\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n\n /* octicon checkmark image */\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzgwMyAwLjIxOTYyNUMxMS45MjEgMC4zNjA0MjcgMTIgMC41NTEzMDUgMTIgMC43NTAzMTNDMTIgMC45NDkzMjEgMTEuOTIxIDEuMTQwMTkgMTEuNzgwMyAxLjI4MUw0LjUxODYgOC41NDA0MkM0LjM3Nzc1IDguNjgxIDQuMTg2ODIgOC43NiAzLjk4Nzc0IDguNzZDMy43ODg2NyA4Ljc2IDMuNTk3NzMgOC42ODEgMy40NTY4OSA4LjU0MDQyTDAuMjAxNjIyIDUuMjg2MkMwLjA2ODkyNzcgNS4xNDM4MyAtMC4wMDMzMDkwNSA0Ljk1NTU1IDAuMDAwMTE2NDkzIDQuNzYwOThDMC4wMDM1NTIwNSA0LjU2NjQzIDAuMDgyMzg5NCA0LjM4MDgxIDAuMjIwMDMyIDQuMjQzMjFDMC4zNTc2NjUgNC4xMDU2MiAwLjU0MzM1NSA0LjAyNjgxIDAuNzM3OTcgNC4wMjMzOEMwLjkzMjU4NCA0LjAxOTk0IDEuMTIwOTMgNC4wOTIxNyAxLjI2MzM0IDQuMjI0ODJMMy45ODc3NCA2Ljk0ODM1TDEwLjcxODYgMC4yMTk2MjVDMTAuODU5NSAwLjA3ODk5MjMgMTEuMDUwNCAwIDExLjI0OTUgMEMxMS40NDg1IDAgMTEuNjM5NSAwLjA3ODk5MjMgMTEuNzgwMyAwLjIxOTYyNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=');\n mask-size: 75%;\n mask-repeat: no-repeat;\n mask-position: center;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: checkmarkOut 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards; /* slightly snappier animation out */\n }\n }\n\n /* extend touch target */\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n }\n\n &[disabled] {\n & ~ .FormControl-checkbox-labelWrap,\n & ~ .FormControl-radio-labelWrap {\n & .FormControl-label {\n color: var(--color-primer-fg-disabled);\n cursor: not-allowed;\n }\n }\n }\n\n &:checked {\n background: var(--color-accent-fg);\n border-color: var(--color-accent-fg);\n transition: background-color, border-color 80ms cubic-bezier(0.32, 0, 0.67, 0) 0ms; /* unchecked -> checked */\n\n &::before {\n visibility: visible;\n transition: visibility 0s linear 0s;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n animation: checkmarkIn 80ms cubic-bezier(0.65, 0, 0.35, 1) forwards 80ms;\n }\n }\n\n &:disabled {\n cursor: not-allowed;\n background-color: var(--color-primer-fg-disabled);\n border-color: var(--color-primer-fg-disabled);\n opacity: 1;\n\n &::before {\n background-color: var(--color-fg-on-emphasis);\n }\n }\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n }\n\n &:focus-visible {\n @mixin focusOutline 2px;\n }\n\n &:indeterminate {\n &::before {\n mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAxQzAgMC40NDc3MTUgMC40NDc3MTUgMCAxIDBIOUM5LjU1MjI5IDAgMTAgMC40NDc3MTUgMTAgMUMxMCAxLjU1MjI4IDkuNTUyMjkgMiA5IDJIMUMwLjQ0NzcxNSAyIDAgMS41NTIyOCAwIDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');\n visibility: visible;\n }\n }\n}\n\ninput[type='radio'].FormControl-radio {\n @mixin Field;\n\n position: relative;\n width: var(--base-size-16, 16px);\n height: var(--base-size-16, 16px);\n margin: 0;\n margin-top: 0.125rem; /* 2px to center align with label (20px line-height) */\n cursor: pointer;\n border-color: var(--color-neutral-emphasis);\n border-radius: var(--primer-borderRadius-full, 100vh);\n transition: background-color, border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */\n appearance: none;\n\n &::after {\n @mixin minTouchTarget var(--primer-control-medium-size, 32px) var(--primer-control-medium-size, 32px);\n }\n\n &:checked {\n border-color: var(--color-accent-fg);\n border-width: var(--base-size-4, 4px);\n\n &:disabled {\n cursor: not-allowed;\n border-color: var(--color-primer-fg-disabled);\n }\n }\n\n &:focus-visible {\n @mixin focusOutline 2px;\n }\n\n /* Windows High Contrast mode */\n @media (forced-colors: active) {\n background-color: canvastext;\n border-color: canvastext;\n }\n}\n\n@keyframes checkmarkIn {\n from {\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n }\n\n to {\n clip-path: inset(0 0 0 0);\n }\n}\n\n@keyframes checkmarkOut {\n from {\n clip-path: inset(0 0 0 0);\n }\n\n to {\n clip-path: inset(var(--base-size-16, 16px) 0 0 0);\n }\n}\n","/* inset box-shadow for form controls */\n@define-mixin focusBoxShadowInset $outlineWidth: 1px, $outlineColor: var(--color-accent-fg) {\n border-color: var(--color-accent-fg);\n outline: none;\n box-shadow: inset 0 0 0 $outlineWidth $outlineColor;\n}\n",null,"@define-mixin focusOutline $outlineOffset: -2px, $outlineColor: var(--color-accent-fg) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: none;\n}\n"]}
@@ -196,6 +196,12 @@
196
196
  }
197
197
  }
198
198
 
199
+ .FormControl-toggleSwitchInput {
200
+ display: flex;
201
+ align-items: flex-start;
202
+ gap: var(--base-size-16, 16px);
203
+ }
204
+
199
205
  /* positioning for leading/trailing items for TextInput */
200
206
  .FormControl-input-wrap {
201
207
  position: relative;
@@ -1 +1 @@
1
- .ToggleSwitch,.ToggleSwitch.ToggleSwitch{display:inline-flex}.ToggleSwitch{align-items:center;gap:var(--primer-controlStack-medium-gap-condensed,8px)}.ToggleSwitch:hover .ToggleSwitch-knob{background-color:var(--color-btn-hover-bg)}.ToggleSwitch:active .ToggleSwitch-knob{background-color:var(--color-btn-active-bg)}.ToggleSwitch--checked .ToggleSwitch-statusOn{height:auto;visibility:visible}.ToggleSwitch--checked .ToggleSwitch-statusOff{height:0;visibility:hidden}.ToggleSwitch-track{-webkit-appearance:none;appearance:none;background-color:var(--color-switch-track-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);cursor:pointer;display:block;height:var(--primer-control-medium-size,32px);overflow:hidden;padding:0;position:relative;text-decoration:none;transition-duration:80ms;transition-property:background-color,border-color;transition-timing-function:cubic-bezier(.5,1,.89,1);-webkit-user-select:none;user-select:none;width:var(--base-size-64,64px)}.ToggleSwitch-track:focus,.ToggleSwitch-track:focus-visible{outline-offset:0}@media (pointer:coarse){.ToggleSwitch-track:before{content:"";height:100%;left:50%;min-height:44px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}@media (prefers-reduced-motion){.ToggleSwitch-track,.ToggleSwitch-track *{transition:none}}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]{background-color:var(--color-canvas-subtle);border-color:var(--color-border-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover{background-color:var(--color-canvas-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-disabled-bg)}.ToggleSwitch-track[aria-checked=true]{background-color:var(--color-switch-track-checked-bg);border-color:var(--color-switch-track-checked-border)}.ToggleSwitch-track[aria-checked=true]:hover{background-color:var(--color-switch-track-checked-hover-bg)}.ToggleSwitch-track[aria-checked=true]:active{background-color:var(--color-switch-track-checked-active-bg)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-bg);border:0;transform:translateX(calc(100% + 1px))}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon{transform:translateX(0)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon{transform:translateX(100%)}.ToggleSwitch-track[aria-disabled=true]{background-color:var(--color-canvas-subtle);border-color:var(--color-border-subtle);cursor:not-allowed;transition-property:none}.ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob{border-color:var(--color-border-default);box-shadow:none}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon{color:var(--color-fg-subtle)}.ToggleSwitch-icons{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.ToggleSwitch-lineIcon{color:var(--color-accent-fg);transform:translateX(-100%)}.ToggleSwitch-circleIcon,.ToggleSwitch-lineIcon{flex:1 0 50%;line-height:0;transition-duration:80ms;transition-property:transform}.ToggleSwitch-circleIcon{color:var(--color-fg-default);transform:translateX(0)}.ToggleSwitch-knob{background-color:var(--color-btn-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);bottom:-1px;box-shadow:var(--color-shadow-medium),var(--color-btn-inset-shadow);position:absolute;top:-1px;transform:translateX(-1px);transition-duration:80ms;transition-property:transform;transition-timing-function:cubic-bezier(.5,1,.89,1);width:50%;z-index:1}@media (prefers-reduced-motion){.ToggleSwitch-knob{transition:none}}.ToggleSwitch-status{color:var(--color-fg-default);font-size:var(--primer-text-body-size-medium,14px);line-height:1.5;position:relative;text-align:right}.ToggleSwitch--small .ToggleSwitch-status{font-size:var(--primer-text-body-size-small,12px)}.ToggleSwitch--small .ToggleSwitch-track{height:var(--primer-control-xsmall-size,24px);width:var(--base-size-48,48px)}.ToggleSwitch--disabled .ToggleSwitch-status{color:var(--color-fg-muted)}.ToggleSwitch-statusOn{height:0;visibility:hidden}.ToggleSwitch-statusOff{height:auto;visibility:visible}.ToggleSwitch--statusAtEnd{flex-direction:row-reverse}.ToggleSwitch--statusAtEnd .ToggleSwitch-status{text-align:left}
1
+ .ToggleSwitch,.ToggleSwitch.ToggleSwitch{display:inline-flex}.ToggleSwitch{align-items:center;gap:var(--primer-controlStack-medium-gap-condensed,8px)}.ToggleSwitch:hover .ToggleSwitch-knob{background-color:var(--color-btn-hover-bg)}.ToggleSwitch:active .ToggleSwitch-knob{background-color:var(--color-btn-active-bg)}.ToggleSwitch--checked .ToggleSwitch-statusOn{height:auto;visibility:visible}.ToggleSwitch--checked .ToggleSwitch-statusOff{height:0;visibility:hidden}.ToggleSwitch-track{-webkit-appearance:none;appearance:none;background-color:var(--color-switch-track-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);cursor:pointer;display:block;height:var(--primer-control-medium-size,32px);overflow:hidden;padding:0;position:relative;text-decoration:none;transition-duration:80ms;transition-property:background-color,border-color;transition-timing-function:cubic-bezier(.5,1,.89,1);-webkit-user-select:none;user-select:none;width:var(--base-size-64,64px)}.ToggleSwitch-track:focus,.ToggleSwitch-track:focus-visible{outline-offset:0}@media (pointer:coarse){.ToggleSwitch-track:before{content:"";height:100%;left:50%;min-height:44px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}@media (prefers-reduced-motion){.ToggleSwitch-track,.ToggleSwitch-track *{transition:none}}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]{background-color:var(--color-canvas-subtle);border-color:var(--color-border-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover{background-color:var(--color-canvas-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-disabled-bg)}.ToggleSwitch-track[aria-checked=true]{background-color:var(--color-switch-track-checked-bg);border-color:var(--color-switch-track-checked-border)}.ToggleSwitch-track[aria-checked=true]:hover{background-color:var(--color-switch-track-checked-hover-bg)}.ToggleSwitch-track[aria-checked=true]:active{background-color:var(--color-switch-track-checked-active-bg)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-bg);border:0;transform:translateX(calc(100% + 1px))}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon{transform:translateX(0)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon{transform:translateX(100%)}.ToggleSwitch-track[aria-disabled=true]{background-color:var(--color-canvas-subtle);border-color:var(--color-border-subtle);cursor:not-allowed;transition-property:none}.ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob{border-color:var(--color-border-default);box-shadow:none}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon{color:var(--color-fg-subtle)}.ToggleSwitch-icons{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.ToggleSwitch-lineIcon{color:var(--color-accent-fg);transform:translateX(-100%)}.ToggleSwitch-circleIcon,.ToggleSwitch-lineIcon{flex:1 0 50%;line-height:0;transition-duration:80ms;transition-property:transform}.ToggleSwitch-circleIcon{color:var(--color-fg-default);transform:translateX(0)}.ToggleSwitch-knob{background-color:var(--color-btn-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);bottom:-1px;box-shadow:var(--color-shadow-medium),var(--color-btn-inset-shadow);position:absolute;top:-1px;transform:translateX(-1px);transition-duration:80ms;transition-property:transform;transition-timing-function:cubic-bezier(.5,1,.89,1);width:50%;z-index:1}@media (prefers-reduced-motion){.ToggleSwitch-knob{transition:none}}.ToggleSwitch-status{color:var(--color-fg-default);font-size:var(--primer-text-body-size-medium,14px);line-height:1.5;position:relative;text-align:right}.ToggleSwitch-statusIcon{display:flex;margin-top:.063rem;width:var(--base-size-16,16px)}.ToggleSwitch--small .ToggleSwitch-status{font-size:var(--primer-text-body-size-small,12px)}.ToggleSwitch--small .ToggleSwitch-track{height:var(--primer-control-xsmall-size,24px);width:var(--base-size-48,48px)}.ToggleSwitch--disabled .ToggleSwitch-status{color:var(--color-fg-muted)}.ToggleSwitch-statusOn{height:0;visibility:hidden}.ToggleSwitch-statusOff{height:auto;visibility:visible}.ToggleSwitch--statusAtEnd{flex-direction:row-reverse}.ToggleSwitch--statusAtEnd .ToggleSwitch-status{text-align:left}
@@ -1 +1 @@
1
- {"name":"alpha/toggle_switch","selectors":[".ToggleSwitch",".ToggleSwitch.ToggleSwitch",".ToggleSwitch:hover .ToggleSwitch-knob",".ToggleSwitch:active .ToggleSwitch-knob",".ToggleSwitch--checked .ToggleSwitch-statusOn",".ToggleSwitch--checked .ToggleSwitch-statusOff",".ToggleSwitch-track",".ToggleSwitch-track:focus",".ToggleSwitch-track:focus-visible",".ToggleSwitch-track:before",".ToggleSwitch-track *",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover",".ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true]",".ToggleSwitch-track[aria-checked=true]:hover",".ToggleSwitch-track[aria-checked=true]:active",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true]",".ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon",".ToggleSwitch-icons",".ToggleSwitch-lineIcon",".ToggleSwitch-circleIcon",".ToggleSwitch-knob",".ToggleSwitch-status",".ToggleSwitch--small .ToggleSwitch-status",".ToggleSwitch--small .ToggleSwitch-track",".ToggleSwitch--disabled .ToggleSwitch-status",".ToggleSwitch-statusOn",".ToggleSwitch-statusOff",".ToggleSwitch--statusAtEnd",".ToggleSwitch--statusAtEnd .ToggleSwitch-status"]}
1
+ {"name":"alpha/toggle_switch","selectors":[".ToggleSwitch",".ToggleSwitch.ToggleSwitch",".ToggleSwitch:hover .ToggleSwitch-knob",".ToggleSwitch:active .ToggleSwitch-knob",".ToggleSwitch--checked .ToggleSwitch-statusOn",".ToggleSwitch--checked .ToggleSwitch-statusOff",".ToggleSwitch-track",".ToggleSwitch-track:focus",".ToggleSwitch-track:focus-visible",".ToggleSwitch-track:before",".ToggleSwitch-track *",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover",".ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true]",".ToggleSwitch-track[aria-checked=true]:hover",".ToggleSwitch-track[aria-checked=true]:active",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true]",".ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon",".ToggleSwitch-icons",".ToggleSwitch-lineIcon",".ToggleSwitch-circleIcon",".ToggleSwitch-knob",".ToggleSwitch-status",".ToggleSwitch-statusIcon",".ToggleSwitch--small .ToggleSwitch-status",".ToggleSwitch--small .ToggleSwitch-track",".ToggleSwitch--disabled .ToggleSwitch-status",".ToggleSwitch-statusOn",".ToggleSwitch-statusOff",".ToggleSwitch--statusAtEnd",".ToggleSwitch--statusAtEnd .ToggleSwitch-status"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["toggle_switch.pcss","<no source>"],"names":[],"mappings":"AAQA,yCAHE,mBAmBF,CAhBA,cACE,kBAAmB,CAEnB,uDAaF,CAVI,uCACE,0CACF,CAIA,wCACE,2CACF,CAKF,8CACE,WAAY,CACZ,kBACF,CAEA,+CACE,QAAS,CACT,iBACF,CAGF,oBAgBE,uBAAgB,CAAhB,eAAgB,CANhB,6CAA8C,CAC9C,gFAAkF,CAClF,mDAAqD,CAJrD,cAAe,CANf,aAAc,CAEd,6CAA+C,CAE/C,eAAgB,CADhB,SAAU,CAJV,iBAAkB,CAMlB,oBAAqB,CAOrB,wBAAyB,CACzB,iDAAmD,CAFnD,mDAAyD,CAJzD,wBAAiB,CAAjB,gBAAiB,CANjB,8BAiCF,CAlBE,4DAEE,gBACF,CAEA,wBAEI,2BC/DN,WAAA,YAAA,SAAA,gBAAA,kBAAA,QAAA,4CAAA,UD+DgC,CAE9B,CAEA,gCAGE,0CACE,eACF,CACF,CAGF,2DACE,2CAA4C,CAC5C,uCAiBF,CAfE,mIAEE,2CAQF,CAEA,uPACE,6DACF,CAGF,uCACE,qDAAsD,CACtD,qDAuBF,CArBE,6CACE,2DACF,CAEA,8CACE,4DACF,CAEA,0DACE,oDAAqD,CACrD,QAAS,CACT,sCACF,CAEA,8DACE,uBACF,CAEA,gEACE,0BACF,CAGF,wCAEE,2CAA4C,CAC5C,uCAAwC,CAFxC,kBAAmB,CAGnB,wBA0BF,CAtBI,mIACE,oCACF,CAGF,2DACE,wCAAyC,CACzC,eAMF,CAJE,mIAEE,oCACF,CAOF,gIACE,4BACF,CAGF,oBAEE,kBAAmB,CADnB,YAAa,CAGb,WAAY,CACZ,eAAgB,CAFhB,UAGF,CAEA,uBAEE,4BAA6B,CAG7B,2BAEF,CAEA,gDAHE,YAAa,CALb,aAAc,CAEd,wBAAyB,CACzB,6BAYF,CAPA,yBAEE,6BAA8B,CAG9B,uBAEF,CAEA,mBAME,oCAAqC,CACrC,gFAAkF,CAClF,mDAAqD,CALrD,WAAY,CAMZ,mEAAqE,CARrE,iBAAkB,CAClB,QAAS,CAWT,0BAA2B,CAF3B,wBAAyB,CACzB,6BAA8B,CAF9B,mDAAyD,CALzD,SAAU,CADV,SAcF,CAHE,gCAfF,mBAgBI,eAEJ,CADE,CAGF,qBAIE,6BAA8B,CAF9B,kDAAoD,CACpD,eAAgB,CAFhB,iBAAkB,CAIlB,gBACF,CAGE,0CACE,iDACF,CAEA,yCAEE,6CAA+C,CAD/C,8BAEF,CAIA,6CACE,2BACF,CAGF,uBACE,QAAS,CACT,iBACF,CAEA,wBACE,WAAY,CACZ,kBACF,CAEA,2BACE,0BAKF,CAHE,gDACE,eACF","file":"toggle_switch.css","sourcesContent":["/* ToggleSwitch */\n\n/* Catalyst in dotcom applies a display: block to all web component elements. This\n** rule overrides it so the status label and toggle switch are laid out correctly. */\n.ToggleSwitch.ToggleSwitch {\n display: inline-flex;\n}\n\n.ToggleSwitch {\n align-items: center;\n display: inline-flex;\n gap: var(--primer-controlStack-medium-gap-condensed, 8px);\n\n &:hover {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-hover-bg);\n }\n }\n\n &:active {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-active-bg);\n }\n }\n}\n\n.ToggleSwitch--checked {\n & .ToggleSwitch-statusOn {\n height: auto;\n visibility: visible;\n }\n\n & .ToggleSwitch-statusOff {\n height: 0;\n visibility: hidden;\n }\n}\n\n.ToggleSwitch-track {\n position: relative;\n display: block;\n width: var(--base-size-64, 64px);\n height: var(--primer-control-medium-size, 32px);\n padding: 0;\n overflow: hidden;\n text-decoration: none;\n cursor: pointer;\n user-select: none;\n background-color: var(--color-switch-track-bg);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-switch-track-border);\n border-radius: var(--primer-borderRadius-medium, 6px);\n transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);\n transition-duration: 80ms;\n transition-property: background-color, border-color;\n appearance: none;\n\n &:focus,\n &:focus-visible {\n outline-offset: 0;\n }\n\n @media (pointer: coarse) {\n &::before {\n @mixin minTouchTarget 44px;\n }\n }\n\n @media (prefers-reduced-motion) {\n transition: none;\n\n & * {\n transition: none;\n }\n }\n}\n\n.ToggleSwitch-track[aria-checked='true'][aria-disabled='true'] {\n background-color: var(--color-canvas-subtle);\n border-color: var(--color-border-subtle);\n\n &:hover,\n &:active {\n background-color: var(--color-canvas-subtle);\n\n /* This is the most straightforward way of setting the knob's styles when the\n ** switch is both checked and disabled. */\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-disabled-bg);\n }\n }\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-disabled-bg);\n }\n}\n\n.ToggleSwitch-track[aria-checked='true'] {\n background-color: var(--color-switch-track-checked-bg);\n border-color: var(--color-switch-track-checked-border);\n\n &:hover {\n background-color: var(--color-switch-track-checked-hover-bg);\n }\n\n &:active {\n background-color: var(--color-switch-track-checked-active-bg);\n }\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-bg);\n border: 0;\n transform: translateX(calc(100% + 1px));\n }\n\n & .ToggleSwitch-lineIcon {\n transform: translateX(0%);\n }\n\n & .ToggleSwitch-circleIcon {\n transform: translateX(100%);\n }\n}\n\n.ToggleSwitch-track[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--color-canvas-subtle);\n border-color: var(--color-border-subtle);\n transition-property: none;\n\n &:hover,\n &:active {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-bg);\n }\n }\n\n & .ToggleSwitch-knob {\n border-color: var(--color-border-default);\n box-shadow: none;\n\n &:hover,\n &:active {\n background-color: var(--color-btn-bg);\n }\n }\n\n & .ToggleSwitch-lineIcon {\n color: var(--color-fg-subtle);\n }\n\n & .ToggleSwitch-circleIcon {\n color: var(--color-fg-subtle);\n }\n}\n\n.ToggleSwitch-icons {\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.ToggleSwitch-lineIcon {\n line-height: 0;\n color: var(--color-accent-fg);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(-100%);\n flex: 1 0 50%;\n}\n\n.ToggleSwitch-circleIcon {\n line-height: 0;\n color: var(--color-fg-default);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(0);\n flex: 1 0 50%;\n}\n\n.ToggleSwitch-knob {\n position: absolute;\n top: -1px;\n bottom: -1px;\n z-index: 1;\n width: 50%;\n background-color: var(--color-btn-bg);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-switch-track-border);\n border-radius: var(--primer-borderRadius-medium, 6px);\n box-shadow: var(--color-shadow-medium), var(--color-btn-inset-shadow);\n transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(-1px);\n\n @media (prefers-reduced-motion) {\n transition: none;\n }\n}\n\n.ToggleSwitch-status {\n position: relative;\n font-size: var(--primer-text-body-size-medium, 14px);\n line-height: 1.5;\n color: var(--color-fg-default);\n text-align: right;\n}\n\n.ToggleSwitch--small {\n & .ToggleSwitch-status {\n font-size: var(--primer-text-body-size-small, 12px);\n }\n\n & .ToggleSwitch-track {\n width: var(--base-size-48, 48px);\n height: var(--primer-control-xsmall-size, 24px);\n }\n}\n\n.ToggleSwitch--disabled {\n & .ToggleSwitch-status {\n color: var(--color-fg-muted);\n }\n}\n\n.ToggleSwitch-statusOn {\n height: 0;\n visibility: hidden;\n}\n\n.ToggleSwitch-statusOff {\n height: auto;\n visibility: visible;\n}\n\n.ToggleSwitch--statusAtEnd {\n flex-direction: row-reverse;\n\n & .ToggleSwitch-status {\n text-align: left;\n }\n}\n",null]}
1
+ {"version":3,"sources":["toggle_switch.pcss","<no source>"],"names":[],"mappings":"AAQA,yCAHE,mBAmBF,CAhBA,cACE,kBAAmB,CAEnB,uDAaF,CAVI,uCACE,0CACF,CAIA,wCACE,2CACF,CAKF,8CACE,WAAY,CACZ,kBACF,CAEA,+CACE,QAAS,CACT,iBACF,CAGF,oBAgBE,uBAAgB,CAAhB,eAAgB,CANhB,6CAA8C,CAC9C,gFAAkF,CAClF,mDAAqD,CAJrD,cAAe,CANf,aAAc,CAEd,6CAA+C,CAE/C,eAAgB,CADhB,SAAU,CAJV,iBAAkB,CAMlB,oBAAqB,CAOrB,wBAAyB,CACzB,iDAAmD,CAFnD,mDAAyD,CAJzD,wBAAiB,CAAjB,gBAAiB,CANjB,8BAiCF,CAlBE,4DAEE,gBACF,CAEA,wBAEI,2BC/DN,WAAA,YAAA,SAAA,gBAAA,kBAAA,QAAA,4CAAA,UD+DgC,CAE9B,CAEA,gCAGE,0CACE,eACF,CACF,CAGF,2DACE,2CAA4C,CAC5C,uCAiBF,CAfE,mIAEE,2CAQF,CAEA,uPACE,6DACF,CAGF,uCACE,qDAAsD,CACtD,qDAuBF,CArBE,6CACE,2DACF,CAEA,8CACE,4DACF,CAEA,0DACE,oDAAqD,CACrD,QAAS,CACT,sCACF,CAEA,8DACE,uBACF,CAEA,gEACE,0BACF,CAGF,wCAEE,2CAA4C,CAC5C,uCAAwC,CAFxC,kBAAmB,CAGnB,wBA0BF,CAtBI,mIACE,oCACF,CAGF,2DACE,wCAAyC,CACzC,eAMF,CAJE,mIAEE,oCACF,CAOF,gIACE,4BACF,CAGF,oBAEE,kBAAmB,CADnB,YAAa,CAGb,WAAY,CACZ,eAAgB,CAFhB,UAGF,CAEA,uBAEE,4BAA6B,CAG7B,2BAEF,CAEA,gDAHE,YAAa,CALb,aAAc,CAEd,wBAAyB,CACzB,6BAYF,CAPA,yBAEE,6BAA8B,CAG9B,uBAEF,CAEA,mBAME,oCAAqC,CACrC,gFAAkF,CAClF,mDAAqD,CALrD,WAAY,CAMZ,mEAAqE,CARrE,iBAAkB,CAClB,QAAS,CAWT,0BAA2B,CAF3B,wBAAyB,CACzB,6BAA8B,CAF9B,mDAAyD,CALzD,SAAU,CADV,SAcF,CAHE,gCAfF,mBAgBI,eAEJ,CADE,CAGF,qBAIE,6BAA8B,CAF9B,kDAAoD,CACpD,eAAgB,CAFhB,iBAAkB,CAIlB,gBACF,CAEA,yBAEE,YAAa,CACb,kBAAoB,CAFpB,8BAGF,CAGE,0CACE,iDACF,CAEA,yCAEE,6CAA+C,CAD/C,8BAEF,CAIA,6CACE,2BACF,CAGF,uBACE,QAAS,CACT,iBACF,CAEA,wBACE,WAAY,CACZ,kBACF,CAEA,2BACE,0BAKF,CAHE,gDACE,eACF","file":"toggle_switch.css","sourcesContent":["/* ToggleSwitch */\n\n/* Catalyst in dotcom applies a display: block to all web component elements. This\n** rule overrides it so the status label and toggle switch are laid out correctly. */\n.ToggleSwitch.ToggleSwitch {\n display: inline-flex;\n}\n\n.ToggleSwitch {\n align-items: center;\n display: inline-flex;\n gap: var(--primer-controlStack-medium-gap-condensed, 8px);\n\n &:hover {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-hover-bg);\n }\n }\n\n &:active {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-active-bg);\n }\n }\n}\n\n.ToggleSwitch--checked {\n & .ToggleSwitch-statusOn {\n height: auto;\n visibility: visible;\n }\n\n & .ToggleSwitch-statusOff {\n height: 0;\n visibility: hidden;\n }\n}\n\n.ToggleSwitch-track {\n position: relative;\n display: block;\n width: var(--base-size-64, 64px);\n height: var(--primer-control-medium-size, 32px);\n padding: 0;\n overflow: hidden;\n text-decoration: none;\n cursor: pointer;\n user-select: none;\n background-color: var(--color-switch-track-bg);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-switch-track-border);\n border-radius: var(--primer-borderRadius-medium, 6px);\n transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);\n transition-duration: 80ms;\n transition-property: background-color, border-color;\n appearance: none;\n\n &:focus,\n &:focus-visible {\n outline-offset: 0;\n }\n\n @media (pointer: coarse) {\n &::before {\n @mixin minTouchTarget 44px;\n }\n }\n\n @media (prefers-reduced-motion) {\n transition: none;\n\n & * {\n transition: none;\n }\n }\n}\n\n.ToggleSwitch-track[aria-checked='true'][aria-disabled='true'] {\n background-color: var(--color-canvas-subtle);\n border-color: var(--color-border-subtle);\n\n &:hover,\n &:active {\n background-color: var(--color-canvas-subtle);\n\n /* This is the most straightforward way of setting the knob's styles when the\n ** switch is both checked and disabled. */\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-disabled-bg);\n }\n }\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-disabled-bg);\n }\n}\n\n.ToggleSwitch-track[aria-checked='true'] {\n background-color: var(--color-switch-track-checked-bg);\n border-color: var(--color-switch-track-checked-border);\n\n &:hover {\n background-color: var(--color-switch-track-checked-hover-bg);\n }\n\n &:active {\n background-color: var(--color-switch-track-checked-active-bg);\n }\n\n & .ToggleSwitch-knob {\n background-color: var(--color-switch-knob-checked-bg);\n border: 0;\n transform: translateX(calc(100% + 1px));\n }\n\n & .ToggleSwitch-lineIcon {\n transform: translateX(0%);\n }\n\n & .ToggleSwitch-circleIcon {\n transform: translateX(100%);\n }\n}\n\n.ToggleSwitch-track[aria-disabled='true'] {\n cursor: not-allowed;\n background-color: var(--color-canvas-subtle);\n border-color: var(--color-border-subtle);\n transition-property: none;\n\n &:hover,\n &:active {\n & .ToggleSwitch-knob {\n background-color: var(--color-btn-bg);\n }\n }\n\n & .ToggleSwitch-knob {\n border-color: var(--color-border-default);\n box-shadow: none;\n\n &:hover,\n &:active {\n background-color: var(--color-btn-bg);\n }\n }\n\n & .ToggleSwitch-lineIcon {\n color: var(--color-fg-subtle);\n }\n\n & .ToggleSwitch-circleIcon {\n color: var(--color-fg-subtle);\n }\n}\n\n.ToggleSwitch-icons {\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.ToggleSwitch-lineIcon {\n line-height: 0;\n color: var(--color-accent-fg);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(-100%);\n flex: 1 0 50%;\n}\n\n.ToggleSwitch-circleIcon {\n line-height: 0;\n color: var(--color-fg-default);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(0);\n flex: 1 0 50%;\n}\n\n.ToggleSwitch-knob {\n position: absolute;\n top: -1px;\n bottom: -1px;\n z-index: 1;\n width: 50%;\n background-color: var(--color-btn-bg);\n border: var(--primer-borderWidth-thin, 1px) solid var(--color-switch-track-border);\n border-radius: var(--primer-borderRadius-medium, 6px);\n box-shadow: var(--color-shadow-medium), var(--color-btn-inset-shadow);\n transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);\n transition-duration: 80ms;\n transition-property: transform;\n transform: translateX(-1px);\n\n @media (prefers-reduced-motion) {\n transition: none;\n }\n}\n\n.ToggleSwitch-status {\n position: relative;\n font-size: var(--primer-text-body-size-medium, 14px);\n line-height: 1.5;\n color: var(--color-fg-default);\n text-align: right;\n}\n\n.ToggleSwitch-statusIcon {\n width: var(--base-size-16, 16px);\n display: flex;\n margin-top: 0.063rem;\n}\n\n.ToggleSwitch--small {\n & .ToggleSwitch-status {\n font-size: var(--primer-text-body-size-small, 12px);\n }\n\n & .ToggleSwitch-track {\n width: var(--base-size-48, 48px);\n height: var(--primer-control-xsmall-size, 24px);\n }\n}\n\n.ToggleSwitch--disabled {\n & .ToggleSwitch-status {\n color: var(--color-fg-muted);\n }\n}\n\n.ToggleSwitch-statusOn {\n height: 0;\n visibility: hidden;\n}\n\n.ToggleSwitch-statusOff {\n height: auto;\n visibility: visible;\n}\n\n.ToggleSwitch--statusAtEnd {\n flex-direction: row-reverse;\n\n & .ToggleSwitch-status {\n text-align: left;\n }\n}\n",null]}
@@ -1,6 +1,8 @@
1
1
  <%= render(Primer::BaseComponent.new(tag: "toggle-switch", **@system_arguments)) do %>
2
- <%= render(Primer::Beta::Octicon.new(size: :small, color: :danger, icon: :alert, hidden: "true", data: { target: "toggle-switch.errorIcon" })) %>
3
- <%= render(Primer::Beta::Spinner.new(size: :small, hidden: "true", data: { target: "toggle-switch.loadingSpinner" })) %>
2
+ <span class="ToggleSwitch-statusIcon">
3
+ <%= render(Primer::Beta::Octicon.new(size: :small, color: :danger, icon: :alert, hidden: "true", data: { target: "toggle-switch.errorIcon" })) %>
4
+ <%= render(Primer::Beta::Spinner.new(size: :small, hidden: "true", data: { target: "toggle-switch.loadingSpinner" })) %>
5
+ </span>
4
6
  <%= render(Primer::Beta::Text.new(aria: { hidden: true }, classes: "ToggleSwitch-status")) do %>
5
7
  <%= render(Primer::Box.new(classes: "ToggleSwitch-statusOn").with_content("On")) %>
6
8
  <%= render(Primer::Box.new(classes: "ToggleSwitch-statusOff").with_content("Off")) %>
@@ -81,9 +81,13 @@ let ToggleSwitchElement = class ToggleSwitchElement extends HTMLElement {
81
81
  this.loadingSpinner.removeAttribute('hidden');
82
82
  }
83
83
  setSuccessState() {
84
+ const event = new CustomEvent('toggleSwitchSuccess', { bubbles: true });
85
+ this.dispatchEvent(event);
84
86
  this.setFinishedState(false);
85
87
  }
86
- setErrorState() {
88
+ setErrorState(message) {
89
+ const event = new CustomEvent('toggleSwitchError', { bubbles: true, detail: message });
90
+ this.dispatchEvent(event);
87
91
  this.setFinishedState(true);
88
92
  }
89
93
  setFinishedState(error) {
@@ -102,24 +106,32 @@ let ToggleSwitchElement = class ToggleSwitchElement extends HTMLElement {
102
106
  try {
103
107
  if (!this.src)
104
108
  throw new Error('invalid src');
105
- const response = await fetch(this.src, {
106
- credentials: 'same-origin',
107
- method: 'POST',
108
- headers: {
109
- 'Requested-With': 'XMLHttpRequest'
110
- },
111
- body
112
- });
109
+ let response;
110
+ try {
111
+ response = await fetch(this.src, {
112
+ credentials: 'same-origin',
113
+ method: 'POST',
114
+ headers: {
115
+ 'Requested-With': 'XMLHttpRequest'
116
+ },
117
+ body
118
+ });
119
+ }
120
+ catch (error) {
121
+ throw new Error('A network error occurred, please try again.');
122
+ }
113
123
  if (response.ok) {
114
124
  this.setSuccessState();
115
125
  this.performToggle();
116
126
  }
117
127
  else {
118
- this.setErrorState();
128
+ throw new Error(await response.text());
119
129
  }
120
130
  }
121
131
  catch (error) {
122
- this.setErrorState();
132
+ if (error instanceof Error) {
133
+ this.setErrorState(error.message || 'An error occurred, please try again.');
134
+ }
123
135
  }
124
136
  }
125
137
  };
@@ -208,6 +208,12 @@
208
208
  text-align: right;
209
209
  }
210
210
 
211
+ .ToggleSwitch-statusIcon {
212
+ width: var(--base-size-16, 16px);
213
+ display: flex;
214
+ margin-top: 0.063rem;
215
+ }
216
+
211
217
  .ToggleSwitch--small {
212
218
  & .ToggleSwitch-status {
213
219
  font-size: var(--primer-text-body-size-small, 12px);
@@ -97,10 +97,16 @@ class ToggleSwitchElement extends HTMLElement {
97
97
  }
98
98
 
99
99
  private setSuccessState(): void {
100
+ const event = new CustomEvent('toggleSwitchSuccess', {bubbles: true})
101
+ this.dispatchEvent(event)
102
+
100
103
  this.setFinishedState(false)
101
104
  }
102
105
 
103
- private setErrorState(): void {
106
+ private setErrorState(message: string): void {
107
+ const event = new CustomEvent('toggleSwitchError', {bubbles: true, detail: message})
108
+ this.dispatchEvent(event)
109
+
104
110
  this.setFinishedState(true)
105
111
  }
106
112
 
@@ -125,22 +131,32 @@ class ToggleSwitchElement extends HTMLElement {
125
131
 
126
132
  try {
127
133
  if (!this.src) throw new Error('invalid src')
128
- const response = await fetch(this.src, {
129
- credentials: 'same-origin',
130
- method: 'POST',
131
- headers: {
132
- 'Requested-With': 'XMLHttpRequest'
133
- },
134
- body
135
- })
134
+
135
+ let response
136
+
137
+ try {
138
+ response = await fetch(this.src, {
139
+ credentials: 'same-origin',
140
+ method: 'POST',
141
+ headers: {
142
+ 'Requested-With': 'XMLHttpRequest'
143
+ },
144
+ body
145
+ })
146
+ } catch (error) {
147
+ throw new Error('A network error occurred, please try again.')
148
+ }
149
+
136
150
  if (response.ok) {
137
151
  this.setSuccessState()
138
152
  this.performToggle()
139
153
  } else {
140
- this.setErrorState()
154
+ throw new Error(await response.text())
141
155
  }
142
156
  } catch (error) {
143
- this.setErrorState()
157
+ if (error instanceof Error) {
158
+ this.setErrorState(error.message || 'An error occurred, please try again.')
159
+ }
144
160
  }
145
161
  }
146
162
  }
@@ -197,9 +197,6 @@ class ToolTipElement extends HTMLElement {
197
197
  }
198
198
  this.hiddenFromView = true;
199
199
  __classPrivateFieldSet(this, _ToolTipElement_allowUpdatePosition, true, "f");
200
- if (!this.id) {
201
- this.id = `tooltip-${Date.now()}-${(Math.random() * 10000).toFixed(0)}`;
202
- }
203
200
  if (!this.control)
204
201
  return;
205
202
  this.setAttribute('role', 'tooltip');
@@ -197,10 +197,6 @@ class ToolTipElement extends HTMLElement {
197
197
  this.hiddenFromView = true
198
198
  this.#allowUpdatePosition = true
199
199
 
200
- if (!this.id) {
201
- this.id = `tooltip-${Date.now()}-${(Math.random() * 10000).toFixed(0)}`
202
- }
203
-
204
200
  if (!this.control) return
205
201
 
206
202
  this.setAttribute('role', 'tooltip')
@@ -107,10 +107,11 @@ module Primer
107
107
 
108
108
  @text = text
109
109
  @system_arguments = system_arguments
110
+ @system_arguments[:id] ||= self.class.generate_id
110
111
  @system_arguments[:tag] = :"tool-tip"
111
112
  @system_arguments[:for] = for_id
112
- system_arguments[:classes] = class_names(
113
- system_arguments[:classes],
113
+ @system_arguments[:classes] = class_names(
114
+ @system_arguments[:classes],
114
115
  "sr-only"
115
116
  )
116
117
  @system_arguments[:position] = :absolute
@@ -121,6 +122,6 @@ module Primer
121
122
  def call
122
123
  render(Primer::BaseComponent.new(**@system_arguments)) { @text }
123
124
  end
124
- end
125
125
  end
126
126
  end
127
+ end
@@ -63,7 +63,7 @@ module Primer
63
63
  @wrapper_arguments = wrapper_arguments
64
64
  @show_tooltip = show_tooltip
65
65
  @system_arguments = system_arguments
66
- @system_arguments[:id] ||= "icon-button-#{SecureRandom.hex(4)}"
66
+ @system_arguments[:id] ||= self.class.generate_id
67
67
 
68
68
  @system_arguments[:classes] = class_names(
69
69
  "Button",
@@ -22,6 +22,10 @@ module Primer
22
22
  status == :deprecated
23
23
  end
24
24
 
25
+ def self.generate_id
26
+ "#{name.demodulize.underscore.dasherize}-#{SecureRandom.uuid}"
27
+ end
28
+
25
29
  private
26
30
 
27
31
  def raise_on_invalid_options?