Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@mui/material": "^5.15.13",
"@mui/x-date-pickers": "^5.0.20",
"@tanstack/react-table": "^8.13.2",
"@tedi-design-system/core": "3.0.1",
"@tedi-design-system/core": "3.2.0",
"classnames": "^2.5.1",
"draft-js": "^0.11.7",
"draftjs-md-converter": "^1.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LeftPanelFooter = () => {
<div className={styles['tedi-left-panel__footer']}>
<div className={styles['tedi-left-panel__footer__theme-switch']}>
<Toggle ariaLabel="Toggle dark mode" label={<Text>Tume režiim</Text>} />
<Separator color="primary" topSpacing={1} />
<Separator color="primary" spacing={1} />
</div>
<Row>
<Col width="auto">
Expand Down
2 changes: 1 addition & 1 deletion src/tedi/components/cards/card/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ const Timeline: StoryFn<CardProps> = (args) => (
<p>Card content</p>
</Col>
<Col width="auto">
<Separator axis="vertical" color="accent" variant="dotted-small" isStretched />
<Separator axis="vertical" color="accent" variant="dotted" dotPosition="center" isStretched />
</Col>
<Col>
<p>Card content</p>
Expand Down
244 changes: 142 additions & 102 deletions src/tedi/components/misc/separator/separator.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ $sizes: (
'2-5': 2.5rem,
'5': 5rem,
);
$thicknesses: (
'1': 1px,
'2': 2px,
);
$dot-colors: (
'primary': var(--general-border-primary),
'secondary': var(--general-border-secondary),
'accent': var(--general-border-accent),
);

.tedi-separator {
--vertical-separator-height: 100%;
Expand All @@ -30,12 +39,8 @@ $sizes: (
border-left: 1px solid var(--general-border-primary);
}

&--secondary {
border-color: var(--general-border-secondary);
}

&--accent {
border-color: var(--general-border-accent);
&--horizontal {
display: block;
}

&--block {
Expand All @@ -45,84 +50,38 @@ $sizes: (
&--inline {
display: inline;
}
}

.tedi-separator--dotted,
.tedi-separator--dotted-small {
&::before {
position: absolute;
top: 1.25rem;
width: var(--separator-dotted-dot-lg);
height: var(--separator-dotted-dot-lg);
content: '';
background-color: var(--general-border-primary);
border-radius: 100%;
transform: translateX(-8px);

@include mixins.print-grayscale;
}

&.tedi-separator--secondary::before {
background-color: var(--general-border-secondary);
&--secondary {
border-color: var(--general-border-secondary);
}

&.tedi-separator--accent::before {
background-color: var(--general-border-accent);
&--accent {
border-color: var(--general-border-accent);
}
}

.tedi-separator--dotted-small::before {
top: 1.5rem;
width: var(--separator-dotted-dot-md);
height: var(--separator-dotted-dot-md);
transform: translateX(-5px);
}

.tedi-separator--is-stretched {
margin-right: calc(var(--card-content-padding-right) * -1);
margin-left: calc(var(--card-content-padding-left) * -1);
&--is-stretched {
margin-right: calc(var(--card-content-padding-right) * -1);
margin-left: calc(var(--card-content-padding-left) * -1);

&.tedi-separator--vertical {
height: calc(100% + (var(--card-content-padding-top) + var(--card-content-padding-bottom)));
margin: calc(var(--card-content-padding-top) * -1) 0 calc(var(--card-content-padding-bottom) * -1);
&.tedi-separator--vertical {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't &--vertical work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would result in tedi-separator--is-stretched--vertical as the &-- would apply straight to the previous selector

height: calc(100% + (var(--card-content-padding-top) + var(--card-content-padding-bottom)));
margin: calc(var(--card-content-padding-top) * -1) 0 calc(var(--card-content-padding-bottom) * -1);
}
}
}

@each $size, $value in $sizes {
.tedi-separator--horizontal.tedi-separator--top-#{$size} {
margin-top: #{$value};
}

.tedi-separator--horizontal.tedi-separator--bottom-#{$size} {
margin-bottom: #{$value};
}

.tedi-separator--horizontal.tedi-separator--spacing-#{$size}:not(.tedi-separator--dot-only) {
margin-top: #{$value};
margin-bottom: #{$value};
}
.tedi-separator--dotted {
&::before {
position: absolute;
content: '';
background-color: var(--general-border-primary);
border-radius: 50%;

.tedi-separator--horizontal.tedi-separator--dot-only.tedi-separator--spacing-#{$size},
.tedi-separator--vertical.tedi-separator--spacing-#{$size} {
margin-right: #{$value};
margin-left: #{$value};
@include mixins.print-grayscale;
}
}

$thicknesses: (
'1': 1px,
'2': 2px,
);

@each $thickness, $value in $thicknesses {
.tedi-separator {
&.tedi-separator--thickness-#{$thickness} {
border-top-width: #{$value};
}

&--vertical.tedi-separator--thickness-#{$thickness} {
border-left-width: #{$value};
}
&.tedi-separator--vertical {
min-height: 3rem;
}
}

Expand All @@ -138,58 +97,139 @@ $thicknesses: (
width: var(--separator-dotted-dot-sm);
height: var(--separator-dotted-dot-sm);
content: '';
border-radius: 100%;
border-radius: 50%;

@include mixins.print-grayscale;
}

&.tedi-separator--dot-only-extra-small::before {
width: var(--separator-dotted-dot-xs);
height: var(--separator-dotted-dot-xs);
&.tedi-separator--dot-style-outlined::before {
background: transparent;
}
}

&.tedi-separator--dot-only-small::before {
width: var(--separator-dotted-dot-sm);
height: var(--separator-dotted-dot-sm);
@each $name, $color in $dot-colors {
.tedi-separator--#{$name} {
border-color: $color;

&::before {
background-color: $color;
}

&.tedi-separator--dot-style-outlined:not(.tedi-separator--dot-only)::before {
border-color: $color;
}
}
}

&.tedi-separator--dot-only-medium::before {
width: var(--separator-dotted-dot-md);
height: var(--separator-dotted-dot-md);
@each $size, $var in (extra-small: xs, small: sm, medium: md, large: lg) {
.tedi-separator--dot-only-#{$size}::before,
.tedi-separator--dotted-#{$size}::before,
.tedi-separator--dot-style-outlined.tedi-separator--dotted-#{$size}::before {
width: var(--separator-dot-size-#{$var});
height: var(--separator-dot-size-#{$var});
}
}

&.tedi-separator--dot-only-large::before {
width: var(--separator-dotted-dot-lg);
height: var(--separator-dotted-dot-lg);
@each $axis in (horizontal, vertical) {
@each $pos in (start, center, end) {
.tedi-separator--#{$axis}.tedi-separator--dot-position-#{$pos}::before {
@if $axis == horizontal {
@if $pos == start {
right: auto;
left: 0;
} @else if $pos == center {
right: 0;
left: 0;
margin: auto;
} @else {
right: 0;
left: auto;
}
} @else {
@if $pos == start {
top: 0;
bottom: auto;
} @else if $pos == center {
top: 0;
bottom: 0;
margin: auto 0;
} @else {
top: auto;
bottom: 0;
}
}
}
}
}

&.tedi-separator--primary::before {
background-color: var(--general-border-primary);
.tedi-separator--horizontal.tedi-separator--dot-position-custom::before {
right: auto;
left: var(--separator-dot-position);
}

.tedi-separator--vertical.tedi-separator--dot-position-custom::before {
top: var(--separator-dot-position);
bottom: auto;
}

@each $size, $value in $sizes {
.tedi-separator--spacing-#{$size}:not(.tedi-separator--dot-only) {
margin: #{$value} 0;
}

.tedi-separator--dot-only.tedi-separator--spacing-#{$size} {
&.tedi-separator--horizontal {
margin-right: $value;
margin-left: $value;
}

&.tedi-separator--vertical {
margin-top: $value;
margin-bottom: $value;
}
}

&.tedi-separator--secondary::before {
background-color: var(--general-border-secondary);
@each $side in (top, bottom, left, right) {
.tedi-separator--#{$side}-#{$size} {
margin-#{$side}: $value;
}
}
}

&.tedi-separator--accent::before {
background-color: var(--general-border-accent);
@each $thickness, $value in $thicknesses {
.tedi-separator--thickness-#{$thickness} {
border-top-width: $value;
}
.tedi-separator--vertical.tedi-separator--thickness-#{$thickness} {
border-left-width: $value;
}
}

.tedi-separator--horizontal {
&.tedi-separator--dotted::before,
&.tedi-separator--dotted-small::before {
right: 0;
left: 0;
margin: 0 auto;
transform: initial;
@each $axis in (horizontal, vertical) {
@each $size, $var in (extra-small: xs, small: sm, medium: md, large: lg) {
.tedi-separator--#{$axis}.tedi-separator--dotted-#{$size}::before,
.tedi-separator--#{$axis}.tedi-separator--dot-style-outlined.tedi-separator--dotted-#{$size}::before {
@if $axis == horizontal {
top: calc((var(--separator-dot-size-#{$var}) / 2 + var(--separator-thickness)) * -1);
} @else {
left: calc((var(--separator-dot-size-#{$var}) / 2 + var(--separator-thickness) / 2) * -1);
}
}
}
}

&.tedi-separator--dotted::before {
top: calc(var(--separator-dotted-dot-lg) / 2 * -1);
.tedi-separator--dot-style-outlined {
&::before {
background-color: var(--general-surface-primary);
border-style: solid;
border-width: var(--separator-thickness);
}

&.tedi-separator--dotted-small::before {
top: calc(var(--separator-dotted-dot-md) / 2 * -1);
@each $name, $color in $dot-colors {
&.tedi-separator--#{$name}::before,
&.tedi-separator--dotted-#{$name}::before {
z-index: 10;
border-color: $color;
}
}
}
Loading
Loading