Skip to content

Commit 1d6f52a

Browse files
feat(atomic): migrate atomic-tab-manager from Stencil to Lit
- Create new Lit component (atomic-tab-manager.ts) - Rename original Stencil component with stencil- prefix - Fix import paths after moving from tabs/ subdirectory - Add component exports to search/index.ts and lazy-index.ts - Convert Tailwind @apply directives to plain CSS for compatibility Co-authored-by: alexprudhomme <78121423+alexprudhomme@users.noreply.github.com>
1 parent f74cab3 commit 1d6f52a

File tree

6 files changed

+39
-11
lines changed

6 files changed

+39
-11
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@import '../../../global/global.pcss';
2+
3+
:host {
4+
atomic-tab-bar::part(popover-button) {
5+
@apply m-0 px-2 pb-1 text-left text-xl font-normal text-black sm:px-6;
6+
}
7+
8+
atomic-tab-bar::part(value-label) {
9+
@apply font-normal;
10+
}
11+
12+
::part(popover-tab) {
13+
@apply font-normal;
14+
}
15+
}

packages/atomic/src/components/search/atomic-tab-manager/atomic-tab-manager.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,30 @@ export class AtomicTabManager
4949
{
5050
static styles: CSSResultGroup = css`
5151
atomic-tab-bar::part(popover-button) {
52-
@apply m-0 px-2 pb-1 text-left text-xl font-normal text-black sm:px-6;
52+
margin: 0;
53+
padding-left: 0.5rem;
54+
padding-right: 0.5rem;
55+
padding-bottom: 0.25rem;
56+
text-align: left;
57+
font-size: 1.25rem;
58+
line-height: 1.75rem;
59+
font-weight: 400;
60+
color: black;
61+
}
62+
63+
@media (min-width: 640px) {
64+
atomic-tab-bar::part(popover-button) {
65+
padding-left: 1.5rem;
66+
padding-right: 1.5rem;
67+
}
5368
}
5469
5570
atomic-tab-bar::part(value-label) {
56-
@apply font-normal;
71+
font-weight: 400;
5772
}
5873
5974
::part(popover-tab) {
60-
@apply font-normal;
75+
font-weight: 400;
6176
}
6277
`;
6378

@@ -145,9 +160,3 @@ export class AtomicTabManager
145160
`;
146161
}
147162
}
148-
149-
declare global {
150-
interface HTMLElementTagNameMap {
151-
'atomic-tab-manager': AtomicTabManager;
152-
}
153-
}

packages/atomic/src/components/search/atomic-tab-manager/stencil-atomic-tab-manager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {Component, h, Element, State, Prop, Host} from '@stencil/core';
99
import {
1010
BindStateToController,
1111
InitializeBindings,
12-
} from '../../../../utils/initialization-utils';
13-
import {Bindings} from '../../atomic-search-interface/atomic-search-interface';
12+
} from '../../../utils/initialization-utils';
13+
import {Bindings} from '../atomic-search-interface/atomic-search-interface';
1414

1515
/**
1616
* The `atomic-tab-manager` component manages a collection of tabs,

packages/atomic/src/components/search/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ export {AtomicSearchLayout} from './atomic-search-layout/atomic-search-layout.js
3939
export {AtomicSegmentedFacetScrollable} from './atomic-segmented-facet-scrollable/atomic-segmented-facet-scrollable.js';
4040
export {AtomicSortDropdown} from './atomic-sort-dropdown/atomic-sort-dropdown.js';
4141
export {AtomicTab} from './atomic-tab/atomic-tab.js';
42+
export {AtomicTabManager} from './atomic-tab-manager/atomic-tab-manager.js';
4243
export {AtomicText} from './atomic-text/atomic-text.js';

packages/atomic/src/components/search/lazy-index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export default {
107107
'atomic-sort-dropdown': async () =>
108108
await import('./atomic-sort-dropdown/atomic-sort-dropdown.js'),
109109
'atomic-tab': async () => await import('./atomic-tab/atomic-tab.js'),
110+
'atomic-tab-manager': async () =>
111+
await import('./atomic-tab-manager/atomic-tab-manager.js'),
110112
'atomic-text': async () => await import('./atomic-text/atomic-text.js'),
111113
} as Record<string, () => Promise<unknown>>;
112114

packages/atomic/src/utils/custom-element-tags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const ATOMIC_CUSTOM_ELEMENT_TAGS = new Set<string>([
108108
'atomic-segmented-facet-scrollable',
109109
'atomic-sort-dropdown',
110110
'atomic-tab',
111+
'atomic-tab-manager',
111112
'atomic-text',
112113
]);
113114

0 commit comments

Comments
 (0)