@protonradio/proton-ui 0.6.18 → 0.7.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- :root{--proton-rem: calc(12px + .39vw) ;--proton-color__primary:#e26014;--proton-color__primary-light:#fbe5d7;--proton-color__secondary:#f2f2f2;--proton-color__gray-super-dark:#141211;--proton-color__gray-dark:#4d4d4d;--proton-color__gray-medium:#7d7d7d;--proton-color__gray-medium-light:#b1b1b1;--proton-color__gray-light:#ddd;--proton-color__gray-lightest:#f0f1f2;--proton-color__gray-super-light:#f7f8f9;--proton-color__white:#fff;--proton-color__danger-super-dark:#991b1b;--proton-color__danger-dark:#a80724;--proton-color__danger-medium:#e23f5c;--proton-color__danger-light:#f16880;--proton-color__danger-super-light:#ffe1e1;--proton-color__warning-dark:#8b5600;--proton-color__warning-medium:#b37208;--proton-color__warning-light:#ffac23;--proton-color__warning-super-light:#fff0c9;--proton-color__success-dark:#247800;--proton-color__success-medium:#339a07;--proton-color__success-light:#66cf39;--proton-color__success-super-light:#deffd1;--proton-control__text-color:var(--proton-color__white);--proton-control__background-color:var(--proton-color__white);--proton-control__border-color:var(--proton-color__gray-dark)}.proton-ActionMenu__background{z-index:10;background:#000000bf;width:100%;height:100%;transition:opacity .3s ease-in-out;position:fixed;top:0;left:0}@media (min-width:768px){.proton-ActionMenu__background{display:none}}.proton-ActionMenu__wrapper{z-index:10;max-height:100vh;overflow:none;flex:1;width:100%;position:fixed;bottom:0;left:0}@media (min-width:768px){.proton-ActionMenu__wrapper{display:none}}.proton-ActionMenu__wrapper--scrollable{overflow-y:scroll}.proton-ActionMenu__card{background:var(--proton-control__background-color);color:var(--proton-control__text-color);z-index:1;border-radius:14px 14px 0 0;flex-direction:column;height:0;transition:height .3s cubic-bezier(.34,1.56,.64,1);display:flex;position:relative;overflow:hidden;box-shadow:0 0 4px #0000001a,0 0 20px #00000026}.proton-ActionMenu__card>div{flex-direction:column;flex:1;display:flex}@media (min-width:768px){.proton-ActionMenu__card{border-radius:.8rem;min-width:300px}}.proton-ActionMenu__close-button{fill:var(--proton-color__white);color:var(--proton-color__white);pointer-events:none;text-align:center;margin-right:12px;transition:visibility ease-out,opacity .35s ease-out;position:fixed;top:1rem;right:0}.proton-ActionMenu__close-button div{letter-spacing:.1em;margin:.5rem;font-weight:500;display:block}.proton-ActionMenu__cancel-button{margin:0 12px 16px}.proton-ActionMenu__cancel-button button{justify-content:center;width:100%}.proton-ActionMenu__content{padding:12px 12px 0}.proton-ActionMenu__list{flex-direction:column;margin:10px 0;display:flex}.proton-ActionMenu__list--disabled{opacity:.5;cursor:not-allowed}.proton-ActionMenu__item{color:inherit;cursor:pointer;padding:12px 8px 12px 12px;text-decoration:none;transition:background-color .1s}.proton-ActionMenu__item:hover,.proton-ActionMenu__item:focus{background-color:var(--proton-color__gray-super-light);border:none;outline:none}.proton-ui__theme--dark .proton-ActionMenu__item:hover,.proton-ui__theme--dark .proton-ActionMenu__item:focus{background-color:#606060fa}.proton-ActionMenu__item[aria-checked=true]{background-color:var(--proton-color__primary-light);color:var(--proton-color__primary)}.proton-ui__theme--dark .proton-ActionMenu__item[aria-checked=true]{background-color:var(--proton-color__primary);color:var(--proton-control__text-color)}.proton-ui__theme--dark .proton-ActionMenu__item[aria-checked=true]:hover,.proton-ui__theme--dark .proton-ActionMenu__item[aria-checked=true]:focus{background-color:#e26014d9}.proton-ActionMenu__item[aria-disabled=true]{opacity:.5;cursor:not-allowed}.proton-ActionMenu__item[aria-disabled=true]:hover{background-color:#0000}.proton-ActionMenu__content:has(.proton-ListBox){padding:0}.proton-ActionMenu__content>.proton-ListBox{background:0 0;border:none;border-radius:0;margin-bottom:12px}.proton-Badge{letter-spacing:.2em;text-align:center;text-transform:uppercase;white-space:nowrap;border-radius:10rem;height:1.6rem;padding-bottom:calc(1rem - 1.1em);padding-left:1rem;padding-right:calc(1rem - .2em);font-size:max(11px,min(.6875rem + .1vw,16px));font-weight:500;line-height:1.8rem;display:inline-block}.proton-ui__theme--dark.proton-Badge:not([class*=proton-Badge--]){background-color:var(--proton-control__background-color);color:var(--proton-control__text-color)}.proton-ui__theme--light.proton-Badge:not([class*=proton-Badge--]),.proton-ui__theme--light.proton-Badge--secondary{background-color:var(--proton-color__secondary);color:#666}.proton-ui__theme--dark.proton-Badge--secondary{color:var(--proton-control__text-color);background-color:#ffffff26}.proton-Badge--primary{background-color:var(--proton-color__primary);color:var(--proton-color__white)}.proton-Badge--success{background-color:var(--proton-color__success-super-light);color:var(--proton-color__success-dark)}.proton-Badge--warning{background-color:var(--proton-color__warning-super-light);color:var(--proton-color__warning-dark)}.proton-Badge--danger{background-color:var(--proton-color__danger-super-light);color:var(--proton-color__danger-dark)}.proton-Badge--transparent{color:#666;background-color:#0000}.proton-Button{font-size:var(--proton-rem);letter-spacing:.05em;border:0;border-radius:4px;align-items:center;column-gap:.4em;padding:.4em .86em;font-weight:300;text-decoration:none;transition:filter .1s,background-color .1s;display:flex}.proton-Button:hover{filter:brightness(1.08);cursor:pointer;text-decoration:none}.proton-Button--primary,.proton-Button--primary:hover{color:var(--proton-color__white);background-color:var(--proton-color__primary)}.proton-Button--secondary,.proton-Button--secondary:hover{color:var(--proton-color__gray-dark);background-color:var(--proton-color__gray-light)}.proton-Button--danger{color:var(--proton-color__white);background-color:var(--proton-color__danger-medium)}.proton-Button--success{color:var(--proton-color__white);background-color:var(--proton-color__success-medium)}.proton-Button--translucent{color:var(--proton-color__white);background-color:#ffffff1a}.proton-Button--translucent:hover{background-color:#ffffff24}.proton-Button--disabled,.proton-Button--disabled:hover{opacity:.5;filter:none;cursor:not-allowed}.proton-Button:focus{outline:solid var(--proton-color__primary)1px;border:none}.proton-Button:focus-visible{outline:solid var(--proton-color__primary)1px;border:none}:root{--banner__default-background:var(--proton-color__gray-lightest);--banner__default-title:var(--proton-color__gray-dark);--banner__default-content:var(--proton-color__gray-medium);--banner__default-icon:var(--proton-color__gray-medium-light);--banner__warning-background:var(--proton-color__warning-super-light);--banner__warning-title:var(--proton-color__warning-dark);--banner__warning-content:var(--proton-color__warning-medium);--banner__warning-icon:var(--proton-color__warning-light);--banner__success-background:var(--proton-color__success-super-light);--banner__success-title:var(--proton-color__success-dark);--banner__success-content:var(--proton-color__success-medium);--banner__success-icon:var(--proton-color__success-light);--banner__danger-background:var(--proton-color__danger-super-light);--banner__danger-title:var(--proton-color__danger-dark);--banner__danger-content:var(--proton-color__danger-medium);--banner__danger-icon:var(--proton-color__danger-light)}.proton-Banner{margin:0}.proton-Banner--rounded{border-radius:.375rem}.proton-Banner__wrapper{padding:2rem;display:flex}.proton-Banner__wrapper--compact{padding:1rem}.proton-Banner__content-wrapper{flex:1;min-width:0}.proton-Banner__container{flex-direction:column;padding:0 10px;display:flex}.proton-Banner__title{letter-spacing:.01rem;margin:0;font-size:max(14px,min(1.8rem,20px));font-weight:600}.proton-Banner__actions{gap:.5rem;margin:6px 0 0;display:flex}.proton-Banner__icon{margin-top:2px}@media (min-width:768px){.proton-Banner__container{grid-template-columns:1fr auto;align-items:center;display:grid}.proton-Banner__container>.proton-Banner__title,.proton-Banner__container>.proton-Banner__content{grid-column:1}.proton-Banner__container>div:last-child{grid-area:1/2/span 2}.proton-Banner__actions{margin:0 0 0 12px}}.proton-Banner--default{background-color:var(--banner__default-background)}.proton-Banner--default__title{color:var(--banner__default-title)}.proton-Banner--default__content{color:var(--banner__default-content)}.proton-Banner--default__icon{fill:var(--banner__default-icon)}.proton-Banner--warning{background-color:var(--banner__warning-background)}.proton-Banner--warning__title{color:var(--banner__warning-title)}.proton-Banner--warning__content{color:var(--banner__warning-content)}.proton-Banner--warning__icon{fill:var(--banner__warning-icon)}.proton-Banner--success{background-color:var(--banner__success-background)}.proton-Banner--success__title{color:var(--banner__success-title)}.proton-Banner--success__content{color:var(--banner__success-content)}.proton-Banner--success__icon{fill:var(--banner__success-icon)}.proton-Banner--danger{background-color:var(--banner__danger-background)}.proton-Banner--danger__title{color:var(--banner__danger-title)}.proton-Banner--danger__content{color:var(--banner__danger-content)}.proton-Banner--danger__icon{fill:var(--banner__danger-icon)}.proton-ButtonGroup{font-size:var(--proton-rem);border:1px solid var(--proton-color__gray-light);border-radius:4px;font-weight:400;display:flex;overflow:hidden}.proton-ButtonGroup__option{background-color:var(--proton-color__gray-super-light);cursor:pointer;border-left:1px solid var(--proton-color__gray-light);color:var(--proton-color__gray-dark);text-align:center;border-radius:0;flex:1;padding:.5em 1em}.proton-ButtonGroup__option:first-child{border-left:0}.proton-ButtonGroup__option--selected{background-color:var(--proton-color__white);color:var(--proton-color__primary);z-index:2;cursor:default;border-radius:inherit;box-shadow:0 0 6px #00000026}.proton-ButtonGroup__option--selected+.proton-ButtonGroup__option{border-left:1px solid #0000}.proton-Dialog{background-color:var(--proton-control__background-color);color:var(--proton-control__text-color);border-radius:4px;outline:none;padding:.65rem .85rem;font-weight:300;box-shadow:0 4px 16px -3px #0003,0 2px 4px -1px #00000014}.proton-Dialog__header{margin-top:0;margin-bottom:5px}.proton-Input{box-sizing:border-box;outline:1px solid var(--proton-control__border-color);border:1px solid #0000;border-radius:4px;flex:1;width:100%;min-height:40px;padding-left:12px;transition:all .2s ease-in-out}.proton-Input:disabled{opacity:.6;cursor:not-allowed}.proton-Input:not(.proton-Input--error):focus{outline:1px solid var(--proton-color__primary)}.proton-Input:not(.proton-Input--error):focus-visible{outline:1px solid var(--proton-color__primary)}.proton-ui__theme--light .proton-Input{background-color:var(--proton-color__white);outline:1px solid var(--proton-control__border-color);color:var(--proton-control__text-color)}.proton-ui__theme--dark .proton-Input{background-color:var(--proton-control__background-color);outline:1px solid var(--proton-control__border-color);color:var(--proton-control__text-color)}.proton-Input.proton-Input--error{outline:1px solid var(--proton-color__danger-dark)}.proton-Input__container{flex-direction:column;flex:1;width:100%;display:flex}.proton-Input__container-inner{flex:1;align-items:center;display:flex;position:relative}.proton-Input__descriptor{z-index:1;background-position:50%;background-repeat:no-repeat;background-size:50%;justify-content:center;align-items:center;height:100%;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.proton-Input__prefix,.proton-Input__suffix{flex:0 0 32px;justify-content:center;align-items:center;display:flex}.proton-Input__prefix{opacity:.5;cursor:text;margin-left:12px;left:0}.proton-Input__suffix{outline:none;padding-right:12px;right:0}.proton-Input__container-inner:has(.proton-Input__prefix) .proton-Input{padding-left:32px}.proton-Input__container-inner:has(.proton-Input__suffix) .proton-Input{padding-right:44px}.proton-Input__text{color:var(--proton-color__gray-medium);padding:4px 0;font-size:.75rem}.proton-Input__error{color:var(--proton-color__danger-medium)}.proton-Input__label-top{padding-top:24px;padding-bottom:8px}.proton-Input__label{color:var(--proton-color__gray-medium-light);pointer-events:none;transform-origin:left center 0px;transition:color .2s,font-size .5s,top .5s;position:absolute;top:15px;left:14px}.proton-Input:focus+.proton-Input__label,.proton-Input__label--filled{font-size:.75rem;top:7px}.proton-Input:focus+.proton-Input__label{color:var(--proton-color__primary)}.proton-Input__label--hide{display:none}.proton-SearchInput__wrapper{width:100%}.proton-SearchInput__wrapper input{border-radius:50px;padding-left:44px!important}.proton-SearchInput__button{color:currentColor;cursor:pointer;opacity:1;background-color:#0000;border:none;transition:opacity .2s ease-in-out}.proton-SearchInput__button--hide{opacity:0}.proton-SearchInput__wrapper input[type=search]::-ms-clear{width:0;height:0;display:none}.proton-SearchInput__wrapper input[type=search]::-ms-reveal{width:0;height:0;display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-decoration{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-cancel-button{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-results-button{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-results-decoration{display:none}.arrow{fill:var(--proton-control__background-color);stroke-width:1px;width:12px;height:12px;position:absolute}.arrow[data-placement=top]{top:100%;transform:translate(-50%)}.arrow[data-placement=bottom]{bottom:100%;transform:translate(-50%)rotate(180deg)}.arrow[data-placement=left]{left:100%;transform:translateY(-50%)rotate(-90deg)}.arrow[data-placement=right]{right:100%;transform:translateY(-50%)rotate(90deg)}.proton-ResponsiveMenuTrigger{display:inline-block;position:relative}.proton-ResponsiveMenuTrigger__button{cursor:pointer;color:var(--proton-control__text-color);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:4px;display:flex}.proton-ResponsiveMenuTrigger__button:focus{outline:2px solid var(--proton-color__primary)}.proton-ResponsiveMenuTrigger__button:hover{background-color:#60606026}.proton-ui__theme--dark .proton-ResponsiveMenuTrigger__button:hover{background-color:#ffffff1a}.proton-ResponsiveMenuTrigger__menu-item:focus{background-color:#60606026;outline:none}.proton-ui__theme--dark .proton-ResponsiveMenuTrigger__menu-item:focus{background-color:#ffffff1a}.proton-ListBox{letter-spacing:.05em;background:var(--proton-control__background-color);border:1px solid var(--proton-control__border-color);min-width:100px;color:var(--proton-control__text-color);border-radius:10px;margin:.5rem 0 0;padding:0;list-style:none;overflow:auto}.proton-ListBox:focus{outline:none}.proton-ListBox:focus-visible{outline:none}.proton-ListBox__item{cursor:pointer;outline:none;justify-content:space-between;padding:8px 16px;transition:background-color .1s;display:flex}.proton-ListBox__item--disabled{opacity:.5;cursor:not-allowed}.proton-ListBox__item:not(.proton-ListBox__item--disabled):hover,.proton-ListBox__item--focused{background-color:var(--proton-color__gray-super-light);outline:none}.proton-ListBox__item--selected{background:var(--proton-color__primary-light);color:var(--proton-color__primary)}.proton-ui__theme--dark .proton-ListBox__item:hover,.proton-ui__theme--dark .proton-ListBox__item--focused{background-color:#606060fa}.proton-ui__theme--dark .proton-ListBox__item--selected{background-color:var(--proton-color__primary);color:var(--proton-control__text-color)}.proton-ui__theme--dark .proton-ListBox__item--selected:hover,.proton-ui__theme--dark .proton-ListBox__item--selected:focus{background-color:#e26014d9}.proton-Select{flex-direction:column;width:100%;margin:0;display:flex}.proton-Select__label{color:var(--proton-color__gray-dark);margin-bottom:2px}.proton-Select__trigger{color:var(--proton-control__text-color);font-size:inherit;border-radius:50px;flex:1;justify-content:space-between;align-items:center;width:100%;padding:.2rem .6rem .2rem 1rem;display:flex}button.proton-Select__trigger{letter-spacing:.05em;cursor:pointer;background:var(--proton-control__background-color);outline:1px solid var(--proton-control__border-color);border:1px solid #0000;font-weight:400;transition:outline .2s;position:relative}button.proton-Select__trigger:hover:after{content:"";-webkit-backdrop-filter:brightness(98%);backdrop-filter:brightness(98%);z-index:1;border-radius:50px;width:100%;height:100%;position:absolute;left:0}button.proton-Select__trigger:focus{outline:solid var(--proton-color__primary)1px;border:1px solid #0000}button.proton-Select__trigger:focus-visible{outline:solid var(--proton-color__primary)1px;border:1px solid #0000}.proton-Select__popover{padding-left:.25rem}.proton-Select__trigger_icon{color:var(--proton-control__text-color);width:.75em;height:.75em;margin-left:.8em;transition:transform .2s;position:relative}.proton-Select__trigger_icon svg{width:100%;height:100%;position:absolute;top:50%;left:0;transform:translateY(-50%)}.proton-Select__trigger_icon--flipped{transform:rotateX(180deg)}.proton-Select:hover{cursor:pointer}.proton-Select__trigger--disabled,.proton-Select__trigger--disabled:hover{opacity:.5;filter:none;cursor:not-allowed}.proton-Select__value{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.proton-Switch{font-size:var(--proton-rem);flex-flow:column;row-gap:5px;display:flex}.proton-Switch__label{text-transform:uppercase;letter-spacing:.1em;color:var(--proton-color__gray-dark);font-size:.7em;font-weight:600}.proton-Switch__description{color:var(--proton-color__gray-medium);align-self:center;font-size:.9em}.proton-Switch__wrapper{column-gap:12px;display:flex}.proton-Switch__toggle{background-color:var(--proton-color__gray-light);cursor:pointer;border-radius:26px;flex-shrink:0;width:50px;height:26px;position:relative}.proton-Switch__slider{background-color:#fff;border-radius:22px;width:22px;height:22px;transition:left .2s;position:absolute;top:2px;left:2px}.proton-Switch--on .proton-Switch__toggle{background-color:var(--proton-color__primary)}.proton-Switch--on .proton-Switch__slider{left:26px}.proton-Switch--disabled{opacity:.4}.proton-Switch--disabled .proton-Switch__toggle{cursor:not-allowed}.proton-Table{border-collapse:collapse;color:var(--proton-control__text-color);width:100%;font-weight:300}.proton-Table__header{cursor:default;letter-spacing:.1em;text-transform:uppercase;text-align:left;outline:none;padding:7px 10px;font-size:.75rem;font-weight:500;line-height:1rem}.proton-Table__header--center{text-align:center}.proton-Table__header--right{text-align:right}.proton-Table__headerSortIcon{padding:0 2px}.proton-Table__row{cursor:default;border-top:1px solid #ccc;outline:none}.proton-Table__row:last-child{border-bottom:1px solid #ccc}.proton-Table__cell{vertical-align:middle;outline:none;padding:7px 10px}.proton-Table__cell--center{text-align:center}.proton-Table__cell--right{text-align:right}.proton-TextEmphasis{color:var(--proton-color__gray-super-dark);background-image:linear-gradient(0deg,#0000 0,#0000 15%,#ff713480 15%,#ff713480 35%,#0000 35%,#0000);padding:0 .05rem;font-style:normal;font-weight:700}.proton-TextEmphasis a{color:inherit;transition:color .15s}.proton-TextEmphasis a:hover{color:var(--proton-color__primary);text-decoration:none}.proton-ui__theme--dark.proton-TextEmphasis{color:var(--proton-color__gray-super-light)}.proton-TextEmphasis--tooltip{background-image:linear-gradient(0deg,#0000 0,#0000 15%,#ff713480 25%,#ff713480 87%,#0000 80%,#0000);background-position:bottom;background-repeat:no-repeat;background-size:100% 35%;font-style:italic;font-weight:400;transition:background-size .3s,border-radius .3s}.proton-TextEmphasis--tooltip:hover{background-size:100% 100%;border-radius:2px}.proton-TextEmphasis--tooltip:not(:hover){transition-delay:.2s}.proton__Tooltip{background-color:var(--proton-control__background-color);color:var(--proton-control__text-color);position:absolute}.proton__TooltipTrigger{all:unset}.proton__Tooltip[data-placement=top]{--origin:translateY(4px);margin-bottom:8px}.proton__Tooltip[data-placement=bottom]{--origin:translateY(-4px);margin-top:8px}.proton__Tooltip[data-placement=bottom] .proton__TooltipArrow svg{transform:rotate(180deg)}.proton__Tooltip[data-placement=right]{--origin:translateX(-4px);margin-left:8px}.proton__Tooltip[data-placement=right] .proton__TooltipArrow svg{transform:rotate(90deg)}.proton__Tooltip[data-placement=left]{--origin:translateX(4px);margin-right:8px}.proton__Tooltip[data-placement=left] .proton__TooltipArrow svg{transform:rotate(-90deg)}.proton__Tooltip .proton__TooltipArrow svg{fill:var(--proton-control__background-color);display:block}.proton__Tooltip[data-entering]{animation:.2s slide}.proton__Tooltip[data-exiting]{animation:.2s reverse slide}@keyframes slide{0%{opacity:0;transform:var(--origin)}to{opacity:1;transform:translateY(0)}}:root{--waveform-bar-color-dark:#ffffffe6;--waveform-bar-color-light:#000000b3;--waveform-disabled-color-dark:#fff3;--waveform-disabled-color-light:#0003;--waveform-animation-curve:cubic-bezier(.34,1.56,.64,1);--waveform-animation-duration:.4s;--waveform-bar-delay-multiplier:.7ms;--waveform-timestamp-padding:.25rem;--waveform-timestamp-font-size:.75rem;--waveform-timestamp-border-radius:.125rem;--waveform-hover-line-width:2px}.proton-Waveform{flex-direction:row;align-items:center;width:100%;height:100%;display:flex;position:relative}.proton-Waveform__container{z-index:0;flex:1;align-items:center;width:100%;height:100%;display:flex;position:relative}.proton-Waveform__timestamp{pointer-events:none;border-radius:var(--waveform-timestamp-border-radius);padding:0 var(--waveform-timestamp-padding);font-size:var(--waveform-timestamp-font-size);z-index:1;background-color:#0009;position:absolute}.proton-ui__theme--light .proton-Waveform__timestamp{color:#000c;background-color:#ffffffe6;box-shadow:0 2px 2px #0000004d}.proton-Waveform__timestamp--left{left:1px}.proton-Waveform__timestamp--right{right:3px}.proton-Waveform__hover-line{width:var(--waveform-hover-line-width);background-color:#ffffff80;position:absolute;top:0;bottom:0;transform:translate(-50%)}.proton-ui__theme--light .proton-Waveform__hover-line{background-color:#00000080}.proton-Waveform__bar-wrapper{flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex;position:relative}.proton-Waveform__bar{background-color:var(--waveform-bar-color-dark);transform-origin:50%;width:100%;height:0;transition:height var(--waveform-animation-duration)var(--waveform-animation-curve);position:relative}.proton-Waveform__bar.proton-Waveform__bar--visible{height:var(--target-height);transition-delay:calc(var(--index)*var(--waveform-bar-delay-multiplier))}.proton-Waveform__bar.proton-Waveform__bar--upper{transform-origin:bottom}.proton-Waveform__bar.proton-Waveform__bar--lower{transform-origin:top}.proton-ui__theme--light .proton-Waveform__bar{background-color:var(--waveform-bar-color-light)}.proton-Waveform__bar.proton-Waveform__bar--disabled{background-color:var(--waveform-disabled-color-dark)}.proton-ui__theme--light .proton-Waveform__bar.proton-Waveform__bar--disabled{background-color:var(--waveform-disabled-color-light)}.proton-Waveform__bar.proton-Waveform__bar--disabled.proton-Waveform__bar--played{background-color:var(--waveform-disabled-color-dark)}.proton-ui__theme--light .proton-Waveform__bar.proton-Waveform__bar--disabled.proton-Waveform__bar--played{background-color:var(--waveform-disabled-color-light)}.proton-Waveform__bar.proton-Waveform__bar--played{background-color:var(--proton-color__primary)}.proton-Waveform__bar--hover{height:var(--hover-height);z-index:10;background-color:color-mix(in srgb,var(--proton-color__primary)50%,transparent);mix-blend-mode:darken;width:100%;position:absolute;top:50%;transform:translateY(-50%)}.proton-ui__theme--light .proton-Waveform__bar--hover{background-color:color-mix(in srgb,var(--proton-color__primary)50%,white);mix-blend-mode:lighten}.proton-Waveform__bar-unavailable{pointer-events:none;text-align:center;z-index:10;color:#fff;background-color:#000000b3;border-radius:4px;padding:3px 6px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.proton-ui__theme--light .proton-Waveform__bar-unavailable{color:#000;background-color:#fff;box-shadow:0 5px 5px #0000004d}.proton-Waveform__active-region{pointer-events:none;z-index:1;border:1.5px solid #ffffffb3;border-radius:4px;position:absolute;top:0;bottom:0}.proton-ui__theme--light .proton-Waveform__active-region{border-color:#0000004d}
1
+ :root{--proton-rem: calc(12px + .39vw) ;--proton-color__primary:#e26014;--proton-color__primary-light:#fbe5d7;--proton-color__secondary:#f2f2f2;--proton-color__gray-super-dark:#141211;--proton-color__gray-dark:#4d4d4d;--proton-color__gray-medium:#7d7d7d;--proton-color__gray-medium-light:#b1b1b1;--proton-color__gray-light:#ddd;--proton-color__gray-lightest:#f0f1f2;--proton-color__gray-super-light:#f7f8f9;--proton-color__white:#fff;--proton-color__danger-super-dark:#991b1b;--proton-color__danger-dark:#a80724;--proton-color__danger-medium:#e23f5c;--proton-color__danger-light:#f16880;--proton-color__danger-super-light:#ffe1e1;--proton-color__warning-dark:#8b5600;--proton-color__warning-medium:#b37208;--proton-color__warning-light:#ffac23;--proton-color__warning-super-light:#fff0c9;--proton-color__success-dark:#247800;--proton-color__success-medium:#339a07;--proton-color__success-light:#66cf39;--proton-color__success-super-light:#deffd1;--proton-control__text-color:var(--proton-color__white);--proton-control__background-color:var(--proton-color__white);--proton-control__border-color:var(--proton-color__gray-dark);--proton-control__shadow-color:var(--proton-color__gray-dark)}.proton-ActionMenu__background{z-index:10;background:#000000bf;width:100%;height:100%;transition:opacity .3s ease-in-out;position:fixed;top:0;left:0}@media (min-width:768px){.proton-ActionMenu__background{display:none}}.proton-ActionMenu__wrapper{z-index:10;max-height:100vh;overflow:none;flex:1;width:100%;position:fixed;bottom:0;left:0}@media (min-width:768px){.proton-ActionMenu__wrapper{display:none}}.proton-ActionMenu__wrapper--scrollable{overflow-y:scroll}.proton-ActionMenu__card{background:var(--proton-control__background-color);color:var(--proton-control__text-color);z-index:1;border-radius:14px 14px 0 0;flex-direction:column;height:0;transition:height .3s cubic-bezier(.34,1.56,.64,1);display:flex;position:relative;overflow:hidden;box-shadow:0 0 4px #0000001a,0 0 20px #00000026}.proton-ActionMenu__card>div{flex-direction:column;flex:1;display:flex}@media (min-width:768px){.proton-ActionMenu__card{border-radius:.8rem;min-width:300px}}.proton-ui__theme--custom-dark .proton-ActionMenu__card{background:var(--proton-control__background-color)}.proton-ActionMenu__close-button{fill:var(--proton-color__white);color:var(--proton-color__white);pointer-events:none;text-align:center;margin-right:12px;transition:visibility ease-out,opacity .35s ease-out;position:fixed;top:1rem;right:0}.proton-ActionMenu__close-button div{letter-spacing:.1em;margin:.5rem;font-weight:500;display:block}.proton-ActionMenu__cancel-button{margin:0 12px 16px}.proton-ActionMenu__cancel-button button{justify-content:center;width:100%}.proton-ActionMenu__content{padding:12px 12px 0}.proton-ActionMenu__list{flex-direction:column;margin:10px 0;display:flex}.proton-ActionMenu__list--disabled{opacity:.5;cursor:not-allowed}.proton-ActionMenu__item{color:inherit;cursor:pointer;padding:12px 8px 12px 12px;text-decoration:none;transition:background-color .1s}.proton-ActionMenu__item:hover,.proton-ActionMenu__item:focus{background-color:var(--proton-color__gray-super-light);border:none;outline:none}.proton-ui__theme--dark .proton-ActionMenu__item:hover,.proton-ui__theme--dark .proton-ActionMenu__item:focus,.proton-ui__theme--custom-dark .proton-ActionMenu__item:focus,.proton-ui__theme--custom-dark .proton-ActionMenu__item:hover{background-color:#606060fa}.proton-ActionMenu__item[aria-checked=true]{background-color:var(--proton-color__primary-light);color:var(--proton-color__primary)}.proton-ui__theme--custom-dark .proton-ActionMenu__item[aria-checked=true],.proton-ui__theme--dark .proton-ActionMenu__item[aria-checked=true]{background-color:var(--proton-color__primary);color:var(--proton-control__text-color)}.proton-ActionMenu__item[aria-disabled=true]{opacity:.5;cursor:not-allowed}.proton-ActionMenu__item[aria-disabled=true]:hover{background-color:#0000}.proton-ActionMenu__content:has(.proton-ListBox){padding:0}html .proton-ActionMenu__content>.proton-ListBox{box-shadow:none;background:0 0;border:none;border-radius:0;margin-bottom:12px}.proton-Badge{letter-spacing:.2em;text-align:center;text-transform:uppercase;white-space:nowrap;border-radius:10rem;height:1.6rem;padding-bottom:calc(1rem - 1.1em);padding-left:1rem;padding-right:calc(1rem - .2em);font-size:max(11px,min(.6875rem + .1vw,16px));font-weight:500;line-height:1.8rem;display:inline-block}.proton-Badge:not([class*=proton-Badge--]){background-color:var(--proton-color__primary);color:var(--proton-color__white)}.proton-Badge--secondary{background-color:var(--proton-color__secondary);color:var(--proton-control__text-color)}.proton-ui__theme--dark .proton-Badge--secondary{color:var(--proton-color__gray-dark)}.proton-Badge--primary{background-color:var(--proton-color__primary);color:var(--proton-color__white)}.proton-Badge--success{background-color:var(--proton-color__success-super-light);color:var(--proton-color__success-dark)}.proton-Badge--warning{background-color:var(--proton-color__warning-super-light);color:var(--proton-color__warning-dark)}.proton-Badge--danger{background-color:var(--proton-color__danger-super-light);color:var(--proton-color__danger-dark)}.proton-Badge--transparent{color:#666;background-color:#0000}.proton-Button{font-size:var(--proton-rem);letter-spacing:.05em;border:0;border-radius:4px;align-items:center;column-gap:.4em;padding:.4em .86em;font-weight:300;text-decoration:none;transition:filter .1s,background-color .1s;display:flex}.proton-Button:hover{filter:brightness(1.08);cursor:pointer;text-decoration:none}.proton-Button--primary,.proton-Button--primary:hover{color:var(--proton-color__white);background-color:var(--proton-color__primary)}.proton-Button--secondary,.proton-Button--secondary:hover{color:var(--proton-color__gray-dark);background-color:var(--proton-color__gray-light)}.proton-Button--danger{color:var(--proton-color__white);background-color:var(--proton-color__danger-medium)}.proton-Button--success{color:var(--proton-color__white);background-color:var(--proton-color__success-medium)}.proton-Button--translucent{color:var(--proton-color__white);background-color:#ffffff1a}.proton-Button--translucent:hover{background-color:#ffffff24}.proton-Button--disabled,.proton-Button--disabled:hover{opacity:.5;filter:none;cursor:not-allowed}.proton-Button:focus{outline:solid var(--proton-color__primary)1px;border:none}.proton-Button:focus-visible{outline:solid var(--proton-color__primary)1px;border:none}:root{--banner__default-background:var(--proton-color__gray-lightest);--banner__default-title:var(--proton-color__gray-dark);--banner__default-content:var(--proton-color__gray-medium);--banner__default-icon:var(--proton-color__gray-medium-light);--banner__warning-background:var(--proton-color__warning-super-light);--banner__warning-title:var(--proton-color__warning-dark);--banner__warning-content:var(--proton-color__warning-medium);--banner__warning-icon:var(--proton-color__warning-light);--banner__success-background:var(--proton-color__success-super-light);--banner__success-title:var(--proton-color__success-dark);--banner__success-content:var(--proton-color__success-medium);--banner__success-icon:var(--proton-color__success-light);--banner__danger-background:var(--proton-color__danger-super-light);--banner__danger-title:var(--proton-color__danger-dark);--banner__danger-content:var(--proton-color__danger-medium);--banner__danger-icon:var(--proton-color__danger-light)}.proton-Banner{margin:0}.proton-Banner--rounded{border-radius:.375rem}.proton-Banner__wrapper{padding:2rem;display:flex}.proton-Banner__wrapper--compact{padding:1rem}.proton-Banner__content-wrapper{flex:1;min-width:0}.proton-Banner__container{flex-direction:column;padding:0 10px;display:flex}.proton-Banner__title{letter-spacing:.01rem;margin:0;font-size:max(14px,min(1.8rem,20px));font-weight:600}.proton-Banner__actions{gap:.5rem;margin:6px 0 0;display:flex}.proton-Banner__icon{margin-top:2px}@media (min-width:768px){.proton-Banner__container{grid-template-columns:1fr auto;align-items:center;display:grid}.proton-Banner__container>.proton-Banner__title,.proton-Banner__container>.proton-Banner__content{grid-column:1}.proton-Banner__container>div:last-child{grid-area:1/2/span 2}.proton-Banner__actions{margin:0 0 0 12px}}.proton-Banner--default{background-color:var(--banner__default-background)}.proton-Banner--default__title{color:var(--banner__default-title)}.proton-Banner--default__content{color:var(--banner__default-content)}.proton-Banner--default__icon{fill:var(--banner__default-icon)}.proton-Banner--warning{background-color:var(--banner__warning-background)}.proton-Banner--warning__title{color:var(--banner__warning-title)}.proton-Banner--warning__content{color:var(--banner__warning-content)}.proton-Banner--warning__icon{fill:var(--banner__warning-icon)}.proton-Banner--success{background-color:var(--banner__success-background)}.proton-Banner--success__title{color:var(--banner__success-title)}.proton-Banner--success__content{color:var(--banner__success-content)}.proton-Banner--success__icon{fill:var(--banner__success-icon)}.proton-Banner--danger{background-color:var(--banner__danger-background)}.proton-Banner--danger__title{color:var(--banner__danger-title)}.proton-Banner--danger__content{color:var(--banner__danger-content)}.proton-Banner--danger__icon{fill:var(--banner__danger-icon)}.proton-ButtonGroup{font-size:var(--proton-rem);border:1px solid var(--proton-color__gray-light);border-radius:4px;font-weight:400;display:flex;overflow:hidden}.proton-ButtonGroup__option{background-color:var(--proton-color__gray-super-light);cursor:pointer;border-left:1px solid var(--proton-color__gray-light);color:var(--proton-color__gray-dark);text-align:center;border-radius:0;flex:1;padding:.5em 1em}.proton-ButtonGroup__option:first-child{border-left:0}.proton-ButtonGroup__option--selected{background-color:var(--proton-color__white);color:var(--proton-color__primary);z-index:2;cursor:default;border-radius:inherit;box-shadow:0 0 6px #00000026}.proton-ButtonGroup__option--selected+.proton-ButtonGroup__option{border-left:1px solid #0000}.proton-Dialog{background-color:var(--dialog-background);box-shadow:0 0 2px 0 var(--proton-control__shadow-color),0 0 12px 0 var(--proton-control__shadow-color);color:var(--proton-control__text-color);border-radius:4px;outline:none;padding:.65rem .85rem;font-weight:300}.proton-Dialog__header{margin-top:0;margin-bottom:5px}.proton-Input{box-sizing:border-box;background-color:var(--input-background);outline:1px solid var(--proton-control__border-color);width:100%;min-height:40px;color:var(--proton-control__text-color);border:1px solid #0000;border-radius:4px;flex:1;padding-left:12px;transition:all .2s ease-in-out}.proton-Input:disabled{opacity:.6;cursor:not-allowed}.proton-Input:not(.proton-Input--error):focus{outline:1px solid var(--proton-color__primary)}.proton-Input:not(.proton-Input--error):focus-visible{outline:1px solid var(--proton-color__primary)}.proton-Input.proton-Input--error{outline:1px solid var(--proton-color__danger-dark)}.proton-Input__container{flex-direction:column;flex:1;width:100%;display:flex}.proton-Input__container-inner{flex:1;align-items:center;display:flex;position:relative}.proton-Input__descriptor{z-index:1;background-position:50%;background-repeat:no-repeat;background-size:50%;justify-content:center;align-items:center;height:100%;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.proton-Input__prefix,.proton-Input__suffix{flex:0 0 32px;justify-content:center;align-items:center;display:flex}.proton-Input__prefix{opacity:.5;cursor:text;margin-left:12px;left:0}.proton-Input__suffix{outline:none;padding-right:12px;right:0}.proton-Input__container-inner:has(.proton-Input__prefix) .proton-Input{padding-left:32px}.proton-Input__container-inner:has(.proton-Input__suffix) .proton-Input{padding-right:44px}.proton-Input__text{color:var(--proton-color__gray-medium);padding:4px 0;font-size:.75rem}.proton-ui__theme--custom-dark .proton-Input__text{color:var(--proton-color__gray-medium-light)}.proton-Input__error{color:var(--proton-color__danger-medium)}.proton-Input__label-top{padding-top:24px;padding-bottom:8px}.proton-Input__label{color:var(--proton-color__gray-medium-light);pointer-events:none;transform-origin:left center 0px;transition:color .2s,font-size .5s,top .5s;position:absolute;top:15px;left:14px}.proton-Input:focus+.proton-Input__label,.proton-Input__label--filled{font-size:.75rem;top:7px}.proton-Input:focus+.proton-Input__label{color:var(--proton-color__primary)}.proton-ui__theme--custom-dark .proton-Input:focus+.proton-Input__label{color:var(--proton-color__primary-light)}.proton-Input__label--hide{display:none}.proton-SearchInput__wrapper{width:100%}.proton-SearchInput__wrapper input{border-radius:50px;padding-left:44px!important}.proton-SearchInput__button{color:currentColor;cursor:pointer;opacity:1;background-color:#0000;border:none;transition:opacity .2s ease-in-out}.proton-SearchInput__button--hide{opacity:0}.proton-SearchInput__wrapper input[type=search]::-ms-clear{width:0;height:0;display:none}.proton-SearchInput__wrapper input[type=search]::-ms-reveal{width:0;height:0;display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-decoration{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-cancel-button{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-results-button{display:none}.proton-SearchInput__wrapper input[type=search]::-webkit-search-results-decoration{display:none}.proton-Popover{transform-origin:top}.proton-Popover[data-entering]{animation:.2s ease-out forwards slideDown}@keyframes slideDown{0%{opacity:0;transform:scaleY(0)}to{opacity:1;transform:scaleY(1)}}.arrow{fill:var(--dialog-background);stroke-width:1px;width:12px;height:12px;position:absolute}.arrow[data-placement=top]{top:100%;transform:translate(-50%)}.arrow[data-placement=bottom]{bottom:100%;transform:translate(-50%)rotate(180deg)}.arrow[data-placement=left]{left:100%;transform:translateY(-50%)rotate(-90deg)}.arrow[data-placement=right]{right:100%;transform:translateY(-50%)rotate(90deg)}.proton-ResponsiveMenuTrigger{display:inline-block;position:relative}.proton-ResponsiveMenuTrigger__button{cursor:pointer;color:var(--proton-control__text-color);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;padding:4px;display:flex}.proton-ResponsiveMenuTrigger__button:disabled{cursor:not-allowed;opacity:.5}.proton-ui__theme--dark .proton-ResponsiveMenuTrigger__button:disabled:hover,.proton-ResponsiveMenuTrigger__button:disabled:hover{background:0 0}.proton-ResponsiveMenuTrigger__button:focus{outline:2px solid var(--proton-control__border-color)}.proton-ResponsiveMenuTrigger__button:hover{background-color:#60606026}.proton-ui__theme--dark .proton-ResponsiveMenuTrigger__button:hover{background-color:#ffffff1a}.proton-ListBox{letter-spacing:.05em;background:var(--proton-control__background-color);border:1px solid var(--proton-control__border-color);min-width:100px;color:var(--proton-control__text-color);box-shadow:0 0 3px var(--proton-control__shadow-color);border-radius:10px;margin:.5rem 0 0;padding:0;list-style:none;overflow:auto}.proton-ui__theme--custom-dark .proton-ListBox{background:var(--proton-color__primary)}.proton-ListBox:focus{outline:none}.proton-ListBox:focus-visible{outline:none}.proton-ListBox__item{cursor:pointer;outline:none;justify-content:space-between;padding:8px 16px;transition:background-color .1s;display:flex}.proton-ListBox__item:hover{background:#0000000a}.proton-ui__theme--dark .proton-ListBox__item:hover,.proton-ui__theme--custom-dark .proton-ListBox__item:hover{background:#ffffff1a}.proton-ListBox__item--disabled{opacity:.5;cursor:not-allowed}.proton-ListBox__item--selected{background:var(--proton-color__primary-light);color:var(--proton-color__primary)}.proton-ui__theme--custom-dark .proton-ListBox__item--selected{color:var(--proton-control__text-color)}.proton-Select{flex-direction:column;width:100%;margin:0;display:flex}.proton-Select__label{color:var(--proton-control__text-color);margin-bottom:2px}.proton-Select__trigger{color:var(--proton-control__text-color);font-size:inherit;border-radius:50px;flex:1;justify-content:space-between;align-items:center;width:100%;padding:.2rem .6rem .2rem 1rem;display:flex}button.proton-Select__trigger{letter-spacing:.05em;cursor:pointer;background:var(--proton-control__background-color);outline:1px solid var(--proton-control__border-color);border:1px solid #0000;font-weight:400;transition:outline .2s;position:relative}.proton-ui__theme--custom-dark button.proton-Select__trigger{background:var(--proton-color__primary)}button.proton-Select__trigger:hover:after{content:"";-webkit-backdrop-filter:brightness(98%);backdrop-filter:brightness(98%);z-index:1;border-radius:50px;width:100%;height:100%;position:absolute;left:0}button.proton-Select__trigger:focus{outline:solid var(--proton-color__primary)1px;border:1px solid #0000}button.proton-Select__trigger:focus-visible{outline:solid var(--proton-color__primary)1px;border:1px solid #0000}.proton-ui__theme--custom-dark button.proton-Select__trigger:focus{outline:solid var(--proton-color__gray-medium-light)1px;border:1px solid #0000}.proton-ui__theme--custom-dark button.proton-Select__trigger:focus-visible{outline:solid var(--proton-color__gray-medium-light)1px;border:1px solid #0000}.proton-Select__popover{padding-left:.25rem}.proton-Select__trigger_icon{color:var(--proton-control__text-color);width:.75em;height:.75em;margin-left:.8em;transition:transform .2s;position:relative}.proton-Select__trigger_icon svg{width:100%;height:100%;position:absolute;top:50%;left:0;transform:translateY(-50%)}.proton-Select__trigger_icon--flipped{transform:rotateX(180deg)}.proton-Select:hover{cursor:pointer}.proton-Select__trigger--disabled,.proton-Select__trigger--disabled:hover{opacity:.5;filter:none;cursor:not-allowed}.proton-Select__value{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.proton-Switch{font-size:var(--proton-rem);flex-flow:column;row-gap:5px;display:flex}.proton-Switch__label{text-transform:uppercase;letter-spacing:.1em;color:var(--proton-color__gray-dark);font-size:.7em;font-weight:600}.proton-Switch__description{color:var(--proton-color__gray-medium);align-self:center;font-size:.9em}.proton-Switch__wrapper{column-gap:12px;display:flex}.proton-Switch__toggle{background-color:var(--proton-color__gray-light);cursor:pointer;border-radius:26px;flex-shrink:0;width:50px;height:26px;position:relative}.proton-ui__theme--dark .proton-Switch__toggle,.proton-ui__theme--custom-dark .proton-Switch__toggle{background-color:var(--proton-color__gray-dark)}.proton-Switch__slider{background-color:#fff;border-radius:22px;width:22px;height:22px;transition:left .2s;position:absolute;top:2px;left:2px}.proton-Switch--on .proton-Switch__toggle{background-color:var(--proton-color__primary)}.proton-Switch--on .proton-Switch__slider{left:26px}.proton-Switch--disabled{opacity:.4}.proton-Switch--disabled .proton-Switch__toggle{cursor:not-allowed}.proton-Table{border-collapse:collapse;color:var(--proton-control__text-color);width:100%;font-weight:300}.proton-Table__header{cursor:default;letter-spacing:.1em;text-transform:uppercase;text-align:left;outline:none;padding:7px 10px;font-size:.75rem;font-weight:500;line-height:1rem}.proton-Table__header--center{text-align:center}.proton-Table__header--right{text-align:right}.proton-Table__headerSortIcon{padding:0 2px}.proton-Table__row{cursor:default;border-top:1px solid #ccc;outline:none}.proton-Table__row:last-child{border-bottom:1px solid #ccc}.proton-Table__cell{vertical-align:middle;outline:none;padding:7px 10px}.proton-Table__cell--center{text-align:center}.proton-Table__cell--right{text-align:right}.proton-TextEmphasis{background-image:linear-gradient(to top,#0000 0,#0000 15%,var(--text-emphasis-highlight)15%,var(--text-emphasis-highlight)35%,transparent 35%,transparent 100%);color:var(--proton-color__gray-super-dark);padding:0 .05rem;font-style:normal;font-weight:700}.proton-TextEmphasis a{color:inherit;text-decoration:none;transition:color .15s}.proton-TextEmphasis a:hover{color:var(--proton-color__primary);text-decoration:none}.proton-ui__theme--custom-dark .proton-TextEmphasis,.proton-ui__theme--dark .proton-TextEmphasis{color:var(--proton-color__gray-lightest)}.proton-TextEmphasis--tooltip{background-image:linear-gradient(to top,#0000 0,#0000 15%,var(--text-emphasis-highlight)25%,var(--text-emphasis-highlight)87%,transparent 80%,transparent 100%);background-position:bottom;background-repeat:no-repeat;background-size:100% 35%;font-style:italic;font-weight:400;transition:background-size .3s,border-radius .3s}.proton-TextEmphasis--tooltip:hover{background-size:100% 100%;border-radius:2px}.proton-TextEmphasis--tooltip:not(:hover){transition-delay:.2s}.proton__Tooltip{background-color:var(--tooltip-background);color:var(--proton-control__text-color);position:absolute}.proton__TooltipTrigger{all:unset}.proton__Tooltip[data-placement=top]{--origin:translateY(4px);margin-bottom:8px}.proton__Tooltip[data-placement=bottom]{--origin:translateY(-4px);margin-top:8px}.proton__Tooltip[data-placement=bottom] .proton__TooltipArrow svg{transform:rotate(180deg)}.proton__Tooltip[data-placement=right]{--origin:translateX(-4px);margin-left:8px}.proton__Tooltip[data-placement=right] .proton__TooltipArrow svg{transform:rotate(90deg)}.proton__Tooltip[data-placement=left]{--origin:translateX(4px);margin-right:8px}.proton__Tooltip[data-placement=left] .proton__TooltipArrow svg{transform:rotate(-90deg)}.proton__Tooltip .proton__TooltipArrow svg{fill:var(--tooltip-background);display:block}.proton__Tooltip[data-entering]{animation:.2s slide}.proton__Tooltip[data-exiting]{animation:.2s reverse slide}@keyframes slide{0%{opacity:0;transform:var(--origin)}to{opacity:1;transform:translateY(0)}}:root{--waveform-bar-color-dark:#ffffffe6;--waveform-bar-color-light:#000000b3;--waveform-disabled-color-dark:#fff3;--waveform-disabled-color-light:#0003;--waveform-animation-curve:cubic-bezier(.34,1.56,.64,1);--waveform-animation-duration:.4s;--waveform-bar-delay-multiplier:.7ms;--waveform-timestamp-padding:.25rem;--waveform-timestamp-font-size:.75rem;--waveform-timestamp-border-radius:.125rem;--waveform-hover-line-width:2px}.proton-Waveform{flex-direction:row;align-items:center;width:100%;height:100%;display:flex;position:relative}.proton-Waveform__container{z-index:0;flex:1;align-items:center;width:100%;height:100%;display:flex;position:relative}.proton-Waveform__timestamp{pointer-events:none;border-radius:var(--waveform-timestamp-border-radius);padding:0 var(--waveform-timestamp-padding);font-size:var(--waveform-timestamp-font-size);z-index:1;background-color:#0009;position:absolute}.proton-ui__theme--light .proton-Waveform__timestamp{color:#000c;background-color:#ffffffe6;box-shadow:0 2px 2px #0000004d}.proton-Waveform__timestamp--left{left:1px}.proton-Waveform__timestamp--right{right:3px}.proton-Waveform__hover-line{width:var(--waveform-hover-line-width);background-color:#ffffff80;position:absolute;top:0;bottom:0;transform:translate(-50%)}.proton-ui__theme--light .proton-Waveform__hover-line{background-color:#00000080}.proton-Waveform__bar-wrapper{flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex;position:relative}.proton-Waveform__bar{background-color:var(--waveform-bar-color-dark);transform-origin:50%;width:100%;height:0;transition:height var(--waveform-animation-duration)var(--waveform-animation-curve);position:relative}.proton-Waveform__bar.proton-Waveform__bar--visible{height:var(--target-height);transition-delay:calc(var(--index)*var(--waveform-bar-delay-multiplier))}.proton-Waveform__bar.proton-Waveform__bar--upper{transform-origin:bottom}.proton-Waveform__bar.proton-Waveform__bar--lower{transform-origin:top}.proton-ui__theme--light .proton-Waveform__bar{background-color:var(--waveform-bar-color-light)}.proton-Waveform__bar.proton-Waveform__bar--disabled{background-color:var(--waveform-disabled-color-dark)}.proton-ui__theme--light .proton-Waveform__bar.proton-Waveform__bar--disabled{background-color:var(--waveform-disabled-color-light)}.proton-Waveform__bar.proton-Waveform__bar--disabled.proton-Waveform__bar--played{background-color:var(--waveform-disabled-color-dark)}.proton-ui__theme--light .proton-Waveform__bar.proton-Waveform__bar--disabled.proton-Waveform__bar--played{background-color:var(--waveform-disabled-color-light)}.proton-Waveform__bar.proton-Waveform__bar--played{background-color:var(--proton-color__primary)}.proton-Waveform__bar--hover{height:var(--hover-height);z-index:10;background-color:color-mix(in srgb,var(--proton-color__primary)50%,transparent);mix-blend-mode:darken;width:100%;position:absolute;top:50%;transform:translateY(-50%)}.proton-ui__theme--light .proton-Waveform__bar--hover{background-color:color-mix(in srgb,var(--proton-color__primary)50%,white);mix-blend-mode:lighten}.proton-Waveform__bar-unavailable{pointer-events:none;text-align:center;z-index:10;color:#fff;background-color:#000000b3;border-radius:4px;padding:3px 6px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.proton-ui__theme--light .proton-Waveform__bar-unavailable{color:#000;background-color:#fff;box-shadow:0 5px 5px #0000004d}.proton-Waveform__active-region{pointer-events:none;z-index:1;border:1.5px solid #ffffffb3;border-radius:4px;position:absolute;top:0;bottom:0}.proton-ui__theme--light .proton-Waveform__active-region{border-color:#0000004d}
@@ -0,0 +1,145 @@
1
+ import { B as P, G as e } from "./colors-Dwh4VIMR.mjs";
2
+ import { toRgba as n, transparentize as U, saturate as C, desaturate as h, getScale as u, adjustHue as N, darken as M, lighten as S, hasBadContrast as l, getLuminance as T } from "color2k";
3
+ const y = {
4
+ BRAND: {
5
+ PRIMARY: P.PRIMARY,
6
+ PRIMARY_LIGHT: P.PRIMARY_LIGHT,
7
+ SECONDARY: P.SECONDARY
8
+ },
9
+ PRIMARY: {
10
+ PRIMARY_SUPER_DARK: e.GRAY_SUPER_DARK,
11
+ PRIMARY_DARK: e.GRAY_DARK,
12
+ PRIMARY_MEDIUM: e.GRAY_MEDIUM,
13
+ PRIMARY_MEDIUM_LIGHT: e.GRAY_MEDIUM_LIGHT,
14
+ PRIMARY_LIGHT: e.GRAY_LIGHT,
15
+ PRIMARY_LIGHTEST: e.GRAY_LIGHTEST,
16
+ PRIMARY_SUPER_LIGHT: e.GRAY_SUPER_LIGHT
17
+ },
18
+ SECONDARY: {
19
+ SECONDARY_SUPER_DARK: e.GRAY_SUPER_DARK,
20
+ SECONDARY_DARK: e.GRAY_DARK,
21
+ SECONDARY_MEDIUM: e.GRAY_MEDIUM,
22
+ SECONDARY_MEDIUM_LIGHT: e.GRAY_MEDIUM_LIGHT,
23
+ SECONDARY_LIGHT: e.GRAY_LIGHT,
24
+ SECONDARY_LIGHTEST: e.GRAY_LIGHTEST,
25
+ SECONDARY_SUPER_LIGHT: e.GRAY_SUPER_LIGHT
26
+ }
27
+ // Success, Warning & Danger palettes go here...
28
+ }, m = (t, R) => R === void 0 ? `rgb(${t[0]}, ${t[1]}, ${t[2]})` : `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${R})`, g = (t, R) => n(U(t, R)), Y = (t, R) => n(C(t, R)), r = (t, R) => n(h(t, R)), f = (t, R = !0) => {
29
+ const a = m(t), I = u("#FFFFFF", a, "#000000"), s = Array.from({ length: 12 }, (c, i) => {
30
+ const G = I(i / 11);
31
+ return r(G, 85e-4);
32
+ }), A = R ? s.map(
33
+ (c) => Y(L(c), 5e-3)
34
+ ) : s, H = n(Y(N(a, 180), 1)), d = u("#FFFFFF", H, "#000000"), D = Array.from({ length: 12 }, (c, i) => {
35
+ const G = d(i / 11);
36
+ return r(G, 0.1);
37
+ }), E = R ? D.map(
38
+ (c) => r(L(c), 0.22)
39
+ ) : D;
40
+ return {
41
+ BRAND: {
42
+ PRIMARY: r(o(A[5]), 0.125),
43
+ PRIMARY_LIGHT: r(
44
+ _(A[5]),
45
+ 0.1
46
+ ),
47
+ SECONDARY: r(E[4], 0.02)
48
+ },
49
+ PRIMARY: {
50
+ //backgrounds
51
+ PRIMARY_SUPER_DARK: o(s[9]),
52
+ PRIMARY_DARK: o(s[8]),
53
+ //interactive components
54
+ PRIMARY_MEDIUM: n(
55
+ M(
56
+ r(o(A[7]), 0.18),
57
+ 0.05
58
+ )
59
+ ),
60
+ //borders and seperators
61
+ PRIMARY_MEDIUM_LIGHT: _(A[6]),
62
+ //solid colors
63
+ PRIMARY_LIGHT: Y(_(A[5]), 0.2),
64
+ //accessible text
65
+ PRIMARY_LIGHTEST: n(
66
+ S(Y(_(A[3]), 0.2), 0.1)
67
+ ),
68
+ PRIMARY_SUPER_LIGHT: n(S(A[0], 0.2))
69
+ },
70
+ SECONDARY: {
71
+ //backgrounds
72
+ SECONDARY_SUPER_DARK: o(D[10]),
73
+ SECONDARY_DARK: o(D[9]),
74
+ // interactive components
75
+ SECONDARY_MEDIUM: n(
76
+ M(
77
+ r(o(E[7]), 0.35),
78
+ 0.1
79
+ )
80
+ ),
81
+ //borders and seperators
82
+ SECONDARY_MEDIUM_LIGHT: _(E[6]),
83
+ //solid colors
84
+ SECONDARY_LIGHT: Y(
85
+ _(E[5]),
86
+ 0.1
87
+ ),
88
+ //accessible text
89
+ SECONDARY_LIGHTEST: n(
90
+ S(
91
+ Y(_(E[3]), 0.2),
92
+ 0.1
93
+ )
94
+ ),
95
+ SECONDARY_SUPER_LIGHT: n(S(E[0], 0.2))
96
+ }
97
+ };
98
+ }, _ = (t) => {
99
+ for (; l(t, "readable", e.GRAY_DARK); )
100
+ t = S(t, 0.01);
101
+ return n(t);
102
+ }, o = (t) => {
103
+ for (; l(e.GRAY_SUPER_LIGHT, "readable", t); )
104
+ t = M(t, 0.01);
105
+ return n(t);
106
+ }, L = (t) => {
107
+ let R = t, a = T(n(R)), I = 0;
108
+ const s = 6;
109
+ for (; a < 0.16 && I < s; )
110
+ I++, R = S(R, 0.1), a = T(n(R));
111
+ for (; a > 0.6 && I < s; )
112
+ I++, R = M(R, 0.1), a = T(n(R));
113
+ return n(R);
114
+ }, p = (t) => typeof t == "string" || t instanceof String;
115
+ function w(...t) {
116
+ return t.filter(p).join(" ");
117
+ }
118
+ const O = (t) => {
119
+ if (/^https?:\/\//.test(t)) {
120
+ const R = document.createElement("a");
121
+ return R.href = t, R.hostname;
122
+ }
123
+ return window.location.hostname;
124
+ }, $ = (t) => {
125
+ const R = window.location.hostname, a = O(t);
126
+ return R !== a;
127
+ }, v = (t, R) => {
128
+ if (t.metaKey || t.altKey || t.ctrlKey || t.shiftKey || t.button && t.button !== 0)
129
+ return;
130
+ t.preventDefault();
131
+ const a = R.startsWith("/") ? R : `/${R}`;
132
+ window.history.pushState({}, "", a), window.dispatchEvent(new PopStateEvent("popstate"));
133
+ };
134
+ export {
135
+ y as D,
136
+ m as a,
137
+ w as c,
138
+ r as d,
139
+ f as g,
140
+ v as h,
141
+ $ as i,
142
+ Y as s,
143
+ g as t
144
+ };
145
+ //# sourceMappingURL=utils-D9D3Fg9O.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-D9D3Fg9O.mjs","sources":["../src/utils/color.ts","../src/utils/utils.ts"],"sourcesContent":["import { COLORS } from \"../constants\";\r\nimport {\r\n adjustHue,\r\n getScale,\r\n saturate as _saturate,\r\n transparentize as _transparentize,\r\n desaturate as _desaturate,\r\n hasBadContrast,\r\n getLuminance,\r\n lighten,\r\n darken,\r\n toRgba,\r\n} from \"color2k\";\r\n\r\nexport type RGBArray = [number, number, number];\r\n\r\nexport type Palette = {\r\n BRAND: {\r\n PRIMARY: string;\r\n PRIMARY_LIGHT: string;\r\n SECONDARY: string;\r\n };\r\n PRIMARY: {\r\n //backgrounds\r\n PRIMARY_SUPER_DARK: string;\r\n PRIMARY_DARK: string;\r\n //interactive components\r\n PRIMARY_MEDIUM: string;\r\n //borders and seperators\r\n PRIMARY_MEDIUM_LIGHT: string;\r\n //solid colors\r\n PRIMARY_LIGHT: string;\r\n //accessible text\r\n PRIMARY_LIGHTEST: string;\r\n PRIMARY_SUPER_LIGHT: string;\r\n };\r\n SECONDARY: {\r\n //backgrounds\r\n SECONDARY_SUPER_DARK: string;\r\n SECONDARY_DARK: string;\r\n //interactive components\r\n SECONDARY_MEDIUM: string;\r\n //borders and seperators\r\n SECONDARY_MEDIUM_LIGHT: string;\r\n //solid colors\r\n SECONDARY_LIGHT: string;\r\n //accessible text\r\n SECONDARY_LIGHTEST: string;\r\n SECONDARY_SUPER_LIGHT: string;\r\n };\r\n};\r\n\r\nexport const DEFAULT_PALETTE: Palette = {\r\n BRAND: {\r\n PRIMARY: COLORS.BRAND.PRIMARY,\r\n PRIMARY_LIGHT: COLORS.BRAND.PRIMARY_LIGHT,\r\n SECONDARY: COLORS.BRAND.SECONDARY,\r\n },\r\n PRIMARY: {\r\n PRIMARY_SUPER_DARK: COLORS.GRAYSCALE.GRAY_SUPER_DARK,\r\n PRIMARY_DARK: COLORS.GRAYSCALE.GRAY_DARK,\r\n PRIMARY_MEDIUM: COLORS.GRAYSCALE.GRAY_MEDIUM,\r\n PRIMARY_MEDIUM_LIGHT: COLORS.GRAYSCALE.GRAY_MEDIUM_LIGHT,\r\n PRIMARY_LIGHT: COLORS.GRAYSCALE.GRAY_LIGHT,\r\n PRIMARY_LIGHTEST: COLORS.GRAYSCALE.GRAY_LIGHTEST,\r\n PRIMARY_SUPER_LIGHT: COLORS.GRAYSCALE.GRAY_SUPER_LIGHT,\r\n },\r\n SECONDARY: {\r\n SECONDARY_SUPER_DARK: COLORS.GRAYSCALE.GRAY_SUPER_DARK,\r\n SECONDARY_DARK: COLORS.GRAYSCALE.GRAY_DARK,\r\n SECONDARY_MEDIUM: COLORS.GRAYSCALE.GRAY_MEDIUM,\r\n SECONDARY_MEDIUM_LIGHT: COLORS.GRAYSCALE.GRAY_MEDIUM_LIGHT,\r\n SECONDARY_LIGHT: COLORS.GRAYSCALE.GRAY_LIGHT,\r\n SECONDARY_LIGHTEST: COLORS.GRAYSCALE.GRAY_LIGHTEST,\r\n SECONDARY_SUPER_LIGHT: COLORS.GRAYSCALE.GRAY_SUPER_LIGHT,\r\n },\r\n // Success, Warning & Danger palettes go here...\r\n};\r\n\r\n/**\r\n * Converts an RGB array to a CSS string representation.\r\n * @param rgb - The RGB array to convert.\r\n * @param opacity - Optional opacity value.\r\n * @returns A CSS string representation of the RGB array, using `rgb()`, or `rgba()` if an opacity value is provided.\r\n */\r\nexport const arrayToRgbString = (rgb: RGBArray, opacity?: number): string => {\r\n return opacity === undefined\r\n ? `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`\r\n : `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opacity})`;\r\n};\r\n\r\n/**\r\n * Transparentizes an input color.\r\n *\r\n * @param color - The color string to transparentize.\r\n * @param amount - The amount to increase the opacity of the color by, given as a decimal between 0 and 1.\r\n * @returns An RGBA color string.\r\n */\r\nexport const transparentize = (color: string, amount: number): string => {\r\n return toRgba(_transparentize(color, amount));\r\n};\r\n\r\n/**\r\n * Saturates a color.\r\n *\r\n * @param color - Input color\r\n * @param amount - The amount to saturate, given as a decimal between 0 and 1\r\n * @returns An RGBA color string.\r\n */\r\nexport const saturate = (color: string, amount: number): string => {\r\n return toRgba(_saturate(color, amount));\r\n};\r\n\r\n/**\r\n * Desaturates a color.\r\n *\r\n * @param color - Input color\r\n * @param amount - The amount to desaturate, given as a decimal between 0 and 1\r\n * @returns An RGBA color string.\r\n */\r\nexport const desaturate = (color: string, amount: number): string => {\r\n return toRgba(_desaturate(color, amount));\r\n};\r\n\r\n/**\r\n * Generates a complete color palette based on a primary color input.\r\n * The palette includes primary and secondary color scales with varying shades.\r\n *\r\n * @param primaryColor - The base RGB color array to generate the palette from\r\n * @param adjustForLuminance - Whether to adjust the generated colors for better luminance/contrast. Defaults to true.\r\n * @returns A Palette object containing:\r\n * - BRAND colors (primary, light primary, and secondary)\r\n * - PRIMARY scale (7 shades from super dark to super light)\r\n * - SECONDARY scale (7 shades from super dark to super light)\r\n *\r\n * The function:\r\n * 1. Creates a 12-color scale from white to the primary color to black\r\n * 2. Generates a complementary secondary color by shifting the hue 180 degrees\r\n * 3. Creates another 12-color scale for the secondary color\r\n * 4. Maps specific positions from these scales to create the final palette structure\r\n */\r\nexport const generatePalette = (\r\n primaryColor: RGBArray,\r\n adjustForLuminance: boolean = true\r\n): Palette => {\r\n const primaryRgba = arrayToRgbString(primaryColor);\r\n\r\n //why does primary lightest look lighter than primary super light?\r\n //also primary lightest is returning in hsla?\r\n //dark release colors dont looks so good rn...\r\n //we should also proabbly saturate the colors against heavy hoverboxes in RL (maybe also hover box could be lighter), for ex:\r\n //http://local.protonradio.com:3000/r/rl2pAmu9x5Tgw/insights this one is bad\r\n //http://local.protonradio.com:3000/r/rlMWSB2DdIoC8/insights this is also pretty bad\r\n // http://local.protonradio.com:3000/r/rlAVBAD7N5YQw/insights\r\n //http://local.protonradio.com:3000/r/rlOHftclmdJ0w/insights\r\n //http://local.protonradio.com:3000/r/rlw_tmjUkVy4s/insights\r\n //why are we seeing the arrow in select dropdowns\r\n const primaryScaleFunc = getScale(\"#FFFFFF\", primaryRgba, \"#000000\");\r\n const primaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = primaryScaleFunc(i / 11);\r\n return desaturate(color, 0.0085);\r\n });\r\n\r\n const adjustedPrimaryScale = adjustForLuminance\r\n ? primaryScale.map((color) =>\r\n saturate(adjustBrightnessForLuminance(color), 0.005)\r\n )\r\n : primaryScale;\r\n\r\n const secondaryColor = toRgba(saturate(adjustHue(primaryRgba, 180), 1));\r\n\r\n const secondaryScaleFunc = getScale(\"#FFFFFF\", secondaryColor, \"#000000\");\r\n const secondaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = secondaryScaleFunc(i / 11);\r\n return desaturate(color, 0.1);\r\n });\r\n\r\n const adjustedSecondaryScale = adjustForLuminance\r\n ? secondaryScale.map((color) =>\r\n desaturate(adjustBrightnessForLuminance(color), 0.22)\r\n )\r\n : secondaryScale;\r\n\r\n return {\r\n BRAND: {\r\n PRIMARY: desaturate(darkenForContrast(adjustedPrimaryScale[5]), 0.125),\r\n PRIMARY_LIGHT: desaturate(\r\n lightenForContrast(adjustedPrimaryScale[5]),\r\n 0.1\r\n ),\r\n SECONDARY: desaturate(adjustedSecondaryScale[4], 0.02),\r\n },\r\n PRIMARY: {\r\n //backgrounds\r\n PRIMARY_SUPER_DARK: darkenForContrast(primaryScale[9]),\r\n PRIMARY_DARK: darkenForContrast(primaryScale[8]),\r\n //interactive components\r\n PRIMARY_MEDIUM: toRgba(\r\n darken(\r\n desaturate(darkenForContrast(adjustedPrimaryScale[7]), 0.18),\r\n 0.05\r\n )\r\n ),\r\n //borders and seperators\r\n PRIMARY_MEDIUM_LIGHT: lightenForContrast(adjustedPrimaryScale[6]),\r\n //solid colors\r\n PRIMARY_LIGHT: saturate(lightenForContrast(adjustedPrimaryScale[5]), 0.2),\r\n //accessible text\r\n PRIMARY_LIGHTEST: toRgba(\r\n lighten(saturate(lightenForContrast(adjustedPrimaryScale[3]), 0.2), 0.1)\r\n ),\r\n PRIMARY_SUPER_LIGHT: toRgba(lighten(adjustedPrimaryScale[0], 0.2)),\r\n },\r\n SECONDARY: {\r\n //backgrounds\r\n SECONDARY_SUPER_DARK: darkenForContrast(secondaryScale[10]),\r\n SECONDARY_DARK: darkenForContrast(secondaryScale[9]),\r\n // interactive components\r\n SECONDARY_MEDIUM: toRgba(\r\n darken(\r\n desaturate(darkenForContrast(adjustedSecondaryScale[7]), 0.35),\r\n 0.1\r\n )\r\n ),\r\n //borders and seperators\r\n SECONDARY_MEDIUM_LIGHT: lightenForContrast(adjustedSecondaryScale[6]),\r\n //solid colors\r\n SECONDARY_LIGHT: saturate(\r\n lightenForContrast(adjustedSecondaryScale[5]),\r\n 0.1\r\n ),\r\n //accessible text\r\n SECONDARY_LIGHTEST: toRgba(\r\n lighten(\r\n saturate(lightenForContrast(adjustedSecondaryScale[3]), 0.2),\r\n 0.1\r\n )\r\n ),\r\n SECONDARY_SUPER_LIGHT: toRgba(lighten(adjustedSecondaryScale[0], 0.2)),\r\n },\r\n };\r\n};\r\n\r\nconst lightenForContrast = (color: string): string => {\r\n while (hasBadContrast(color, \"readable\", COLORS.GRAYSCALE.GRAY_DARK)) {\r\n color = lighten(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst darkenForContrast = (color: string): string => {\r\n while (hasBadContrast(COLORS.GRAYSCALE.GRAY_SUPER_LIGHT, \"readable\", color)) {\r\n color = darken(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst adjustBrightnessForLuminance = (color: string): string => {\r\n let currentColor = color;\r\n let currentLuminance = getLuminance(toRgba(currentColor));\r\n let adjustmentAttempts = 0;\r\n const MAX_ATTEMPTS = 6;\r\n\r\n while (currentLuminance < 0.16 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = lighten(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n while (currentLuminance > 0.6 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = darken(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n return toRgba(currentColor);\r\n};\r\n","const isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\n/**\r\n * [getLinkHost] - get the host of a link.\r\n * Referenced from is-url-external npm package\r\n * https://github.com/mrded/is-url-external/blob/master/index.js\r\n */\r\nconst getLinkHost = (url) => {\r\n if (/^https?:\\/\\//.test(url)) {\r\n // Absolute URL.\r\n // The easy way to parse an URL, is to create <a> element.\r\n // @see: https://gist.github.com/jlong/2428561\r\n const parser = document.createElement(\"a\");\r\n parser.href = url;\r\n return parser.hostname;\r\n }\r\n return window.location.hostname;\r\n};\r\n\r\n/**\r\n * [isUrlExternal] - determine if passed absolute url is external to the current domain.\r\n */\r\nexport const isUrlExternal = (url) => {\r\n const host = window.location.hostname;\r\n const linkHost = getLinkHost(url);\r\n\r\n return host !== linkHost;\r\n};\r\n\r\n/**\r\n * Handles internal navigation clicks by preventing default browser behavior and\r\n * programmatically updating the URL and history state.\r\n *\r\n * @param e - The click event from the anchor element\r\n * @param to - The destination path to navigate to\r\n *\r\n * @remarks\r\n * - Converts relative paths to absolute by prepending \"/\" if needed\r\n * - Updates browser history using pushState and dispatches a popstate event\r\n */\r\nexport const handleInternalNavigation = (\r\n e: React.MouseEvent<HTMLAnchorElement>,\r\n to: string\r\n) => {\r\n // Don't handle navigation if modifier keys are pressed\r\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) {\r\n return;\r\n }\r\n\r\n // Don't handle middle clicks or right clicks\r\n if (e.button && e.button !== 0) {\r\n return;\r\n }\r\n\r\n e.preventDefault();\r\n\r\n // Handle relative paths\r\n const resolvedPath = to.startsWith(\"/\") ? to : `/${to}`;\r\n window.history.pushState({}, \"\", resolvedPath);\r\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\r\n};\r\n"],"names":["DEFAULT_PALETTE","COLORS.BRAND","COLORS.GRAYSCALE","arrayToRgbString","rgb","opacity","transparentize","color","amount","toRgba","_transparentize","saturate","_saturate","desaturate","_desaturate","generatePalette","primaryColor","adjustForLuminance","primaryRgba","primaryScaleFunc","getScale","primaryScale","_","adjustedPrimaryScale","adjustBrightnessForLuminance","secondaryColor","adjustHue","secondaryScaleFunc","secondaryScale","adjustedSecondaryScale","darkenForContrast","lightenForContrast","darken","lighten","hasBadContrast","currentColor","currentLuminance","getLuminance","adjustmentAttempts","MAX_ATTEMPTS","isString","x","csx","classnames","getLinkHost","url","parser","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PRIMARY_LIGHT:n.BRAND.PRIMARY_LIGHT,SECONDARY:n.BRAND.SECONDARY},PRIMARY:{PRIMARY_SUPER_DARK:n.GRAYSCALE.GRAY_SUPER_DARK,PRIMARY_DARK:n.GRAYSCALE.GRAY_DARK,PRIMARY_MEDIUM:n.GRAYSCALE.GRAY_MEDIUM,PRIMARY_MEDIUM_LIGHT:n.GRAYSCALE.GRAY_MEDIUM_LIGHT,PRIMARY_LIGHT:n.GRAYSCALE.GRAY_LIGHT,PRIMARY_LIGHTEST:n.GRAYSCALE.GRAY_LIGHTEST,PRIMARY_SUPER_LIGHT:n.GRAYSCALE.GRAY_SUPER_LIGHT},SECONDARY:{SECONDARY_SUPER_DARK:n.GRAYSCALE.GRAY_SUPER_DARK,SECONDARY_DARK:n.GRAYSCALE.GRAY_DARK,SECONDARY_MEDIUM:n.GRAYSCALE.GRAY_MEDIUM,SECONDARY_MEDIUM_LIGHT:n.GRAYSCALE.GRAY_MEDIUM_LIGHT,SECONDARY_LIGHT:n.GRAYSCALE.GRAY_LIGHT,SECONDARY_LIGHTEST:n.GRAYSCALE.GRAY_LIGHTEST,SECONDARY_SUPER_LIGHT:n.GRAYSCALE.GRAY_SUPER_LIGHT}},D=(t,e)=>e===void 0?`rgb(${t[0]}, ${t[1]}, ${t[2]})`:`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${e})`,u=(t,e)=>R.toRgba(R.transparentize(t,e)),Y=(t,e)=>R.toRgba(R.saturate(t,e)),A=(t,e)=>R.toRgba(R.desaturate(t,e)),P=(t,e=!0)=>{const a=D(t),_=R.getScale("#FFFFFF",a,"#000000"),r=Array.from({length:12},(I,c)=>{const i=_(c/11);return A(i,.0085)}),o=e?r.map(I=>Y(L(I),.005)):r,M=R.toRgba(Y(R.adjustHue(a,180),1)),T=R.getScale("#FFFFFF",M,"#000000"),G=Array.from({length:12},(I,c)=>{const i=T(c/11);return A(i,.1)}),S=e?G.map(I=>A(L(I),.22)):G;return{BRAND:{PRIMARY:A(E(o[5]),.125),PRIMARY_LIGHT:A(s(o[5]),.1),SECONDARY:A(S[4],.02)},PRIMARY:{PRIMARY_SUPER_DARK:E(r[9]),PRIMARY_DARK:E(r[8]),PRIMARY_MEDIUM:R.toRgba(R.darken(A(E(o[7]),.18),.05)),PRIMARY_MEDIUM_LIGHT:s(o[6]),PRIMARY_LIGHT:Y(s(o[5]),.2),PRIMARY_LIGHTEST:R.toRgba(R.lighten(Y(s(o[3]),.2),.1)),PRIMARY_SUPER_LIGHT:R.toRgba(R.lighten(o[0],.2))},SECONDARY:{SECONDARY_SUPER_DARK:E(G[10]),SECONDARY_DARK:E(G[9]),SECONDARY_MEDIUM:R.toRgba(R.darken(A(E(S[7]),.35),.1)),SECONDARY_MEDIUM_LIGHT:s(S[6]),SECONDARY_LIGHT:Y(s(S[5]),.1),SECONDARY_LIGHTEST:R.toRgba(R.lighten(Y(s(S[3]),.2),.1)),SECONDARY_SUPER_LIGHT:R.toRgba(R.lighten(S[0],.2))}}},s=t=>{for(;R.hasBadContrast(t,"readable",n.GRAYSCALE.GRAY_DARK);)t=R.lighten(t,.01);return R.toRgba(t)},E=t=>{for(;R.hasBadContrast(n.GRAYSCALE.GRAY_SUPER_LIGHT,"readable",t);)t=R.darken(t,.01);return R.toRgba(t)},L=t=>{let e=t,a=R.getLuminance(R.toRgba(e)),_=0;const r=6;for(;a<.16&&_<r;)_++,e=R.lighten(e,.1),a=R.getLuminance(R.toRgba(e));for(;a>.6&&_<r;)_++,e=R.darken(e,.1),a=R.getLuminance(R.toRgba(e));return R.toRgba(e)},g=t=>typeof t=="string"||t instanceof String;function C(...t){return t.filter(g).join(" ")}const d=t=>{if(/^https?:\/\//.test(t)){const e=document.createElement("a");return e.href=t,e.hostname}return window.location.hostname},H=t=>{const e=window.location.hostname,a=d(t);return e!==a},h=(t,e)=>{if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.button&&t.button!==0)return;t.preventDefault();const a=e.startsWith("/")?e:`/${e}`;window.history.pushState({},"",a),window.dispatchEvent(new PopStateEvent("popstate"))};exports.DEFAULT_PALETTE=l;exports.arrayToRgbString=D;exports.csx=C;exports.desaturate=A;exports.generatePalette=P;exports.handleInternalNavigation=h;exports.isUrlExternal=H;exports.saturate=Y;exports.transparentize=u;
2
+ //# sourceMappingURL=utils-DbIphMSk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-DbIphMSk.js","sources":["../src/utils/color.ts","../src/utils/utils.ts"],"sourcesContent":["import { COLORS } from \"../constants\";\r\nimport {\r\n adjustHue,\r\n getScale,\r\n saturate as _saturate,\r\n transparentize as _transparentize,\r\n desaturate as _desaturate,\r\n hasBadContrast,\r\n getLuminance,\r\n lighten,\r\n darken,\r\n toRgba,\r\n} from \"color2k\";\r\n\r\nexport type RGBArray = [number, number, number];\r\n\r\nexport type Palette = {\r\n BRAND: {\r\n PRIMARY: string;\r\n PRIMARY_LIGHT: string;\r\n SECONDARY: string;\r\n };\r\n PRIMARY: {\r\n //backgrounds\r\n PRIMARY_SUPER_DARK: string;\r\n PRIMARY_DARK: string;\r\n //interactive components\r\n PRIMARY_MEDIUM: string;\r\n //borders and seperators\r\n PRIMARY_MEDIUM_LIGHT: string;\r\n //solid colors\r\n PRIMARY_LIGHT: string;\r\n //accessible text\r\n PRIMARY_LIGHTEST: string;\r\n PRIMARY_SUPER_LIGHT: string;\r\n };\r\n SECONDARY: {\r\n //backgrounds\r\n SECONDARY_SUPER_DARK: string;\r\n SECONDARY_DARK: string;\r\n //interactive components\r\n SECONDARY_MEDIUM: string;\r\n //borders and seperators\r\n SECONDARY_MEDIUM_LIGHT: string;\r\n //solid colors\r\n SECONDARY_LIGHT: string;\r\n //accessible text\r\n SECONDARY_LIGHTEST: string;\r\n SECONDARY_SUPER_LIGHT: string;\r\n };\r\n};\r\n\r\nexport const DEFAULT_PALETTE: Palette = {\r\n BRAND: {\r\n PRIMARY: COLORS.BRAND.PRIMARY,\r\n PRIMARY_LIGHT: COLORS.BRAND.PRIMARY_LIGHT,\r\n SECONDARY: COLORS.BRAND.SECONDARY,\r\n },\r\n PRIMARY: {\r\n PRIMARY_SUPER_DARK: COLORS.GRAYSCALE.GRAY_SUPER_DARK,\r\n PRIMARY_DARK: COLORS.GRAYSCALE.GRAY_DARK,\r\n PRIMARY_MEDIUM: COLORS.GRAYSCALE.GRAY_MEDIUM,\r\n PRIMARY_MEDIUM_LIGHT: COLORS.GRAYSCALE.GRAY_MEDIUM_LIGHT,\r\n PRIMARY_LIGHT: COLORS.GRAYSCALE.GRAY_LIGHT,\r\n PRIMARY_LIGHTEST: COLORS.GRAYSCALE.GRAY_LIGHTEST,\r\n PRIMARY_SUPER_LIGHT: COLORS.GRAYSCALE.GRAY_SUPER_LIGHT,\r\n },\r\n SECONDARY: {\r\n SECONDARY_SUPER_DARK: COLORS.GRAYSCALE.GRAY_SUPER_DARK,\r\n SECONDARY_DARK: COLORS.GRAYSCALE.GRAY_DARK,\r\n SECONDARY_MEDIUM: COLORS.GRAYSCALE.GRAY_MEDIUM,\r\n SECONDARY_MEDIUM_LIGHT: COLORS.GRAYSCALE.GRAY_MEDIUM_LIGHT,\r\n SECONDARY_LIGHT: COLORS.GRAYSCALE.GRAY_LIGHT,\r\n SECONDARY_LIGHTEST: COLORS.GRAYSCALE.GRAY_LIGHTEST,\r\n SECONDARY_SUPER_LIGHT: COLORS.GRAYSCALE.GRAY_SUPER_LIGHT,\r\n },\r\n // Success, Warning & Danger palettes go here...\r\n};\r\n\r\n/**\r\n * Converts an RGB array to a CSS string representation.\r\n * @param rgb - The RGB array to convert.\r\n * @param opacity - Optional opacity value.\r\n * @returns A CSS string representation of the RGB array, using `rgb()`, or `rgba()` if an opacity value is provided.\r\n */\r\nexport const arrayToRgbString = (rgb: RGBArray, opacity?: number): string => {\r\n return opacity === undefined\r\n ? `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`\r\n : `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opacity})`;\r\n};\r\n\r\n/**\r\n * Transparentizes an input color.\r\n *\r\n * @param color - The color string to transparentize.\r\n * @param amount - The amount to increase the opacity of the color by, given as a decimal between 0 and 1.\r\n * @returns An RGBA color string.\r\n */\r\nexport const transparentize = (color: string, amount: number): string => {\r\n return toRgba(_transparentize(color, amount));\r\n};\r\n\r\n/**\r\n * Saturates a color.\r\n *\r\n * @param color - Input color\r\n * @param amount - The amount to saturate, given as a decimal between 0 and 1\r\n * @returns An RGBA color string.\r\n */\r\nexport const saturate = (color: string, amount: number): string => {\r\n return toRgba(_saturate(color, amount));\r\n};\r\n\r\n/**\r\n * Desaturates a color.\r\n *\r\n * @param color - Input color\r\n * @param amount - The amount to desaturate, given as a decimal between 0 and 1\r\n * @returns An RGBA color string.\r\n */\r\nexport const desaturate = (color: string, amount: number): string => {\r\n return toRgba(_desaturate(color, amount));\r\n};\r\n\r\n/**\r\n * Generates a complete color palette based on a primary color input.\r\n * The palette includes primary and secondary color scales with varying shades.\r\n *\r\n * @param primaryColor - The base RGB color array to generate the palette from\r\n * @param adjustForLuminance - Whether to adjust the generated colors for better luminance/contrast. Defaults to true.\r\n * @returns A Palette object containing:\r\n * - BRAND colors (primary, light primary, and secondary)\r\n * - PRIMARY scale (7 shades from super dark to super light)\r\n * - SECONDARY scale (7 shades from super dark to super light)\r\n *\r\n * The function:\r\n * 1. Creates a 12-color scale from white to the primary color to black\r\n * 2. Generates a complementary secondary color by shifting the hue 180 degrees\r\n * 3. Creates another 12-color scale for the secondary color\r\n * 4. Maps specific positions from these scales to create the final palette structure\r\n */\r\nexport const generatePalette = (\r\n primaryColor: RGBArray,\r\n adjustForLuminance: boolean = true\r\n): Palette => {\r\n const primaryRgba = arrayToRgbString(primaryColor);\r\n\r\n //why does primary lightest look lighter than primary super light?\r\n //also primary lightest is returning in hsla?\r\n //dark release colors dont looks so good rn...\r\n //we should also proabbly saturate the colors against heavy hoverboxes in RL (maybe also hover box could be lighter), for ex:\r\n //http://local.protonradio.com:3000/r/rl2pAmu9x5Tgw/insights this one is bad\r\n //http://local.protonradio.com:3000/r/rlMWSB2DdIoC8/insights this is also pretty bad\r\n // http://local.protonradio.com:3000/r/rlAVBAD7N5YQw/insights\r\n //http://local.protonradio.com:3000/r/rlOHftclmdJ0w/insights\r\n //http://local.protonradio.com:3000/r/rlw_tmjUkVy4s/insights\r\n //why are we seeing the arrow in select dropdowns\r\n const primaryScaleFunc = getScale(\"#FFFFFF\", primaryRgba, \"#000000\");\r\n const primaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = primaryScaleFunc(i / 11);\r\n return desaturate(color, 0.0085);\r\n });\r\n\r\n const adjustedPrimaryScale = adjustForLuminance\r\n ? primaryScale.map((color) =>\r\n saturate(adjustBrightnessForLuminance(color), 0.005)\r\n )\r\n : primaryScale;\r\n\r\n const secondaryColor = toRgba(saturate(adjustHue(primaryRgba, 180), 1));\r\n\r\n const secondaryScaleFunc = getScale(\"#FFFFFF\", secondaryColor, \"#000000\");\r\n const secondaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = secondaryScaleFunc(i / 11);\r\n return desaturate(color, 0.1);\r\n });\r\n\r\n const adjustedSecondaryScale = adjustForLuminance\r\n ? secondaryScale.map((color) =>\r\n desaturate(adjustBrightnessForLuminance(color), 0.22)\r\n )\r\n : secondaryScale;\r\n\r\n return {\r\n BRAND: {\r\n PRIMARY: desaturate(darkenForContrast(adjustedPrimaryScale[5]), 0.125),\r\n PRIMARY_LIGHT: desaturate(\r\n lightenForContrast(adjustedPrimaryScale[5]),\r\n 0.1\r\n ),\r\n SECONDARY: desaturate(adjustedSecondaryScale[4], 0.02),\r\n },\r\n PRIMARY: {\r\n //backgrounds\r\n PRIMARY_SUPER_DARK: darkenForContrast(primaryScale[9]),\r\n PRIMARY_DARK: darkenForContrast(primaryScale[8]),\r\n //interactive components\r\n PRIMARY_MEDIUM: toRgba(\r\n darken(\r\n desaturate(darkenForContrast(adjustedPrimaryScale[7]), 0.18),\r\n 0.05\r\n )\r\n ),\r\n //borders and seperators\r\n PRIMARY_MEDIUM_LIGHT: lightenForContrast(adjustedPrimaryScale[6]),\r\n //solid colors\r\n PRIMARY_LIGHT: saturate(lightenForContrast(adjustedPrimaryScale[5]), 0.2),\r\n //accessible text\r\n PRIMARY_LIGHTEST: toRgba(\r\n lighten(saturate(lightenForContrast(adjustedPrimaryScale[3]), 0.2), 0.1)\r\n ),\r\n PRIMARY_SUPER_LIGHT: toRgba(lighten(adjustedPrimaryScale[0], 0.2)),\r\n },\r\n SECONDARY: {\r\n //backgrounds\r\n SECONDARY_SUPER_DARK: darkenForContrast(secondaryScale[10]),\r\n SECONDARY_DARK: darkenForContrast(secondaryScale[9]),\r\n // interactive components\r\n SECONDARY_MEDIUM: toRgba(\r\n darken(\r\n desaturate(darkenForContrast(adjustedSecondaryScale[7]), 0.35),\r\n 0.1\r\n )\r\n ),\r\n //borders and seperators\r\n SECONDARY_MEDIUM_LIGHT: lightenForContrast(adjustedSecondaryScale[6]),\r\n //solid colors\r\n SECONDARY_LIGHT: saturate(\r\n lightenForContrast(adjustedSecondaryScale[5]),\r\n 0.1\r\n ),\r\n //accessible text\r\n SECONDARY_LIGHTEST: toRgba(\r\n lighten(\r\n saturate(lightenForContrast(adjustedSecondaryScale[3]), 0.2),\r\n 0.1\r\n )\r\n ),\r\n SECONDARY_SUPER_LIGHT: toRgba(lighten(adjustedSecondaryScale[0], 0.2)),\r\n },\r\n };\r\n};\r\n\r\nconst lightenForContrast = (color: string): string => {\r\n while (hasBadContrast(color, \"readable\", COLORS.GRAYSCALE.GRAY_DARK)) {\r\n color = lighten(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst darkenForContrast = (color: string): string => {\r\n while (hasBadContrast(COLORS.GRAYSCALE.GRAY_SUPER_LIGHT, \"readable\", color)) {\r\n color = darken(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst adjustBrightnessForLuminance = (color: string): string => {\r\n let currentColor = color;\r\n let currentLuminance = getLuminance(toRgba(currentColor));\r\n let adjustmentAttempts = 0;\r\n const MAX_ATTEMPTS = 6;\r\n\r\n while (currentLuminance < 0.16 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = lighten(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n while (currentLuminance > 0.6 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = darken(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n return toRgba(currentColor);\r\n};\r\n","const isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\n/**\r\n * [getLinkHost] - get the host of a link.\r\n * Referenced from is-url-external npm package\r\n * https://github.com/mrded/is-url-external/blob/master/index.js\r\n */\r\nconst getLinkHost = (url) => {\r\n if (/^https?:\\/\\//.test(url)) {\r\n // Absolute URL.\r\n // The easy way to parse an URL, is to create <a> element.\r\n // @see: https://gist.github.com/jlong/2428561\r\n const parser = document.createElement(\"a\");\r\n parser.href = url;\r\n return parser.hostname;\r\n }\r\n return window.location.hostname;\r\n};\r\n\r\n/**\r\n * [isUrlExternal] - determine if passed absolute url is external to the current domain.\r\n */\r\nexport const isUrlExternal = (url) => {\r\n const host = window.location.hostname;\r\n const linkHost = getLinkHost(url);\r\n\r\n return host !== linkHost;\r\n};\r\n\r\n/**\r\n * Handles internal navigation clicks by preventing default browser behavior and\r\n * programmatically updating the URL and history state.\r\n *\r\n * @param e - The click event from the anchor element\r\n * @param to - The destination path to navigate to\r\n *\r\n * @remarks\r\n * - Converts relative paths to absolute by prepending \"/\" if needed\r\n * - Updates browser history using pushState and dispatches a popstate event\r\n */\r\nexport const handleInternalNavigation = (\r\n e: React.MouseEvent<HTMLAnchorElement>,\r\n to: string\r\n) => {\r\n // Don't handle navigation if modifier keys are pressed\r\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) {\r\n return;\r\n }\r\n\r\n // Don't handle middle clicks or right clicks\r\n if (e.button && e.button !== 0) {\r\n return;\r\n }\r\n\r\n e.preventDefault();\r\n\r\n // Handle relative paths\r\n const resolvedPath = to.startsWith(\"/\") ? to : `/${to}`;\r\n window.history.pushState({}, \"\", resolvedPath);\r\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\r\n};\r\n"],"names":["DEFAULT_PALETTE","COLORS.BRAND","COLORS.GRAYSCALE","arrayToRgbString","rgb","opacity","transparentize","color","amount","toRgba","_transparentize","saturate","_saturate","desaturate","_desaturate","generatePalette","primaryColor","adjustForLuminance","primaryRgba","primaryScaleFunc","getScale","primaryScale","_","i","adjustedPrimaryScale","adjustBrightnessForLuminance","secondaryColor","adjustHue","secondaryScaleFunc","secondaryScale","adjustedSecondaryScale","darkenForContrast","lightenForContrast","darken","lighten","hasBadContrast","currentColor","currentLuminance","getLuminance","adjustmentAttempts","MAX_ATTEMPTS","isString","x","csx","classnames","getLinkHost","url","parser","isUrlExternal","host","linkHost","handleInternalNavigation","e","to","resolvedPath"],"mappings":"0EAoDaA,EAA2B,CACtC,MAAO,CACL,QAASC,EAAa,MAAA,QACtB,cAAeA,EAAa,MAAA,cAC5B,UAAWA,EAAa,MAAA,SAC1B,EACA,QAAS,CACP,mBAAoBC,EAAiB,UAAA,gBACrC,aAAcA,EAAiB,UAAA,UAC/B,eAAgBA,EAAiB,UAAA,YACjC,qBAAsBA,EAAiB,UAAA,kBACvC,cAAeA,EAAiB,UAAA,WAChC,iBAAkBA,EAAiB,UAAA,cACnC,oBAAqBA,EAAiB,UAAA,gBACxC,EACA,UAAW,CACT,qBAAsBA,EAAiB,UAAA,gBACvC,eAAgBA,EAAiB,UAAA,UACjC,iBAAkBA,EAAiB,UAAA,YACnC,uBAAwBA,EAAiB,UAAA,kBACzC,gBAAiBA,EAAiB,UAAA,WAClC,mBAAoBA,EAAiB,UAAA,cACrC,sB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WA,EAAE,QAAUA,EAAE,SAAWA,EAAE,UAKxCA,EAAE,QAAUA,EAAE,SAAW,EAC3B,OAGFA,EAAE,eAAe,EAGjB,MAAME,EAAeD,EAAG,WAAW,GAAG,EAAIA,EAAK,IAAIA,CAAE,GACrD,OAAO,QAAQ,UAAU,CAAC,EAAG,GAAIC,CAAY,EAC7C,OAAO,cAAc,IAAI,cAAc,UAAU,CAAC,CACpD"}
package/dist/utils.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=t=>typeof t=="string"||t instanceof String;function i(...t){return t.filter(a).join(" ")}const s=t=>{if(/^https?:\/\//.test(t)){const n=document.createElement("a");return n.href=t,n.hostname}return window.location.hostname},l=t=>{const n=window.location.hostname,o=s(t);return n!==o},h=(t,n)=>{if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.button&&t.button!==0)return;t.preventDefault();const o=n.startsWith("/")?n:`/${n}`;window.history.pushState({},"",o),window.dispatchEvent(new PopStateEvent("popstate"))},e=179,c=42,u=(t,n)=>[Math.min(t[0]+255*n,e),Math.min(t[1]+255*n,e),Math.min(t[2]+255*n,e)].map(r=>Math.round(Math.max(r,c))),d=(t,n)=>t.map(o=>Math.max(0,o-o*n)),m=(t,n)=>n===void 0?`rgb(${t[0]}, ${t[1]}, ${t[2]})`:`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${n})`;exports.arrayToRgbString=m;exports.csx=i;exports.darkenRGBColor=d;exports.handleInternalNavigation=h;exports.isUrlExternal=l;exports.lightenRGBColor=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils-DbIphMSk.js");exports.DEFAULT_PALETTE=e.DEFAULT_PALETTE;exports.arrayToRgbString=e.arrayToRgbString;exports.csx=e.csx;exports.desaturate=e.desaturate;exports.generatePalette=e.generatePalette;exports.handleInternalNavigation=e.handleInternalNavigation;exports.isUrlExternal=e.isUrlExternal;exports.saturate=e.saturate;exports.transparentize=e.transparentize;
2
2
  //# sourceMappingURL=utils.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs.js","sources":["../src/utils/index.ts"],"sourcesContent":["const isString = (x: unknown): boolean =>\n typeof x === \"string\" || x instanceof String;\n\nexport function csx(...classnames: unknown[]): string {\n return classnames.filter(isString).join(\" \");\n}\n\n/**\n * [getLinkHost] - get the host of a link.\n * Referenced from is-url-external npm package\n * https://github.com/mrded/is-url-external/blob/master/index.js\n */\nconst getLinkHost = (url) => {\n if (/^https?:\\/\\//.test(url)) {\n // Absolute URL.\n // The easy way to parse an URL, is to create <a> element.\n // @see: https://gist.github.com/jlong/2428561\n const parser = document.createElement(\"a\");\n parser.href = url;\n return parser.hostname;\n }\n return window.location.hostname;\n};\n\n/**\n * [isUrlExternal] - determine if passed absolute url is external to the current domain.\n */\nexport const isUrlExternal = (url) => {\n const host = window.location.hostname;\n const linkHost = getLinkHost(url);\n\n return host !== linkHost;\n};\n\n/**\n * Handles internal navigation clicks by preventing default browser behavior and\n * programmatically updating the URL and history state.\n *\n * @param e - The click event from the anchor element\n * @param to - The destination path to navigate to\n *\n * @remarks\n * - Converts relative paths to absolute by prepending \"/\" if needed\n * - Updates browser history using pushState and dispatches a popstate event\n */\nexport const handleInternalNavigation = (\n e: React.MouseEvent<HTMLAnchorElement>,\n to: string\n) => {\n // Don't handle navigation if modifier keys are pressed\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) {\n return;\n }\n\n // Don't handle middle clicks or right clicks\n if (e.button && e.button !== 0) {\n return;\n }\n\n e.preventDefault();\n\n // Handle relative paths\n const resolvedPath = to.startsWith(\"/\") ? to : `/${to}`;\n window.history.pushState({}, \"\", resolvedPath);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n};\n\nexport type RGBArray = [number, number, number];\n\nconst ceilColor = 179;\nconst floorColor = 42;\n\n/**\n * Lightens an RGB color by a specified factor.\n * @param rgb - The RGB color array to lighten.\n * @param factor - The factor between 0 (darker) - 1 (lighter) by which to transform the color.\n * @returns The lightened RGB color array, RGB values are clamped to 42 (dark) - 179 (light).\n */\nexport const lightenRGBColor = (rgb: RGBArray, factor: number): RGBArray => {\n const lightenedRGB = [\n Math.min(rgb[0] + 255 * factor, ceilColor),\n Math.min(rgb[1] + 255 * factor, ceilColor),\n Math.min(rgb[2] + 255 * factor, ceilColor),\n ];\n\n return lightenedRGB.map((value) =>\n Math.round(Math.max(value, floorColor))\n ) as RGBArray;\n};\n\n/**\n * Darkens an RGB color by a specified factor.\n * @param color - The RGB color array to darken.\n * @param factor - The factor between 0 (lighter) - 1 (darker) by which to transform the color.\n * @returns The darkened RGB color array, RGB values are clamped to 0 (light) - 255 (dark).\n */\n\nexport const darkenRGBColor = (color: RGBArray, factor: number): RGBArray => {\n return color.map((c) => Math.max(0, c - c * factor)) as RGBArray;\n};\n\n/**\n * Converts an RGB array to a CSS string representation.\n * @param rgb - The RGB array to convert.\n * @param opacity - Optional opacity value.\n * @returns A CSS string representation of the RGB array, using `rgb()`, or `rgba()` if an opacity value is provided.\n */\nexport const arrayToRgbString = (rgb: RGBArray, opacity?: number): string => {\n return opacity === undefined\n ? `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`\n : `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opacity})`;\n};\n"],"names":["isString","x","csx","classnames","getLinkHost","url","parser","isUrlExternal","host","linkHost","handleInternalNavigation","e","to","resolvedPath","ceilColor","floorColor","lightenRGBColor","rgb","factor","value","darkenRGBColor","color","c","arrayToRgbString","opacity"],"mappings":"gFAAA,MAAMA,EAAYC,GAChB,OAAOA,GAAM,UAAYA,aAAa,OAEjC,SAASC,KAAOC,EAA+B,CACpD,OAAOA,EAAW,OAAOH,CAAQ,EAAE,KAAK,GAAG,CAC7C,CAOA,MAAMI,EAAeC,GAAQ,CACvB,GAAA,eAAe,KAAKA,CAAG,EAAG,CAItB,MAAAC,EAAS,SAAS,cAAc,GAAG,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@ export declare const arrayToRgbString: (rgb: RGBArray, opacity?: number) => stri
8
8
 
9
9
  export declare function csx(...classnames: unknown[]): string;
10
10
 
11
+ export declare const DEFAULT_PALETTE: Palette;
12
+
13
+ /**
14
+ * Desaturates a color.
15
+ *
16
+ * @param color - Input color
17
+ * @param amount - The amount to desaturate, given as a decimal between 0 and 1
18
+ * @returns An RGBA color string.
19
+ */
20
+ export declare const desaturate: (color: string, amount: number) => string;
21
+
11
22
  /**
12
- * Darkens an RGB color by a specified factor.
13
- * @param color - The RGB color array to darken.
14
- * @param factor - The factor between 0 (lighter) - 1 (darker) by which to transform the color.
15
- * @returns The darkened RGB color array, RGB values are clamped to 0 (light) - 255 (dark).
23
+ * Generates a complete color palette based on a primary color input.
24
+ * The palette includes primary and secondary color scales with varying shades.
25
+ *
26
+ * @param primaryColor - The base RGB color array to generate the palette from
27
+ * @param adjustForLuminance - Whether to adjust the generated colors for better luminance/contrast. Defaults to true.
28
+ * @returns A Palette object containing:
29
+ * - BRAND colors (primary, light primary, and secondary)
30
+ * - PRIMARY scale (7 shades from super dark to super light)
31
+ * - SECONDARY scale (7 shades from super dark to super light)
32
+ *
33
+ * The function:
34
+ * 1. Creates a 12-color scale from white to the primary color to black
35
+ * 2. Generates a complementary secondary color by shifting the hue 180 degrees
36
+ * 3. Creates another 12-color scale for the secondary color
37
+ * 4. Maps specific positions from these scales to create the final palette structure
16
38
  */
17
- export declare const darkenRGBColor: (color: RGBArray, factor: number) => RGBArray;
39
+ export declare const generatePalette: (primaryColor: RGBArray, adjustForLuminance?: boolean) => Palette;
18
40
 
19
41
  /**
20
42
  * Handles internal navigation clicks by preventing default browser behavior and
@@ -34,15 +56,51 @@ export declare const handleInternalNavigation: (e: React.MouseEvent<HTMLAnchorEl
34
56
  */
35
57
  export declare const isUrlExternal: (url: any) => boolean;
36
58
 
59
+ export declare type Palette = {
60
+ BRAND: {
61
+ PRIMARY: string;
62
+ PRIMARY_LIGHT: string;
63
+ SECONDARY: string;
64
+ };
65
+ PRIMARY: {
66
+ PRIMARY_SUPER_DARK: string;
67
+ PRIMARY_DARK: string;
68
+ PRIMARY_MEDIUM: string;
69
+ PRIMARY_MEDIUM_LIGHT: string;
70
+ PRIMARY_LIGHT: string;
71
+ PRIMARY_LIGHTEST: string;
72
+ PRIMARY_SUPER_LIGHT: string;
73
+ };
74
+ SECONDARY: {
75
+ SECONDARY_SUPER_DARK: string;
76
+ SECONDARY_DARK: string;
77
+ SECONDARY_MEDIUM: string;
78
+ SECONDARY_MEDIUM_LIGHT: string;
79
+ SECONDARY_LIGHT: string;
80
+ SECONDARY_LIGHTEST: string;
81
+ SECONDARY_SUPER_LIGHT: string;
82
+ };
83
+ };
84
+
85
+ export declare type RGBArray = [number, number, number];
86
+
37
87
  /**
38
- * Lightens an RGB color by a specified factor.
39
- * @param rgb - The RGB color array to lighten.
40
- * @param factor - The factor between 0 (darker) - 1 (lighter) by which to transform the color.
41
- * @returns The lightened RGB color array, RGB values are clamped to 42 (dark) - 179 (light).
88
+ * Saturates a color.
89
+ *
90
+ * @param color - Input color
91
+ * @param amount - The amount to saturate, given as a decimal between 0 and 1
92
+ * @returns An RGBA color string.
42
93
  */
43
- export declare const lightenRGBColor: (rgb: RGBArray, factor: number) => RGBArray;
94
+ export declare const saturate: (color: string, amount: number) => string;
44
95
 
45
- export declare type RGBArray = [number, number, number];
96
+ /**
97
+ * Transparentizes an input color.
98
+ *
99
+ * @param color - The color string to transparentize.
100
+ * @param amount - The amount to increase the opacity of the color by, given as a decimal between 0 and 1.
101
+ * @returns An RGBA color string.
102
+ */
103
+ export declare const transparentize: (color: string, amount: number) => string;
46
104
 
47
105
  export { }
48
106
 
package/dist/utils.es.js CHANGED
@@ -1,35 +1,13 @@
1
- const s = (t) => typeof t == "string" || t instanceof String;
2
- function h(...t) {
3
- return t.filter(s).join(" ");
4
- }
5
- const a = (t) => {
6
- if (/^https?:\/\//.test(t)) {
7
- const n = document.createElement("a");
8
- return n.href = t, n.hostname;
9
- }
10
- return window.location.hostname;
11
- }, l = (t) => {
12
- const n = window.location.hostname, o = a(t);
13
- return n !== o;
14
- }, c = (t, n) => {
15
- if (t.metaKey || t.altKey || t.ctrlKey || t.shiftKey || t.button && t.button !== 0)
16
- return;
17
- t.preventDefault();
18
- const o = n.startsWith("/") ? n : `/${n}`;
19
- window.history.pushState({}, "", o), window.dispatchEvent(new PopStateEvent("popstate"));
20
- }, e = 179, i = 42, u = (t, n) => [
21
- Math.min(t[0] + 255 * n, e),
22
- Math.min(t[1] + 255 * n, e),
23
- Math.min(t[2] + 255 * n, e)
24
- ].map(
25
- (r) => Math.round(Math.max(r, i))
26
- ), d = (t, n) => t.map((o) => Math.max(0, o - o * n)), m = (t, n) => n === void 0 ? `rgb(${t[0]}, ${t[1]}, ${t[2]})` : `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${n})`;
1
+ import { D as t, a as e, c as r, d as n, g as i, h as g, i as l, s as o, t as E } from "./utils-D9D3Fg9O.mjs";
27
2
  export {
28
- m as arrayToRgbString,
29
- h as csx,
30
- d as darkenRGBColor,
31
- c as handleInternalNavigation,
3
+ t as DEFAULT_PALETTE,
4
+ e as arrayToRgbString,
5
+ r as csx,
6
+ n as desaturate,
7
+ i as generatePalette,
8
+ g as handleInternalNavigation,
32
9
  l as isUrlExternal,
33
- u as lightenRGBColor
10
+ o as saturate,
11
+ E as transparentize
34
12
  };
35
13
  //# sourceMappingURL=utils.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.es.js","sources":["../src/utils/index.ts"],"sourcesContent":["const isString = (x: unknown): boolean =>\n typeof x === \"string\" || x instanceof String;\n\nexport function csx(...classnames: unknown[]): string {\n return classnames.filter(isString).join(\" \");\n}\n\n/**\n * [getLinkHost] - get the host of a link.\n * Referenced from is-url-external npm package\n * https://github.com/mrded/is-url-external/blob/master/index.js\n */\nconst getLinkHost = (url) => {\n if (/^https?:\\/\\//.test(url)) {\n // Absolute URL.\n // The easy way to parse an URL, is to create <a> element.\n // @see: https://gist.github.com/jlong/2428561\n const parser = document.createElement(\"a\");\n parser.href = url;\n return parser.hostname;\n }\n return window.location.hostname;\n};\n\n/**\n * [isUrlExternal] - determine if passed absolute url is external to the current domain.\n */\nexport const isUrlExternal = (url) => {\n const host = window.location.hostname;\n const linkHost = getLinkHost(url);\n\n return host !== linkHost;\n};\n\n/**\n * Handles internal navigation clicks by preventing default browser behavior and\n * programmatically updating the URL and history state.\n *\n * @param e - The click event from the anchor element\n * @param to - The destination path to navigate to\n *\n * @remarks\n * - Converts relative paths to absolute by prepending \"/\" if needed\n * - Updates browser history using pushState and dispatches a popstate event\n */\nexport const handleInternalNavigation = (\n e: React.MouseEvent<HTMLAnchorElement>,\n to: string\n) => {\n // Don't handle navigation if modifier keys are pressed\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) {\n return;\n }\n\n // Don't handle middle clicks or right clicks\n if (e.button && e.button !== 0) {\n return;\n }\n\n e.preventDefault();\n\n // Handle relative paths\n const resolvedPath = to.startsWith(\"/\") ? to : `/${to}`;\n window.history.pushState({}, \"\", resolvedPath);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n};\n\nexport type RGBArray = [number, number, number];\n\nconst ceilColor = 179;\nconst floorColor = 42;\n\n/**\n * Lightens an RGB color by a specified factor.\n * @param rgb - The RGB color array to lighten.\n * @param factor - The factor between 0 (darker) - 1 (lighter) by which to transform the color.\n * @returns The lightened RGB color array, RGB values are clamped to 42 (dark) - 179 (light).\n */\nexport const lightenRGBColor = (rgb: RGBArray, factor: number): RGBArray => {\n const lightenedRGB = [\n Math.min(rgb[0] + 255 * factor, ceilColor),\n Math.min(rgb[1] + 255 * factor, ceilColor),\n Math.min(rgb[2] + 255 * factor, ceilColor),\n ];\n\n return lightenedRGB.map((value) =>\n Math.round(Math.max(value, floorColor))\n ) as RGBArray;\n};\n\n/**\n * Darkens an RGB color by a specified factor.\n * @param color - The RGB color array to darken.\n * @param factor - The factor between 0 (lighter) - 1 (darker) by which to transform the color.\n * @returns The darkened RGB color array, RGB values are clamped to 0 (light) - 255 (dark).\n */\n\nexport const darkenRGBColor = (color: RGBArray, factor: number): RGBArray => {\n return color.map((c) => Math.max(0, c - c * factor)) as RGBArray;\n};\n\n/**\n * Converts an RGB array to a CSS string representation.\n * @param rgb - The RGB array to convert.\n * @param opacity - Optional opacity value.\n * @returns A CSS string representation of the RGB array, using `rgb()`, or `rgba()` if an opacity value is provided.\n */\nexport const arrayToRgbString = (rgb: RGBArray, opacity?: number): string => {\n return opacity === undefined\n ? `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`\n : `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opacity})`;\n};\n"],"names":["isString","x","csx","classnames","getLinkHost","url","parser","isUrlExternal","host","linkHost","handleInternalNavigation","e","to","resolvedPath","ceilColor","floorColor","lightenRGBColor","rgb","factor","value","darkenRGBColor","color","c","arrayToRgbString","opacity"],"mappings":"AAAA,MAAMA,IAAW,CAACC,MAChB,OAAOA,KAAM,YAAYA,aAAa;AAEjC,SAASC,KAAOC,GAA+B;AACpD,SAAOA,EAAW,OAAOH,CAAQ,EAAE,KAAK,GAAG;AAC7C;AAOA,MAAMI,IAAc,CAACC,MAAQ;AACvB,MAAA,eAAe,KAAKA,CAAG,GAAG;AAItB,UAAAC,IAAS,SAAS,cAAc,GAAG;AACzC,WAAAA,EAAO,OAAOD,GACPC,EAAO;AAAA,EAChB;AACA,SAAO,OAAO,SAAS;AACzB,GAKaC,IAAgB,CAACF,MAAQ;AAC9B,QAAAG,IAAO,OAAO,SAAS,UACvBC,IAAWL,EAAYC,CAAG;AAEhC,SAAOG,MAASC;AAClB,GAaaC,IAA2B,CACtCC,GACAC,MACG;AAOH,MALID,EAAE,WAAWA,EAAE,UAAUA,EAAE,WAAWA,EAAE,YAKxCA,EAAE,UAAUA,EAAE,WAAW;AAC3B;AAGF,EAAAA,EAAE,eAAe;AAGjB,QAAME,IAAeD,EAAG,WAAW,GAAG,IAAIA,IAAK,IAA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