-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui-shell): sync with @carbon/react version (#10526)
* feat(ui-shell): ui-shell carbon v11 sync * feat(ui-shell): header side nav items and new props * feat(ui-shell): side-nav overlay * feat(ui-shell): active header menu * feat(ui-shell): add box-sizing to switcher link * feat(ui-shell): import grid styles * Update packages/carbon-web-components/src/components/ui-shell/header-side-nav-items.ts Co-authored-by: Ignacio Becerra <[email protected]> * feat(ui-shell): address some of the feedback * feat(ui-shell): header styles * feat(ui-shell): set correct tabbing order for sidenav * feat(ui-shell): fix rail focus and overlay * feat(ui-shell): story book content * feat(ui-shell): remove unnecessary test * feat(ui-shell): add elements to index * feat(ui-shell): adjust focus order for sidenav,actions,nav --------- Co-authored-by: Ignacio Becerra <[email protected]>
- Loading branch information
1 parent
7a8aa21
commit 560a753
Showing
28 changed files
with
1,505 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...components/packages/carbon-web-components/src/components/ui-shell/header-global-action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2023 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { LitElement } from 'lit'; | ||
import { property, customElement } from 'lit/decorators.js'; | ||
import { BUTTON_TOOLTIP_POSITION } from '../button/button'; | ||
import CDSButton from '../button/button'; | ||
import styles from './header.scss'; | ||
import { prefix } from '../../globals/settings'; | ||
|
||
/** | ||
* Header global action button | ||
* | ||
* @element cds-header-global-action | ||
*/ | ||
@customElement(`${prefix}-header-global-action`) | ||
class CDSHeaderGlobalAction extends CDSButton { | ||
/** | ||
* Specify whether the action is currently active | ||
*/ | ||
@property({ type: Boolean, reflect: true }) | ||
active; | ||
|
||
connectedCallback() { | ||
this.tooltipPosition = BUTTON_TOOLTIP_POSITION.BOTTOM; | ||
super.connectedCallback(); | ||
} | ||
|
||
firstUpdated() { | ||
const button = this.shadowRoot?.querySelector('button'); | ||
|
||
if (button) { | ||
button?.classList.add(`${prefix}--header__action`); | ||
|
||
if (this.active) { | ||
button?.classList.add(`${prefix}--header__action--active`); | ||
} | ||
} | ||
} | ||
|
||
static shadowRootOptions = { | ||
...LitElement.shadowRootOptions, | ||
delegatesFocus: true, | ||
}; | ||
|
||
static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader | ||
} | ||
|
||
export default CDSHeaderGlobalAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
web-components/packages/carbon-web-components/src/components/ui-shell/header-panel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2023 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { LitElement, html } from 'lit'; | ||
import { property, customElement } from 'lit/decorators.js'; | ||
import styles from './header.scss'; | ||
import { prefix } from '../../globals/settings'; | ||
|
||
/** | ||
* Header panel | ||
* | ||
* @element cds-header-panel | ||
*/ | ||
@customElement(`${prefix}-header-panel`) | ||
class CDSHeaderPanel extends LitElement { | ||
/** | ||
* Specify whether the panel is expanded | ||
*/ | ||
@property({ type: Boolean, reflect: true }) | ||
expanded; | ||
|
||
render() { | ||
return html`<slot></slot>`; | ||
} | ||
|
||
static shadowRootOptions = { | ||
...LitElement.shadowRootOptions, | ||
delegatesFocus: true, | ||
}; | ||
|
||
static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader | ||
} | ||
|
||
export default CDSHeaderPanel; |
Oops, something went wrong.