-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(Divider): added initial divider component
- Loading branch information
1 parent
ee7dd70
commit 066ea62
Showing
12 changed files
with
154 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Component, html, LitElement, css } from '@rxdi/lit-html'; | ||
|
||
/** | ||
* @customElement divider-view-component | ||
*/ | ||
@Component({ | ||
selector: 'divider-view-component', | ||
style: css` | ||
.container { | ||
padding: 50px; | ||
background: white; | ||
color: #666; | ||
} | ||
`, | ||
template(this: DividerViewComponent) { | ||
return html` | ||
<div class="container"> | ||
<h1>Regular Divider</h1> | ||
<rx-divider></rx-divider> | ||
<h1>Icon Divider</h1> | ||
<rx-divider type="icon"></rx-divider> | ||
</div> | ||
`; | ||
} | ||
}) | ||
export class DividerViewComponent extends LitElement {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# Divider Component | ||
|
||
##### Usage | ||
|
||
```typescript | ||
import { ButtonComponent } from '@rxdi/ui-kit/button'; | ||
|
||
@Module({ | ||
components: [ | ||
ButtonComponent | ||
], | ||
}) | ||
export class AppModule {} | ||
``` | ||
|
||
|
||
```html | ||
<rx-divider></rx-divider> | ||
<rx-divider type="icon"></rx-divider> | ||
``` | ||
|
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,30 @@ | ||
import { | ||
unsafeCSS, | ||
Component, | ||
LitElement, | ||
html, | ||
css, | ||
property | ||
} from '@rxdi/lit-html'; | ||
import { style } from './style'; | ||
/** | ||
* @customElement rx-divider | ||
*/ | ||
@Component({ | ||
selector: 'rx-divider', | ||
style, | ||
template(this: DividerComponent) { | ||
if (this.type === 'icon') { | ||
return html` | ||
<hr class="icon" /> | ||
`; | ||
} | ||
|
||
return html` | ||
<hr class="default" /> | ||
`; | ||
} | ||
}) | ||
export class DividerComponent extends LitElement { | ||
@property({ type: String }) type: 'default' | 'icon' = 'default'; | ||
} |
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,9 @@ | ||
import { DividerComponent } from './divider.component'; | ||
|
||
export * from './divider.component'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'rx-divider': DividerComponent; | ||
} | ||
} |
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 @@ | ||
import { css } from '@rxdi/lit-html'; | ||
|
||
export const style = css` | ||
.icon { | ||
margin-bottom: 0; | ||
position: relative; | ||
height: 20px; | ||
background-image: url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22%23e5e5e5%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A); | ||
background-repeat: no-repeat; | ||
background-position: 50% 50%; | ||
} | ||
hr { | ||
border: 0; | ||
} | ||
.default { | ||
overflow: visible; | ||
text-align: inherit; | ||
margin: 0 0 20px 0; | ||
border: 0; | ||
border-top: 1px solid #e5e5e5; | ||
} | ||
.icon::before { | ||
right: calc(50% + (50px / 2)); | ||
width: 100%; | ||
content: ''; | ||
position: absolute; | ||
top: 50%; | ||
max-width: calc(50% - (50px / 2)); | ||
border-bottom: 1px solid #e5e5e5; | ||
} | ||
.icon::after { | ||
left: calc(50% + (50px / 2)); | ||
width: 100%; | ||
content: ''; | ||
position: absolute; | ||
top: 50%; | ||
max-width: calc(50% - (50px / 2)); | ||
border-bottom: 1px solid #e5e5e5; | ||
} | ||
`; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.