diff --git a/app.vue b/app.vue index 592227e32..4f05007a7 100644 --- a/app.vue +++ b/app.vue @@ -8,15 +8,6 @@ import EventBus from '@/layouts/AppEventBus'; export default { - /*watch: { - $route: { - handler(to) { - if (to.name === 'index') { - this.themeChangeListener({ theme: this.$appState.darkTheme ? 'aura-dark-green' : 'aura-light-green', dark: this.$appState.darkTheme }); - } - } - } - },*/ mounted() { EventBus.on('theme-change', this.themeChangeListener); }, @@ -34,16 +25,8 @@ export default { document.startViewTransition(() => this.applyTheme(event)); }, applyTheme(event) { - /*this.$primevue.changeTheme(this.$appState.theme, event.theme, 'theme-link', () => { - this.$appState.theme = event.theme; - this.$appState.darkTheme = event.dark; - - EventBus.emit('theme-change-complete', { theme: event.theme, dark: event.dark }); - });*/ - // @todo - this.$appState.theme = event.theme; this.$appState.darkTheme = event.dark; - + if (event.dark) document.documentElement.classList.add('p-dark'); else document.documentElement.classList.remove('p-dark'); } diff --git a/assets/styles/layout/_animation.scss b/assets/styles/layout/_animation.scss new file mode 100644 index 000000000..3ca6c38c5 --- /dev/null +++ b/assets/styles/layout/_animation.scss @@ -0,0 +1,72 @@ +@keyframes px-fadein { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes px-fadeout { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +@keyframes px-scalein { + 0% { + opacity: 0; + transform: scaleY(0.8); + transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1); + } + 100% { + opacity: 1; + transform: scaleY(1); + } +} + +@keyframes px-slidedown { + 0% { + max-height: 0; + } + 100% { + max-height: auto; + } +} + +@keyframes px-slideup { + 0% { + max-height: 1000px; + } + 100% { + max-height: 0; + } +} + +.px-hidden { + display: none; +} + +.px-scalein { + animation: scalein 150ms linear; +} + +.px-fadein { + animation: fadein 150ms linear; +} + +.px-fadeout { + animation: fadeout 150ms linear; +} + +.px-slidedown { + animation: slidedown 0.45s ease-in-out; +} + +.px-slideup { + animation: slideup 0.45s cubic-bezier(0, 1, 0, 1); +} + \ No newline at end of file diff --git a/assets/styles/layout/_content.scss b/assets/styles/layout/_content.scss index 563ff8db0..ebdf759c9 100644 --- a/assets/styles/layout/_content.scss +++ b/assets/styles/layout/_content.scss @@ -10,7 +10,7 @@ } .card { - background: var(--card-bg); + background: var(--p-surface-card); border: var(--card-border); padding: 2rem; border-radius: 10px; diff --git a/assets/styles/layout/_core.scss b/assets/styles/layout/_core.scss index e91e63ee0..4bf5e87d6 100644 --- a/assets/styles/layout/_core.scss +++ b/assets/styles/layout/_core.scss @@ -9,13 +9,11 @@ body { overflow-y: auto; background-color: var(--p-surface-ground); font-weight: normal; - color: var(--text-color); + color: var(--p-text-color); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -} - -.layout-wrapper { - background-color: var(--p-surface-ground); + font-family: var(--p-font-family); + font-feature-settings: var(--p-font-feature-settings); } a { @@ -23,8 +21,8 @@ a { } ::selection { - background-color: var(--highlight-bg); - color: var(--highlight-text-color); + background-color: var(--p-highlight-bg); + color: var(--p-highlight-text-color); } h1, h2, h3, h4, h5, h6 { @@ -32,7 +30,7 @@ h1, h2, h3, h4, h5, h6 { font-family: inherit; font-weight: 600; line-height: 1.2; - color: var(--surface-900); + color: var(--p-dark-surface-0, var(--p-surface-900)); &:first-child { margin-top: 0; @@ -68,16 +66,6 @@ p { margin: 0 0 1rem 0; } -input[type="number"] { - -moz-appearance: textfield; - - &::-webkit-outer-spin-button, - &::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } -} - .p-toast.p-toast-top-right, .p-toast.p-toast-top-left { top: 7rem; @@ -85,7 +73,7 @@ input[type="number"] { .px-link { font-size: 1rem; - border-radius: var(--border-radius); + border-radius: var(--p-border-radius); text-align: left; background-color: transparent; margin: 0; @@ -102,6 +90,6 @@ input[type="number"] { } button { - font-family: var(--font-family); - font-feature-settings: var(--font-feature-settings); + font-family: var(--p-font-family); + font-feature-settings: var(--p-font-feature-settings); } \ No newline at end of file diff --git a/assets/styles/layout/_docsearch.scss b/assets/styles/layout/_docsearch.scss index 9ca5433fc..489b414ef 100644 --- a/assets/styles/layout/_docsearch.scss +++ b/assets/styles/layout/_docsearch.scss @@ -1,19 +1,19 @@ .DocSearch-Button { - border-radius: var(--border-radius); - border: 1px solid var(--surface-border); + border-radius: var(--p-border-radius); + border: 1px solid var(--p-surface-border); height: 2rem; - background-color: var(--surface-card); + background-color: var(--p-surface-card); margin: 0; transition: all .3s; padding: 0 .5rem; @include focus-visible(); &:hover { - border-color: var(--primary-color); + border-color: var(--p-primary-color); } &:hover { - border-color: var(--primary-color); + border-color: var(--p-primary-color); box-shadow: none; } @@ -43,7 +43,7 @@ border-radius: 0; height: auto; width: auto; - font-family: var(--font-family); + font-family: var(--p-font-family); &:first-child { font-size: 0.75rem; @@ -59,7 +59,7 @@ &::before { content: "\e90d"; display: flex; - color: var(--text-color); + color: var(--p-text-color); font-family: "primeicons"; font-size: .4rem; opacity: .7; @@ -79,25 +79,25 @@ } .DocSearch-Modal { - border: 1px solid var(--surface-border); + border: 1px solid var(--p-surface-border); box-shadow: none; } .DocSearch-Footer { box-shadow: none; - border-top: 1px solid var(--surface-border); - background-color: var(--surface-overlay); + border-top: 1px solid var(--p-surface-border); + background-color: var(--p-surface-overlay); } .DocSearch-Form { - background: var(--surface-card); + background: var(--p-surface-card); box-shadow: none; - border: 1px solid var(--surface-border); - border-radius: var(--border-radius); + border: 1px solid var(--p-surface-border); + border-radius: var(--p-border-radius); transition: border-color .3s; &:hover { - border-color: var(--primary-color); + border-color: var(--p-primary-color); } .DocSearch-MagnifierLabel, .DocSearch-Reset { @@ -106,21 +106,21 @@ } .DocSearch-Hit { - border-bottom: 1px solid var(--surface-border); + border-bottom: 1px solid var(--p-surface-border); padding-bottom: 0; margin-bottom: .25rem; } .DocSearch-Hit-source { - color: var(--primary-color); + color: var(--p-primary-color); } .DocSearch-Logo .cls-1, .DocSearch-Logo .cls-2 { - fill: var(--primary-color); + fill: var(--p-primary-color); } .DocSearch-Prefill { - color: var(--primary-color); + color: var(--p-primary-color); } .DocSearch-Button-Placeholder { @@ -130,20 +130,20 @@ } :root { - --docsearch-searchbox-focus-background: var(--surface-card); - --docsearch-text-color: var(--text-color); - --docsearch-muted-color: var(--text-color); - --docsearch-searchbox-background: var(--surface-card); - --docsearch-text-color: var(--text-color); - --docsearch-modal-background: var(--surface-overlay); - --docsearch-key-gradient: var(--surface-ground); + --docsearch-searchbox-focus-background: var(--p-surface-card); + --docsearch-text-color: var(--p-text-color); + --docsearch-muted-color: var(--p-text-color); + --docsearch-searchbox-background: var(--p-surface-card); + --docsearch-text-color: var(--p-text-color); + --docsearch-modal-background: var(--p-surface-overlay); + --docsearch-key-gradient: var(--p-surface-ground); --docsearch-key-shadow: none; - --docsearch-container-background: var(--maskbg); - --docsearch-hit-background: var(--surface-overlay); + --docsearch-container-background: var(--p-mask-bg); + --docsearch-hit-background: var(--p-surface-overlay); --docsearch-hit-shadow: none; --docsearch-spacing: 1rem; - --docsearch-hit-color: var(--text-color); - --docsearch-highlight-color: var(--primary-color); - --docsearch-hit-active-color: var(--primary-color-text); + --docsearch-hit-color: var(--p-text-color); + --docsearch-highlight-color: var(--p-primary-color); + --docsearch-hit-active-color: var(--p-primary-color-inverse); } diff --git a/assets/styles/layout/_topbar.scss b/assets/styles/layout/_topbar.scss index bbd53f870..bdc578281 100644 --- a/assets/styles/layout/_topbar.scss +++ b/assets/styles/layout/_topbar.scss @@ -8,7 +8,7 @@ border-bottom: 1px solid transparent; &.layout-topbar-sticky { - border-bottom: 1px solid var(--surface-border); + border-bottom: 1px solid var(--p-surface-border); background-color: var(--topbar-sticky-bg); backdrop-filter: blur(8px); } @@ -28,7 +28,7 @@ .layout-topbar-logo, .layout-topbar-icon { - border-radius: var(--border-radius); + border-radius: 6px; @include focus-visible(); svg { @@ -55,4 +55,176 @@ .menu-button { display: none; } + + .topbar-items { + display: flex; + list-style-type: none; + margin: 0; + padding: 0; + gap: 0.5rem; + align-items: center; + + li { + position: relative; + } + + .topbar-item { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + border: 1px solid var(--p-surface-border); + width: 2rem; + height: 2rem; + transition: all .2s; + border-radius: 6px; + margin: 0; + padding: 0; + background-color: var(--p-surface-card); + cursor: pointer; + + @include focus-visible(); + + &:hover { + border-color: var(--primary-color-default); + } + + i, span { + color: var(--p-text-color); + } + } + + .config-item { + background-color: var(--p-primary-color); + + i { + color: var(--p-primary-color-inverse); + } + } + + .config-panel { + position: absolute; + top: 2.5rem; + right: 0; + width: 14rem; + padding: .75rem; + background-color: var(--p-surface-overlay); + border-radius: var(--p-border-radius); + border: 1px solid var(--p-surface-border); + transform-origin: top; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + + .config-panel-content { + display: flex; + flex-direction: column; + gap: 1rem; + } + + .config-panel-label { + font-size: .875rem; + color: var(--p-text-secondary-color); + font-weight: 600; + line-height: 1; + } + + .config-panel-colors { + > div { + padding-top: .5rem; + display: flex; + gap: .5rem; + flex-wrap: wrap; + + button { + border: none; + width: 1em; + height: 1rem; + border-radius: 50%; + cursor: pointer; + + &.active-color { + outline: 2px solid currentcolor; + outline-offset: 2px; + } + } + } + } + + .config-panel-settings { + > div { + display: flex; + align-items: center; + justify-content: space-between; + } + } + } + + .version-item { + width: auto; + padding: 0.5rem; + + .version-text { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .version-icon { + margin-left: .25rem; + color: var(--p-text-secondary-color); + } + } + + .versions-panel { + padding: .25rem; + background-color: var(--p-surface-overlay); + position: absolute; + right: 0; + top: auto; + border-radius: var(--p-border-radius); + border: 1px solid var(--p-surface-border); + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + transform-origin: top; + width: 8rem; + + ul { + padding: 0; + margin: 0; + list-style-type: none; + display: flex; + flex-direction: column; + gap: 4px; + + li { + margin: 2px; + + } + + a { + display: inline-flex; + padding: 0.5rem .75rem; + border-radius: var(--p-border-radius); + width: 100%; + overflow: hidden; + + &:hover { + background-color: var(--p-surface-hover); + } + + span:first-child { + font-weight: bold; + color: var(--p-dark-surface-0, var(--p-surface-900)); + } + + span:last-child { + margin-left: 0.5rem; + color: var(--p-text-color); + white-space: nowrap; + display: block; + overflow: hidden; + text-overflow: ellipsis; + } + } + } + } + } } \ No newline at end of file diff --git a/assets/styles/layout/layout.scss b/assets/styles/layout/layout.scss index 1d790164d..063aae136 100644 --- a/assets/styles/layout/layout.scss +++ b/assets/styles/layout/layout.scss @@ -14,4 +14,5 @@ @import './_doc'; @import './_docsearch'; @import './_responsive'; +@import './_animation'; @import './landing/_landing'; diff --git a/assets/styles/layout/variables/main/_dark.scss b/assets/styles/layout/variables/main/_dark.scss index 799af8b7c..ebc7da921 100644 --- a/assets/styles/layout/variables/main/_dark.scss +++ b/assets/styles/layout/variables/main/_dark.scss @@ -1,17 +1,15 @@ -.layout-dark { - --primary-color-default:var(--primary-400); - --primary-color-inverse-default:var(--gray-900); - --topbar-sticky-bg:rgba(0,0,0,.3); +:root[class="p-dark"] { + --primary-color-default:var(--p-dark-primary-400); + --primary-color-inverse-default:var(--p-dark-zinc-900); --card-border: 1px solid transparent; - --card-bg: var(--p-surface-card); --glow-image: url(https://www.primefaces.org/cdn/primevue/images/layout/pattern.png), radial-gradient(50% 50% at center -25px, var(--primary-color) 0%, #000000 100%); --glow-blend: hard-light, color-dodge; - --topbar-border: var(--surface-border); + --topbar-sticky-bg:rgba(0,0,0,.3); --mobile-menu-bg: rgba(0,0,0,.3); - --demo-code-bg: var(--surface-card); - --demo-code-button-color: var(--surface-500); + --demo-code-bg: var(--p-dark-surface-900); + --demo-code-button-color: var(--p-dark-surface-300); --demo-code-button-hover-bg: rgba(255,255,255,.1); - --demo-code-button-hover-color: var(--surface-700); - --doc-highlight-text-bg: var(--surface-50); - --doc-highlight-text-color: var(--surface-500); + --demo-code-button-hover-color: var(--p-dark-surface-100); + --doc-highlight-text-bg: var(--p-dark-surface-800); + --doc-highlight-text-color: var(--p-dark-surface-300); } \ No newline at end of file diff --git a/assets/styles/layout/variables/main/_light.scss b/assets/styles/layout/variables/main/_light.scss index 1c8bad052..3dce51cfb 100644 --- a/assets/styles/layout/variables/main/_light.scss +++ b/assets/styles/layout/variables/main/_light.scss @@ -1,17 +1,15 @@ -.layout-light { - --primary-color-default:var(--primary-600); - --primary-color-inverse-default:var(--surface-0); - --topbar-sticky-bg:rgba(255,255,255,.7); - --card-border: 1px solid var(--p-surface-border); - --card-bg: var(--p-surface-card); +:root { + --primary-color-default:var(--p-primary-600); + --primary-color-inverse-default:var(--p-surface-0); + --card-border: 1px solid var(--p-surface-200); --glow-image: url(https://www.primefaces.org/cdn/primevue/images/layout/pattern.png); --glow-blend: hard-light, multiply; - --topbar-border: rgba(0,0,0,.05); - --mobile-menu-bg: var(--surface-overlay); - --demo-code-bg: var(--surface-800); - --demo-code-button-color: var(--surface-300); + --topbar-sticky-bg:rgba(255,255,255,.7); + --mobile-menu-bg: var(--p-surface-0); + --demo-code-bg: var(--p-surface-800); + --demo-code-button-color: var(--p-surface-300); --demo-code-button-hover-bg: rgba(255,255,255,.1); - --demo-code-button-hover-color: var(--surface-100); - --doc-highlight-text-bg: var(--surface-200); - --doc-highlight-text-color: var(--surface-700); + --demo-code-button-hover-color: var(--p-surface-100); + --doc-highlight-text-bg: var(--p-surface-200); + --doc-highlight-text-color: var(--p-surface-700); } \ No newline at end of file diff --git a/components/lib/theme/aura/index.js b/components/lib/theme/aura/index.js index e2e2f5ecd..3ba95146c 100644 --- a/components/lib/theme/aura/index.js +++ b/components/lib/theme/aura/index.js @@ -73,8 +73,13 @@ export default { 900: '{slate.900}', 950: '{slate.950}' }, - textColor: '{surface.700}', - textSecondaryColor: '{surface.500}' + highlight: { + bg: '{primary.50}', + textColor: '{primary.700}' + }, + hover: { + bg: '{surface.100}' + } }, dark: { primary: { @@ -104,12 +109,18 @@ export default { 900: '{zinc.900}', 950: '{zinc.950}' }, - textColor: '{dark.surface.0}', - textSecondaryColor: '{dark.surface.400}' + highlight: { + bg: 'color-mix(in srgb, {primary.50}, transparency %16)', + textColor: 'rgba(255,255,255,.87)' + }, + hover: { + bg: 'rgba(255, 255, 255, 0.03)' + } } }, common: { - fontFamily: '"Inter var", sans-serif', + fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', + fontFeatureSettings: '"cv02", "cv03", "cv04", "cv11"', borderRadius: '6px', transitionDuration: '.2s', focusRing: { @@ -121,7 +132,26 @@ export default { surface: { card: 'var(--p-dark-surface-900, var(--p-surface-0))', border: 'var(--p-dark-surface-700, var(--p-surface-200))', - ground: 'var(--p-dark-surface-950, var(--p-surface-50))' + ground: 'var(--p-dark-surface-950, var(--p-surface-50))', + overlay: 'var(--p-dark-surface-900, var(--p-surface-0))', + hover: 'var(--p-dark-hover-bg, var(--p-hover-bg))' + }, + text: { + color: 'var(--p-dark-surface-0, var(--p-surface-700))', + secondaryColor: 'var(--p-dark-surface-400, var(--p-surface-500))' + }, + primary: { + color: 'var(--p-dark-primary-400, var(--p-primary-500))', + colorInverse: 'var(--p-dark-surface-900, var(--p-surface-0))', + colorText: 'var(--p-primary-color-inverse)' + }, + highlight: { + bg: 'var(--p-dark-highlight-bg, var(--p-highlight-bg))', + textColor: 'var(--p-dark-highlight-text-color, var(--p-highlight-text-color))' + }, + anchorGutter: '2px', + mask: { + bg: 'rgba(0,0,0,0.4)' } } }, diff --git a/layouts/AppConfigurator.vue b/layouts/AppConfigurator.vue index 55d50068a..a6f4320b0 100755 --- a/layouts/AppConfigurator.vue +++ b/layouts/AppConfigurator.vue @@ -1,418 +1,133 @@ diff --git a/layouts/default.vue b/layouts/default.vue index 2939a2cdc..026e5c8a0 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,8 +1,7 @@