Something went wrong. Try again.
UIKit a SolidJS component library inspired by Google's Material 3 Expressive
Something went wrong. Try again.
7.7 kB · 307 lines
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307.container { display: flex; flex-direction: column; gap: 0;}
.root { transition: var(--uk-sys-motion-easing-standard-normal) var(--uk-sys-motion-duration-150), outline-width linear 0s, outline-offset linear 0s; display: flex; flex-direction: row; position: relative;
&[data-color="filled"] { background-color: rgb(var(--uk-sys-color-surface-container-highest)); border-radius: var(--uk-sys-shape-corner-extra-small-top); height: 3.5rem; caret-color: rgb(var(--uk-sys-color-primary));
.inputContainer { position: relative; }
&::after { content: ""; position: absolute; height: 1px; width: 100%; bottom: 0; left: 0; background-color: rgb(var(--uk-sys-color-on-surface-variant)); }
& .labelText { top: 0; left: 0; color: rgb(var(--uk-sys-color-on-surface-variant)); height: 3.5rem; display: flex; align-items: center; }
&:focus-within { &::after { background-color: rgb(var(--uk-sys-color-primary)); }
& .labelText { color: rgb(var(--uk-sys-color-primary)); } }
&[data-populated="true"], &:focus-within, &[data-force-focus="true"] { & .labelText { font-size: var(--uk-sys-typescale-body-small-size); line-height: var(--uk-sys-typescale-body-small-line-height); letter-spacing: var(--uk-sys-typescale-body-small-tracking); top: 0.5rem; height: var(--uk-sys-typescale-body-small-line-height); }
& input { padding-top: calc(var(--uk-sys-typescale-body-small-line-height) + 0.5rem); padding-bottom: 0.5rem; } } }
&[data-color="outlined"] { border-radius: var(--uk-sys-shape-corner-extra-small); outline-style: solid; outline-width: 1px; outline-offset: 0; outline-color: rgb(var(--uk-sys-color-outline)); height: 3.5rem;
& .labelText { top: 1px; left: 0;
padding-top: 15px; padding-bottom: 15px;
&::before { content: ""; position: absolute; display: block; background-color: transparent; height: calc(var(--uk-sys-typescale-body-small-size) - 2px); width: calc(100% - 2rem); top: 1px; left: 1rem; z-index: -1; transition: var(--uk-sys-motion-easing-standard-decelerate) var(--uk-sys-motion-duration-100); } }
&:has(.leadingIcon) { & .labelText { left: 2.25rem; } }
&:has(textarea) { min-height: max-content; }
&:focus-within, &[data-force-focus="true"] { outline-color: rgb(var(--uk-sys-color-primary)); outline-width: 3px; outline-offset: -1px; }
&[data-populated="true"], &:focus-within, &[data-force-focus="true"] { & .labelText { font-family: var(--uk-sys-typescale-body-small-font), sans-serif; font-weight: var(--uk-sys-typescale-body-small-weight); letter-spacing: var(--uk-sys-typescale-body-small-tracking); line-height: var(--uk-sys-typescale-body-small-line-height); font-size: var(--uk-sys-typescale-body-small-size); top: -0.5rem; left: 0; margin-left: 0.75rem; padding-top: 0; padding-bottom: 0; padding-left: 0.25rem; padding-right: 0.25rem; color: rgb(var(--uk-sys-color-on-surface-variant), 0.75);
&::before { width: 100%; left: 0; background-color: rgb(var(--uk-sys-color-surface-container-highest)); }
&.labelTextBackgroundColor { &::before { background-color: rgb(var(--uk-sys-color-background)); } } } }
&[data-error="true"] { outline-color: rgb(var(--uk-sys-color-error));
& .labelText { color: rgb(var(--uk-sys-color-error)); }
& .input { color: rgb(var(--uk-sys-color-on-surface)); } } }
&:focus-within, &:hover, &:active, &[data-force-focus="true"] { .visibilityIcon { opacity: 1; } }}
.inputContainer { flex-grow: 1;}
.labelText { position: absolute; user-select: none; pointer-events: none; transition: var(--uk-sys-motion-easing-standard-decelerate) var(--uk-sys-motion-duration-100); padding-left: 1rem; padding-right: 1rem;
color: rgb(var(--uk-sys-color-on-surface-variant)); font-family: var(--uk-sys-typescale-body-large-font), sans-serif; line-height: var(--uk-sys-typescale-body-large-line-height); font-size: var(--uk-sys-typescale-body-large-size); font-weight: var(--uk-sys-typescale-body-large-weight); letter-spacing: var(--uk-sys-typescale-body-large-tracking); z-index: 0;}
.input { background-color: transparent; border: none; outline: none; width: 100%; height: 100%; padding-left: 1rem; padding-right: 1rem;
color: rgb(var(--uk-sys-color-on-surface-variant)); font-family: var(--uk-sys-typescale-body-large-font), sans-serif; line-height: var(--uk-sys-typescale-body-large-line-height); font-size: var(--uk-sys-typescale-body-large-size); font-weight: var(--uk-sys-typescale-body-large-weight); letter-spacing: var(--uk-sys-typescale-body-large-tracking);}
textarea.input { display: block; resize: vertical; padding-top: 1rem; padding-bottom: 1rem; min-height: 3.5rem;
&::-webkit-scrollbar { width: 0.75rem; height: 100%; background-color: rgb(var(--uk-sys-color-surface-variant)); cursor: default; }
&::-webkit-scrollbar-thumb { background-color: rgb(var(--uk-sys-color-on-surface-variant)); border-radius: 10rem; border: 2px solid rgb(var(--uk-sys-color-surface-variant)); cursor: default; }
&::-webkit-scrollbar-button { display: none; visibility: hidden; cursor: default; }
&::-webkit-scrollbar-corner { background-color: rgb(var(--uk-sys-color-surface-variant)); border: solid transparent 0; outline: solid transparent 0; cursor: default; }
&::-webkit-resizer { background-color: rgb(var(--uk-sys-color-surface-variant)); background-image: url(resizeHeightLight.svg); background-size: 0.75rem; background-repeat: no-repeat; background-position: center;
border-top-left-radius: var(--uk-sys-shape-corner-extra-small); border-bottom-right-radius: var(--uk-sys-shape-corner-extra-small); outline-style: solid; outline-width: 1px; outline-offset: 0; outline-color: rgb(var(--uk-sys-color-outline)); cursor: ns-resize; }}
.supportingText { color: rgb(var(--uk-sys-color-on-surface-variant)); font-family: var(--uk-sys-typescale-body-small-font), sans-serif; line-height: var(--uk-sys-typescale-body-small-line-height); font-size: var(--uk-sys-typescale-body-small-size); font-weight: var(--uk-sys-typescale-body-small-weight); letter-spacing: var(--uk-sys-typescale-body-small-tracking);
padding-top: 0.25rem; padding-left: 1rem; padding-right: 1rem; gap: 1rem; display: flex; flex-direction: row; justify-content: space-between;
&[data-error="true"] { color: rgb(var(--uk-sys-color-error)); }}
.leadingIcon { color: rgb(var(--uk-sys-color-on-surface-variant)); margin-left: 0.75rem; margin-right: 0; margin-top: auto; margin-bottom: auto;
--icon-size: 1.5rem;}
.trailingIcon { color: rgb(var(--uk-sys-color-on-surface-variant)); margin-right: 0.75rem; margin-top: auto; margin-bottom: auto; margin-left: 0.5rem;
--icon-size: 1.5rem;}
.visibilityIcon { opacity: 0; transition: opacity var(--uk-sys-motion-duration-150) var(--uk-sys-motion-easing-standard-decelerate);}