Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3ef4d5c
Install storybook
Jeremy-Walton Jul 21, 2022
de5808f
Install storybook
Jeremy-Walton Jul 22, 2022
6588dd8
Remove unused stories
Jeremy-Walton Jul 22, 2022
2938f17
Change intro group to Overview
Jeremy-Walton Jul 22, 2022
4845ac0
Add card and button
Jeremy-Walton Jul 22, 2022
4e3241e
Add build storybook script
Jeremy-Walton Jul 22, 2022
37354ec
Add storybook docs folder
Jeremy-Walton Jul 22, 2022
17f09bb
Clean up button css
Jeremy-Walton Jul 22, 2022
78004a4
Point to docs folder
Jeremy-Walton Jul 22, 2022
8d8f5a8
Replace button docs with storybook docs
Jeremy-Walton Jul 23, 2022
bc92e2a
Move description to docs instead of in stories file for button
Jeremy-Walton Jul 23, 2022
5a3c6bf
Move card docs to storybook
Jeremy-Walton Jul 23, 2022
65a554f
Update readme to point to docs
Jeremy-Walton Jul 23, 2022
fb87d6f
Start to add form stories
Jeremy-Walton Jul 23, 2022
54a2c8a
Add error summary
Jeremy-Walton Jul 26, 2022
1a09dd6
Add form group
Jeremy-Walton Jul 26, 2022
0c6a5d1
Allow inputs to be readonly
Jeremy-Walton Jul 26, 2022
cf3cd41
Allow text area and select to be readonly
Jeremy-Walton Jul 26, 2022
cb6df3a
Add docs for Form
Jeremy-Walton Jul 26, 2022
422b8de
Remove old docs
Jeremy-Walton Jul 26, 2022
36c5e40
Add link to docs in readme
Jeremy-Walton Jul 26, 2022
0fda986
Simplify card to not make assumptions about inner content
Jeremy-Walton Aug 2, 2022
b7a1faa
Clarify form playground docs
Jeremy-Walton Aug 2, 2022
42d3f7d
Remove material symbols
Jeremy-Walton Aug 2, 2022
c6afc52
Use rolemodel theme with logo
Jeremy-Walton Aug 2, 2022
5f40a94
Convert shadow docs to storybook
Jeremy-Walton Aug 2, 2022
bbec573
Move remaining docs into storybook
Jeremy-Walton Aug 2, 2022
13203d7
Update scss build to exclude stories
Jeremy-Walton Aug 2, 2022
ec1daa6
Fix button outline not changing
Jeremy-Walton Aug 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and Deploy Storybook Documentation

on:
release:
types: [created]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install and Build 🔧
run: | # Install npm packages and build the Storybook files
npm install
npm run build-storybook
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs-build # The folder that the build-storybook script generates files.
CLEAN: true # Automatically remove deleted files from the deploy branch
TARGET_FOLDER: docs # The folder that we serve our Storybook files from
13 changes: 13 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/preset-scss"
],
"framework": "@storybook/html"
}
6 changes: 6 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/addons';
import rolemodelTheme from './rolemodelTheme';

addons.setConfig({
theme: rolemodelTheme,
});
11 changes: 11 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}

import '!style-loader!css-loader!sass-loader!../src/rolemodel-design-system.scss';
9 changes: 9 additions & 0 deletions .storybook/rolemodelTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from '@storybook/theming';

export default create({
base: 'light',
brandTitle: 'RoleModel Design System',
brandUrl: 'https://rolemodel.github.io/rolemodel-design-system/',
brandImage: 'https://rolemodelsoftware.com/packs/media/images/rolemodel-logo--blue-4eb2301367b75bba352fe6ca9155b154.svg',
brandTarget: '_self',
});
65 changes: 6 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ If you are using a different compiler such as Dart Sass, you may need to referen
@import '@rolemodel/rolemodel-design-system/dist/scss/rolemodel-design-system'
```

## Documentation

We use [Storybook](https://storybook.js.org/docs/html/get-started/introduction) as a way to provide informative and interactive documentation.

It can be found here [RoleModel Design System Documentation](https://rolemodel.github.io/rolemodel-design-system)

## Tokens

Tokens are defined in `src/core/tokens`
Expand Down Expand Up @@ -87,62 +93,3 @@ If you do not want all the styles RoleModel Design System provides, you can impo

@import '@rolemodel/rolemodel-design-system/scss/components/button.scss';
```

## Documentation

### Base Layout

The basic layout that this design system expects looks like the following:
```html
<!DOCTYPE html>
<html>
<head>
<title>Sample Layout</title>
<meta content='width=device-width, initial-scale=1' name='viewport' />
</head>
<body>
<!-- Flash message here -->
<!-- Confirm here -->
<!-- Modal here -->
<!-- Panel here -->
<div class='container'>
<!-- Page Contents -->
</div>
</body>
</html>
```

### Dark Mode

Dark mode is enabled by default and will dynamically flip your semantic tokens to a dark version of it based on your system setting.
If your application does not use or need dark mode, it can be disabled by adding a data attribute to your root `html` tag.

```html
<!DOCTYPE html>
<html data-allow-dark-mode-preference='false'>
...
</html>
```

### Scale Overriding

If you want to change the font or spacing scale within the context of a specific component, you can't just set the `--rm-space-scale-unit` because the css variables for the scale are already computed and won't be re-computed when you set the scale unit. You can force it to re-compute by redefining the scale. This is why each set of tokens is defined in a scss mixin. `card--condensed` is a great example of how to do this.

```scss
.card--condensed {
@include spacing-scales;
--rm-space-scale-unit: 0.5rem;
}
```

### Utilities

[Shadows](./docs/components/shadow/shadow.md)

### Components

[Buttons](./docs/components/button/button.md)

[Card](./docs/components/card/card.md)

[Forms](./docs/components/form/form.md)
Binary file removed docs/components/button/button-variations.png
Binary file not shown.
79 changes: 0 additions & 79 deletions docs/components/button/button.md

This file was deleted.

Binary file removed docs/components/card/card-variations.png
Binary file not shown.
41 changes: 0 additions & 41 deletions docs/components/card/card.md

This file was deleted.

Binary file removed docs/components/form/form-inputs.png
Binary file not shown.
111 changes: 0 additions & 111 deletions docs/components/form/form.md

This file was deleted.

Loading