Skip to content

Commit 0060a2f

Browse files
authored
Merge pull request #52 from silinternational/develop
Release 2.3.0
2 parents 1648966 + 937fcc6 commit 0060a2f

File tree

7 files changed

+12390
-7995
lines changed

7 files changed

+12390
-7995
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.3.0](https://github.com/silinternational/ui-components/releases/tag/v2.3.0) - 2021-07-21
10+
### Added
11+
- borderRadius, padding and bordered props to Badge
12+
- bgColor to StaticChip
13+
14+
### Changed
15+
- README - updated component index
16+
917
## [2.2.1](https://github.com/silinternational/ui-components/releases/tag/v2.2.1) - 2021-07-15
1018
### Fixed
1119
- Excessive warnings from sass. Reverted to 1.32.12

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ TopAppBar (dense, fixed, navIconBreakpointClass, bgColorIsVariant) [
9696
actions.js, title.js
9797
]
9898

99-
Badge (color)
99+
Badge (color, borderRadius, padding, bordered)
100100

101101
CustomCard (
102102
src, alt, title, icon, disabled, buttons, footerText
@@ -108,7 +108,7 @@ Page (loading, title, layout, center, noProgress) [
108108
Page.Subheader
109109
]
110110

111-
StaticChip
111+
StaticChip (bgColor)
112112

113113
Tour (steps, data)
114114

components/Badge.svelte

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
<script>
22
export let color = 'gray'
3+
export let borderRadius = '50%'
4+
export let padding = '.2em'
5+
export let bordered = false
6+
7+
let transparentColor = ''
8+
9+
$: if (/^#([0-9A-F]{3}){1,2}$/i.test(color)) {
10+
color.length == 7 && (transparentColor = color + '12')
11+
12+
color.length == 4 && (transparentColor = '#' + color.slice(1, 2).repeat(2) + color.slice(2, 3).repeat(2) + color.slice(3, 4).repeat(2) + '12')
13+
}
314
</script>
415

516
<style>
617
span {
718
min-width: 1.15em;
819
min-height: 1.15em;
9-
padding: .2em;
20+
padding: var(--padding);
21+
background-color: var(--theme-color);
22+
border-radius: var(--border-radius);
1023
}
1124
12-
.background {
13-
background-color: var(--theme-color);
25+
.bordered {
26+
background: linear-gradient(0deg, var(--bg-color), var(--bg-color)), #FFF;
27+
border: 1px solid var(--theme-color);
28+
color: black;
1429
}
1530
</style>
1631

17-
<span class="mdc-typography dib text-align-center white fs-16 br-50 background {$$props.class}" style="--theme-color: {color}" ><slot /></span>
32+
<span class="mdc-typography dib text-align-center white fs-16 {$$props.class}" class:bordered style="--theme-color: {color}; --bg-color: {transparentColor}; --border-radius: {borderRadius}; --padding: {padding}" >
33+
<slot />
34+
</span>

components/StaticChip.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
<script>
2+
export let bgColor = '#e5e5e5'
3+
</script>
4+
15
<style>
2-
.chip{
3-
background-color: #e5e5e5;
6+
.chip {
7+
background-color: var(--theme-color);
48
height: 36px;
59
}
610
7-
.chip-content{
11+
.chip-content {
812
padding-left: 12px;
913
padding-right: 12px;
1014
}
1115
</style>
1216

13-
<div class="mdc-typography chip black flex justify-center align-items-center mb-1 mr-2 fs-14 br-16px {$$props.class}">
17+
<div class="mdc-typography chip black flex justify-center align-items-center mb-1 mr-2 fs-14 br-16px {$$props.class}" style="--theme-color: {bgColor}">
1418
<div class="chip-content flex align-items-center">
1519
<slot></slot>
1620
</div>

0 commit comments

Comments
 (0)