Skip to content
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

feat(styles): add custom theme for primeng #2718

Merged
merged 40 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
31b5727
feat(styles): add custom theme for primeng
alizedebray Feb 22, 2024
b5daec5
feat(styles): add custom theme for primeng
alizedebray Feb 26, 2024
f61929b
Add changeset for the docs
alizedebray Feb 27, 2024
8b4355a
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Feb 27, 2024
de4c920
fix sonar issues
alizedebray Feb 27, 2024
7fead56
Disable analytics
imagoiq Feb 28, 2024
8227dde
fix sonar issues
alizedebray Mar 5, 2024
c09f108
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Mar 5, 2024
22e2172
Update .stylelintrc
alizedebray Mar 5, 2024
d6c03b4
Update _steps.scss
alizedebray Mar 5, 2024
8a69d66
Update packages/styles-primeng-workspace/package.json
alizedebray Mar 7, 2024
5502d45
Update packages/styles-primeng-workspace/projects/styles-primeng/pack…
alizedebray Mar 7, 2024
1bf57e3
Update packages/styles-primeng-workspace/projects/styles-primeng/READ…
alizedebray Mar 7, 2024
9838ab3
Update packages/styles-primeng-workspace/LICENSE
alizedebray Mar 7, 2024
0944eab
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Mar 13, 2024
fae7b3c
update versions
alizedebray Mar 13, 2024
5e41442
Enable color contrast check for tables
alizedebray Mar 13, 2024
61bab47
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Mar 13, 2024
2ddb053
Update pnpm-lock.yaml
alizedebray Mar 13, 2024
d7f4fe6
remove color-contrast check for tables
alizedebray Mar 18, 2024
3f8d298
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Mar 18, 2024
dda4b5c
Update pnpm-lock.yaml
alizedebray Mar 18, 2024
13adfd7
Update packages/documentation/src/stories/getting-started/styles-prim…
alizedebray Mar 26, 2024
ee5bbfe
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Apr 29, 2024
32a9095
Update angular version
alizedebray Apr 29, 2024
c36d202
Remove the need for a specific layer to use prime ng styles
alizedebray Apr 29, 2024
4e4ea77
Delete CHANGELOG.md
alizedebray Apr 29, 2024
ac2b5cf
Fix code smells
alizedebray Apr 29, 2024
4863852
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Jun 20, 2024
1879c03
Update styles version
alizedebray Jun 20, 2024
6a2fdc5
Fix linting issues
alizedebray Jun 20, 2024
0a1b9c3
fix sonar issues
alizedebray Jun 20, 2024
2c5c3fa
update showcase app
alizedebray Jun 20, 2024
e81db62
Fix paginator
alizedebray Jun 20, 2024
afec923
Add focus rings
alizedebray Jun 20, 2024
f9d9235
Update packages/styles-primeng-workspace/projects/styles-primeng/pack…
alizedebray Jul 16, 2024
de9f738
Update packages/styles-primeng-workspace/projects/styles-primeng/pack…
alizedebray Jul 16, 2024
357bf5a
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Jul 16, 2024
ef30d29
Update packages
alizedebray Jul 16, 2024
e907059
Merge branch 'main' into 2069-styles-for-prime-ng-datatable
alizedebray Jul 16, 2024
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
5 changes: 5 additions & 0 deletions .changeset/nasty-items-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles-primeng': major
---

Created a Swiss Post Design System theme for PrimeNg datatable.
5 changes: 5 additions & 0 deletions .changeset/rich-chefs-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles-primeng-workspace': major
---

Created a workspace to maintain the Swiss Post PrimeNg theme.
5 changes: 5 additions & 0 deletions .changeset/tiny-chairs-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-documentation': minor
---

Added documentation on how to get started with the `@swisspost/design-system-styles-primeng` package.
5 changes: 5 additions & 0 deletions .changeset/unlucky-actors-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Updated table colors on dark backgrounds.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@
"nextjs:build": "pnpm --filter design-system-nextjs-integration build",
"nextjs:lint": "pnpm --filter design-system-nextjs-integration lint",
"changeset:publish": "pnpm changeset publish",
"changeset:version": "pnpm changeset version && pnpm install --lockfile-only"
"changeset:version": "pnpm changeset version && pnpm install --lockfile-only",
"primeng": "pnpm primeng:start",
gfellerph marked this conversation as resolved.
Show resolved Hide resolved
"primeng:start": "pnpm --filter design-system-styles-primeng-workspace start",
"primeng:build": "pnpm --filter design-system-styles-primeng-workspace build",
"primeng:lint": "pnpm --filter design-system-styles-primeng-workspace lint",
"primeng:lint:fix": "pnpm --filter design-system-styles-primeng-workspace lint:fix"
},
"devDependencies": {
"@changesets/cli": "2.27.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Meta, StoryObj } from '@storybook/web-components';

const meta: Meta = {
id: '833ef689-a573-40f5-a6a6-30a999b94733',
title: 'Getting Started/Components-Angular',
title: 'Getting Started/Components for Angular',
parameters: {
badges: [],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@use "@swisspost/design-system-styles-primeng/primeng-theme";
@use "primeng/resources/primeng.css";

@layer design-system-styles, primeng;

// refer to the @swisspost/design-system-styles installation guidelines to know which bundle-name and extension to choose for your project
@import '@swisspost/design-system-styles/<bundle-name>.<extension>' layer(design-system-styles);
alizedebray marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Meta, Source } from '@storybook/blocks';
import * as GettingStartedStories from './styles-primeng.stories';
import PrimeNgThemeImportSample from './primeng-theme-import.sample.scss?raw';

<Meta of={GettingStartedStories} />

# @swisspost/design-system-styles-primeng

[![npm version](https://badge.fury.io/js/@swisspost%2Fdesign-system-styles-primeng.svg)](https://badge.fury.io/js/@swisspost%2Fdesign-system-styles-primeng)

The Design System Styles for PrimeNg, style your PrimeNg datatables.

## Installation

<Source code={`npm install @swisspost/design-system-styles-primeng`} language="bash" />

## Usage

The PrimeNg theme and core styles are the necessary, as well as the Swiss Post styles.
All three should be imported in the main style file of your Angular project, usually `src/styles.scss`.

Be sure to assign a layer to the Design System styles to avoid interference.

<Source code={PrimeNgThemeImportSample} language="scss" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Meta, StoryObj } from '@storybook/web-components';

const meta: Meta = {
id: 'd2112bed-c611-4098-a1ad-e654f7d622e7',
title: 'Getting Started/Styles for PrimeNg',
alizedebray marked this conversation as resolved.
Show resolved Hide resolved
};

export default meta;

type Story = StoryObj;

export const Default: Story = {};
16 changes: 16 additions & 0 deletions packages/styles-primeng-workspace/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
50 changes: 50 additions & 0 deletions packages/styles-primeng-workspace/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
43 changes: 43 additions & 0 deletions packages/styles-primeng-workspace/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.vscode/
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
17 changes: 17 additions & 0 deletions packages/styles-primeng-workspace/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"plugins": ["stylelint-scss"],
"extends": [
"stylelint-config-sass-guidelines",
"stylelint-prettier/recommended"
],
"rules": {
"scss/dollar-variable-pattern": ["/[a-z][a-zA-Z]+/", {"ignore": "global"}],
"max-nesting-depth": 10,
"selector-max-compound-selectors": 10,
"selector-max-id": 1,
"selector-no-qualifying-type": [true, { "ignore": ["attribute", "class"] }],
"function-url-quotes": null,
"scss/dollar-variable-colon-space-after": "always-single-line",
"selector-type-no-unknown": [true, { "ignoreTypes": ["/^p-/", "/icon$/"] }]
}
}
4 changes: 4 additions & 0 deletions packages/styles-primeng-workspace/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
"recommendations": ["angular.ng-template"]
}
20 changes: 20 additions & 0 deletions packages/styles-primeng-workspace/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
]
}
42 changes: 42 additions & 0 deletions packages/styles-primeng-workspace/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
},
{
"type": "npm",
"script": "test",
"isBackground": true,
"problemMatcher": {
"owner": "typescript",
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "bundle generation complete"
}
}
}
}
]
}
1 change: 1 addition & 0 deletions packages/styles-primeng-workspace/CHANGELOG.md
alizedebray marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @swisspost/design-system-styles-primeng-workspace
Loading
Loading