Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(topbar): add package * fix(sidebar): provide 100% width when within flex wrapper * chore: build fixes and codemods * chore: lockfile * chore: fix lint errors * chore: limit story viewport for snapshotting * fix: pr comments * fix: stories padding removed * fix(sidebar): overlay content wrapper margin when compact * feat(design-tokens): add size-topbar token * fix(topbar): add minHeight token * test: update snapshot
- Loading branch information
Showing
28 changed files
with
531 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@twilio-paste/codemods': patch | ||
--- | ||
|
||
[Codemods] Add `@twilio-paste/topbar` package |
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,6 @@ | ||
--- | ||
'@twilio-paste/sidebar': patch | ||
'@twilio-paste/core': patch | ||
--- | ||
|
||
[Sidebar] set width to 100% for `SidebarOverlayContentWrapper` |
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,6 @@ | ||
--- | ||
'@twilio-paste/sidebar': patch | ||
'@twilio-paste/core': patch | ||
--- | ||
|
||
[Sidebar] fix SidebarOverlayContentWrapper left margin when `compact=true` |
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,6 @@ | ||
--- | ||
'@twilio-paste/topbar': minor | ||
'@twilio-paste/core': minor | ||
--- | ||
|
||
[Topbar] add package with stories and tests |
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,6 @@ | ||
--- | ||
'@twilio-paste/core': patch | ||
'@twilio-paste/design-tokens': patch | ||
--- | ||
|
||
[Design tokens] add `size-topbar` token |
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
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
45 changes: 45 additions & 0 deletions
45
packages/paste-core/components/topbar/__tests__/index.spec.tsx
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,45 @@ | ||
import * as React from 'react'; | ||
import {render, screen} from '@testing-library/react'; | ||
import {CustomizationProvider} from '@twilio-paste/customization'; | ||
|
||
import {Topbar} from '../src'; | ||
|
||
describe('Topbar', () => { | ||
it('renders correctly', () => { | ||
render(<Topbar>Topbar</Topbar>); | ||
const renderedTopbar = screen.getByText('Topbar'); | ||
expect(renderedTopbar).toHaveStyleRule('position', 'sticky'); | ||
expect(renderedTopbar).toHaveStyleRule('top', '0'); | ||
}); | ||
|
||
describe('customization', () => { | ||
it('should add custom styling correctly', (): void => { | ||
render( | ||
<CustomizationProvider | ||
baseTheme="default" | ||
elements={{ | ||
TOPBAR: { | ||
backgroundColor: 'colorBackgroundPrimary', | ||
color: 'colorTextInverse', | ||
}, | ||
CUSTOM_TOPBAR: { | ||
backgroundColor: 'colorBackgroundPrimaryWeak', | ||
color: 'colorText', | ||
}, | ||
}} | ||
> | ||
<Topbar>Topbar</Topbar> | ||
<Topbar element="CUSTOM_TOPBAR">CustomTopbar</Topbar> | ||
</CustomizationProvider> | ||
); | ||
|
||
const renderedTopbar = screen.getByText('Topbar'); | ||
expect(renderedTopbar).toHaveStyleRule('background-color', 'rgb(2, 99, 224)'); | ||
expect(renderedTopbar).toHaveStyleRule('color', 'rgb(255, 255, 255)'); | ||
|
||
const renderedCustomTopbar = screen.getByText('CustomTopbar'); | ||
expect(renderedCustomTopbar).toHaveStyleRule('background-color', 'rgb(153, 205, 255)'); | ||
expect(renderedCustomTopbar).toHaveStyleRule('color', 'rgb(18, 28, 45)'); | ||
}); | ||
}); | ||
}); |
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,3 @@ | ||
const {build} = require('../../../../tools/build/esbuild'); | ||
|
||
build(require('./package.json')); |
Oops, something went wrong.