-
Notifications
You must be signed in to change notification settings - Fork 4
Introduce first minimal part of a design system #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
10deb76
Generate @ppwcode/ng-ppw-ds
glenstaes 8d25bf8
Build @ppwcode/ng-ppw-ds as a part of the GitHub action
glenstaes 9989c27
Remove unused get-libs.sh script
glenstaes 08ba0cf
Add shapes
glenstaes 88c9af2
Access ppw-ds from demo application
glenstaes d972cea
Add spacings
glenstaes e7f6f5d
Include ppw-ds stylesheet in build assets of project
glenstaes 7188de9
Document ng-ppw-ds in main storybook configuration
glenstaes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 @@ | ||
| # PeopleWare Design System | ||
|
|
||
| This library holds the official PeopleWare Design System implementation for Angular. |
This file contains hidden or 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,10 @@ | ||
| { | ||
| "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json", | ||
| "dest": "../../../dist/ppwcode/ng-ppw-ds", | ||
| "lib": { | ||
| "entryFile": "src/public-api.ts" | ||
| }, | ||
| "assets": [ | ||
| "ppw-ds.scss" | ||
| ] | ||
| } |
This file contains hidden or 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,12 @@ | ||
| { | ||
| "name": "@ppwcode/ng-ppw-ds", | ||
| "version": "0.0.1", | ||
| "peerDependencies": { | ||
| "@angular/common": "^20.0.0", | ||
| "@angular/core": "^20.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "tslib": "^2.3.0" | ||
| }, | ||
| "sideEffects": false | ||
| } |
This file contains hidden or 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,2 @@ | ||
| @use 'src/lib/scss/shapes'; | ||
| @use 'src/lib/scss/spacings'; |
This file contains hidden or 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,18 @@ | ||
| import { Meta, Canvas } from '@storybook/addon-docs/blocks'; | ||
| import * as ShapesStories from '../stories/shapes.stories' | ||
|
|
||
| <Meta of={ShapesStories} /> | ||
|
|
||
| # Shapes | ||
|
|
||
| Shape defines the geometry of components throughout the design system, primarily through corner radius and outline style. Consistent shape tokens create a cohesive visual language, reinforce brand identity, and ensure components such as buttons, cards, inputs, and dialogs share a unified appearance. By using shape tokens instead of hardcoded values, the overall look and feel can be updated consistently across the entire application. | ||
|
|
||
| ## Usage | ||
|
|
||
| The ppwcode design system provides CSS tokens that can be used for consistent shapes in your application. | ||
|
|
||
| The CSS tokens follow the syntax `--ppw-ds-radius-[level]`, where `[level]` indicates a shaping level. | ||
|
|
||
| A shaping level is one of the following demonstrated levels, where each greater level means a more rounded shape. | ||
|
|
||
| <Canvas of={ShapesStories.AllLevels} /> |
This file contains hidden or 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,20 @@ | ||
| import { Meta, Canvas } from '@storybook/addon-docs/blocks'; | ||
| import * as SpacingsStories from '../stories/spacings.stories' | ||
|
|
||
| <Meta of={SpacingsStories} /> | ||
|
|
||
| # Spacing | ||
|
|
||
| Spacing defines the consistent use of whitespace throughout the design system. Spacing tokens provide a standardized scale for margins, padding, gaps, and layout dimensions, creating balanced, readable, and predictable interfaces. By using spacing tokens instead of hardcoded values, layouts remain consistent, responsive, and easy to maintain across all components and applications. | ||
|
|
||
| ## Usage | ||
|
|
||
| The ppwcode design system provides linear and explicit CSS tokens that can be used for consistent spacing in your application. | ||
|
|
||
| The CSS tokens follow the syntax `--ppw-ds-spacing-[level]`, where `[level]` indicates a spacing level. | ||
|
|
||
| A linear spacing level is the multiplication of 4. Level 0 thus means 0px, where level 5 means 20px. | ||
|
|
||
| <Canvas of={SpacingsStories.AllLevels} /> | ||
|
|
||
| The tokens `--ppw-ds-spacing-1px` and `--ppw-ds-spacing-2px` are explicit and intended for usage where space is limited and decreasing density would otherwise bring visual items far too close to each other. |
This file contains hidden or 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,13 @@ | ||
| $_radii: ( | ||
| 'none': 0, | ||
| 'small': 4px, | ||
| 'medium': 8px, | ||
| 'large': 20px, | ||
| 'full': 1000px | ||
| ); | ||
|
|
||
| :root { | ||
| @each $radius, $value in $_radii { | ||
| --ppw-ds-radius-#{$radius}: #{$value}; | ||
| } | ||
| } |
This file contains hidden or 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,14 @@ | ||
| $_base-spacing: 4px; | ||
|
|
||
| :root { | ||
| // The following CSS tokens are explicit spacing tokens that don't take part in the base-spacing linearity. | ||
| // They are a specifically targeted at situations where space is limited and decreasing density would otherwise | ||
| // bring visual items far too close to each other. | ||
| --ppw-ds-spacing-1px: 1px; | ||
| --ppw-ds-spacing-2px: 2px; | ||
|
|
||
| // Generate CSS tokens for a linear scale from 0 to 20 for increased spacing. | ||
| @for $i from 0 through 20 { | ||
| --ppw-ds-spacing-#{$i}: #{$i * $_base-spacing}; | ||
| } | ||
| } | ||
48 changes: 48 additions & 0 deletions
48
projects/ppwcode/ng-ppw-ds/src/lib/stories/shapes.stories.ts
This file contains hidden or 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,48 @@ | ||
| import { Meta, moduleMetadata, StoryObj } from '@storybook/angular' | ||
| import { Component } from '@angular/core' | ||
|
|
||
| const shapes = ['none', 'small', 'medium', 'large', 'full'] | ||
|
|
||
| @Component({ | ||
| selector: 'ppw-shapes-example', | ||
| template: ` | ||
| @for (shape of shapes; track shape) { | ||
| <div class="box" [style.border-radius]="'var(--ppw-ds-radius-' + shape + ')'">{{ shape }}</div> | ||
| } | ||
| `, | ||
| styles: ` | ||
| :host { | ||
| display: grid; | ||
| grid-template-columns: repeat(3, 1fr); | ||
| grid-gap: 16px; | ||
| } | ||
|
|
||
| .box { | ||
| display: inline-flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| background: var(--ppw-primary-color); | ||
| color: var(--ppw-primary-contrast-color); | ||
| padding: 16px; | ||
| width: 250px; | ||
| } | ||
| ` | ||
| }) | ||
| export class ShapesExampleComponent { | ||
| public readonly shapes = shapes | ||
| } | ||
|
|
||
| const meta: Meta<ShapesExampleComponent> = { | ||
| title: 'ng-ppw-ds/Shapes', | ||
| component: ShapesExampleComponent, | ||
| decorators: [ | ||
| moduleMetadata({ | ||
| imports: [ShapesExampleComponent] | ||
| }) | ||
| ] | ||
| } | ||
|
|
||
| export default meta | ||
| type Story = StoryObj<ShapesExampleComponent> | ||
|
|
||
| export const AllLevels: Story = {} |
73 changes: 73 additions & 0 deletions
73
projects/ppwcode/ng-ppw-ds/src/lib/stories/spacings.stories.ts
This file contains hidden or 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,73 @@ | ||
| import { Meta, moduleMetadata, StoryObj } from '@storybook/angular' | ||
| import { Component } from '@angular/core' | ||
|
|
||
| const spacings = Array.from({ length: 21 }, (_, i) => i) | ||
|
|
||
| @Component({ | ||
| selector: 'ppw-spacings-example', | ||
| template: ` | ||
| @for (level of spacings; track level) { | ||
| <div class="boxes-wrapper" [style.gap]="'var(--ppw-ds-spacing-' + level + ')'"> | ||
| <div class="box box--primary">{{ level }}</div> | ||
| <div class="box box--secondary">{{ level * 4 }}px</div> | ||
| </div> | ||
| } | ||
| `, | ||
| styles: ` | ||
| :host { | ||
| display: grid; | ||
| grid-template-columns: repeat(3, 1fr); | ||
| grid-gap: 16px; | ||
| } | ||
|
|
||
| .boxes-wrapper { | ||
| display: flex; | ||
| flex-direction: row; | ||
| } | ||
|
|
||
| .box { | ||
| display: inline-flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| padding: 16px; | ||
| width: 25px; | ||
|
|
||
| &--primary { | ||
| background: var(--ppw-primary-color); | ||
| color: var(--ppw-primary-contrast-color); | ||
| } | ||
|
|
||
| &--secondary { | ||
| background: var(--ppw-secondary-color); | ||
| color: var(--ppw-secondary-contrast-color); | ||
| } | ||
| } | ||
| ` | ||
| }) | ||
| export class SpacingsExampleComponent { | ||
| public readonly spacings = spacings | ||
| } | ||
|
|
||
| const meta: Meta<SpacingsExampleComponent> = { | ||
| title: 'ng-ppw-ds/Spacings', | ||
| component: SpacingsExampleComponent, | ||
| decorators: [ | ||
| moduleMetadata({ | ||
| imports: [SpacingsExampleComponent] | ||
| }) | ||
| ], | ||
| parameters: { | ||
| docs: { | ||
| description: { | ||
| component: ` | ||
|
|
||
| ` | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export default meta | ||
| type Story = StoryObj<SpacingsExampleComponent> | ||
|
|
||
| export const AllLevels: Story = {} |
This file contains hidden or 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,5 @@ | ||
| /* | ||
| * Public API Surface of ng-ppw-ds | ||
| */ | ||
|
|
||
| export {} |
This file contains hidden or 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,15 @@ | ||
| /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ | ||
| /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ | ||
| { | ||
| "extends": "../../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../../../out-tsc/lib", | ||
| "declaration": true, | ||
| "declarationMap": true, | ||
| "inlineSources": true, | ||
| "types": [] | ||
| }, | ||
| "exclude": [ | ||
| "**/*.spec.ts" | ||
| ] | ||
| } |
This file contains hidden or 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,11 @@ | ||
| /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ | ||
| /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ | ||
| { | ||
| "extends": "./tsconfig.lib.json", | ||
| "compilerOptions": { | ||
| "declarationMap": false | ||
| }, | ||
| "angularCompilerOptions": { | ||
| "compilationMode": "partial" | ||
| } | ||
| } |
This file contains hidden or 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,15 @@ | ||
| /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ | ||
| /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ | ||
| { | ||
| "extends": "../../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../../../out-tsc/spec", | ||
| "types": [ | ||
| "jasmine" | ||
| ] | ||
| }, | ||
| "include": [ | ||
| "**/*.spec.ts", | ||
| "**/*.d.ts" | ||
| ] | ||
| } |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.