Skip to content

Commit e3a1375

Browse files
committed
chore: update from base branch
2 parents 493ee77 + 725dda0 commit e3a1375

21 files changed

+285
-63
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
contents: write
10-
packages: write
11-
actions: read
12-
pull-requests: write
13-
148
concurrency:
159
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1610
cancel-in-progress: true
@@ -25,6 +19,7 @@ jobs:
2519
uses: actions/checkout@v4
2620
with:
2721
fetch-depth: 0
22+
persist-credentials: false
2823

2924
- name: Collect Workflow Telemetry
3025
uses: catchpoint/workflow-telemetry-action@v2

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# [1.4.0](https://github.com/input-output-hk/lace-ui-toolkit/compare/v1.3.0...v1.4.0) (2024-07-02)
2+
3+
4+
### Features
5+
6+
* add card image variant ([96f9b56](https://github.com/input-output-hk/lace-ui-toolkit/commit/96f9b56c4a2bef60e667641ab8269caefe9af2c6))
7+
* add color schema decorator layout prop ([22e74e6](https://github.com/input-output-hk/lace-ui-toolkit/commit/22e74e62328f627d8b8381301e44da18a314f992))
8+
* add height prop to divider ([b6aac9a](https://github.com/input-output-hk/lace-ui-toolkit/commit/b6aac9ace55e7753a3d725c9768c2e43aa0d81d5))
9+
* add toggle button group small variant ([bfca976](https://github.com/input-output-hk/lace-ui-toolkit/commit/bfca9762e538949f9ea8adda3bae6c8e6c30c10d))
10+
11+
# [1.3.0](https://github.com/input-output-hk/lace-ui-toolkit/compare/v1.2.0...v1.3.0) (2024-07-02)
12+
13+
14+
### Features
15+
16+
* add new icon set ([b6802a2](https://github.com/input-output-hk/lace-ui-toolkit/commit/b6802a2beaf686d4be9abe13d3156496f04a35e6))
17+
118
# [1.2.0](https://github.com/input-output-hk/lace-ui-toolkit/compare/v1.1.0...v1.2.0) (2024-06-26)
219

320

CONTRIBUTING.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Contributing
2+
3+
## Development workflow
4+
5+
To get started with the project, run `yarn` in the root directory to install the required dependencies:
6+
7+
```sh
8+
yarn
9+
```
10+
11+
We use [storybook](https://storybook.js.org/docs) for components development. To run storybook execute
12+
13+
```sh
14+
yarn dev
15+
```
16+
17+
## Linting and tests
18+
19+
We use [TypeScript](https://www.typescriptlang.org/) for type checking
20+
21+
```sh
22+
yarn type-check
23+
```
24+
25+
[ESLint](https://eslint.org/) for linting the code
26+
27+
```sh
28+
yarn lint
29+
```
30+
31+
and [Prettier](https://prettier.io/) for formatting the code
32+
33+
```sh
34+
yarn format
35+
```
36+
37+
> [!TIP] Pre-commit hook
38+
>
39+
> Our pre-commit hooks verify that the linter and format pass when committing.
40+
41+
We use [Chromatic](https://www.chromatic.com/docs/) for visual testing and UI regression.
42+
43+
Our storybook is published to Chromatic and accessible by following: [https://storybook.lw.iog.io/](https://storybook.lw.iog.io/)
44+
45+
## Commit message convention
46+
47+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
48+
49+
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
50+
- `feat`: new features, e.g. add new method to the module.
51+
- `docs`: changes into documentation, e.g. add usage example for the module..
52+
- `style`: formatting, code style.
53+
- `refactor`: code refactor, e.g. migrate from class components to hooks.
54+
- `test`: adding or updating tests, e.g. add integration tests using detox.
55+
- `ci`: changes to continuous integration, pipelines, workflows.
56+
- `chore`: other changes not affecting functionality.
57+
58+
> [!TIP] Pre-commit hook
59+
>
60+
> Our pre-commit hooks verify that your commit message matches this format when committing.
61+
62+
### How to write good commit message
63+
64+
**Write the summary line of what you have done in the imperative mood**, that is as if you were
65+
commanding someone.
66+
67+
Start the line with `fix`, `add`, `change` instead of ~~`fixed`~~, ~~`added`~~, ~~`changed`~~.
68+
69+
Don’t end the summary line with a period`.`.
70+
71+
## Code Review
72+
73+
During the code review, we aim to improve the overall product quality.
74+
75+
- Reviews should be concise and written in neutral language. Critique the code, not the author, and be respectful.
76+
- Over-communicate your thoughts in the initial message, as it saves time on back and forth communication cycles.
77+
78+
### Merge Review
79+
80+
The PR commit messages plays an essential role in our versioning and publishing process. Rebase your branch with main to keep your code in sync and to have a linear commits history.
81+
82+
Create atomic commits which focuses on single thing at a time, and write good commit message, so it is self-contained and explanatory.
83+
84+
## Versioning and Publishing
85+
86+
We follow [semantic versioning](https://semver.org/) and use [semantic release](https://github.com/semantic-release/semantic-release) for automatic versioning and publishing npm package to [GitHub Package Registry](https://github.com/input-output-hk/lace-ui-toolkit/pkgs/npm/lace-ui-toolkit).
87+
88+
> [!IMPORTANT]
89+
>
90+
> It's important to follow [Commit message convention](#commit-message-convention), so semantic-release can automatically determine the right version to be published to registry.
91+
92+
## Useful links
93+
94+
- [Auto-squashing Git Commits](https://thoughtbot.com/blog/autosquashing-git-commits)
95+
- [Code Review Developer Guide](https://google.github.io/eng-practices/review/)
96+
- [Respectful Code Reviews](https://chromium.googlesource.com/chromium/src/+/master/docs/cr_respect.md)

README.md

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Lace UI toolkit
22

33
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=input-output-hk_lace-ui-toolkit&metric=alert_status&token=98802db7b585471a39ab75e8baf01cff96c561db)](https://sonarcloud.io/summary/new_code?id=input-output-hk_lace-ui-toolkit)
4-
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=input-output-hk_lace-ui-toolkit&metric=coverage&token=98802db7b585471a39ab75e8baf01cff96c561db)](https://sonarcloud.io/summary/new_code?id=input-output-hk_lace-ui-toolkit)
54
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=input-output-hk_lace-ui-toolkit&metric=security_rating&token=98802db7b585471a39ab75e8baf01cff96c561db)](https://sonarcloud.io/summary/new_code?id=input-output-hk_lace-ui-toolkit)
65
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=input-output-hk_lace-ui-toolkit&metric=vulnerabilities&token=98802db7b585471a39ab75e8baf01cff96c561db)](https://sonarcloud.io/summary/new_code?id=input-output-hk_lace-ui-toolkit)
76

@@ -19,12 +18,34 @@ yarn install
1918

2019
## Development
2120

22-
Storybook is used for development, run it using command:
21+
[Storybook](https://storybook.js.org/docs) is used for development, run it using command:
2322

2423
```bash
2524
yarn storybook
2625
```
2726

27+
or
28+
29+
```bash
30+
yarn dev
31+
```
32+
33+
For more details check [CONTRIBUTING.md]('./CONTRIBUTING.md) guide.
34+
35+
## File naming convention
36+
37+
| FILES | PURPOSE |
38+
| ---------------- | :----------------------------------------------------------------------------: |
39+
| \*.index.ts | Defines the public API to be imported by other modules |
40+
| \*.component.tsx | Defines the UI component |
41+
| \*.css.ts | Vanilla-extract CSS files |
42+
| \*.stories.ts | Storybook files |
43+
| \*.data.ts | Defines the data/types representation of the UI component or application logic |
44+
| \*.context.ts | Defines the UI component's inner state to be consumed by nested children |
45+
| \*.hooks.ts | Defines methods to manipulate the context state |
46+
47+
## Working with Storybook
48+
2849
### Stories format
2950

3051
| Type | PURPOSE |
@@ -49,25 +70,18 @@ export default {
4970
} as Meta;
5071
```
5172

52-
## File naming convention
73+
## Working with Icons
5374

54-
| FILES | PURPOSE |
55-
| ---------------- | :----------------------------------------------------------------------------: |
56-
| \*.index.ts | Defines the public API to be imported by other modules |
57-
| \*.component.tsx | Defines the UI component |
58-
| \*.css.ts | Vanilla-extract CSS files |
59-
| \*.stories.ts | Storybook files |
60-
| \*.data.ts | Defines the data/types representation of the UI component or application logic |
61-
| \*.context.ts | Defines the UI component's inner state to be consumed by nested children |
62-
| \*.hooks.ts | Defines methods to manipulate the context state |
75+
Adding a new or updating existing icons require:
6376

64-
### Icons
77+
1. Add svg icon to `src/icons/raw` directory.
78+
2. Run `build:icons` command (It will generate tsx components in `src/icons` directory and update `src/icons/index.ts`)
6579

66-
Adding new or updating existing icon require:
80+
```bash
81+
yarn build:icons
82+
```
6783

68-
1. Copy icon to `src/icons/raw` directory
69-
2. Run command `yarn build:icons`. It will generate tsx component in `src/icons` directory and update `src/icons/index.ts`
70-
3. Commit moved icon to raw directory and built component
84+
3. Commit all added and modified files.
7185

7286
To use icon in this project import it using lookup location `@icons/`
7387

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@input-output-hk/lace-ui-toolkit",
3-
"version": "1.2.0",
3+
"version": "1.4.0",
44
"description": "Lace UI Toolkit",
55
"homepage": "https://github.com/input-output-hk/lace-ui-toolkit/blob/main/README.md",
66
"bugs": {
@@ -27,6 +27,7 @@
2727
"cleanup": "yarn run cleanup:dist && yarn run cleanup:nm",
2828
"cleanup:dist": "yarn exec rm -rf dist",
2929
"cleanup:nm": "yarn exec rm -rf node_modules",
30+
"dev": "yarn storybook",
3031
"format": "yarn prettier --write .",
3132
"format-check": "yarn prettier --check .",
3233
"lint": "yarn eslint --ext .ts,.tsx,.js,.jsx .",

src/design-system/cards/base-card.css.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export const card = recipe({
2727
borderStyle: 'solid',
2828
borderWidth: vars.spacing.$2,
2929
},
30+
[Scheme.Img]: {
31+
borderColor: vars.colors.$card_img_borderColor,
32+
backgroundColor: vars.colors.$card_img_bgColor,
33+
borderRadius: vars.radius.$large,
34+
},
3035
},
3136
},
3237
});

src/design-system/cards/cards.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export const Overview = (): JSX.Element => {
4141
Component: Card.Outlined,
4242
variant: Scheme.Outlined,
4343
},
44+
{
45+
Component: Card.Img,
46+
variant: Scheme.Img,
47+
},
4448
];
4549

4650
const renderTable = (showHeader = false): JSX.Element => (
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createCardVariantComponent } from './create-card-variant-component.util';
2+
import { Scheme } from './types';
3+
4+
import type { VariantCardProps } from './create-card-variant-component.util';
5+
6+
export type ElevatedProps = VariantCardProps;
7+
8+
export const Img = createCardVariantComponent<ElevatedProps>(Scheme.Img);

src/design-system/cards/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { Elevated } from './elevated.component';
22
export { Greyed } from './greyed.component';
33
export { Outlined } from './outlined.component';
4+
export { Img } from './img.component';

src/design-system/cards/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum Scheme {
22
Elevated = 'Elevated',
33
Greyed = 'Greyed',
44
Outlined = 'Outlined',
5+
Img = 'Img',
56
}

0 commit comments

Comments
 (0)