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

Refactor Tab component #1352

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d6afbf8
refactor(tabs): refactor the tab into single component
MonikaKirkova Aug 16, 2024
2abeda6
Merge branch 'master' into mkirkova/feat-1289
MonikaKirkova Aug 16, 2024
f4be0fa
Merge branch 'master' into mkirkova/feat-1289
rkaraivanov Sep 24, 2024
53c96ff
Merge branch 'master' into mkirkova/feat-1289
desig9stein Sep 30, 2024
012fea4
Merge branch 'master' into mkirkova/feat-1289
desig9stein Oct 1, 2024
891831b
Merge branch 'master' into mkirkova/feat-1289
simeonoff Oct 7, 2024
5f6a41f
Merge branch 'master' into mkirkova/feat-1289
desig9stein Oct 8, 2024
dc02e4a
Merge branch 'master' into mkirkova/feat-1289
MonikaKirkova Oct 9, 2024
363621d
chore(*): add tabs-count property
MonikaKirkova Oct 9, 2024
358d732
Merge branch 'master' into mkirkova/feat-1289
desig9stein Oct 10, 2024
b2b0ca6
Merge branch 'master' of https://github.com/IgniteUI/igniteui-webcomp…
MonikaKirkova Oct 15, 2024
ef20827
refactor(tabs): update styles
desig9stein Oct 15, 2024
44ed3e1
Merge branch 'master' into mkirkova/feat-1289
MonikaKirkova Oct 16, 2024
3ece184
refactor(tabs): remove unnecessary methods call
MonikaKirkova Oct 16, 2024
77827f0
fix(tabs): fix failing tests
MonikaKirkova Oct 16, 2024
b346339
refactor(tabs): update styles
desig9stein Oct 17, 2024
c4d0399
Merge branch 'master' into mkirkova/feat-1289
rkaraivanov Oct 18, 2024
b03882e
refactor: Abstract resize observer and code cleanups
rkaraivanov Oct 21, 2024
98fbc67
refactor(tabs): final styles
desig9stein Oct 21, 2024
baf3e9d
refactor(tabs): update tab story
desig9stein Oct 21, 2024
7d5c5ef
refactor: Scroll logic and internal CSS variables
rkaraivanov Oct 22, 2024
3ba3709
refactor(tabs): move scroll-padding-inline to the tabs part
desig9stein Oct 22, 2024
fb0de24
fix: Smooth scroll snap with keyboard in Firefox
rkaraivanov Oct 22, 2024
ca72f48
fix: Indicator in RTL context. Unit tests.
rkaraivanov Oct 22, 2024
e14da4a
refactor: Organized the code along the contribution guidelines
rkaraivanov Oct 22, 2024
ce78e2e
refactor(utils): Removed `getOffset` helper function
rkaraivanov Oct 22, 2024
f8823a7
refactor: Removed unused button references
rkaraivanov Oct 23, 2024
35ef1f9
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Oct 23, 2024
ec52381
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Oct 23, 2024
486ec59
fix: Keyboard activation on scroll buttons
rkaraivanov Oct 23, 2024
457d163
refactor(tabs): Cleanup the styles and fix RTL for nav buttons in fir…
desig9stein Oct 23, 2024
a629842
feat: Use scroll snapping for button scrolls
rkaraivanov Oct 23, 2024
7327f3d
refactor(tabs): Update tab styles and variable names
desig9stein Oct 23, 2024
51ad3e6
refactor(tabs): fix scroll behavior under IOS, remove touch-action fr…
desig9stein Oct 23, 2024
8f74bc2
refactor(tabs): fix button icon size in all themes to match the UI kit
desig9stein Oct 24, 2024
6c02fd8
refactor(tabs): fix bootstrap focus to match the UI kit
desig9stein Oct 25, 2024
37b70e5
Merge branch 'master' into mkirkova/feat-1289
rkaraivanov Oct 25, 2024
0cb91e6
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Oct 31, 2024
1e9339e
fix: Scroll buttons disabled state tolerance
rkaraivanov Oct 31, 2024
cff2072
fix: Scroll buttons tolerance calculation
rkaraivanov Nov 1, 2024
283a8b4
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Nov 1, 2024
a45a8ce
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Nov 1, 2024
36842d6
refactor: Post merge fixes and nested tabs support
rkaraivanov Nov 4, 2024
74f3d98
fix(tabs): fix wrong focus styles behavior
desig9stein Nov 4, 2024
e6385f0
refactor(tabs): rename header and body to tab-header and tab-body
desig9stein Nov 4, 2024
405681f
fix(tabs): fix removable tabs stories button focus cut off
desig9stein Nov 4, 2024
3156237
fix: Scroll buttons visiblibity with dynamic tabs
rkaraivanov Nov 4, 2024
192d5fd
fix(tabs): fixing design issues
desig9stein Nov 4, 2024
017ace4
refactor: Minor internal naming changes
rkaraivanov Nov 5, 2024
8e16f30
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Nov 5, 2024
1cc7aaa
fix(tabs): selected-indicator position.
desig9stein Nov 5, 2024
6398f64
fix(tabs): selected-indicator position.
desig9stein Nov 5, 2024
334a732
fix(tabs): fix color in fluent active hover
desig9stein Nov 5, 2024
5824f46
fix(tabs): remove transitions form bootstrap theme header
desig9stein Nov 5, 2024
c6cec48
refactor(tabs): fix sass warning in the console
desig9stein Nov 5, 2024
5e146d5
chore: Removed stray tooltip specification inclusion
rkaraivanov Nov 11, 2024
a92347b
Merge branch 'master' into mkirkova/feat-1289
rkaraivanov Nov 11, 2024
5f6b2ac
Merge branch 'master' into mkirkova/feat-1289
simeonoff Nov 12, 2024
8ae8fc6
Merge branch 'master' into mkirkova/feat-1289
simeonoff Nov 12, 2024
5a447fa
Merge branch 'master' into mkirkova/feat-1289
simeonoff Nov 18, 2024
29e81b1
fix(tabs): Remove the --tabs-width variable
desig9stein Nov 19, 2024
074d059
fix(tabs): address issues from comments
desig9stein Nov 19, 2024
7599269
Merge branch 'master' into mkirkova/feat-1289
desig9stein Nov 19, 2024
3c05f0c
fix(tabs): address issues from comments
desig9stein Nov 20, 2024
9c4f5f1
Merge branch 'master' into mkirkova/feat-1289
simeonoff Nov 25, 2024
c1e0f50
Merge branch 'master' into mkirkova/feat-1289
rkaraivanov Dec 2, 2024
bbf8d93
Merge remote-tracking branch 'origin/master' into mkirkova/feat-1289
rkaraivanov Dec 12, 2024
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
12 changes: 7 additions & 5 deletions src/components/tabs/themes/tab.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@use 'sass:map';

[part~='tab-header'] {
$transition: .3s cubic-bezier(.35, 0, .25, 1);
$transition: .3s $tabs-animation-function;

display: flex;
scroll-snap-align: var(--_ig-tab-snap);
Expand All @@ -15,8 +15,8 @@
justify-content: center;
pointer-events: all;
height: 100%;
max-width: var(--tab-max-width--justify, var(--tab-max-width));
min-width: var(--tab-min-width);
max-width: var(--tab-max-width--justify, $tab-max-width);
min-width: $tab-min-width;
cursor: pointer;
position: relative;
z-index: map.get($tabs-z-index, 'header');
Expand Down Expand Up @@ -70,12 +70,14 @@
display: none;
position: sticky;
inset-inline-start: 0;
width: var(--tabs-width);
width: 100%;
height: 100%;
grid-row: 3;
grid-column: 1 / -1;

// The value of --_ig-tabs-width is calculated in TypeScript and represents the width of the ig-tabs component
max-width: var(--_ig-tabs-width);
simeonoff marked this conversation as resolved.
Show resolved Hide resolved
transition: transform 250ms ease-in-out;
height: 100%;
}

:host([selected]) {
Expand Down
17 changes: 5 additions & 12 deletions src/components/tabs/themes/tabs.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
@use 'sass:map';

:host {
// Scroll buttons
--scroll-btn-size: #{rem(48px)};
--tabs-width: 100%;
--tab-max-width: #{rem(360px)};
--tab-min-width: #{rem(90px)};
--_border-size: #{rem(1px)};

display: block;
Expand Down Expand Up @@ -55,14 +51,13 @@
}

[part~='scrollable'] {
/* stylelint-disable */
/* stylelint-disable-next-line max-line-length */
grid-template-columns: var(--scroll-btn-size) repeat(var(--_tabs-count), minmax(max-content, auto)) var(--scroll-btn-size);
/* stylelint-enable */
}

[part~='inner']:not([part~='scrollable']) {
grid-template-columns: repeat(var(--_tabs-count), minmax(auto, min-content));
min-width: var(--tab-min-width);
min-width: $tab-min-width;
}

:host([alignment='start']) {
Expand Down Expand Up @@ -101,12 +96,12 @@

[part~='scrollable'] {
/* stylelint-disable */
simeonoff marked this conversation as resolved.
Show resolved Hide resolved
grid-template-columns: var(--scroll-btn-size) repeat(var(--_tabs-count), minmax(var(--tab-min-width), 1fr)) var(--scroll-btn-size);
grid-template-columns: var(--scroll-btn-size) repeat(var(--_tabs-count), minmax($tab-min-width, 1fr)) var(--scroll-btn-size);
/* stylelint-enable */
}

[part~='inner']:not([part~='scrollable']) {
grid-template-columns: repeat(var(--_tabs-count), minmax(var(--tab-min-width), auto));
grid-template-columns: repeat(var(--_tabs-count), minmax($tab-min-width, auto));
}
}

Expand Down Expand Up @@ -140,16 +135,14 @@ igc-icon-button::part(base) {
}

[part='selected-indicator'] {
$indicator-bezier: cubic-bezier(.35, 0, .25, 1);

position: relative;
grid-row: 2;
grid-column: 1 / -1;

span {
position: absolute;
display: inline-block;
transition: transform .3s $indicator-bezier, width .2s $indicator-bezier;
transition: transform .3s $tabs-animation-function, width .2s $tabs-animation-function;
z-index: map.get($tabs-z-index, 'selected-indicator');
}
}
5 changes: 5 additions & 0 deletions src/components/tabs/themes/tabs.common.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@use 'styles/utilities' as *;

$tabs-z-index: (
scroll-button: 2,
selected-indicator: 1,
header: 1,
);
$tab-min-width: rem(90px);
$tab-max-width: rem(360px);
$tabs-animation-function: cubic-bezier(.35, 0, .25, 1);
4 changes: 2 additions & 2 deletions stories/tabs.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ export const NestedTabs: Story = {
margin: 0 auto;
}
.nested {
padding-inline-start: 1rem;
padding-block-start: 1rem;
padding: 1rem;
background: var(--ig-gray-50);
}
</style>
<igc-tabs
Expand Down