Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard 2.0 #305

Merged
merged 21 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a88b706
feat(cxl-ui): add `cxl-stats` component
phkel Jul 6, 2023
518baf1
feat(cxl-ui): add `cxl-course-card` component
freudFlintstone Jul 25, 2023
cd3a8df
feat(cxl-ui): add `cxl-time`component
freudFlintstone Aug 1, 2023
ae15f87
refactor(cxl-ui): add cxlBaseCardElement as base class
freudFlintstone Aug 1, 2023
0cadbd7
feat(cxl-lumo-styles): add badge secondary theme
phkel Aug 2, 2023
07f53f1
feat(cxl-ui): add `cxl-light-card` component
phkel Aug 2, 2023
f95209e
feat(cxl-ui): improve `cxl-base-card` component
kertuilves Aug 7, 2023
938dc1d
feat(cxl-ui): refactor `cxl-light-card` component based on `cxl-base-…
kertuilves Aug 7, 2023
9155878
feat: add `featured-course-card` component
pawelkmpt Jun 28, 2023
68cc69a
feat(cxl-ui): improve `cxl-base-card` component
kertuilves Aug 2, 2023
355660a
feat(cxl-ui): refactor `cxl-light-card` component based on `cxl-base-…
kertuilves Aug 2, 2023
a94d0cf
feat(cxl-ui): add `cxl-notification-card` component
kertuilves Aug 9, 2023
2313e1f
feat(cxl-ui): add `cxl-dashboard-notification` component
kertuilves Aug 9, 2023
45a85a0
feat: add dashboard category accordion
phkel Jul 5, 2023
f0ebd94
feat(cxl-ui): add `cxl-dashboard-header` component
phkel Jul 13, 2023
736bd94
feat(cxl-ui): add `cxl-course-dialog` component
kertuilves Aug 14, 2023
ec09293
feat(cxl-ui): export new cxl components
kertuilves Aug 16, 2023
5bb2a8a
feat(cxl-ui): add `cxl-dashboard-layout` story
kertuilves Aug 14, 2023
282c6ce
feat(cxl-ui): fix dashboard components layout issues
kertuilves Aug 14, 2023
47c5739
chore(yarn): rebase on top of `master`
pawelkmpt Aug 16, 2023
7c4b890
fix(cxl-ui): fix dashboard layout issues
kertuilves Aug 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cxl-lumo-styles/scss/badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
color: var(--lumo-primary-text-color);
}

[theme~="badge"][theme~="secondary"] {
color: var(--lumo-primary-contrast-color);
background-color: var(--cxl-color-brand-blue);
}

.course-skills {
[theme~="badge"] {
margin-right: var(--lumo-space-s);
Expand Down
6 changes: 6 additions & 0 deletions packages/cxl-lumo-styles/scss/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ html {
--cxl-content-max-width: 48em;
--cxl-content-max-width-wide: calc(var(--cxl-content-max-width) * 2);
--cxl-wrap-padding: var(--lumo-space-m);
--cxl-space-sm: 12px;
--cxl-color-light-gray: hsla(0, 0%, 96%, 1);
--cxl-color-dark-gray: hsla(240, 1%, 24%, 1);
--cxl-color-black-50pct: hsla(0, 0%, 0%, 0.5);
--cxl-color-brand-blue: hsla(214, 61%, 25%, 1);
--cxl-color-light-pink: hsl(353, 73%, 96%, 1);

/**
* Lumo Icons have a documented 4px "safe area" around them. Vaadin Icons don't, for unknown reasons.
Expand Down
91 changes: 91 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/cxl-tabs-slider.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "../mixins";
@use "../mq";

::slotted(vaadin-tab) {
align-items: stretch; // Equal height elements.
Expand Down Expand Up @@ -31,3 +32,93 @@
display: initial;
}
}

/**
* Theme "cxl-course-slider"
*/

:host([theme~="cxl-course-slider"][theme~="minimal"]) {
::slotted(vaadin-tab) {
padding: 0 calc(var(--lumo-space-s) / 2) calc(var(--lumo-space-s) / 2);
}

::slotted(vaadin-tab:first-of-type) {
margin-inline-start: calc(var(--lumo-space-m) - var(--lumo-space-xs));

@media #{mq.$small} {
margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-xs));
}
}

&::before,
&::after {
position: absolute;
top: calc(var(--lumo-space-m) * -1);
bottom: calc(var(--lumo-space-m) * -1);
width: 68px;
content: "";
background: linear-gradient(270deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
opacity: 0%;
}

[part="tabs"] {
margin: 0;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;

&::-webkit-scrollbar {
display: none;
}
}

[part="back-button"],
[part="forward-button"] {
width: var(--lumo-space-xl);
height: var(--lumo-space-xl);
color: var(--lumo-primary-color);
border-radius: 100%;

&::after {
font-size: var(--lumo-font-size-xxl);
}
}

[part="back-button"] {
margin-left: var(--lumo-space-s);
}

[part="forward-button"] {
margin-right: var(--lumo-space-s);
}
}

:host([theme~="cxl-course-slider"][overflow="start end"]),
:host([theme~="cxl-course-slider"][overflow="start"]) {
&::before {
left: 0;
z-index: 1;
rotate: 180deg;
opacity: 100%;
}
}

:host([theme~="cxl-course-slider"][overflow="end"]),
:host([theme~="cxl-course-slider"][overflow="start end"]) {
&::after {
right: 0;
opacity: 100%;
}
}

/**
* Theme "cxl-course-slider" and "cxl-category-accordion"
*/

:host([theme~="cxl-course-slider"][theme~="cxl-category-accordion"][theme~="minimal"]) {
margin-left: calc(-1 * var(--lumo-space-m));

@media #{mq.$small} {
margin-left: calc(-1 * var(--lumo-space-l));
}
}
40 changes: 40 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/vaadin-accordion-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,43 @@
padding-bottom: var(--lumo-space-m);
}
}

/**
* Theme "cxl-dashboard-category".
*/
:host([theme~="cxl-dashboard-category"]) {
border-top: solid 1px var(--cxl-color-light-gray);
border-bottom: none;

[part="summary"] {
padding: var(--lumo-space-l) 0;
}

[part="content"] {
padding: 0;
margin-bottom: var(--lumo-space-l);
}

[part="toggle"] {
margin-right: var(--lumo-space-l);
}
}

:host([theme~="cxl-dashboard-category"][opened]) {
[part="summary"] {
padding-bottom: 0;
}
}

@media (hover: hover) {
:host([theme~="cxl-dashboard-category"]:not([opened])) {
[part="summary"]:hover {
cursor: pointer;
background-color: var(--cxl-color-light-gray);

[part="toggle"] {
color: var(--lumo-shade);
}
}
}
}
59 changes: 59 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/vaadin-details.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../mq";

/**
* Modify toggle visibility.
*/
Expand Down Expand Up @@ -34,3 +36,60 @@
}
}
}

// Dashboard notification component
:host([theme~="cxl-dashboard-notification"]) {
margin: 0;

[part="toggle"] {
display: none;
}

[part="content"] {
padding: 0;
}

[part="summary"] {
display: block;
padding: 0;
}
}

// Dashboard header
:host([theme~="cxl-dashboard-header"]) {
margin: var(--lumo-space-s) 0 0;
border: 1px solid var(--cxl-color-dark-gray);
border-radius: var(--lumo-border-radius-s);

[part="summary"] {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--lumo-space-m);
line-height: 1.3;
color: var(--lumo-primary-contrast-color);

&:hover {
color: var(--lumo-primary-contrast-color);
}
}

[part="toggle"] {
flex-shrink: 0;
margin-left: var(--lumo-space-s);
font-size: var(--lumo-font-size-m);
color: var(--lumo-primary-contrast-color);
background-color: var(--lumo-tint-5pct);
border-radius: 100%;
}

[part="content"] {
padding: 0;
}
}

:host([theme~="cxl-dashboard-header"][opened]) {
[part="toggle"] {
background-color: var(--lumo-tint-5pct);
}
}
32 changes: 32 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/vaadin-overlay.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../mq";

// Perfectly align modal in the center of the screen.
:host([theme~="cxl-marketing-nav"][phone]) [part="overlay"] {
top: 0;
Expand All @@ -12,3 +14,33 @@

background-color: var(--lumo-shade-#{$vaadin-overlay-shade-pct * 3.5}#{"pct"});
}

// Theme: cxl-course-dialog
:host([theme="cxl-course-dialog"]) {
[part='backdrop'] {
background-color: var(--cxl-color-black-50pct);
}

[part='overlay'] {
width: 100%;
max-width: var(--cxl-content-max-width);
}

[part='content'] {
padding: var(--lumo-space-m) var(--lumo-space-m) 0 var(--lumo-space-m);

@media #{mq.$small} {
padding: var(--lumo-space-l) var(--lumo-space-l) 0 var(--lumo-space-l);
}
}

[part='footer'] {
background-color: unset;
box-shadow: var(--lumo-box-shadow-m);

@media #{mq.$small} {
gap: var(--lumo-space-m);
padding-right: var(--lumo-space-l);
}
}
}
23 changes: 23 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/vaadin-tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,26 @@
:host([theme~="cxl-marketing-nav"][hidden]) {
visibility: hidden;
}

:host([theme~="cxl-featured-course-slider"]) {
padding: 0;
}

// Dashboard notifications
:host([theme~="cxl-dashboard-notification"]) {
padding: 6px 16px;
font-weight: 500;
color: var(--lumo-body-text-color);
border-top-left-radius: var(--lumo-border-radius-s);
border-top-right-radius: var(--lumo-border-radius-s);

&::before,
&::after {
display: none;
}
}

:host([theme~="cxl-dashboard-notification"][selected]) {
color: var(--lumo-primary-contrast-color);
background-color: var(--lumo-primary-color);
}
68 changes: 68 additions & 0 deletions packages/cxl-lumo-styles/scss/themes/vaadin-tabs.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "../mixins";
@use "../mq";

// Collapse margins.
:host([orientation="vertical"][theme~="cxl-marketing-nav"]) {
Expand Down Expand Up @@ -65,3 +66,70 @@ $vaadin-tab-horizontal-padding: 0.75rem;
margin-right: auto;
margin-left: auto;
}

// Featured course slider
:host([theme~="cxl-featured-course-slider"][orientation="horizontal"]) {
background-color: var(--cxl-color-light-gray);

[part="tabs"] {
padding: 0;
margin: 0;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;

&::-webkit-scrollbar {
display: none;
}
}

[part="back-button"],
[part="forward-button"] {
width: var(--lumo-size-s);
height: var(--lumo-size-s);
color: var(--lumo-primary-color);
border-radius: 100%;

&::after {
font-size: var(--lumo-font-size-xl);
}

@media #{mq.$medium} {
width: var(--lumo-space-xl);
height: var(--lumo-space-xl);

&::after {
font-size: var(--lumo-font-size-xxl);
}
}
}

@media #{mq.$medium} {
[part="back-button"] {
margin-left: var(--lumo-space-s);
}

[part="forward-button"] {
margin-right: var(--lumo-space-s);
}
}

::slotted(vaadin-tab) {
padding: 0 var(--lumo-space-m);

@media #{mq.$medium} {
padding: 0;
}
}

::slotted(vaadin-tab:not(:first-child)) {
@media #{mq.$medium} {
padding-left: var(--lumo-size-xl);
}
}
}

// Dashboard notifications
:host([theme~="cxl-dashboard-notification"]) [part="tabs"] {
margin: 0;
}
3 changes: 3 additions & 0 deletions packages/cxl-lumo-styles/src/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading