Skip to content

Commit 1945669

Browse files
authored
Merge pull request #41 from silinternational/develop
Release 2.0.0
2 parents 930ef55 + 1c5bc38 commit 1945669

32 files changed

+6447
-6222
lines changed

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: github pages
33
on:
44
push:
55
branches:
6-
- main # Set a branch name to trigger deployment
6+
- develop # Set a branch name to trigger deployment
77

88
jobs:
99
deploy:
@@ -24,6 +24,7 @@ jobs:
2424
restore-keys: |
2525
${{ runner.os }}-node-
2626
27+
- run: npm install -g sass
2728
- run: npm ci
2829
- run: npm test
2930

@@ -32,7 +33,7 @@ jobs:
3233

3334
- name: Deploy
3435
uses: peaceiris/actions-gh-pages@v3
35-
if: github.ref == 'refs/heads/main'
36+
if: github.ref == 'refs/heads/develop'
3637
with:
3738
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./storybook-static
39+
publish_dir: ./storybook-static

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,8 @@ dist
104104
.tern-port
105105

106106
# MacOs
107-
.DS_Store
107+
.DS_Store
108+
109+
#CSS compiled for Storybook
110+
global.css.map
111+
global.css

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
## [2.0.0](https://github.com/silinternational/ui-components/releases/tag/v2.0.0) - 2021-07-02
10+
### Changed
11+
- README - Instructions for running Storybook locally
12+
- global.css is compiled during Storybook dev and deployment build from global.scss and used only for Storybook
13+
- _index.scss uses global.scss
14+
15+
### BREAKING CHANGES
16+
- .align-center, .align-left and .align-right global classes are now .text-align-center, .text-align-left and .text-align-right.
17+
- .aligned global class is now .align-items-center
18+
- Progress.Linear barColorProvided prop deleted
19+
- Progress.Linear uses --progress-bar-color instead of --sil-primary-blue from the apps _theme file and falls back to --mdc-theme-primary
20+
- TopAppBar prop bgColorIsVariant default value is now false
21+
22+
### Added
23+
- $$props.class to Badge, Form, CustomCard, Tour and StaticChip so they can accept global classes
24+
- mdc-typography class to Badge, StaticChip and Card as it was not being applied
25+
- Badge, CustomCard, Drawer, Form, StaticChip and Tour stories to Storybook
26+
- global.scss to generate full range of padding and margin from 1rem to 8rem, height and width from 0 to 100% in increments of 5, z-index from 0 to 10.
27+
- align-item and align-self flex utilites to global.scss
28+
- .text-align-start, .text-align-end, .d-inline, .d-block, .relative, .fixed and .fs-10 added to global.scss
29+
- toggle (opens and closes Drawer when modal or dismissible), dismissible(Drawer is hidden by default) and hasTopAppBar props to Drawer
30+
31+
### Removed
32+
- global.css was removed and added to .gitignore
33+
- barColorProvided from Progress.Linear
34+
35+
### Fixed
36+
- Tour was failing to replace key with value of data prop in steps content.
37+
738
## [1.1.0](https://github.com/silinternational/ui-components/releases/tag/v1.1.0) - 2021-05-26
839
### Changed
940
- package.json version to 1.1.0

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Reusable Svelte components for some internal applications
55
To install to your Svelte project, open your project's root directory in a terminal. Type `npm i @silintl/ui-components` and press enter.
66

77
### bundler configuration
8-
Your Svelte project will need the bundler (rollup most likely) configured to compile Sass files. If you are using rollup your plugins in your "rollup.config.js" should look something like this taking special note of postcss and svelte (it may work still without autoPreprocess):
8+
Your Svelte project will need the bundler (rollup most likely) configured to compile Sass files. If you are using rollup your plugins in your "rollup.config.js" should look something like this taking special note of postcss and svelte:
99
```
1010
import postcss from 'rollup-plugin-postcss';
1111
import autoPreprocess from 'svelte-preprocess';
@@ -58,7 +58,7 @@ Dialog [
5858
Dialog.Alert (open, title, defaultAction), Dialog.Simple(open, title)
5959
]
6060

61-
Drawer (title, subtitle, menuItems)
61+
Drawer (title, subtitle, menuItems, toggle, modal, dismissible, hasTopAppBar)
6262

6363
Fab (icon, label, url)
6464

@@ -69,7 +69,7 @@ List (twoLine, avatar) [
6969
]
7070

7171
Progress [
72-
Progress.Circular, Progress.Linear (indeterminate, value, barColorProvided)
72+
Progress.Circular, Progress.Linear (indeterminate, value)
7373
]
7474

7575
Select (options, width, disabled, selectedID)
@@ -179,10 +179,11 @@ An example of using Drawer:
179179
```
180180

181181
### storybook
182-
Try out our components at https://silinternational.github.io/ui-components/
182+
Try out our components and see examples at https://silinternational.github.io/ui-components/
183+
or run storybook locally. Just copy this repo to your machine and run `npm install` then `npm run dev.` Storybook should open a browser window when it finishes building.
183184

184185
### CSS utility classes
185-
Classes from [global.css](https://github.com/silinternational/ui-components/blob/develop/components/global.css) can be applied to all components and even components and elements from your app.
186+
Classes from [global.scss](https://github.com/silinternational/ui-components/blob/develop/components/global.scss) can be applied to all components and even components and elements from your app.
186187

187188
### theming
188189
If you are using an [MDC theme](https://material.io/develop/web/docs/theming) and [typography](https://material.io/develop/web/components/typography) then import your _index.scss file to the App.svelte file so they get applied to the ui-components.

components/Badge.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
}
1515
</style>
1616

17-
<span class="dib align-center white fs-16 br-50 background" style="--theme-color: {color}" ><slot /></span>
17+
<span class="mdc-typography dib text-align-center white fs-16 br-50 background {$$props.class}" style="--theme-color: {color}" ><slot /></span>

components/CustomCard.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
}
2626
</style>
2727

28-
<Card class="h-100 py-1">
28+
<Card class="h-100 py-1 {$$props.class}">
2929
<div class="flex justify-center">
3030
<img class="w-100" {src} {alt} class:disabled/>
3131
</div>
3232

33-
<div class="flex justify-between aligned black">
33+
<div class="flex justify-between align-items-center black">
3434
<h4>{title}</h4>
3535

3636
<span class="material-icons">{icon}</span>

components/Form.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
}
55
</style>
66

7-
<form class="w-100" on:submit|preventDefault autocomplete="off">
7+
<form class="w-100 {$$props.class}" on:submit|preventDefault autocomplete="off">
88
<slot />
99
</form>

components/StaticChip.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
</style>
1212

13-
<div class="chip black flex justify-center aligned mb-1 mr-2 fs-14 br-16px">
14-
<div class="chip-content flex aligned">
13+
<div class="mdc-typography chip black flex justify-center align-items-center mb-1 mr-2 fs-14 br-16px {$$props.class}">
14+
<div class="chip-content flex align-items-center">
1515
<slot></slot>
1616
</div>
1717
</div>

components/Tour.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
tourTitle = thisStep.title || ''
5757
target = thisStep.target || ''
5858
for (const [key, value] of Object.entries(data)) {
59-
tourMessage = tourMessage.replace(`{${key}}`, value)
60-
tourTitle = tourTitle.replace(`{${key}}`, value)
61-
target = target.replace(`{${key}}`, value)
59+
tourMessage = tourMessage.replace(key, value)
60+
tourTitle = tourTitle.replace(key, value)
61+
target = target.replace(key, value)
6262
}
6363
6464
buttons = [
@@ -68,4 +68,4 @@
6868
}
6969
</script>
7070

71-
<Dialog.Alert title={tourTitle} on:chosen={event => alertChosen(event.detail)} open={openDialog} {buttons}>{@html tourMessage}</Dialog.Alert>
71+
<Dialog.Alert class="{$$props.class}" title={tourTitle} on:chosen={event => alertChosen(event.detail)} open={openDialog} {buttons}>{@html tourMessage}</Dialog.Alert>

0 commit comments

Comments
 (0)