refactor(ui): new component library (#1740)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
|
||||
.app-cg-item {
|
||||
transition-property: background-color, color;
|
||||
}
|
||||
|
||||
.app-cg-item:hover,
|
||||
.app-cg-item.app-cg-active,
|
||||
.app-cg-item.app-cg-prominent {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.app-cg-item:hover {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.app-cg-item:not(.app-cg-last, :hover, .app-cg-active, .app-cg-prominent),
|
||||
.app-cg-item:not(:hover):has(+ .app-cg-item:is(:hover, .app-cg-active)),
|
||||
.app-cg-item.app-cg-prominent:not(.app-cg-last, :hover, .app-cg-active):has(
|
||||
+ .app-cg-item.app-cg-prominent
|
||||
),
|
||||
.app-cg-group > *:has(+ * > .app-cg-item:is(:hover, .app-cg-active)) > .app-cg-item:not(:hover),
|
||||
.app-cg-group
|
||||
> *:has(+ * > .app-cg-item.app-cg-prominent)
|
||||
> .app-cg-item.app-cg-prominent:not(.app-cg-last, :hover, .app-cg-active) {
|
||||
border-right-color: transparent;
|
||||
}
|
||||
|
||||
.app-cg-item:is(:hover, .app-cg-active) + .app-cg-item:not(:hover, .app-cg-active),
|
||||
.app-cg-item.app-cg-prominent + .app-cg-item:not(:hover, .app-cg-active, .app-cg-prominent) {
|
||||
border-left-color: transparent;
|
||||
}
|
||||
|
||||
.app-cg-group
|
||||
> *:has(> .app-cg-item:is(:hover, .app-cg-active))
|
||||
+ *
|
||||
> .app-cg-item:not(:hover, .app-cg-active),
|
||||
.app-cg-group
|
||||
> *:has(> .app-cg-item.app-cg-prominent)
|
||||
+ *
|
||||
> .app-cg-item:not(:hover, .app-cg-active, .app-cg-prominent) {
|
||||
border-left-color: transparent;
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
app-tabs {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.app-tabs-root {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.app-tabs {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.app-tabs-indicator {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
width: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.app-tabs.is-measured .app-tabs-indicator {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.app-tabs.is-animated .app-tabs-indicator {
|
||||
transition:
|
||||
transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
|
||||
width 220ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.app-tab {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--control-gap);
|
||||
box-sizing: border-box;
|
||||
border: 0;
|
||||
background: none;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 0.8203rem;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
color var(--transition-fast),
|
||||
background-color var(--transition-fast),
|
||||
transform var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--color-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
&[aria-selected="true"]:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
.app-tab-icon {
|
||||
font-size: 0.875em;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.app-tab-label {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
app-tabs.placement-below {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
height: var(--app-tabs-row-height, 3.0625rem);
|
||||
padding: 0.2188rem 1.75rem 0;
|
||||
|
||||
@media (width <= 767px) {
|
||||
padding: 0.2188rem 0.875rem 0;
|
||||
}
|
||||
}
|
||||
|
||||
app-tabs.variant-underline {
|
||||
--app-tabs-divider: color-mix(in srgb, var(--color-border) 70%, transparent);
|
||||
|
||||
padding: 0;
|
||||
|
||||
.app-tabs {
|
||||
align-items: stretch;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
gap: 1.3125rem;
|
||||
padding: 0 1.75rem;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: 1.75rem;
|
||||
bottom: 0;
|
||||
left: 1.75rem;
|
||||
height: 1px;
|
||||
background: var(--app-tabs-divider);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (width <= 767px) {
|
||||
gap: 0.875rem;
|
||||
padding: 0 0.875rem;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::after {
|
||||
right: 0.875rem;
|
||||
left: 0.875rem;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-tab {
|
||||
min-width: 4.375rem;
|
||||
padding: 0 0.875rem;
|
||||
|
||||
@media (width <= 767px) {
|
||||
flex: 1 1 0;
|
||||
min-width: 3.5rem;
|
||||
padding: 0 0.7656rem;
|
||||
}
|
||||
|
||||
&[aria-selected="true"] {
|
||||
color: var(--color-text);
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
background: var(--color-primary);
|
||||
border-radius: 2px 2px 0 0;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-tabs.is-measured .app-tab[aria-selected="true"]::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app-tabs-indicator {
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
background: var(--color-primary);
|
||||
border-radius: 2px 2px 0 0;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
app-tabs.variant-segmented {
|
||||
.app-tabs {
|
||||
gap: 0.1094rem;
|
||||
padding: var(--space-1);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--control-bg);
|
||||
|
||||
@media (width <= 767px) {
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-tab {
|
||||
height: 1.75rem;
|
||||
padding: 0 0.875rem;
|
||||
border-radius: var(--control-radius);
|
||||
|
||||
&:hover:not([aria-selected="true"]) {
|
||||
background: var(--color-surface-hover);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
&[aria-selected="true"] {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.app-tabs.is-measured .app-tab[aria-selected="true"] {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.app-tabs-indicator {
|
||||
top: var(--space-1);
|
||||
bottom: var(--space-1);
|
||||
box-sizing: border-box;
|
||||
background: var(--control-primary-bg);
|
||||
border-radius: var(--control-radius);
|
||||
box-shadow: 0 0 0 1px var(--control-primary-border);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,30 @@
|
||||
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
|
||||
@keyframes enter {
|
||||
from {
|
||||
opacity: var(--tw-enter-opacity, 1);
|
||||
transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0)
|
||||
scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@utility animate-in {
|
||||
animation: enter 120ms ease-out;
|
||||
}
|
||||
@utility fade-in-0 {
|
||||
--tw-enter-opacity: 0;
|
||||
}
|
||||
@utility zoom-in-98 {
|
||||
--tw-enter-scale: 0.98;
|
||||
}
|
||||
@utility slide-in-from-top-1 {
|
||||
--tw-enter-translate-y: -0.25rem;
|
||||
}
|
||||
@utility slide-in-from-bottom-1 {
|
||||
--tw-enter-translate-y: 0.25rem;
|
||||
}
|
||||
|
||||
@theme static {
|
||||
--font-sans: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
|
||||
|
||||
@@ -61,6 +85,9 @@
|
||||
--color-logo-start: var(--color-primary-400);
|
||||
--color-logo-end: var(--color-primary-600);
|
||||
--color-logo-bookmark: #FF2126;
|
||||
|
||||
--shadow-control: 0 1px 2px -1px rgb(0 0 0 / 6%), 0 2px 4px 0 rgb(0 0 0 / 4%);
|
||||
--shadow-pop: 0 4px 12px -2px rgb(0 0 0 / 12%), 0 2px 6px -2px rgb(0 0 0 / 8%);
|
||||
}
|
||||
|
||||
:root {
|
||||
@@ -113,6 +140,8 @@
|
||||
--color-logo-bookmark: var(--color-white);
|
||||
--color-warning: var(--color-amber-400);
|
||||
--color-info: var(--color-sky-400);
|
||||
--shadow-control: 0 1px 2px -1px rgb(0 0 0 / 50%), 0 2px 4px 0 rgb(0 0 0 / 40%);
|
||||
--shadow-pop: 0 4px 12px -2px rgb(0 0 0 / 55%), 0 2px 6px -2px rgb(0 0 0 / 45%);
|
||||
}
|
||||
|
||||
[data-app-theme="grimmory"] {
|
||||
@@ -481,7 +510,6 @@
|
||||
--color-logo-end: var(--color-gray-300);
|
||||
}
|
||||
|
||||
/* Custom theme: zinc surface, primary palette chosen at runtime via the picker. */
|
||||
[data-app-theme="custom"] {
|
||||
--app-primary-tint: 5%;
|
||||
--color-primary-50: var(--color-orange-50);
|
||||
@@ -516,6 +544,8 @@
|
||||
--color-border: color-mix(in srgb, var(--color-text) 18%, transparent);
|
||||
--color-card-outline: color-mix(in srgb, var(--color-text) 14%, transparent);
|
||||
--color-active-surface: color-mix(in srgb, var(--color-primary) 14%, transparent);
|
||||
--shadow-control: 0 1px 2px -1px rgb(0 0 0 / 60%), 0 2px 4px 0 rgb(0 0 0 / 50%);
|
||||
--shadow-pop: 0 4px 14px -2px rgb(0 0 0 / 70%), 0 2px 8px -2px rgb(0 0 0 / 55%);
|
||||
}
|
||||
|
||||
@source inline("bg-{red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{50,100,200,300,400,500,600,700,800,900,950}");
|
||||
|
||||
Reference in New Issue
Block a user